/* ============================================================
   RESOURCES.CSS — NCERT Resources Section
   Scoped under .resources-page to prevent conflicts.
   Extends existing classes; does NOT override them.
   ============================================================ */

/* ============================================================
   RESOURCES NAV DROPDOWN
   Extends existing .desktop-nav a behavior
   ============================================================ */
.nav-resources-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-resources-trigger {
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  color: var(--blue-900);
  cursor: pointer;
  padding: 4px 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .2s;
  position: relative;
}
.nav-resources-trigger::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue-600), #06b6d4);
  transition: width .3s cubic-bezier(.22,1,.36,1);
}
.nav-resources-item:hover .nav-resources-trigger::after,
.nav-resources-trigger[aria-expanded="true"]::after { width: 100%; }
.nav-resources-trigger .caret {
  font-size: .65rem;
  transition: transform .25s ease;
}
.nav-resources-trigger[aria-expanded="true"] .caret { transform: rotate(180deg); }

/* Dropdown Panel */
.nav-resources-panel {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 12px 8px;
  z-index: 9000;
  animation: dropdown-appear .18s ease;
}
@keyframes dropdown-appear {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.nav-resources-item:hover .nav-resources-panel,
.nav-resources-panel.open { display: block; }

.nav-resources-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 700;
  color: var(--blue-900);
  transition: background .18s, color .18s;
  text-decoration: none;
}
.nav-resources-panel a:hover { background: var(--blue-50); color: var(--blue-600); }
.nav-dropdown-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 6px 8px;
}
.nav-dropdown-classes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px 6px 2px;
}
.nav-dropdown-classes a {
  font-size: .78rem;
  padding: 6px 8px;
  justify-content: center;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
}
.nav-dropdown-classes a:hover { border-color: var(--blue-300); }

/* Mobile dropdown */
.mobile-resources-section {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 8px;
  padding-top: 8px;
}
.mobile-resources-label {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--yellow-300);
  padding: 4px 16px;
  display: block;
}
.mobile-resources-classes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 14px;
}
.mobile-resources-classes a {
  font-size: .8rem;
  padding: 7px 4px;
  text-align: center;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.85);
  font-weight: 700;
}
.mobile-resources-classes a:hover,
.mobile-resources-classes a.active {
  background: rgba(251,191,36,.2);
  border-color: rgba(251,191,36,.4);
  color: var(--yellow-300);
}

/* ============================================================
   CLASS NAVIGATION STRIP
   ============================================================ */
.class-nav-strip {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: 14px 0;
  position: sticky;
  top: 65px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}
.class-nav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.class-nav-inner::-webkit-scrollbar { display: none; }
.class-nav-label {
  font-size: .75rem;
  font-weight: 800;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
  flex-shrink: 0;
}
.class-nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--blue-900);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .2s ease;
  text-decoration: none;
}
.class-nav-pill:hover { background: var(--blue-100); border-color: var(--blue-300); }
.class-nav-pill.active {
  background: var(--blue-600);
  color: var(--white);
  border-color: var(--blue-600);
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

/* ============================================================
   SUBJECT SECTION HEADER
   ============================================================ */
.subject-section {
  padding: 60px 0 40px;
}
.subject-section:nth-child(odd) { background: var(--white); }
.subject-section:nth-child(even) { background: var(--blue-50); }
.subject-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--blue-100);
}
.subject-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.subject-header h2 {
  font-family: 'Sora', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue-900);
  margin: 0;
}
.subject-book-count {
  margin-left: auto;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 4px 12px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ============================================================
   BOOK CARD — extends .why-card
   ============================================================ */
.book-card {
  /* Inherits .why-card layout */
  display: flex;
  flex-direction: column;
  gap: 0;
}
.book-subject-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
  width: fit-content;
}
.book-chapter-count {
  font-size: .78rem;
  color: var(--gray-500);
  margin: 4px 0 12px;
  font-weight: 600;
}
.book-desc {
  font-size: .85rem;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}
.book-primary-btn {
  font-size: .85rem !important;
  padding: 10px 18px !important;
  margin-bottom: 8px;
  width: 100%;
  justify-content: center;
}

/* Chapter accordion toggle */
.book-chapter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--blue-700);
  cursor: pointer;
  transition: background .2s;
  font-family: 'Nunito', sans-serif;
  margin-top: 4px;
}
.book-chapter-toggle:hover { background: var(--blue-100); }
.book-chapter-toggle .toggle-caret {
  font-size: .7rem;
  transition: transform .25s ease;
}
.book-chapter-toggle.open .toggle-caret { transform: rotate(180deg); }

.book-chapters-list {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: var(--white);
  scrollbar-width: thin;
}
.book-chapters-list.open { display: flex; }
.chapter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--blue-700);
  text-decoration: none;
  transition: background .18s;
  gap: 8px;
}
.chapter-link:hover { background: var(--blue-50); color: var(--blue-900); }
.chapter-link .dl-icon { flex-shrink: 0; font-size: .85rem; }

/* ============================================================
   EXEMPLAR SECTION
   ============================================================ */
.exemplar-section {
  padding: 80px 0;
}
.exemplar-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,.12);
  border: 1px solid rgba(124,58,237,.25);
  color: #c4b5fd;
  font-size: .75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.exemplar-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease;
}
.exemplar-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 48px rgba(0,0,0,.35);
  border-color: rgba(124,58,237,.3);
}
.exemplar-card h4 {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}
.exemplar-card p {
  font-size: .85rem;
  color: rgba(255,255,255,.65);
  line-height: 1.6;
}
.exemplar-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.exemplar-chapter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
  transition: background .18s;
  margin-top: 2px;
}
.exemplar-chapter-link:hover { background: rgba(124,58,237,.2); color: #c4b5fd; }

/* ============================================================
   STANDALONE BREADCRUMB BAR (above the hero)
   ============================================================ */
.res-breadcrumb-bar {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.07);
  padding: 10px 0;
  width: 100%;
}
.res-breadcrumb-bar .container {
  display: flex;
  align-items: center;
}
.res-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: #64748b;
  list-style: none;
  margin: 0;
  padding: 0;
}
.res-breadcrumb a {
  color: #334155;
  text-decoration: none;
  font-weight: 700;
  transition: color .18s;
}
.res-breadcrumb a:hover { color: var(--blue-600, #2563eb); }
.res-breadcrumb .bc-sep {
  color: #94a3b8;
  font-size: .75rem;
  user-select: none;
}
.res-breadcrumb .bc-current {
  color: #64748b;
  font-weight: 600;
}

/* ============================================================
   RESOURCES HERO TWEAKS (extends .page-hero)
   ============================================================ */
.resources-hero .hero-ctas { justify-content: center; }

/* Class hero stats strip */
.res-stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 28px;
  justify-content: center;
}
.res-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255,255,255,.8);
}
.res-stat-icon { font-size: 1rem; }

/* ============================================================
   RESOURCES LANDING PAGE — Class Grid Cards
   ============================================================ */
.class-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.class-grid-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  border: 1px solid var(--blue-100);
  box-shadow: var(--shadow-sm);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease, border-color .3s;
  text-decoration: none;
  display: block;
}
.class-grid-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-300);
}
.class-grid-card .cgc-num {
  font-family: 'Sora', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue-600);
  line-height: 1;
  margin-bottom: 6px;
}
.class-grid-card .cgc-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--gray-500);
  margin-bottom: 10px;
  display: block;
}
.class-grid-card .cgc-subjects {
  font-size: .72rem;
  color: var(--blue-400);
  line-height: 1.5;
}
.class-grid-card.has-exemplar { border-color: rgba(124,58,237,.25); }
.class-grid-card.has-exemplar:hover { border-color: rgba(124,58,237,.5); }
.cgc-exemplar-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(124,58,237,.1);
  color: #7c3aed;
  border: 1px solid rgba(124,58,237,.2);
  margin-top: 8px;
}

/* ============================================================
   INTERNAL CLASS NAVIGATOR (bottom of page)
   ============================================================ */
.class-navigator {
  background: var(--blue-50);
  border-top: 1px solid var(--blue-100);
  border-bottom: 1px solid var(--blue-100);
  padding: 28px 0;
}
.class-navigator-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.class-nav-prev, .class-nav-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: .88rem;
  font-weight: 800;
  background: var(--white);
  border: 1px solid var(--blue-100);
  color: var(--blue-900);
  text-decoration: none;
  transition: all .2s ease;
}
.class-nav-prev:hover, .class-nav-next:hover {
  background: var(--blue-600);
  color: var(--white);
  border-color: var(--blue-600);
  transform: translateY(-2px);
}
.class-nav-all-link {
  font-size: .85rem;
  font-weight: 700;
  color: var(--blue-600);
  text-decoration: none;
}
.class-nav-all-link:hover { color: var(--blue-900); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .class-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .nav-resources-panel { min-width: 220px; left: -10px; transform: none; }
  .class-grid { grid-template-columns: repeat(2, 1fr); }
  .class-navigator-inner { flex-direction: column; text-align: center; }
  .subject-section { padding: 40px 0 28px; }
}
@media (max-width: 480px) {
  .class-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .nav-dropdown-classes { grid-template-columns: repeat(3, 1fr); }
  .class-nav-pill { font-size: .75rem; padding: 5px 10px; }
}

/* ============================================================
   LOGO HOME LINK — injected by nav-inject.js
   ============================================================ */
.logo a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 4px 8px 4px 4px;
  margin: -4px -8px -4px -4px;
  transition: background .2s ease;
}
.logo a:hover {
  background: rgba(37, 99, 235, .07);
}
.logo a .logo-icon {
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.logo a:hover .logo-icon {
  transform: scale(1.1) rotate(-3deg);
}
