/* =================================================================
   site.css — shared chrome (header, hamburger menu, footer) +
   design tokens (single source of truth for the whole site).

   Tokens live in :root here so every page inherits them without
   needing its own block. Individual pages may still override in
   their inline <style> (which cascades AFTER this stylesheet
   loads) for page-specific tweaks.

   Page-specific component styles stay inline in each page's
   <style> block, but ALL colours / fonts / sizes come from here.
================================================================= */

:root {
  /* --- Surfaces ---
     Traditional Sarkari aesthetic: white primary, cream for warm
     callout boxes (Latest Naukri strip, etc.). */
  --paper:        #FFFFFF;
  --paper-warm:   #FEF3E7;

  /* --- Ink (text) ---
     A slightly cool near-black. --ink-strong for headings, --ink
     for body, --ink-soft for supporting copy, --ink-muted for
     metadata. */
  --ink:          #212121;
  --ink-strong:   #111827;
  --ink-soft:     #424242;
  --ink-muted:    #6B7280;

  /* --- Rules (borders) --- */
  --rule:         #E0E0E0;
  --rule-soft:    #EEEEEE;

  /* --- Brand accent ---
     'stamp' is the site's canonical red — the classic Sarkari-site
     signal color. Used for section header bars, CTAs, brand marks,
     urgent status pills. --stamp-hover is the pressed/active state.
     --stamp-tint is a soft wash for icon backgrounds and halos. */
  --stamp:        #C1272D;
  --stamp-hover:  #9F1F24;
  --stamp-tint:   rgba(193, 39, 45, 0.10);
  --stamp-glow:   rgba(193, 39, 45, 0.14);

  /* --- Inline prose links ---
     Blue for links: users are trained to recognise blue as clickable,
     and reserving red for headers/CTAs preserves its "action" weight.
     This split is a hallmark of the traditional Sarkari aesthetic. */
  --link:         #0000EF;
  --link-hover:   #0000BF;

  /* --- Status colours --- used on tags, badges, item-listing UI */
  --green:        #22C55E;
  --amber:        #F59E0B;

  /* --- Type stack ---
     Roboto matches the Google ecosystem AdSense operates in.
     Serif slot points to Roboto too — the site is sans-first;
     the alias exists for pages that still reference --serif. */
  --serif: 'Roboto', system-ui, -apple-system, sans-serif;
  --sans:  'Roboto', system-ui, -apple-system, sans-serif;
  --mono:  'Roboto Mono', ui-monospace, 'SF Mono', 'Consolas', monospace;

  /* --- Typography hierarchy ---
     Values referenced by page-inline rules (e.g. h1.doc-title in
     post.php). Bumped up from the previous soft scale so section
     structure is obvious at a glance. Small screens override
     below. */
  --h1-size:       26px;
  --h1-weight:     700;
  --h1-tracking:   -0.015em;
  --h2-size:       14px;
  --h2-weight:     600;
  --meta-size:     11px;
  --meta-tracking: 0.09em;
}

@media (max-width: 720px) {
  :root {
    --h1-size:     22px;
    --h1-tracking: -0.012em;
  }
}

/* ---------- SITE HEADER ---------- */
.site-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--rule-soft);
  position: relative;
  z-index: 100;
}
.site-header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-strong);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--stamp);
  color: #FFFFFF;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  transition: background 0.12s ease;
}
.site-brand-name {
  line-height: 1.1;
}
.site-brand:hover { color: var(--stamp); }
.site-brand:hover .site-brand-mark { background: var(--stamp); }

/* ---------- HAMBURGER BUTTON ---------- */
.hamburger-btn {
  background: transparent;
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.hamburger-btn:hover {
  border-color: var(--ink-muted);
  background: var(--paper-warm);
  color: var(--ink-strong);
}
.hamburger-btn[aria-expanded="true"] {
  background: var(--ink-strong);
  border-color: var(--ink-strong);
  color: #FFFFFF;
}
.hamburger-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* ---------- MENU PANEL ---------- */
.site-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 24px;
  width: min(280px, 92vw);
  background: #FFFFFF;
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(42, 26, 20, 0.14);
  padding: 8px;
  z-index: 99;
}
.site-menu.is-open { display: block; }
.site-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-menu li + li { margin-top: 2px; }
.site-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink-strong);
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
}
.site-menu a:hover {
  background: var(--paper-warm);
  color: var(--stamp);
}
.site-menu a.is-current {
  background: var(--paper-warm);
  color: var(--stamp);
}
.site-menu a.is-current::after {
  content: "•";
  color: var(--stamp);
}
.site-menu-divider {
  height: 1px;
  background: var(--rule-soft);
  margin: 6px 4px;
}

/* ---------- SITE FOOTER ---------- */
.site-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--rule-soft);
  padding: 28px 24px;
  margin-top: 24px;
}
.site-footer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}
.site-footer-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.site-footer-nav a {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 10px;
  transition: background 0.12s ease, color 0.12s ease;
}
.site-footer-nav a:hover {
  color: var(--stamp);
  background: var(--paper-warm);
}
.site-footer-disclaimer {
  align-self: stretch;
  padding: 14px 16px;
  background: var(--paper-warm);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  text-align: left;
}
.site-footer-disclaimer p {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}
.site-footer-disclaimer strong {
  color: var(--ink-soft);
  font-weight: 700;
}
.site-footer-disclaimer a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.site-footer-disclaimer a:hover {
  color: var(--link-hover);
}
.site-footer-fine {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin: 0;
}

@media (max-width: 720px) {
  .site-header-inner { padding: 12px 16px; }
  .site-brand { font-size: 17px; gap: 8px; }
  .site-brand-mark { width: 30px; height: 30px; font-size: 12px; }
  .site-menu { right: 16px; }
  .site-footer { padding: 24px 16px; margin-top: 16px; }
  .site-footer-fine { font-size: 9.5px; }
  .site-footer-disclaimer { padding: 12px 14px; }
  .site-footer-disclaimer p { font-size: 11.5px; line-height: 1.6; }
}

/* =================================================================
   AD SLOTS + MOBILE APP BANNER
   Consumed by renderAdSlot() / renderAppBanner() in ads_loader.php.
   Loaded on every public page + tool page (all link this file).
================================================================= */

/* ---------- Base ad slot ---------- */
.ad-slot {
  margin: 28px 0;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ---------- Close button (mobile_sticky only via renderAdSlot) ---------- */
.ad-slot-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #FFFFFF;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background 0.15s ease;
}
.ad-slot-close:hover,
.ad-slot-close:focus-visible {
  background: rgba(0, 0, 0, 0.85);
  outline: none;
}
.ad-slot-close svg {
  width: 12px;
  height: 12px;
}

/* ---------- Test-mode placeholder (dashed block, no real ad code) ---------- */
.ad-slot-test {
  background: #FAFAFA;
  border: 1px dashed var(--rule);
  border-radius: 4px;
  padding: 24px 20px;
  flex-direction: column;
  gap: 10px;
  color: var(--ink-muted);
}
.ad-slot-test-iconbox {
  width: 40px;
  height: 40px;
  background: var(--paper-warm);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--stamp);
}
.ad-slot-test-icon {
  width: 22px;
  height: 22px;
}
.ad-slot-test-label {
  font-family: var(--sans, system-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--ink-soft);
}
.ad-slot-test-key {
  font-family: var(--mono, monospace);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- Desktop skyscrapers (≥ 1180px viewport only) ---------- */
.ad-slot[data-slot="desktop_left"],
.ad-slot[data-slot="desktop_right"] { display: none; }

@media (min-width: 1180px) {
  .ad-slot[data-slot="desktop_left"],
  .ad-slot[data-slot="desktop_right"] {
    display: flex;
    position: fixed;
    top: 96px;
    width: 160px;
    min-height: 600px;
    margin: 0;
    z-index: 50;
  }
  .ad-slot[data-slot="desktop_left"]  { left:  calc(50% - 550px); }
  .ad-slot[data-slot="desktop_right"] { right: calc(50% - 550px); }
  .ad-slot[data-slot="desktop_left"].ad-slot-test,
  .ad-slot[data-slot="desktop_right"].ad-slot-test { height: 600px; }
}

/* ---------- Mobile sticky bar (≤ 720px viewport only) ---------- */
.ad-slot[data-slot="mobile_sticky"] { display: none; }

@media (max-width: 720px) {
  .ad-slot[data-slot="mobile_sticky"] {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    margin: 0;
    background: #FFFFFF;
    border-top: 1px solid var(--rule-soft, #E5E0D2);
    z-index: 99;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    padding: 8px;
    min-height: 60px;
  }
  /* Universal offset so page content isn't hidden behind the sticky ad.
     Works for every layout (article, main, .site-footer, etc.). */
  body { padding-bottom: 84px; }
}

.ad-slot[data-slot="mobile_sticky"].ad-slot-test {
  flex-direction: row;
  padding: 10px 16px;
  gap: 14px;
  border-radius: 0;
  justify-content: flex-start;
}
.ad-slot[data-slot="mobile_sticky"] .ad-slot-test-iconbox {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.ad-slot[data-slot="mobile_sticky"] .ad-slot-test-icon {
  width: 20px;
  height: 20px;
}
.ad-slot[data-slot="mobile_sticky"].ad-slot-test .ad-slot-test-label {
  font-size: 12px;
  text-align: left;
}
.ad-slot[data-slot="mobile_sticky"].ad-slot-test .ad-slot-test-key {
  font-size: 9px;
}

/* Legacy: keep the sidebar_sticky slot hidden on mobile if referenced */
@media (max-width: 720px) {
  .ad-slot[data-slot="sidebar_sticky"] { display: none; }
}

/* =================================================================
   MOBILE APP BANNER (renderAppBanner)
   Sticky top banner shown on mobile only, hidden on desktop.
================================================================= */
.app-banner {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--rule-soft, #E5E0D2);
  position: sticky;
  top: 0;
  z-index: 100;
  font-family: var(--sans, system-ui);
}
.app-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--stamp, #C1272D), #9F1F24);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}
.app-banner-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-banner-text { flex: 1; min-width: 0; }
.app-banner-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-strong, #1a0e08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-banner-tag {
  font-size: 12px;
  color: var(--ink-muted, #6B7077);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-banner-btn {
  background: var(--stamp, #C1272D);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 4px;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}
.app-banner-close {
  background: transparent;
  border: none;
  color: var(--ink-muted, #6B7077);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .app-banner { display: flex; }
}
