/* ================================================================
   icseboard.org — Design System v5.0  (Vedantu-class redesign)
   ================================================================
   Fonts:   Plus Jakarta Sans (headings, 500–800) + Noto Sans (body)
   Colors:  Deep Navy #1A3C6E + Green #16A34A (CTAs) + Amber #F59E0B
   Grid:    2-column default (260px left | flex content)
            3-column when right sidebar active
   Base:    Bootstrap 5.3.3 (CDN) — no duplicate Bootstrap rules
   Ref:     Vedantu.com layout & UX patterns
   ================================================================ */

/* ── 1. Design Tokens ───────────────────────────────────────────── */
:root {
  /* Brand — Navy stays, Amber refined, Green added for download CTAs */
  --icse-primary:        #1A3C6E;
  --icse-primary-hover:  #142d55;
  --icse-primary-light:  #EEF3FB;
  --icse-primary-mid:    #B3C9E8;

  /* Amber — highlights, badges, hero accents */
  --icse-accent:         #F59E0B;   /* refined: better OLED contrast */
  --icse-accent-hover:   #D97706;
  --icse-accent-light:   #FFFBEB;

  /* Green — ALL download/CTA buttons (Vedantu pattern: green = free action) */
  --icse-cta:            #16A34A;
  --icse-cta-hover:      #15803D;
  --icse-cta-light:      #F0FDF4;
  --icse-cta-shadow:     rgba(22,163,74,.25);

  /* Status */
  --icse-success:        #059669;
  --icse-success-light:  #ECFDF5;
  --icse-warning:        #D97706;
  --icse-warning-light:  #FFFBEB;
  --icse-danger:         #DC2626;
  --icse-danger-light:   #FEF2F2;

  /* Subject colour system */
  --subject-maths:       #3B82F6;
  --subject-physics:     #8B5CF6;
  --subject-chemistry:   #F59E0B;
  --subject-biology:     #10B981;
  --subject-english:     #EC4899;
  --subject-history:     #EF4444;
  --subject-geography:   #06B6D4;
  --subject-computer:    #6366F1;

  /* Neutrals */
  --icse-white:          #FFFFFF;
  --icse-bg:             #F8FAFC;   /* cooler off-white — easier on eyes */
  --icse-surface:        #FFFFFF;
  --icse-surface-2:      #F1F5F9;   /* alternating section bg */
  --icse-text:           #0F172A;   /* Slate-900: richer black than before */
  --icse-text-secondary: #475569;   /* Slate-600 */
  --icse-text-muted:     #94A3B8;   /* Slate-400 */
  --icse-border:         #E2E8F0;   /* Slate-200 */
  --icse-border-light:   #F1F5F9;   /* Slate-100 */
  --icse-dark:           #0F172A;

  /* Shadows — primary-tinted for depth coherence */
  --shadow-xs:  0 1px 2px rgba(15,23,42,.05);
  --shadow-sm:  0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:  0 4px 16px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg:  0 12px 40px rgba(15,23,42,.12), 0 4px 8px rgba(15,23,42,.05);

  /* Border radius */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Layout — 260px sidebar (was 280px, reclaims 20px for content) */
  --icse-sidebar-left:   260px;
  --icse-sidebar-right:  300px;
  --icse-nav-height:     64px;

  /* Typography — Plus Jakarta Sans replaces Baloo 2 */
  --icse-font:         'Noto Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --icse-heading-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --icse-mono:         'JetBrains Mono', 'Consolas', 'Monaco', monospace;

  /* Fluid type scale — eliminates breakpoint-only type rules */
  --type-xs:   0.75rem;
  --type-sm:   0.8125rem;
  --type-base: 1rem;
  --type-lg:   1.125rem;
  --type-xl:   clamp(1.25rem, 2vw + 0.5rem, 1.5rem);
  --type-2xl:  clamp(1.375rem, 2.5vw + 0.5rem, 1.75rem);
  --type-3xl:  clamp(1.625rem, 3vw + 0.5rem, 2.25rem);
  --type-hero: clamp(1.875rem, 4vw + 0.75rem, 2.75rem);
}


/* ── 2. Global Reset / Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--icse-font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--icse-text);
  background: var(--icse-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}

a {
  color: var(--icse-primary);
  transition: color .15s ease;
}
a:hover { color: var(--icse-primary-hover); }

::selection {
  background: var(--icse-primary-mid);
  color: var(--icse-dark);
}


/* ── 3. Typography ──────────────────────────────────────────────── */
/* Fluid type scale: sizes respond to viewport, no breakpoints needed */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--icse-heading-font);
  font-weight: 700;
  line-height: 1.2;
  color: var(--icse-dark);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;  /* Plus Jakarta Sans looks best at -0.02em */
}

h1 {
  font-size: var(--type-3xl);
  font-weight: 800;
  margin-top: 0;
  letter-spacing: -0.03em;
}
h2 {
  font-size: var(--type-2xl);
  font-weight: 700;
  border-bottom: 2px solid var(--icse-border-light);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
  position: relative;
}
h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--icse-accent);
  border-radius: 2px;
}
h3 { font-size: var(--type-xl); font-weight: 600; }
h4 { font-size: var(--type-lg); font-weight: 600; }
h5 {
  font-size: var(--type-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--icse-text-muted);
  font-family: var(--icse-font);
}
h6 { font-size: var(--type-sm); font-weight: 700; }

p { margin-bottom: 1rem; line-height: 1.8; }

code, pre { font-family: var(--icse-mono); font-size: 0.875rem; }
pre {
  background: #0F172A;
  color: #E2E8F0;
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.65;
}
code:not(pre > code) {
  background: #F1F5F9;
  color: var(--icse-danger);
  padding: 0.125rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
  border: 1px solid var(--icse-border);
}


/* ── 4. Navbar ──────────────────────────────────────────────────── */
.navbar.sticky-top {
  background: var(--icse-white) !important;
  border-bottom: 1px solid var(--icse-border);
  box-shadow: var(--shadow-sm);
  height: var(--icse-nav-height);
  z-index: 1030;
}

.navbar-brand,
.site-title a,
.navbar-brand a {
  font-family: var(--icse-heading-font);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--icse-primary) !important;
  text-decoration: none !important;
  letter-spacing: -0.02em;
}
.navbar-brand span { color: var(--icse-accent); }

/* Navbar nav links */
.navbar-nav .nav-link,
.main-navigation a {
  font-family: var(--icse-font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--icse-text-secondary) !important;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.navbar-nav .nav-link:hover,
.main-navigation a:hover {
  color: var(--icse-primary) !important;
  background: var(--icse-primary-light);
}
.navbar-nav .nav-link.active,
.main-navigation .current-menu-item a {
  color: var(--icse-primary) !important;
  font-weight: 700;
  background: var(--icse-primary-light);
}

/* Center nav links (desktop) */
.navbar-main-links .nav-link {
  color: var(--icse-primary) !important;
  font-weight: 600;
}
.navbar-main-links .nav-link:hover {
  color: var(--icse-accent) !important;
  background: var(--icse-accent-light);
}

/* Search in navbar */
.header-search .form-control {
  border-radius: var(--radius) !important;
  border: 1.5px solid var(--icse-border);
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
  background: var(--icse-bg);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.header-search .form-control:focus {
  border-color: var(--icse-primary);
  background: var(--icse-white);
  box-shadow: 0 0 0 3px rgba(26,60,110,.12);
  outline: none;
}

/* CTA button in navbar — green signals "free download action" */
.navbar-cta {
  background: var(--icse-cta) !important;
  color: var(--icse-white) !important;
  border: none;
  border-radius: var(--radius) !important;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.5rem 1.125rem;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 1px 3px var(--icse-cta-shadow);
}
.navbar-cta:hover {
  background: var(--icse-cta-hover) !important;
  color: var(--icse-white) !important;
  box-shadow: 0 4px 14px var(--icse-cta-shadow);
}


/* ── 5. Mega-menu ───────────────────────────────────────────────── */
.mega-menu-wrapper { position: static !important; }

.mega-dropdown {
  position: absolute !important;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 680px;
  margin: 4px 0 0 0 !important;
  padding: 1.5rem !important;
  border: 1px solid var(--icse-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  background: var(--icse-white) !important;
  display: none;
}
.mega-dropdown.show { display: flex; gap: 2rem; }

.mega-col { flex: 1; }
.mega-col-title {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--icse-text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--icse-border-light);
}
.mega-col ul { list-style: none; padding: 0; margin: 0; }
.mega-col ul li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--icse-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.mega-col ul li a:hover {
  background: var(--icse-primary-light);
  color: var(--icse-primary);
  padding-left: 0.75rem;
}
.mega-col ul li a .subj-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* Mega-menu: click-triggered via Bootstrap data-bs-toggle (not hover)
   Hover was removed — fails on trackpads and keyboard navigation */


/* ── 6. Breadcrumbs — modern › separator, no border (Vedantu pattern) */
.breadcrumb,
.rank-math-breadcrumb,
nav.breadcrumb {
  padding: 0.5rem 0;
  margin-bottom: 0.625rem;
  font-size: 0.75rem;
  color: var(--icse-text-muted);
  background: transparent;
  /* border-bottom removed — cleaner, less visual noise */
}
.breadcrumb a {
  color: var(--icse-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s;
}
.breadcrumb a:hover { color: var(--icse-primary); }
.breadcrumb .separator,
.breadcrumb-item + .breadcrumb-item::before {
  color: var(--icse-text-muted);
  content: "›";   /* › is cleaner than / */
  padding: 0 0.375rem;
  font-weight: 400;
}


/* ── 7. 3-Column Layout Grid ────────────────────────────────────── */
#content.site-content {
  max-width: 1340px;
  margin: 0 auto;
  padding: 1rem 1rem 0;
}

.layout-grid { display: block; }

@media (min-width: 992px) {
  /* Default: 2-column — left sidebar + content.
     The 3rd column (right sidebar) is only added when widgets are active.
     This eliminates the ~300px empty gap on pages without right sidebar content. */
  .layout-grid {
    display: grid;
    grid-template-columns: var(--icse-sidebar-left) minmax(0,1fr);
    column-gap: 1.25rem;
    align-items: start;
  }
  /* 3-column: added by PHP when sidebar-2 has active widgets */
  .layout-grid.has-right-sidebar {
    grid-template-columns: var(--icse-sidebar-left) minmax(0,1fr) var(--icse-sidebar-right);
  }
}

#primary.content-area { min-width: 0; }

@media (min-width: 992px) and (max-width: 1199.98px) {
  :root {
    --icse-sidebar-left:  240px;
    --icse-sidebar-right: 260px;
  }
}
@media (min-width: 1400px) {
  #content.site-content { max-width: 1400px; }
}


/* ── 8. Left Sidebar Tree ───────────────────────────────────────── */
.left-sidebar {
  position: sticky;
  top: calc(var(--icse-nav-height) + 12px);
  max-height: calc(100vh - var(--icse-nav-height) - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--icse-border) transparent;
}

.left-sidebar .card {
  border: 1px solid var(--icse-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
  background: var(--icse-white);
}
.left-sidebar .card-header {
  background: var(--icse-white) !important;
  border-bottom: 1px solid var(--icse-border) !important;
  font-size: 0.625rem !important;
  font-weight: 700 !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
  color: var(--icse-text-muted) !important;
  padding: 0.875rem 1rem !important;
}

/* Sidebar nav tree */
.sidebar-nav-tree { padding: 0.375rem 0; }

.sidebar-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--icse-text-muted);
  padding: 0.75rem 1rem 0.375rem;
  display: block;
}

.sidebar-class-group {
  border-bottom: 1px solid var(--icse-border-light);
}

.sidebar-class-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--icse-text);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .15s;
}
.sidebar-class-toggle a {
  color: inherit;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
}
.sidebar-class-toggle:hover { background: var(--icse-primary-light); }
.sidebar-class-toggle .toggle-arrow {
  font-size: 0.625rem;
  color: var(--icse-text-muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.sidebar-class-group.open .toggle-arrow { transform: rotate(180deg); }

.sidebar-subject-list {
  list-style: none;
  padding: 0.25rem 0 0.375rem;
  margin: 0;
  display: none;
  background: var(--icse-bg);
}
.sidebar-class-group.open .sidebar-subject-list { display: block; }

.sidebar-subject-list li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem 0.375rem 1.5rem;
  font-size: 0.7813rem;
  font-weight: 500;
  color: var(--icse-text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .15s;
}
.sidebar-subject-list li a:hover {
  color: var(--icse-primary);
  background: var(--icse-primary-light);
  border-left-color: var(--icse-primary-mid);
}

/* Coloured dots */
.sidebar-subject-list li a .subj-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.subj-maths     { --subj-color: var(--subject-maths); }
.subj-physics   { --subj-color: var(--subject-physics); }
.subj-chemistry { --subj-color: var(--subject-chemistry); }
.subj-biology   { --subj-color: var(--subject-biology); }
.subj-english   { --subj-color: var(--subject-english); }
.subj-history   { --subj-color: var(--subject-history); }
.subj-geography { --subj-color: var(--subject-geography); }
.subj-computer  { --subj-color: var(--subject-computer); }
.sidebar-subject-list li a .subj-dot { background: var(--subj-color, var(--icse-text-muted)); }

/* Quick links */
.sidebar-quick-links { list-style: none; padding: 0.25rem 0; margin: 0; }
.sidebar-quick-links li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--icse-text-secondary);
  text-decoration: none;
  transition: all .15s;
}
.sidebar-quick-links li a:hover {
  color: var(--icse-accent);
  background: var(--icse-accent-light);
}

@media (max-width: 991.98px) {
  .left-sidebar, .right-sidebar { display: none !important; }
}


/* ── 9. Right Sidebar ───────────────────────────────────────────── */
.right-sidebar {
  position: sticky;
  top: calc(var(--icse-nav-height) + 12px);
  max-height: calc(100vh - var(--icse-nav-height) - 24px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--icse-border) transparent;
}

.right-sidebar .widget,
.right-sidebar .card {
  background: var(--icse-white);
  border: 1px solid var(--icse-border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  font-size: 0.875rem;
}
.right-sidebar .widget-title,
.right-sidebar .card-title {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--icse-text-muted);
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--icse-border-light);
}
.right-sidebar a {
  color: var(--icse-text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
}
.right-sidebar a:hover { color: var(--icse-primary); }

/* ── AdSense rail ──────────────────────────────────────────── */
.ad-rail {
  min-height: 250px;
  contain: layout style;
}
.right-sidebar .ad-rail:first-child {
  min-height: 600px;
}
.adsbygoogle {
  display: block;
  overflow: hidden;
}
.right-sidebar .ad-rail + .ad-rail {
  margin-top: 1.5rem;
}


/* ── 10. Entry / Page Content ───────────────────────────────────── */
/* Borderless card — shadow-only depth (Vedantu editorial pattern) */
.entry-header {
  background: var(--icse-white);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.875rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  border: none;
}

.entry-title,
.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--icse-dark);
  line-height: 1.2;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.entry-meta, .post-meta {
  font-size: 0.8125rem;
  color: var(--icse-text-muted);
  margin: 0.5rem 0 0;
}

.entry-content,
.page-content {
  background: var(--icse-white);
  border: none;                       /* borderless — shadow gives depth */
  border-radius: var(--radius-lg);
  padding: 1.875rem 2.125rem;
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--icse-text);
}
/* Constrain prose for readability — tables/blocks stay full-width */
.entry-content > p,
.page-content > p { max-width: 72ch; }

.entry-content p { margin-bottom: 1.1rem; }
.entry-content ul,
.entry-content ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.entry-content li { margin-bottom: 0.4rem; line-height: 1.7; }

/* Tables in content */
.entry-content table {
  width: 100%;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  border: 1px solid var(--icse-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.entry-content table thead { background: var(--icse-primary-light); }
.entry-content table th {
  font-weight: 600;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--icse-primary);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--icse-primary-mid);
}
.entry-content table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--icse-border-light);
  vertical-align: middle;
}
.entry-content table tbody tr:last-child td { border-bottom: none; }
.entry-content table tbody tr:hover td { background: var(--icse-bg); }

blockquote, .wp-block-quote {
  border-left: 3px solid var(--icse-primary);
  padding: 1rem 1.5rem;
  margin: 1.75rem 0;
  background: var(--icse-primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--icse-text-secondary);
}

@media (max-width: 767.98px) {
  .entry-content { padding: 1.25rem 1.125rem; max-width: none; }
  .entry-title { font-size: 1.375rem; }
}


/* ── 11. Cards — border-color shift on hover, no translate (Vedantu) */
.card {
  border: 1px solid var(--icse-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm);
  background: var(--icse-white);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--icse-primary-mid) !important;
  /* Removed: transform: translateY(-3px) — was distracting, especially on sidebar cards */
}

/* Subject left-border system */
.card[data-subject="maths"]     { border-left: 3px solid var(--subject-maths) !important; }
.card[data-subject="physics"]   { border-left: 3px solid var(--subject-physics) !important; }
.card[data-subject="chemistry"] { border-left: 3px solid var(--subject-chemistry) !important; }
.card[data-subject="biology"]   { border-left: 3px solid var(--subject-biology) !important; }
.card[data-subject="english"]   { border-left: 3px solid var(--subject-english) !important; }
.card[data-subject="history"]   { border-left: 3px solid var(--subject-history) !important; }
.card[data-subject="geography"] { border-left: 3px solid var(--subject-geography) !important; }
.card[data-subject="computer"]  { border-left: 3px solid var(--subject-computer) !important; }


/* ── 12. Buttons — green primary CTA (44px touch target) ─────────── */
.btn-primary-icse,
.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.6875rem 1.375rem;  /* 44px height when base is 16px */
  min-height: 44px;             /* WCAG touch target */
  background: var(--icse-cta);
  color: var(--icse-white);
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 1px 4px var(--icse-cta-shadow);
  transition: background .15s, box-shadow .15s;
  cursor: pointer;
}
.btn-primary-icse:hover,
.pdf-download-btn:hover {
  background: var(--icse-cta-hover);
  box-shadow: 0 4px 16px var(--icse-cta-shadow);
  color: var(--icse-white);
}

.pdf-coming-soon {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--icse-bg);
  color: var(--icse-text-muted);
  border: 1px solid var(--icse-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}


/* ── 13. Alerts ─────────────────────────────────────────────────── */
.alert-info, .info-box {
  background: var(--icse-primary-light);
  border: 1px solid var(--icse-primary-mid);
  border-left: 4px solid var(--icse-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.875rem 1.125rem;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  color: var(--icse-primary);
}
.alert-warning, .warning-box {
  background: var(--icse-warning-light);
  border: 1px solid #fde68a;
  border-left: 4px solid var(--icse-warning);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.875rem 1.125rem;
  margin-bottom: 1.25rem;
}
.alert-success, .success-box {
  background: var(--icse-success-light);
  border: 1px solid #a7f3d0;
  border-left: 4px solid var(--icse-success);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.875rem 1.125rem;
  margin-bottom: 1.25rem;
}


/* ── 14. Pagination ─────────────────────────────────────────────── */
.pagination, .page-numbers {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}
.page-numbers li a, .page-numbers li span {
  display: block;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--icse-border);
  border-radius: var(--radius-sm);
  color: var(--icse-primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
}
.page-numbers li span.current,
.page-numbers li a:hover {
  background: var(--icse-primary);
  color: var(--icse-white);
  border-color: var(--icse-primary);
}


/* ── 15. Offcanvas (mobile menu) ────────────────────────────────── */
@media (max-width: 991.98px) {
  .offcanvas { width: 85vw; max-width: 380px; }
}

.offcanvas-header { background: var(--icse-primary); }
.offcanvas-header h5, .offcanvas-title {
  color: var(--icse-white) !important;
  font-family: var(--icse-heading-font);
  font-weight: 800;
}
.offcanvas-header .btn-close { filter: invert(1); }


/* ── 16. Mobile Bottom Tab Bar — pill indicator for active state ─── */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1050;
  background: var(--icse-white);
  border-top: 1px solid var(--icse-border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 12px rgba(15,23,42,.08);
}
.mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.25rem 0.5rem;
  font-size: 0.5875rem;
  font-weight: 700;
  color: var(--icse-text-muted);
  text-decoration: none;
  gap: 0.2rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  min-height: 56px;
  position: relative;
  transition: color .15s;
}
.mobile-tab .tab-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform .15s ease;
}
/* Active pill indicator — appears above icon */
.mobile-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--icse-primary);
  border-radius: 0 0 3px 3px;
}
.mobile-tab:hover,
.mobile-tab.active {
  color: var(--icse-primary);
  text-decoration: none;
}
.mobile-tab.active .tab-icon {
  transform: scale(1.12);
}
/* Touch feedback */
.mobile-tab:active .tab-icon { transform: scale(0.92); }

@media (max-width: 991.98px) {
  body { padding-bottom: 60px; }
  .scroll-to-top { bottom: 4.5rem; }
}


/* ── 17. Scroll to Top ──────────────────────────────────────────── */
.scroll-to-top {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 40px; height: 40px;
  background: var(--icse-primary);
  color: var(--icse-white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  z-index: 999;
}
.scroll-to-top.visible { opacity: 1; }
.scroll-to-top:hover { transform: translateY(-2px); background: var(--icse-primary-hover); }


/* ── 18. Accessibility ──────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px; left: 0;
  background: var(--icse-primary);
  color: var(--icse-white);
  padding: 0.5rem 1rem;
  z-index: 9999;
  transition: top .15s;
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 2px solid var(--icse-primary); outline-offset: 3px; }

.icse-icon { display: inline-block; width:1em; height:1em; vertical-align:-.125em; fill:currentColor; }
.icse-icon-2x { width:2em; height:2em; }


/* ══════════════════════════════════════════════════════════════════
   19. HOMEPAGE SECTIONS (hp-*)
   ══════════════════════════════════════════════════════════════════ */

/* Hero ─────────────────────────────────────────────────────────── */
.hp-hero {
  background: linear-gradient(135deg, #1A3C6E 0%, #1e4a85 40%, #1A3C6E 100%);
  padding: 4.5rem 0 4rem;
  position: relative;
  overflow: hidden;
  border-bottom: none;
}
/* Subtle pattern overlay */
.hp-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(232,160,32,.12) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(255,255,255,.04) 0%, transparent 40%);
  pointer-events: none;
}
.hp-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 99px;
  padding: 0.35rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  margin-bottom: 1.5rem;
  letter-spacing: .02em;
}
.hp-badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--icse-accent);
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.3); }
}

.hp-hero-headline {
  font-family: var(--icse-heading-font);
  font-size: var(--type-hero);        /* fluid: clamp(1.875rem, 4vw+0.75rem, 2.75rem) */
  font-weight: 800;
  color: var(--icse-white);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  border: none;
}
.hp-hero-headline::after { display: none; }

.hp-headline-accent { color: var(--icse-accent); }

.hp-hero-sub {
  font-size: 1.0625rem;
  color: rgba(255,255,255,.72);
  line-height: 1.65;
  margin-bottom: 2rem;
}

/* Hero search — Bootstrap input-group with pill styling */
.hp-search-form {
  max-width: 580px;
  margin: 0 auto 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
  border-radius: 99px;
  overflow: hidden;
  background: var(--icse-white);
}
.hp-search-form .hp-search-input {
  border: none;
  font-family: var(--icse-font);
  font-size: 0.9375rem;
  padding: 0.875rem 1.5rem;
  box-shadow: none;
}
.hp-search-form .hp-search-input:focus {
  box-shadow: none;
  border-color: transparent;
}
.hp-search-form .hp-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 0.875rem 1.5rem;
  background: var(--icse-accent);
  border-color: var(--icse-accent);
  color: var(--icse-white);
}
.hp-search-form .hp-search-btn:hover {
  background: var(--icse-accent-hover);
  border-color: var(--icse-accent-hover);
  color: var(--icse-white);
}

/* Hero stats — Bootstrap row + semi-transparent cards */
.hp-stat-value {
  font-family: var(--icse-heading-font);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1;
}
.hp-stat-label {
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.hp-stat-card { backdrop-filter: blur(4px); }

/* Sections ─────────────────────────────────────────────────────── */
.hp-section {
  padding: 3.5rem 0;
}
.hp-section-alt {
  background: var(--icse-bg);
  padding: 3.5rem 0;
}

.hp-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}
.hp-section-title {
  font-family: var(--icse-heading-font);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--icse-dark);
  letter-spacing: -0.02em;
  margin: 0;
  border: none;
  padding: 0;
}
.hp-section-title::after { display: none; }
.hp-section-link {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--icse-primary);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.hp-section-link:hover { color: var(--icse-accent); }

/* Bootstrap card accents (grids use row/col) ───────────────────── */
.hp-hover-lift {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.hp-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md) !important;
  text-decoration: none;
}

.hp-class-card {
  position: relative;
  border-top: 3px solid var(--card-color, var(--icse-accent));
  color: inherit;
}
.hp-class-card:hover {
  border-color: var(--card-color, var(--icse-accent));
}

.hp-class-popular {
  position: absolute;
  top: -1px; right: 12px;
  background: var(--icse-accent);
  color: var(--icse-white);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.hp-class-num {
  font-family: var(--icse-heading-font);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--card-color, var(--icse-primary));
  line-height: 1;
  display: block;
}
.hp-class-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--icse-text-secondary);
  display: block;
}
.hp-class-subjects {
  font-size: 0.7rem;
  color: var(--icse-text-muted);
  display: block;
  line-height: 1.4;
  margin-top: 0.25rem;
}
.hp-class-arrow {
  font-size: 0.9rem;
  color: var(--card-color, var(--icse-primary));
  margin-top: 0.5rem;
  display: block;
  transition: transform .15s;
}
.hp-class-card:hover .hp-class-arrow { transform: translateX(4px); }

.hp-resource-card { color: inherit; }
.hp-resource-card .card-title {
  font-family: var(--icse-heading-font);
  color: var(--icse-dark);
}
.hp-resource-icon { font-size: 1.75rem; line-height: 1; }
.hp-resource-arrow { transition: transform .15s; }
.hp-resource-card:hover .hp-resource-arrow { transform: translateX(3px); }
.hp-resource-syllabus:hover  { border-color: #3b82f6 !important; }
.hp-resource-books:hover     { border-color: var(--icse-accent) !important; }
.hp-resource-papers:hover    { border-color: #8b5cf6 !important; }
.hp-resource-sample:hover    { border-color: var(--icse-success) !important; }

.hp-subject-card { color: inherit; }
.hp-subject-card:hover { background: var(--icse-bg); }
.hp-subj-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--subj, var(--icse-primary));
  flex-shrink: 0;
  display: block;
  margin-bottom: 0.25rem;
}
.hp-subj-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--icse-dark);
  display: block;
  font-family: var(--icse-heading-font);
}
.hp-subj-meta {
  font-size: 0.7rem;
  color: var(--icse-text-muted);
  display: block;
}

/* Popular + Latest — Bootstrap list-group with custom accents */
.hp-popular-list,
.hp-updates-list { gap: 0.25rem; }

.hp-popular-item,
.hp-update-item {
  border: 1px solid var(--icse-border);
  border-radius: var(--radius) !important;
  margin-bottom: 0.25rem;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.hp-popular-item:hover,
.hp-update-item:hover {
  background: var(--icse-primary-light);
  border-color: var(--icse-primary-mid) !important;
  transform: translateX(3px);
}
.hp-pop-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 800;
  flex-shrink: 0;
}
.hp-pop-body,
.hp-update-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.hp-pop-body strong,
.hp-update-body strong {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--icse-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp-pop-body span,
.hp-update-body span {
  font-size: 0.7rem;
  color: var(--icse-text-muted);
  margin-top: 0.1rem;
}
.hp-pop-arrow,
.hp-update-arrow {
  font-size: 0.875rem;
  color: var(--icse-text-muted);
  flex-shrink: 0;
  transition: transform .15s, color .15s;
}
.hp-popular-item:hover .hp-pop-arrow,
.hp-update-item:hover .hp-update-arrow {
  transform: translateX(3px);
  color: var(--icse-primary);
}

/* Misc helpers */
.bg-primary-soft { background: var(--icse-primary-light); }
.bg-success-soft { background: var(--icse-success-light); }
.bg-warning-soft { background: var(--icse-warning-light); }
.bg-info-soft    { background: #f0f9ff; }
.feature-card { transition: transform .25s, box-shadow .25s; }
.feature-card:hover, .hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }


/* ══════════════════════════════════════════════════════════════════
   20. FOOTER
   ══════════════════════════════════════════════════════════════════ */

.site-footer {
  background: #1A1F2E;
  color: #94a3b8;
  padding: 3.5rem 0 0;
  margin-top: 3.5rem;
  font-size: 0.875rem;
}

/* Hide default WP widget areas */
.site-footer .widget-area,
.site-footer aside.widget-area,
.site-footer .footer-widgets,
footer aside,
footer .widget-area { display: none !important; }

.site-footer h6.widget-title {
  color: #f1f5f9;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: block;
}

.site-footer .footer-column .widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer .footer-column .widget ul li { padding: 0.2rem 0; }

.site-footer a {
  color: #64748b !important;
  text-decoration: none;
  font-size: 0.8125rem;
  transition: color .15s, padding-left .12s;
}
.site-footer a:hover {
  color: var(--icse-accent) !important;
  padding-left: 0.25rem;
}

.footer-disclaimer-row {
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 1.25rem;
  margin-top: 0.75rem;
}
.footer-disclaimer-row .disclaimer-content {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.65;
}
.footer-disclaimer-row .disclaimer-content a { color: var(--icse-accent) !important; }
.footer-bottom {
  background: rgba(0,0,0,.3);
  border-top: 1px solid rgba(255,255,255,.05);
  padding: 1rem 0;
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #475569;
}
.footer-bottom a { color: #64748b !important; }
.footer-bottom a:hover { color: var(--icse-accent) !important; }


/* ══════════════════════════════════════════════════════════════════
   21. PIPELINE CONTENT COMPONENTS (ib-*)
   ══════════════════════════════════════════════════════════════════ */

/* Author / E-E-A-T Trust Bar */
.ib-author-bar {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  background: var(--icse-success-light);
  border: 1px solid #a7f3d0;
  border-left: 3px solid var(--icse-success);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.625rem 1rem;
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  color: #065f46;
  line-height: 1.5;
}
.ib-author-bar span { display: inline-flex; align-items: center; white-space: nowrap; }
.ib-author-bar span + span::before {
  content: "·"; margin: 0 0.625rem;
  color: #6ee7b7; font-weight: 700; flex-shrink: 0;
}
.ib-author-bar span:first-child::before {
  content: ''; display: inline-block;
  width: 7px; height: 7px;
  background: var(--icse-success);
  border-radius: 50%; margin-right: 0.5rem; flex-shrink: 0;
}
.ib-author-bar a { color: #047857 !important; font-weight: 600; text-decoration: none; }
.ib-author-bar a:hover { color: #065f46 !important; text-decoration: underline; }
@media (max-width: 600px) {
  .ib-author-bar { flex-direction: column; align-items: flex-start; gap: 0.125rem; font-size: 0.7rem; padding: 0.375rem 0.625rem; }
  .ib-author-bar span { white-space: normal; word-break: break-word; }
  .ib-author-bar span + span::before { display: none; }
}

/* ── Table of Contents — Bootstrap accordion, default CLOSED, 2-column ── */
.ib-toc {
  background: var(--icse-white);
  border: 1px solid var(--icse-border);
  border-top: 3px solid var(--icse-primary);
  border-radius: 0 0 var(--radius) var(--radius);
  margin: 0 0 1.75rem;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

/* Toggle header — acts like Bootstrap accordion button */
.ib-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  user-select: none;
  background: var(--icse-white);
  transition: background .15s;
}
.ib-toc-header:hover { background: var(--icse-primary-light); }

.ib-toc-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--icse-text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ib-toc-chevron {
  font-size: 0.625rem;
  color: var(--icse-text-muted);
  transition: transform .22s ease;
  flex-shrink: 0;
  line-height: 1;
}
.ib-toc.toc-open .ib-toc-chevron { transform: rotate(180deg); }

/* Body — hidden by default, shown when .toc-open added by JS */
.ib-toc-body {
  display: none;
  padding: 0.5rem 1.25rem 1rem;
  border-top: 1px solid var(--icse-border-light);
}
.ib-toc.toc-open .ib-toc-body { display: block; }

/* 2-column numbered list */
.ib-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2;
  column-gap: 2rem;
}
@media (max-width: 600px) { .ib-toc ol { columns: 1; } }
.ib-toc li {
  font-size: 0.8125rem;
  margin: 0.3rem 0;
  break-inside: avoid;
  line-height: 1.5;
}
.ib-toc a { color: var(--icse-text-secondary); text-decoration: none; font-weight: 500; }
.ib-toc a:hover { color: var(--icse-primary); text-decoration: underline; }

/* Legacy: if old markup (h3 + ol directly) is still in content, style gracefully */
.ib-toc > h3 {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--icse-text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  border: none;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
}
.ib-toc > h3::after { display: none; }
.ib-toc > ol {
  display: none;
  padding: 0.5rem 1.25rem 1rem 2.5rem;
  margin: 0;
  columns: 2;
  column-gap: 2rem;
  border-top: 1px solid var(--icse-border-light);
}
.ib-toc.toc-open > ol { display: block; }
@media (max-width: 600px) { .ib-toc > ol { columns: 1; } }

/* Download Table */
.wp-block-table.is-style-regular,
.wp-block-table figure { margin: 0 !important; }

.ib-download-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.875rem;
  background: var(--icse-white);
  border-radius: var(--radius);
  overflow: hidden;
}
.ib-download-table thead tr { background: var(--icse-primary); color: var(--icse-white); }
.ib-download-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ib-download-table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--icse-border-light);
  vertical-align: middle;
  color: var(--icse-text);
}
.ib-download-table tbody tr:last-child td { border-bottom: none; }
.ib-download-table tbody tr:nth-child(even) td { background: #fafbff; }
.ib-download-table tbody tr:hover td { background: var(--icse-primary-light); }

/* Download button — green CTA, 44px touch target */
.ib-download-table a.ib-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--icse-cta);
  color: var(--icse-white) !important;
  padding: 0.5rem 0.875rem;
  min-height: 36px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 1px 3px var(--icse-cta-shadow);
}
.ib-download-table a.ib-dl-btn:hover {
  background: var(--icse-cta-hover);
  box-shadow: 0 3px 10px var(--icse-cta-shadow);
  color: var(--icse-white) !important;
}

@media (max-width: 767px) {
  .ib-download-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ib-download-table th,
  .ib-download-table td { padding: 0.5rem 0.625rem; font-size: 0.8125rem; }
}

/* FAQ Accordion */
.ib-faq-section { margin: 2rem 0 1.5rem; }
.ib-faq-section .accordion-item {
  border: 1px solid var(--icse-border) !important;
  border-radius: var(--radius) !important;
  margin-bottom: 6px;
  overflow: hidden;
  background: var(--icse-white);
}
.ib-faq-section .accordion-button {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--icse-dark);
  background: var(--icse-white);
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius) !important;
}
.ib-faq-section .accordion-button:not(.collapsed) {
  color: var(--icse-primary);
  background: var(--icse-primary-light);
  box-shadow: none;
}
.ib-faq {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--icse-text-secondary);
  padding: 0.25rem 0.25rem 0.5rem;
}

/* Related Resources Grid */
.ib-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 1.5rem 0 2rem;
}
.ib-related-card {
  border: 1px solid var(--icse-border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--icse-white);
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
  display: block;
}
.ib-related-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--icse-primary-mid);
  transform: translateY(-2px);
}
.ib-related-card a {
  color: var(--icse-primary);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  display: block;
  margin-bottom: 0.375rem;
}
.ib-related-card p { margin: 0; color: var(--icse-text-muted); font-size: 0.8125rem; line-height: 1.5; }

@media (max-width: 600px) { .ib-related-grid { grid-template-columns: 1fr 1fr; gap: 8px; } }

/* Meta Badge Bar */
.ib-meta-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.5rem 0 1.25rem; align-items: center; }
.ib-badge {
  display: inline-block;
  background: var(--icse-primary-light);
  color: var(--icse-primary);
  padding: 0.1875rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  border: 1px solid var(--icse-primary-mid);
}
.ib-badge-type  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.ib-badge-class { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.ib-badge-year  { background: var(--icse-accent-light); color: #92400e; border-color: #fde68a; }

/* Alert box */
.ib-alert-box {
  background: var(--icse-warning-light);
  border: 1px solid #fde68a;
  border-left: 3px solid var(--icse-warning);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.875rem 1.125rem;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  color: #78350f;
}
.ib-alert-box strong { color: #92400e; }
.ib-alert-box a { color: var(--icse-primary); font-weight: 600; }

/* Discover tags */
.ib-discover-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ib-tag-label { font-size: .8rem; color: var(--icse-text-muted); font-weight: 600; }
.ib-tag {
  display: inline-block;
  background: var(--icse-primary-light);
  color: var(--icse-primary);
  border: 1px solid var(--icse-primary-mid);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}
.ib-tag:hover { background: var(--icse-primary); color: #fff; border-color: var(--icse-primary); }


/* ══════════════════════════════════════════════════════════════════
   22. DOWNLOAD PAGE
   ══════════════════════════════════════════════════════════════════ */

/* Download button (used in page-download.php inline) */
.download-btn-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2.5rem;
  background: var(--icse-accent);
  color: white;
  border-radius: 50px;
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(232,160,32,.35);
  transition: all .2s ease;
  border: none;
  cursor: pointer;
}
.download-btn-main:hover {
  background: var(--icse-accent-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232,160,32,.45);
}

/* Old ib-dl-now-btn (kept for backward compat) */
.ib-dl-now-btn {
  display: inline-block;
  background: var(--icse-accent);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  padding: 10px 24px;
  border-radius: 6px;
  text-decoration: none;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.ib-dl-now-btn:hover:not(.disabled) {
  background: var(--icse-accent-hover);
  color: #fff;
  transform: translateY(-1px);
}
.ib-dl-now-btn.disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
}

/* PDF iframe wrapper */
.ib-pdf-preview-wrap {
  background: #fff;
  border: 1px solid var(--icse-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.ib-pdf-preview-label {
  background: var(--icse-primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 6px 14px;
}
.ib-pdf-frame { display: block; width: 100%; height: 520px; border: none; }
@media (max-width: 640px) { .ib-pdf-frame { height: 360px; } }

/* AdSense slots — CLS prevention */
.ib-ad-slot,
.adsense-slot {
  min-height: 90px;
  width: 100%;
  contain: layout;
  background: var(--icse-bg);
  border: 1px dashed var(--icse-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icse-text-muted);
  font-size: .8rem;
}
.adsense-slot-250 { min-height: 250px; }
.adsense-slot-280 { min-height: 280px; }


/* ── 23. RankMath TOC + FAQ ─────────────────────────────────────── */
/* Rank Math outputs a Bootstrap accordion. We:
   1. Force it closed by default (JS removes .show class on load)
   2. Style the button to match our design system
   3. Lay out top-level TOC items in 2 columns */
.wp-block-rank-math-toc-block,
#rank-math-toc { margin-bottom: 1.5rem; }

.wp-block-rank-math-toc-block .accordion-item {
  border: 1px solid var(--icse-border) !important;
  border-top: 3px solid var(--icse-primary) !important;
  border-radius: 0 0 var(--radius) var(--radius) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.wp-block-rank-math-toc-block .accordion-button {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--icse-text-muted);
  background: var(--icse-white);
  padding: 0.75rem 1.125rem;
  box-shadow: none !important;
}
.wp-block-rank-math-toc-block .accordion-button::after {
  /* Bootstrap chevron — keep default, just resize */
  width: 0.875rem;
  height: 0.875rem;
  background-size: 0.875rem;
}
.wp-block-rank-math-toc-block .accordion-button:not(.collapsed) {
  color: var(--icse-primary);
  background: var(--icse-primary-light);
  border-bottom: 1px solid var(--icse-border-light);
  box-shadow: none !important;
}
.wp-block-rank-math-toc-block .accordion-button.collapsed {
  color: var(--icse-text-muted);
  background: var(--icse-white);
}

/* Body: 2-column layout for top-level TOC items */
.wp-block-rank-math-toc-block .accordion-body {
  padding: 0.625rem 1.125rem 0.875rem;
}
.wp-block-rank-math-toc-block .accordion-body > nav > ul,
.wp-block-rank-math-toc-block .accordion-body > ul {
  columns: 2;
  column-gap: 2rem;
  list-style: decimal;
  padding-left: 1.25rem;
  margin: 0;
}
/* Sub-items stay single-column under their parent */
.wp-block-rank-math-toc-block .accordion-body ul ul {
  columns: 1;
  padding-left: 1rem;
  margin: 0.125rem 0 0.25rem;
}

@media (max-width: 600px) {
  .wp-block-rank-math-toc-block .accordion-body > nav > ul,
  .wp-block-rank-math-toc-block .accordion-body > ul {
    columns: 1;
  }
}

.wp-block-rank-math-toc-block li {
  font-size: 0.8125rem;
  margin: 0.3rem 0;
  break-inside: avoid;
  line-height: 1.5;
}
.wp-block-rank-math-toc-block .accordion-body a {
  color: var(--icse-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s;
}
.wp-block-rank-math-toc-block .accordion-body a:hover {
  color: var(--icse-primary);
  text-decoration: underline;
}

.faq-section { margin: 2.5rem 0 2rem; }
.faq-section .accordion-item {
  border: 1px solid var(--icse-border);
  margin-bottom: 6px;
  border-radius: var(--radius) !important;
  overflow: hidden;
}
.faq-section .accordion-button {
  font-weight: 600; font-size: 0.9375rem;
  color: var(--icse-dark); background: var(--icse-white); padding: 1rem 1.125rem;
}
.faq-section .accordion-button:not(.collapsed) {
  color: var(--icse-primary); background: var(--icse-primary-light);
}
.faq-section .accordion-body {
  padding: 0.875rem 1.125rem; font-size: 0.9375rem; line-height: 1.75; color: var(--icse-text-secondary);
}


/* ── 24. Miscellaneous ──────────────────────────────────────────── */
.wp-block-image, .entry-content figure { margin: 1.5rem 0; border-radius: var(--radius-lg); overflow: hidden; }
.wp-block-image img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
figure figcaption { font-size: .8125rem; color: var(--icse-text-muted); text-align: center; padding: .5rem; font-style: italic; }

.search-field, input[type="search"] {
  font-family: var(--icse-font);
  padding: .5rem 1rem;
  border: 1.5px solid var(--icse-border);
  border-radius: var(--radius);
  font-size: .9375rem;
  transition: border-color .15s, box-shadow .15s;
  background: var(--icse-bg);
}
.search-field:focus, input[type="search"]:focus {
  border-color: var(--icse-primary);
  box-shadow: 0 0 0 3px rgba(26,60,110,.12);
  outline: none;
  background: var(--icse-white);
}

[id*="-chapters"] .btn-sm { white-space: nowrap; min-width: 70px; }
[id*="-chapters"] td strong { color: var(--icse-dark); font-size: .9375rem; }
[id*="-chapters"] td small { display: block; margin-top: .2rem; line-height: 1.4; }

.page-template-page-fullwidth .entry-content { max-width: 900px; margin: 0 auto; }

.accordion-collapse:not(.show):not(.collapsing) { display: none; }


/* ══════════════════════════════════════════════════════════════════
   25. MOBILE-FIRST RESPONSIVE RULES
   ══════════════════════════════════════════════════════════════════ */

/* ── Global mobile fixes ────────────────────────────────────────── */
img,
video,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}
.wp-block-image img,
.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Prevent horizontal overflow on any element */
body { overflow-x: hidden; }
#page, .site-content, .container, .container-fluid {
  overflow-x: hidden;
  max-width: 100%;
}

/* Tables scroll horizontally on mobile instead of breaking layout */
.entry-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) {
  .entry-content table { display: table; }
}

/* ── < 992px (tablets + phones): hide sidebars, show bottom nav ── */
@media (max-width: 991.98px) {
  /* 3-col grid → single column */
  .layout-grid {
    display: block !important;
    padding: 0;
  }

  /* Content fills full width — tighter mobile spacing */
  #content.site-content {
    padding: 0.25rem 0.5rem 0;
  }

  .entry-content,
  .page-content {
    max-width: 100%;
    padding: 0.75rem 0.625rem;
    border-radius: var(--radius-sm);
    border-left: none;
    border-right: none;
  }

  .entry-header {
    padding: 0.625rem 0.625rem 0.5rem;
    border-radius: var(--radius-sm);
  }

  .entry-title,
  .page-title {
    font-size: 1.25rem;
    line-height: 1.2;
    margin-bottom: 0.375rem;
  }

  /* Author bar — compact mobile, allow text wrapping */
  .ib-author-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    font-size: 0.7rem;
    padding: 0.375rem 0.625rem;
    margin: 0 0 0.75rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }
  .ib-author-bar span {
    white-space: normal;
    word-break: break-word;
  }
  .ib-author-bar span + span::before { display: none; }

  /* Breadcrumbs — compact single line with ellipsis */
  .breadcrumb,
  .rank-math-breadcrumb,
  nav.breadcrumb {
    font-size: 0.6875rem;
    padding: 0.25rem 0;
    margin-bottom: 0.375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: none;
  }
  .breadcrumb .separator,
  .breadcrumb-item + .breadcrumb-item::before {
    padding: 0 0.2rem;
  }

  /* Download table scrollable */
  .ib-download-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ib-download-table th,
  .ib-download-table td {
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  /* Related grid 2-col */
  .ib-related-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .ib-related-card { padding: 0.75rem; }

  /* TOC single column */
  .ib-toc ol { columns: 1; }

  /* FAQ accordion tighter */
  .ib-faq-section .accordion-button { font-size: 0.875rem; padding: 0.75rem 1rem; }
}

/* ── < 768px (phones only) ──────────────────────────────────────── */
@media (max-width: 767.98px) {
  /* Even tighter content */
  #content.site-content { padding: 0.25rem 0.5rem 0; }

  .entry-content,
  .page-content {
    padding: 1rem 0.875rem;
    font-size: 0.9375rem;
    line-height: 1.75;
  }

  .entry-header { padding: 0.875rem 0.875rem 0.75rem; }
  .entry-title { font-size: 1.25rem; }

  /* Typography scale down */
  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.25rem; padding-bottom: 0.375rem; }
  h3 { font-size: 1.0625rem; }
  h4 { font-size: 1rem; }
  h2::after { width: 30px; }

  /* Featured image full-bleed look */
  .wp-block-image,
  .entry-content figure {
    margin-left: -0.875rem;
    margin-right: -0.875rem;
    border-radius: 0;
  }
  .wp-block-image img { border-radius: 0; }

  /* Blockquote tighter */
  blockquote, .wp-block-quote { padding: 0.75rem 1rem; margin: 1.25rem 0; font-size: 0.9375rem; }

  /* Code blocks scroll */
  pre { font-size: 0.8125rem; padding: 1rem; }

  /* Related grid single col on very small */
  .ib-related-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }

  /* Meta badges wrap */
  .ib-meta-bar { gap: 4px; }
  .ib-badge { font-size: 0.6875rem; padding: 0.125rem 0.5rem; }

  /* Footer tighter */
  .site-footer { padding-top: 2.5rem; font-size: 0.8125rem; }
  .site-footer .row.g-4 { --bs-gutter-y: 1.5rem; }
}

/* ── Mobile nav compact height ──────────────────────────────────── */
@media (max-width: 991.98px) {
  .navbar.d-lg-none {
    height: 52px !important;
    min-height: 52px !important;
  }
}

/* ── < 576px (small phones — iPhone SE, etc) ────────────────────── */
@media (max-width: 575.98px) {
  /* Typography minimum */
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.1875rem; }
  h3 { font-size: 1rem; }

  .entry-title { font-size: 1.1875rem; }

  /* Hero mobile */
  .hp-hero { padding: 2.5rem 0 2rem; }
  .hp-hero-headline { font-size: 1.75rem; line-height: 1.2; }
  .hp-hero-sub { font-size: 0.9375rem; }
  .hp-hero-badge { font-size: 0.6875rem; padding: 0.25rem 0.75rem; }

  /* Hero search mobile — stacked input-group */
  .hp-search-form {
    flex-direction: column !important;
    border-radius: var(--radius-lg);
  }
  .hp-search-form .hp-search-input {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--icse-border);
  }
  .hp-search-form .hp-search-btn {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
    padding: 0.75rem 1rem;
    justify-content: center;
    width: 100%;
  }

  .hp-stat-value { font-size: 1.125rem; }
  .hp-stat-label { font-size: 0.625rem; }

  .hp-class-num { font-size: 2rem; }
  .hp-class-name { font-size: 0.6875rem; }

  .hp-popular-item,
  .hp-update-item { padding: 0.625rem 0.75rem; }
  .hp-pop-body strong,
  .hp-update-body strong { font-size: 0.78rem; }

  /* Homepage section spacing */
  .hp-section,
  .hp-section-alt { padding: 2.5rem 0; }
  .hp-section-header { flex-direction: column; gap: 0.25rem; margin-bottom: 1.25rem; }
  .hp-section-title { font-size: 1.25rem; }

  /* Mobile bottom nav refinement */
  .mobile-bottom-nav { box-shadow: 0 -2px 12px rgba(0,0,0,.1); }
  .mobile-tab {
    font-size: 0.5625rem;
    padding: 0.375rem 0.125rem;
    min-height: 52px;
    gap: 0.15rem;
  }
  .mobile-tab .tab-icon { font-size: 1.125rem; }

  /* Footer 2-col on mobile */
  .site-footer .col-6 { flex: 0 0 50%; max-width: 50%; }

  /* Download page */
  .ib-pdf-frame { height: 320px; }
}


/* ══════════════════════════════════════════════════════════════════
   28. SOLUTIONS CONTENT — questions, answers, derivations, TOC
   ══════════════════════════════════════════════════════════════════
   Targets the semantic markup used by the Competency-Questions and
   Selina Concise Mathematics draft pages: bare h2/h3/p/ul/hr plus the
   icse-toc card and KaTeX displays. Answer/Reason/Hence callouts are
   created server-side by the the_content filter in functions.php which
   injects the .ib-answer-block / .ib-reason-block / .ib-conclusion
   wrappers used below. */

/* "In this chapter" card — already uses nav.icse-toc.card markup. */
nav.icse-toc.card {
  border: 1px solid var(--icse-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0 2rem;
  overflow: hidden;
}
nav.icse-toc .card-header {
  background: var(--icse-surface-2);
  border-bottom: 1px solid var(--icse-border);
  font-weight: 700;
  color: var(--icse-primary);
  font-size: 0.95rem;
  padding: 0.875rem 1.125rem;
  position: relative;
}
nav.icse-toc .card-header::after {
  content: "";
  position: absolute;
  left: 1.125rem;
  bottom: -1px;
  width: 48px;
  height: 3px;
  background: var(--icse-accent);
  border-radius: 2px;
}
nav.icse-toc .list-group { border-top: 0; }
nav.icse-toc .list-group-item {
  border: 0;
  border-bottom: 1px solid var(--icse-border-light);
  padding: 0.75rem 1.125rem;
  color: var(--icse-primary);
  font-weight: 500;
  transition: background .15s, padding-left .15s;
}
nav.icse-toc .list-group-item:last-child { border-bottom: 0; }
nav.icse-toc .list-group-item:hover {
  background: var(--icse-primary-light);
  padding-left: 1.375rem;
}
nav.icse-toc .list-group-item a {
  color: inherit;
  text-decoration: none;
  flex: 1;
}
nav.icse-toc .badge.rounded-pill {
  background: var(--icse-primary) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
}

/* Section / Exercise headings */
.entry-content h2[id^="exercise-"],
.entry-content h2[id*="multiple-choice"],
.entry-content h2[id*="-questions"],
.entry-content h2[id*="short-answer"],
.entry-content h2[id*="long-answer"],
.entry-content h2[id*="case-study"] {
  color: var(--icse-primary);
  font-weight: 700;
  font-size: clamp(1.375rem, 2vw + 0.5rem, 1.75rem);
  margin: 2.5rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--icse-accent);
  display: inline-block;
}

/* Question headings (Question 1, Question 2, etc.) */
.entry-content h3[id^="question-"] {
  color: var(--icse-text);
  font-weight: 700;
  font-size: 1.1875rem;
  margin: 1.75rem 0 0.75rem;
  padding: 0.375rem 0 0.375rem 0.875rem;
  border-left: 4px solid var(--icse-primary);
  background: linear-gradient(90deg, var(--icse-primary-light) 0%, transparent 60%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* The question stem — first paragraph immediately after a question heading. */
.entry-content h3[id^="question-"] + p {
  font-size: 1.0625rem;
  color: var(--icse-text);
  line-height: 1.65;
  margin-bottom: 0.875rem;
}

/* MCQ options — the unordered list following a question heading. */
.entry-content h3[id^="question-"] ~ ul:first-of-type,
.entry-content h3[id^="question-"] + p + ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
}
.entry-content h3[id^="question-"] ~ ul:first-of-type > li,
.entry-content h3[id^="question-"] + p + ul > li {
  background: var(--icse-surface-2);
  border: 1px solid var(--icse-border-light);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  color: var(--icse-text);
  transition: background .15s, border-color .15s, transform .12s;
  cursor: default;
}
.entry-content h3[id^="question-"] ~ ul:first-of-type > li:hover,
.entry-content h3[id^="question-"] + p + ul > li:hover {
  background: var(--icse-primary-light);
  border-color: var(--icse-primary-mid);
  transform: translateY(-1px);
}

/* Divider between questions. */
.entry-content hr {
  border: 0;
  border-top: 1px solid var(--icse-border);
  margin: 2rem 0;
  position: relative;
}
.entry-content hr::after {
  content: "•";
  position: absolute;
  top: -0.7em;
  left: 50%;
  transform: translateX(-50%);
  background: var(--icse-surface);
  color: var(--icse-text-muted);
  padding: 0 0.5rem;
  font-size: 1rem;
  line-height: 1;
}

/* Answer call-out (server-side injected wrapper). */
.ib-answer-block {
  background: var(--icse-cta-light);
  border: 1px solid #BBF7D0;
  border-left: 4px solid var(--icse-cta);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.875rem 1.125rem;
  margin: 1.25rem 0 1rem;
  font-size: 1rem;
  color: #14532d;
  line-height: 1.55;
}
.ib-answer-block .ib-answer-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--icse-cta-hover);
  margin-right: 0.4rem;
}
.ib-answer-block .ib-answer-label::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--icse-cta);
  color: #fff;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
}
.ib-answer-block .ib-answer-value {
  font-weight: 600;
  color: var(--icse-text);
}

/* Reasoning / explanation block. */
.ib-reason-block {
  background: var(--icse-surface-2);
  border-left: 3px solid var(--icse-text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.75rem 1.125rem;
  margin: 1rem 0;
  color: var(--icse-text);
  font-size: 0.9625rem;
  line-height: 1.65;
}
.ib-reason-block .ib-reason-label {
  font-weight: 700;
  color: var(--icse-primary);
  margin-right: 0.25rem;
}

/* Conclusion line ("Hence, Option N is the correct option."). */
.ib-conclusion {
  display: block;
  background: var(--icse-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.625rem 1rem;
  margin: 1.25rem 0 1.5rem;
  font-weight: 600;
  text-align: center;
  font-size: 0.9375rem;
  box-shadow: var(--shadow-xs);
}

/* Display math — sit derivations in a soft textbook panel.
   Layout/overflow is already handled by the math safety-net plugin; here we
   only add visual chrome. */
.entry-content .katex-display {
  background: #FAFBFD;
  border: 1px solid var(--icse-border-light);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  margin: 1rem 0;
}

/* Inline math should never collide with prose ascenders. */
.entry-content .katex { padding: 0 0.05em; }

/* Pull-quotes (teacher insights, if present). */
.entry-content blockquote {
  border-left: 4px solid var(--icse-accent);
  background: var(--icse-accent-light);
  margin: 1.5rem 0;
  padding: 0.875rem 1.125rem;
  font-style: italic;
  color: #78350f;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Tighter bullet/numbered lists inside answer/reason explanations. */
.ib-answer-block ul,
.ib-answer-block ol,
.ib-reason-block ul,
.ib-reason-block ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

/* Mobile tuning. */
@media (max-width: 768px) {
  .entry-content h2[id^="exercise-"],
  .entry-content h2[id*="multiple-choice"],
  .entry-content h2[id*="-questions"] {
    font-size: 1.25rem;
    margin-top: 2rem;
  }
  .entry-content h3[id^="question-"] {
    font-size: 1.0625rem;
    margin-top: 1.5rem;
  }
  .entry-content h3[id^="question-"] ~ ul:first-of-type,
  .entry-content h3[id^="question-"] + p + ul {
    grid-template-columns: 1fr;
  }
  .ib-answer-block,
  .ib-reason-block { padding: 0.75rem 0.875rem; font-size: 0.9375rem; }
  nav.icse-toc .list-group-item { padding: 0.625rem 0.875rem; font-size: 0.9rem; }
}


/* ── 26. Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* ── 27. Print ──────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .left-sidebar, .right-sidebar,
  .scroll-to-top, .faq-section, .wp-block-rank-math-toc-block,
  .search-field, nav.breadcrumb, .offcanvas,
  .mobile-bottom-nav, .navbar-cta { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; padding-bottom: 0; }
  .layout-grid { display: block !important; }
  .entry-content { border: none; box-shadow: none; padding: 0; max-width: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; }
  a[href^="#"]::after { content: ""; }
  .ib-author-bar, .ib-toc, .ib-alert-box { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════════════
   LIGHT EDITORIAL RESKIN
   White sidebar with thin borders + soft slate content background.
   Inspired by Stripe Docs / Notion / Linear — premium minimalism.
   Scoped overrides of the existing .left-sidebar tree; everything
   else (header, cards, typography) stays on the original tokens.
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --allen-sidebar-bg:        #ffffff;
  --allen-sidebar-hover:     #f1f5f9;
  --allen-sidebar-active:    #eff6ff;
  --allen-sidebar-text:      #0f172a;
  --allen-sidebar-muted:     #64748b;
  --allen-sidebar-border:    #e2e8f0;
  --allen-sidebar-border-soft: #f1f5f9;
  --allen-accent:            #1e40af;
  --allen-content-bg:        #f8fafc;
}

/* Content surface — soft slate */
body { background: var(--allen-content-bg); }

/* Sidebar card → clean white panel with thin border */
.left-sidebar .card {
  background: var(--allen-sidebar-bg) !important;
  border: 1px solid var(--allen-sidebar-border) !important;
  box-shadow: 0 1px 3px rgba(15,23,42,.04) !important;
}
.left-sidebar .card-header {
  background: var(--allen-sidebar-bg) !important;
  border-bottom: 1px solid var(--allen-sidebar-border) !important;
  color: var(--allen-sidebar-muted) !important;
  position: relative;
}
.left-sidebar .card-header::before {
  content: '';
  position: absolute;
  left: 1rem; bottom: -1px;
  width: 14px; height: 2px;
  background: var(--allen-accent);
}

/* Class group rows */
.sidebar-class-group { border-bottom: 1px solid var(--allen-sidebar-border-soft); }
.sidebar-class-toggle { color: var(--allen-sidebar-text); }
.sidebar-class-toggle a { color: var(--allen-sidebar-text) !important; }
.sidebar-class-toggle:hover { background: var(--allen-sidebar-hover); }
.sidebar-class-toggle .toggle-arrow { color: var(--allen-sidebar-muted); }

/* Subject list — soft recess with left guide line */
.sidebar-subject-list {
  background: transparent;
  border-left: 1px solid var(--allen-sidebar-border);
  margin-left: 1rem;
}
.sidebar-subject-list li a {
  color: var(--allen-sidebar-muted);
  border-left: 2px solid transparent;
  margin-left: -1px;
}
.sidebar-subject-list li a:hover {
  color: var(--allen-sidebar-text);
  background: var(--allen-sidebar-hover);
  border-left-color: var(--allen-accent);
}

/* Active state — applied when PHP adds .is-active to the <a> */
.sidebar-subject-list li a.is-active,
.sidebar-quick-links li a.is-active {
  color: var(--allen-accent);
  background: var(--allen-sidebar-active);
  border-left-color: var(--allen-accent);
  font-weight: 600;
}

/* Quick Access block */
.sidebar-nav-tree > div[style*="border-top"] {
  border-top-color: var(--allen-sidebar-border) !important;
}
.sidebar-section-label { color: var(--allen-sidebar-muted); }
.sidebar-quick-links li a { color: var(--allen-sidebar-muted); }
.sidebar-quick-links li a:hover {
  color: var(--allen-sidebar-text);
  background: var(--allen-sidebar-hover);
}

/* Sticky-area scrollbar — subtle on light */
.left-sidebar { scrollbar-color: var(--allen-sidebar-border) transparent; }


/* ── Allen-matched typography scale ──────────────────────────────── */
/* Allen uses Inter as primary UI font with a tight, modern rhythm:
   body 15px / 1.65, h1 ~32/1.2, h2 ~24/1.3, h3 ~20/1.4, sidebar 13-14px.
   We mount Inter alongside the existing Noto/Jakarta stack so existing
   pages don't reflow uncontrollably — Inter is the default, others
   remain as fallbacks for components that opt in. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --allen-font:        'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --allen-fs-base:     15px;
  --allen-lh-base:     1.65;
  --allen-fs-sm:       0.8125rem;   /* 13px — sidebar children, captions */
  --allen-fs-md:       0.875rem;    /* 14px — sidebar parents, meta */
  --allen-fs-lg:       1rem;        /* 16px — buttons, emphasized body */
  --allen-fs-h1:       2rem;        /* 32px */
  --allen-fs-h2:       1.5rem;      /* 24px */
  --allen-fs-h3:       1.25rem;     /* 20px */
  --allen-fs-h4:       1.0625rem;   /* 17px */
  --allen-lh-tight:    1.25;
  --allen-lh-snug:     1.4;
  --allen-tracking:    -0.011em;    /* Inter optical correction */
}

body {
  font-family: var(--allen-font);
  font-size: var(--allen-fs-base);
  line-height: var(--allen-lh-base);
  letter-spacing: var(--allen-tracking);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.entry-content { font-size: var(--allen-fs-base); line-height: var(--allen-lh-base); }
.entry-content p { margin: 0 0 1rem; }

/* Heading rhythm — tight on top, generous below */
h1, .h1, .entry-title {
  font-family: var(--allen-font);
  font-size: var(--allen-fs-h1);
  line-height: var(--allen-lh-tight);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
h2, .h2 {
  font-family: var(--allen-font);
  font-size: var(--allen-fs-h2);
  line-height: var(--allen-lh-snug);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 2rem 0 0.75rem;
}
h3, .h3 {
  font-family: var(--allen-font);
  font-size: var(--allen-fs-h3);
  line-height: var(--allen-lh-snug);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.5rem 0 0.5rem;
}
h4, .h4 {
  font-family: var(--allen-font);
  font-size: var(--allen-fs-h4);
  line-height: 1.45;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

/* Sidebar typography — Allen rhythm */
.left-sidebar .card-header {
  font-size: 0.6875rem !important;     /* 11px caps label */
  letter-spacing: .12em !important;
  font-weight: 700 !important;
}
.sidebar-class-toggle,
.sidebar-class-toggle a {
  font-size: var(--allen-fs-md) !important;   /* 14px parents */
  line-height: 1.4;
  font-weight: 600;
}
.sidebar-subject-list li a,
.sidebar-quick-links li a {
  font-size: var(--allen-fs-sm);              /* 13px children */
  line-height: 1.45;
  font-weight: 500;
}
.sidebar-section-label {
  font-size: 0.6875rem;
  letter-spacing: .12em;
  font-weight: 700;
}

/* Navbar links — match the 14px UI rhythm */
.navbar .nav-link { font-size: var(--allen-fs-md); font-weight: 600; }
.navbar-brand { font-size: 1.125rem; letter-spacing: -0.01em; }

/* Buttons */
.btn { font-family: var(--allen-font); font-weight: 600; letter-spacing: 0; }


/* ═══════════════════════════════════════════════════════════════════
   ARTICLE TRUST BYLINE  (.icse-author-byline)
   Mirrors salesforcetutorial.com .sft-article-trust — dotted rule
   sits UNDER the byline, not between the H1 and the byline.
   ═══════════════════════════════════════════════════════════════════ */

/* Remove Bootstrap card-header divider between page title and byline */
.entry > .card-header.bg-white {
  border-bottom: none !important;
  padding-bottom: 0.375rem;
}
.entry > .entry-content.card-body {
  padding-top: 0.625rem;
}

.icse-author-byline {
  margin: 0 0 1rem;
}
.icse-author-byline__line {
  margin: 0;
  padding-bottom: 0.875rem;
  color: var(--icse-text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  border-bottom: 1px dotted var(--icse-border);
}
.icse-author-byline__author {
  color: var(--icse-primary);
  font-weight: 600;
  text-decoration: none;
}
.icse-author-byline__author:hover,
.icse-author-byline__author:focus-visible {
  text-decoration: underline;
}
.icse-author-byline__sep {
  color: var(--icse-border);
}


/* ═══════════════════════════════════════════════════════════════════
   RIGHT SIDEBAR — Latest Articles  (SalesforceTutorial rail style)
   ═══════════════════════════════════════════════════════════════════ */

.right-sidebar .icse-widget,
.right-sidebar .icse-latest-articles-widget {
  background: var(--icse-white);
  border: 1px solid var(--icse-border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.right-sidebar .icse-widget__title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.875rem;
  padding: 0;
  border: 0;
  color: var(--icse-dark);
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-transform: none;
}

.icse-latest-articles--stack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.icse-latest-articles--stack .icse-latest-articles__item {
  margin: 0;
  padding: 0;
}

.icse-latest-articles--stack .icse-latest-articles__item + .icse-latest-articles__item {
  border-top: 1px solid var(--icse-border-light);
}

.icse-latest-articles--stack .icse-latest-articles__link {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color .15s ease;
}

.icse-latest-articles--stack .icse-latest-articles__link:hover,
.icse-latest-articles--stack .icse-latest-articles__link:focus {
  color: inherit;
  text-decoration: none;
}

.icse-latest-articles--stack .icse-latest-articles__link:hover .icse-latest-articles__title,
.icse-latest-articles--stack .icse-latest-articles__link:focus .icse-latest-articles__title {
  color: var(--icse-primary);
}

.icse-latest-articles--stack .icse-latest-articles__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--icse-primary-light);
}

.icse-latest-articles--stack .icse-latest-articles__image,
.icse-latest-articles--stack .icse-latest-articles__placeholder {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.icse-latest-articles--stack .icse-latest-articles__placeholder {
  background: linear-gradient(135deg, var(--icse-primary-light), #e0f2fe);
}

.icse-latest-articles--stack .icse-latest-articles__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.icse-latest-articles--stack .icse-latest-articles__title {
  color: var(--icse-dark);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s ease;
}

.icse-latest-articles--stack .icse-latest-articles__meta {
  color: var(--icse-text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Header primary nav — quick-access links with compact icons */
.icse-header-nav--scroll {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.icse-header-nav--scroll::-webkit-scrollbar { display: none; }
@media (min-width: 992px) and (max-width: 1199.98px) {
  .icse-header-nav--scroll {
    justify-content: flex-start !important;
    mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  }
}
.icse-header-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  font-size: 0.8125rem;
  padding: 0.35rem 0.55rem !important;
}
.icse-header-nav__icon {
  font-size: 0.9rem;
  line-height: 1;
}
.icse-mobile-quick-links {
  padding: 0.5rem 0 1rem;
  border-bottom: 1px solid var(--icse-border-light);
}
