/* ==========================================================================
   PARIKSHAGYAN COMPACT FOOTER BAR
   ========================================================================== */

/* Zero out body bottom padding & establish sticky flex layout so footer stays pinned to bottom */
html {
  min-height: 100%;
}

html:has(.pg-footer-bar) body,
body:has(.pg-footer-bar),
body.single-mcq,
body.single-indian-history,
body:has(.question-card),
body:has(.home-wrapper),
body:has(.ancient-template-bg),
body:has(.readable-custom-template) {
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

body:has(.pg-footer-bar) .wp-site-blocks,
body.single-mcq .wp-site-blocks,
body.single-indian-history .wp-site-blocks,
body:has(.question-card) .wp-site-blocks,
body:has(.home-wrapper) .wp-site-blocks,
body:has(.ancient-template-bg) .wp-site-blocks,
body:has(.readable-custom-template) .wp-site-blocks {
  flex: 1 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Zero out extra gaps on single MCQ & article templates */
body.single-mcq main,
body.single-mcq .wp-block-group,
body.single-mcq .wp-block-group.alignfull,
body.single-indian-history main,
body.single-indian-history .wp-block-group,
body.single-indian-history .wp-block-group.alignfull,
body:has(.question-card) main,
body:has(.question-card) .wp-block-group,
body:has(.question-card) .wp-block-group.alignfull,
body:has(.ancient-template-bg) main,
body:has(.ancient-template-bg) .wp-block-group,
body:has(.ancient-template-bg) .wp-block-group.alignfull,
body:has(.readable-custom-template) main,
body:has(.readable-custom-template) .wp-block-group {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.pg-footer-bar {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  background: #ecc390 !important;
  border-top: 1px solid rgba(141, 52, 8, 0.16) !important;
  box-shadow: 0 -2px 8px rgba(90, 50, 20, 0.04);
  padding: 8px 14px 8px !important;
  box-sizing: border-box !important;
  clear: both !important;
  z-index: 10 !important;
}

.pg-footer-inner {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Top Row (Brand + Navigation Links) ── */
.pg-footer-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 1px 0;
  box-sizing: border-box;
}

/* Brand Section */
.pg-footer-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pg-footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none !important;
  color: #2c1a10;
  outline: none;
}

.pg-footer-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 5px;
  flex-shrink: 0;
}

.pg-footer-brand-text {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #2c1a10;
  letter-spacing: 0.35px;
  line-height: 1;
}

.pg-footer-brand-highlight {
  color: #c2410c;
}

/* Vertical Separator between Brand & Links */
.pg-footer-v-divider {
  width: 1px;
  height: 15px;
  background: rgba(141, 52, 8, 0.25);
  flex-shrink: 0;
}

/* Legal Links Navigation */
.pg-footer-nav {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
}

.pg-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none !important;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #2c1a10 !important;
  letter-spacing: 0.3px;
  word-spacing: 0.5px;
  transition: color 0.18s ease, transform 0.18s ease;
  line-height: 1.2;
}

.pg-footer-link:hover {
  color: #8d3408 !important;
  transform: translateY(-1px);
}

.pg-footer-icon {
  flex-shrink: 0;
  color: #78350f;
  transition: color 0.18s ease;
}

.pg-footer-link:hover .pg-footer-icon {
  color: #c2410c;
}

.pg-footer-pipe {
  color: rgba(141, 52, 8, 0.32);
  font-size: 12px;
  margin: 0 2px;
  user-select: none;
}

/* ── Horizontal Divider ── */
.pg-footer-h-divider {
  width: 100%;
  max-width: 850px;
  height: 1px;
  background: rgba(141, 52, 8, 0.16);
  margin: 4px auto 3px;
}

/* ── Bottom Row (Copyright) ── */
.pg-footer-bottom-row {
  text-align: center;
  padding: 0;
}

.pg-footer-copyright {
  margin: 0 !important;
  padding: 0 !important;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #523722;
  letter-spacing: 0.35px;
  word-spacing: 0.8px;
  line-height: 1.2;
}

/* ==========================================================================
   DARK THEME COMPATIBILITY
   ========================================================================== */
body.dark .pg-footer-bar,
body.dark-mode .pg-footer-bar {
  background: #191613 !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
}

body.dark .pg-footer-brand-text,
body.dark-mode .pg-footer-brand-text {
  color: #f5f5f5;
}

body.dark .pg-footer-brand-highlight,
body.dark-mode .pg-footer-brand-highlight {
  color: #fb923c;
}

body.dark .pg-footer-v-divider,
body.dark-mode .pg-footer-v-divider {
  background: rgba(255, 255, 255, 0.16);
}

body.dark .pg-footer-link,
body.dark-mode .pg-footer-link {
  color: #d4d4d8 !important;
}

body.dark .pg-footer-link:hover,
body.dark-mode .pg-footer-link:hover {
  color: #fb923c !important;
}

body.dark .pg-footer-icon,
body.dark-mode .pg-footer-icon {
  color: #fb923c;
}

body.dark .pg-footer-pipe,
body.dark-mode .pg-footer-pipe {
  color: rgba(255, 255, 255, 0.2);
}

body.dark .pg-footer-h-divider,
body.dark-mode .pg-footer-h-divider {
  background: rgba(255, 255, 255, 0.1);
}

body.dark .pg-footer-copyright,
body.dark-mode .pg-footer-copyright {
  color: #a1a1aa;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
  .pg-footer-bar {
    padding: 8px 10px 8px !important;
    margin-top: 14px !important;
    margin-bottom: 0 !important;
    position: relative !important;
    z-index: 10 !important;
  }

  .pg-footer-top-row {
    gap: 8px 14px;
  }

  .pg-footer-v-divider {
    display: none;
  }

  .pg-footer-nav {
    gap: 4px 6px;
    position: relative !important;
    z-index: 20 !important;
  }

  .pg-footer-link {
    font-size: 12px;
    letter-spacing: 0.2px;
    padding: 6px 8px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    position: relative !important;
    z-index: 30 !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
  }

  .pg-footer-pipe {
    margin: 0 1px;
    opacity: 0.5;
  }

  .pg-footer-copyright {
    font-size: 10.5px;
    letter-spacing: 0.2px;
    margin-top: 4px !important;
  }
}
