/* ============================
   Duster - shared stylesheet
   ============================ */

:root {
  --blue-900: #0b2545;
  --blue-700: #13458a;
  --blue-600: #1a5fc4;
  --blue-500: #2e79e0;
  --blue-100: #e8f0fe;
  --blue-50: #f4f8ff;
  --ink: #16223a;
  --ink-soft: #4b5a72;
  --line: #e1e7f0;
  --white: #ffffff;
  --amber: #f5a623;
  --green: #1fa06b;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(11, 37, 69, 0.08);
  --shadow-lg: 0 12px 32px rgba(11, 37, 69, 0.14);
  --max-width: 1180px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--blue-600);
  color: var(--white);
}
.btn-primary:hover { background: var(--blue-700); box-shadow: var(--shadow); }
.btn-outline {
  background: transparent;
  border-color: var(--blue-600);
  color: var(--blue-600);
}
.btn-outline:hover { background: var(--blue-100); }
.btn-block { width: 100%; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--blue-900);
  color: #cfe0fb;
  font-size: 0.82rem;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}
.topbar a { color: #cfe0fb; }
.topbar a:hover { color: var(--white); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--blue-900);
}
.brand .logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-900));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-600);
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--white) 100%);
  padding: 64px 0 56px;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--blue-900);
}
.hero h1 span { color: var(--blue-600); }
.hero p.lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 46ch;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stats div { text-align: left; }
.hero-stats strong { display: block; font-size: 1.4rem; color: var(--blue-900); }
.hero-stats span { font-size: 0.85rem; color: var(--ink-soft); }

.hero-art {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.hero-art .search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.hero-art input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.95rem;
}
.hero-art .chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--blue-100);
  color: var(--blue-700);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--blue-50); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: 1.7rem;
  color: var(--blue-900);
  margin: 0 0 6px;
}
.section-head p { color: var(--ink-soft); margin: 0; max-width: 60ch; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-600);
  margin: 0 0 8px;
}

/* ---------- Grids & cards ---------- */
.grid {
  display: grid;
  gap: 22px;
}
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.class-card { text-align: center; }
.class-card .badge {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.class-card h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--blue-900); }
.class-card p { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }

.feature-card .icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: var(--blue-900);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--blue-900); }
.feature-card p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

.subject-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.subject-card .icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--blue-100);
  color: var(--blue-700);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.subject-card h3 { margin: 0 0 4px; font-size: 1rem; color: var(--blue-900); }
.subject-card p { margin: 0; font-size: 0.82rem; color: var(--ink-soft); }
.subject-card .count { margin-left: auto; text-align: right; font-size: 0.78rem; color: var(--blue-600); font-weight: 700; white-space: nowrap; }

/* ---------- Chapter list ---------- */
.chapter-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chapter-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.chapter-item:last-child { border-bottom: none; }
.chapter-item:hover { background: var(--blue-50); }
.chapter-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chapter-info { flex: 1; }
.chapter-info h4 { margin: 0 0 4px; font-size: 0.98rem; color: var(--ink); }
.chapter-info span { font-size: 0.8rem; color: var(--ink-soft); }
.chapter-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-700);
}
.tag.free { background: #e6f7ee; color: var(--green); }

/* ---------- Alerts (register/login/subscribe pages) ---------- */
.alert-box {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
}
.alert-error { background: #fdecec; color: #b3261e; }
.alert-success { background: #e6f7ee; color: var(--green); }
.alert-info { background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); font-weight: 500; }

/* ---------- Pricing card (Exam Corner subscription) ---------- */
.pricing-card {
  background: linear-gradient(160deg, var(--blue-900), var(--blue-700));
  color: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.pricing-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.pricing-amount {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 18px;
}
.pricing-amount span {
  font-size: 0.95rem;
  font-weight: 500;
  color: #d7e6fb;
}
.pricing-features {
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
  color: #e6eefc;
}
.pricing-card .btn-primary {
  background: var(--white);
  color: var(--blue-700);
}
.pricing-card .btn-primary:hover { background: var(--blue-50); }
.pricing-card .form-note { color: #c3d6f2; }

/* ---------- Testimonials ---------- */
.testimonial p.quote {
  font-size: 0.95rem;
  color: var(--ink);
  margin: 0 0 16px;
}
.testimonial .who { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--blue-700);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.who strong { display: block; font-size: 0.9rem; }
.who span { font-size: 0.78rem; color: var(--ink-soft); }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-900));
  color: var(--white);
  border-radius: var(--radius);
  padding: 44px;
  text-align: center;
}
.cta-band h2 { margin: 0 0 12px; font-size: 1.6rem; }
.cta-band p { margin: 0 0 24px; color: #d7e6fb; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--blue-600); font-weight: 600; }
.breadcrumb .sep { margin: 0 6px; }

/* ---------- Donation page ---------- */
.qr-placeholder {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  margin: 14px auto;
  border-radius: 12px;
  border: 2px dashed var(--line);
  background: var(--blue-50);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--blue-600);
}
.qr-placeholder span { font-size: 2.4rem; }
.qr-placeholder p { margin: 0; font-size: 0.85rem; text-align: center; color: var(--ink-soft); line-height: 1.4; }
.badge-chip {
  display: inline-block;
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
}

/* ---------- Page header (inner pages) ---------- */
.page-hero {
  background: var(--blue-50);
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { margin: 0 0 8px; color: var(--blue-900); font-size: 2rem; }
.page-hero p { margin: 0; color: var(--ink-soft); max-width: 65ch; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--ink);
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.95rem;
  font-family: inherit;
}
.form-row textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.82rem; color: var(--ink-soft); margin-top: 10px; }

.contact-info-list { display: flex; flex-direction: column; gap: 20px; }
.contact-info-item { display: flex; gap: 14px; align-items: flex-start; }
.contact-info-item .icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--blue-100);
  color: var(--blue-700);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
}
.contact-info-item h4 { margin: 0 0 4px; font-size: 0.95rem; color: var(--blue-900); }
.contact-info-item p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- About page extras ---------- */
.value-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.stat-strip {
  display: flex;
  justify-content: space-around;
  text-align: center;
  background: var(--blue-900);
  color: var(--white);
  border-radius: var(--radius);
  padding: 32px 16px;
  flex-wrap: wrap;
  gap: 16px;
}
.stat-strip strong { display: block; font-size: 1.8rem; }
.stat-strip span { font-size: 0.82rem; color: #cfe0fb; }

/* ---------- Filter chips (Gallery) ---------- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.filter-chip:hover {
  border-color: var(--blue-600);
  color: var(--blue-700);
}
.filter-chip.active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: var(--white);
}

/* ---------- Gallery grid ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gallery-item {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  aspect-ratio: 4 / 3;
}
.gallery-item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.gallery-item:hover img {
  transform: scale(1.06);
}
.gallery-item-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(11,37,69,0) 0%, rgba(11,37,69,0.82) 100%);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.gallery-item:hover .gallery-item-caption,
.gallery-item:focus-visible .gallery-item-caption {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(6, 15, 30, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: lightbox-fade-in 0.18s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lightbox-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lightbox-figure {
  margin: 0;
  max-width: min(900px, 88vw);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  background: var(--white);
}
.lightbox-figure figcaption {
  color: #eaf1ff;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(255,255,255,0.24); }
.lightbox-close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--blue-900);
  color: #b9cdea;
  padding: 48px 0 20px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-grid h4 {
  color: var(--white);
  font-size: 0.95rem;
  margin: 0 0 14px;
}
.footer-grid ul li { margin-bottom: 10px; font-size: 0.88rem; }
.footer-grid ul li a:hover { color: var(--white); }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand .brand-name { font-weight: 800; font-size: 1.2rem; color: var(--white); }
.footer-note { font-size: 0.85rem; line-height: 1.7; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .value-list { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    display: none;
    gap: 14px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-actions .btn-outline { display: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .cta-band { padding: 28px; }
  .stat-strip { gap: 24px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.6rem; }
  .lightbox { padding: 16px; }
}
