/*
  Ngaji Sanad — rebuilt 2026-07-24 directly on https://seekersguidance.org/'s
  actual branding (not just its structure): dark teal primary (their
  socket/footer color), warm cream content bands, Montserrat throughout,
  pill-shaped buttons. "Malam Tarum" (deep indigo, gold accent, editorial
  serif) is fully retired, not kept as an accent anywhere. Token NAMES are
  unchanged from that era on purpose - every existing component sitewide
  (.entity-card, .course-card, .pill, .btn-primary, etc.) already reads
  these variables, so recoloring them here recolors the entire site in one
  place instead of touching every template. Map when reading old code:
  --teal is now the PRIMARY brand color (was a muted sage secondary before),
  --gold is now a warm amber secondary (was a browner gold before),
  --paper-deep is now a deep teal-black (was near-black indigo before).
*/
:root {
  --paper: #FFFFFF;
  --paper-deep: #123244;
  --ink: #222222;
  --ink-soft: #4A4A4A;
  --muted: #767676;
  --rule: #E6DFD0;
  --gold: #D98715;
  --gold-soft: #F2A63D;
  --gold-ink: #2E1B00;
  --teal: #215268;
  --teal-ink: #FFFFFF;
  --card: #FDF8F1;
  --card-ink: #222222;
  --card-muted: #6B6456;
  --card-rule: #EFE7D8;
  --card-accent: #B4712E;
  --rec-bg: #EFE7D8;
  --rec-ink: #4A4326;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Montserrat", "Montserrat", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
.sans { font-family: "Montserrat", "Montserrat", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif; }
a { color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.wrap.wide { max-width: 1120px; }
.wrap.narrow { max-width: 900px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ===================== Accessibility utilities ===================== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -60px; left: 12px; z-index: 1000;
  background: var(--paper-deep); color: var(--gold);
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.86rem; font-weight: 600; text-decoration: none;
  padding: 12px 20px; border: 1px solid var(--gold); border-radius: 6px;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

/* ===================== Nav & Footer bands =====================
   Both stay on the dark indigo band deliberately (see :root comment) -
   .site-nav-band/.site-footer-band are full-viewport-width dark wrappers;
   .site-nav/footer.site-footer/.footer-legal carry the .wrap class
   themselves (added in base.njk) so their content still centers at the
   normal max-width, same pattern as the homepage's .bleed sections. */
.site-nav-band { background: var(--paper); color: var(--ink-soft); border-bottom: 1px solid var(--rule); }
.site-nav {
  padding: 24px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand img { display: block; border-radius: 6px; }
.site-nav .brand { font-size: 1.4rem; letter-spacing: 0.01em; text-decoration: none; color: var(--ink); }
.site-nav > ul {
  list-style: none; display: flex; gap: 30px; margin: 0; padding: 0;
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.86rem;
}
.site-nav a { text-decoration: none; color: var(--ink-soft); }
.site-nav a.current { color: var(--teal); border-bottom: 1px solid var(--teal); padding-bottom: 2px; }
.nav-dropdown { position: relative; }
.nav-dropdown-toggle::after {
  content: "\25BE"; font-size: 0.7em; margin-left: 4px; display: inline-block; vertical-align: 1px;
}
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: -14px; margin-top: 14px;
  list-style: none; flex-direction: column; gap: 0; min-width: 170px;
  background: #FFFFFF; border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08); padding: 8px; z-index: 20;
}
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu li { width: 100%; }
.nav-dropdown-menu a {
  display: block; padding: 9px 12px; border-radius: 6px; white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--card); }
.nav-dropdown-menu a.current { color: var(--teal); border-bottom: none; background: var(--card); }
.site-nav .cta {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem; font-weight: 600;
  background: var(--teal); color: var(--teal-ink);
  padding: 10px 20px; border-radius: 999px; text-decoration: none;
}
.nav-search input {
  background: transparent; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--ink); font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem; padding: 7px 12px; width: 150px; outline: none;
}
.nav-search input::placeholder { color: var(--muted); }
@media (max-width: 860px) { .site-nav ul { display: none; } .nav-search { display: none; } }

/* ===================== Footer =====================
   Dark teal multi-column band, matching seekersguidance.org's footer -
   the one place on the page besides the flagship spotlight where the
   primary brand color gets real surface area instead of just accents. */
.site-footer-band { background: var(--teal); color: rgba(255,255,255,0.82); }
.site-footer-band .brand { color: #FFFFFF; }
footer.site-footer {
  padding: 56px 0 32px;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px;
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
}
.footer-col { display: flex; flex-direction: column; gap: 11px; font-size: 0.86rem; }
.footer-col h4 {
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: #FFFFFF; margin: 0 0 6px;
}
.footer-col a { color: rgba(255,255,255,0.78); text-decoration: none; }
.footer-col a:hover { color: #FFFFFF; }
.footer-brand p { margin: 12px 0 0; font-size: 0.86rem; max-width: 34ch; color: rgba(255,255,255,0.72); }
.footer-bottom {
  padding: 20px 0 30px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.16);
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem; color: rgba(255,255,255,0.62);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
@media (max-width: 760px) { footer.site-footer { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { footer.site-footer { grid-template-columns: 1fr; } }

/* ===================== Breadcrumb ===================== */
.breadcrumb {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem; color: var(--muted); margin: 8px 0 20px;
}
.breadcrumb a { text-decoration: none; border-bottom: 1px solid var(--rule); }

/* ===================== Page header ===================== */
.page-header, .page-head { padding: 30px 0 8px; max-width: 660px; }
/* On a wide-wrap page (.wrap.wide - directory/listing/detail pages with a
   1120px content area below) the 660px cap above just leaves dead space to
   the header's right without helping readability, since the text itself
   already gets its own 60ch cap below - widen the container to match its
   wide siblings, text still wraps at a readable line length either way. */
.wrap.wide .page-header, .wrap.wide .page-head { max-width: none; }
.page-header h1, .page-head h1 {
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  margin: 0 0 12px; letter-spacing: -0.015em;
}
.page-header .subhead, .page-head p {
  font-size: 1.02rem; color: var(--ink-soft); margin: 0 0 30px;
}

/* ===================== Buttons =====================
   Pill-shaped, per seekersguidance.org's button language. Teal (the site's
   one true primary color now, also the footer color) is the solid fill;
   gold/amber is reserved for smaller in-content accents (eyebrows, prices,
   current-nav) rather than competing as a second "primary" button color. */
.btn-primary, .btn-gold {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
  background: var(--teal); color: var(--teal-ink);
  padding: 13px 26px; border-radius: 999px; display: inline-block;
}
.btn-primary:hover, .btn-gold:hover { background: var(--paper-deep); }
.btn-ghost {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
  color: var(--ink); border: 1.5px solid var(--rule);
  padding: 11.5px 26px; border-radius: 999px; display: inline-block;
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-outline-pill {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem; font-weight: 600; text-decoration: none; text-align: center;
  color: var(--teal); border: 1.5px solid var(--teal);
  padding: 9px 20px; border-radius: 999px; display: inline-block;
}
.btn-outline-pill:hover { background: var(--teal); color: var(--teal-ink); }
.btn-outline-pill:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
/* Only for .btn-ghost sitting directly on the hero photo's dark scrim -
   the default variant is dark-on-light and unreadable there. */
.btn-ghost-invert { color: #FFFFFF; border-color: rgba(255,255,255,0.55); }
.btn-ghost-invert:hover { border-color: #FFFFFF; color: #FFFFFF; background: rgba(255,255,255,0.12); }

/* ===================== Hero photo banner =====================
   Full-bleed photo with a dark scrim and left-aligned overlay text,
   matching seekersguidance.org's hero treatment - replaces the old
   2-column text+image layout entirely. */
.hero-banner {
  width: 100vw; position: relative; left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw;
  min-height: 480px; display: flex; align-items: center;
  background-size: cover; background-position: center;
}
.hero-banner-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(18,50,68,0.92) 0%, rgba(18,50,68,0.72) 40%, rgba(18,50,68,0.28) 75%);
}
.hero-banner-content { position: relative; padding: 72px 0; color: #FFFFFF; }
.hero-banner-content .hero-title { color: #FFFFFF; max-width: 34ch; font-size: clamp(1.9rem, 3.3vw, 2.6rem); }
.hero-banner-content .hero-lede { color: rgba(255,255,255,0.86); }
@media (max-width: 700px) {
  .hero-banner { min-height: 420px; }
  .hero-banner-scrim { background: linear-gradient(180deg, rgba(18,50,68,0.55) 0%, rgba(18,50,68,0.92) 70%); }
  .hero-banner-content .hero-title { max-width: 100%; }
}

/* ===================== Homepage: curriculum cards =====================
   "Start Your Learning Journey Today" pattern - photo + title + blurb +
   outline button, one per Bidang track. */
.curriculum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.curriculum-card { display: flex; flex-direction: column; }
.curriculum-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 18px; }
.curriculum-card h3 { font-size: 1.05rem; margin: 0 0 8px; text-wrap: balance; }
.curriculum-card p { font-size: 0.88rem; color: var(--card-muted); margin: 0 0 18px; flex: 1; }
@media (max-width: 900px) { .curriculum-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .curriculum-grid { grid-template-columns: 1fr; } }

/* ===================== Homepage: poster course cards ===================== */
.poster-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.poster-card { display: block; text-decoration: none; color: inherit; }
.poster-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 14px; }
.poster-card h3 { font-size: 0.96rem; margin: 0 0 5px; color: var(--card-ink); text-wrap: balance; }
.poster-card p { font-size: 0.8rem; color: var(--card-muted); margin: 0; }
@media (max-width: 900px) { .poster-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .poster-grid { grid-template-columns: 1fr; } }

/* ===================== Homepage: content-hub columns =====================
   "Featured Articles / Answers / Podcasts" pattern - three parallel lists,
   not card grids, each a heading + "Lihat Semua" + compact list-items. */
.hub-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.hub-column-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.hub-column-head h3 { font-size: 1rem; margin: 0; }
.hub-column-head a { font-size: 0.78rem; color: var(--card-accent); text-decoration: none; }
.hub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.hub-list-item { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: inherit; padding-top: 16px; border-top: 1px solid var(--card-rule); }
.hub-list li:first-child .hub-list-item { padding-top: 0; border-top: none; }
.hub-list-thumb { width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0; background: linear-gradient(135deg, var(--teal), var(--gold-soft)); }
.hub-list-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.hub-list-body h4 { font-size: 0.88rem; margin: 0 0 4px; line-height: 1.35; text-wrap: balance; }
.hub-list-body p { font-size: 0.76rem; color: var(--card-muted); margin: 0; }
@media (max-width: 860px) { .hub-columns { grid-template-columns: 1fr; gap: 32px; } }

/* ===================== Homepage: spotlight feature band ===================== */
.spotlight-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 48px; align-items: center; }
.spotlight-grid img { width: 100%; border-radius: 10px; display: block; aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 860px) { .spotlight-grid { grid-template-columns: 1fr; } }

/* ===================== Homepage: closing dark band ===================== */
.closing-band { background: var(--paper-deep); color: #FFFFFF; text-align: center; }
.closing-band h2 { color: #FFFFFF; }
.closing-band .trust-strip {
  display: flex; justify-content: center; gap: 36px; flex-wrap: wrap;
  margin: 26px 0 30px; padding: 26px 0; border-top: 1px solid rgba(255,255,255,0.16); border-bottom: 1px solid rgba(255,255,255,0.16);
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
}
.closing-band .trust-strip div { max-width: 22ch; }
.closing-band .trust-strip h4 { font-size: 0.86rem; margin: 0 0 4px; color: var(--gold-soft); }
.closing-band .trust-strip p { font-size: 0.78rem; color: rgba(255,255,255,0.72); margin: 0; }

/* ===================== Hero / "Night Instrument" graphic system =====================
   The identity's signature visual idea: Ngaji Sanad's whole premise is a
   verifiable chain of transmission, and the historical instrument for
   exactly that idea in Islamic scholarly tradition is the astrolabe - a
   precision instrument covered in engraved scales, calibration ticks, and
   a rotating pointer, used for both astronomy and religious timekeeping.
   The hero graphic below renders a sanad chain AS that kind of instrument
   diagram (connected nodes, radial ticks, calibrated rings) instead of a
   plain list - this is the one bold, hand-drawn element the rest of the
   system stays quiet around. */
.hero-2col { padding: 48px 0 64px; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }
.hero-title { font-size: clamp(2.3rem, 4.6vw, 3.5rem); letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 22px; text-wrap: balance; }
.hero-lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 52ch; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-instrument { display: flex; align-items: center; justify-content: center; }
.hero-instrument svg { width: 100%; max-width: 440px; height: auto; }
@media (max-width: 860px) {
  .hero-2col { grid-template-columns: 1fr; padding-top: 20px; }
  .hero-instrument { order: -1; margin-bottom: 8px; }
  .hero-instrument svg { max-width: 280px; }
}

/* Section-break ornament: a thin rule with a small calibrated tick at
   center, standing in for empty vertical whitespace between sections -
   echoes the hero instrument's ring-and-tick language at a much quieter
   volume, so it reads as "part of the same system," not decoration. */
.section-divider { display: flex; align-items: center; gap: 14px; margin: 0; padding: 0; }
.section-divider::before, .section-divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.section-divider .divider-mark { flex-shrink: 0; width: 8px; height: 8px; }

/* Small node-and-line icon used for the "Manhaj" list - the same
   two-node-one-line motif as the hero instrument's constellation,
   scaled down, so the connection idea repeats at list-item scale too. */
.node-icon { flex-shrink: 0; width: 34px; height: 34px; }

/* ===================== Full-bleed light sections (homepage) =====================
   These sections break out of .wrap's max-width to go edge-to-edge and
   alternate between --card (cream) and #FFFFFF so long pages still have
   visual rhythm without a dark band anywhere - nav/footer/every homepage
   section now share the same light system as the rest of the site. */
.bleed {
  width: 100vw; position: relative; left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw;
}
.bleed-light { background: #FFFFFF; color: var(--card-ink); }
.bleed-warm { background: var(--card); color: var(--card-ink); }
.bleed-inner { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

.photo-card {
  display: block; text-decoration: none; color: inherit;
  background: #FFFFFF; border: 1px solid var(--card-rule); border-radius: 10px; overflow: hidden;
}
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-card .photo-card-body { padding: 20px 22px; }
.photo-card h3 { font-size: 1.05rem; margin: 0 0 6px; color: var(--card-ink); }
.photo-card p { font-size: 0.88rem; color: var(--card-muted); margin: 0; }

.teacher-photo-card { text-align: center; }
.teacher-photo-card img {
  width: 128px; height: 128px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 16px; display: block; border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--card-rule);
}
.teacher-photo-card h3 { font-size: 1rem; margin: 0 0 4px; color: var(--card-ink); }
.teacher-photo-card p { font-size: 0.82rem; color: var(--card-muted); margin: 0; }

.stat-block { display: flex; justify-content: center; gap: 64px; flex-wrap: wrap; text-align: center; }
.stat-block .num {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 2.4rem; font-weight: 800; color: var(--card-accent);
  display: block; font-variant-numeric: tabular-nums;
}
.stat-block .label {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}

@media (max-width: 860px) {
  .bleed-inner { padding: 0 20px; }
  .stat-block { gap: 36px; }
}

/* ===================== Filter chips ===================== */
.filter-row, .chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .filter-chip {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.8rem; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 6px;
  padding: 7px 14px; background: transparent; cursor: pointer;
}
.chip.active, .filter-chip.active { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }

/* ===================== Pills ===================== */
.pill {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 4px 10px; border-radius: 6px;
}
.pill.live { background: var(--teal); color: var(--teal-ink); }
.pill.rec { background: var(--rec-bg); color: var(--rec-ink); }
.pill.level, .pill.jenis { background: var(--rule); color: var(--ink-soft); }
.pill.topic { background: transparent; border: 1px solid var(--card-rule); color: var(--card-muted); }
.pill.done { background: var(--success, #4C7A6B); color: var(--success-ink, #FFFFFF); } /* --success/--success-ink are defined in member-shell.njk's :root override - only pill.done call sites so far are member-area pages */
/* Was hand-copied into member.njk's own <style> block first; promoted here now
   that member-kelas-detail.njk needs the same "no real link yet" treatment. */
.link-disabled { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.82rem; color: var(--card-muted); font-style: italic; }

/* ===================== Card grids: pengajar / masyaikh / course ===================== */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 32px 0 88px; }
.entity-card {
  background: var(--card); color: var(--card-ink);
  border-radius: 10px; padding: 26px;
  display: flex; flex-direction: column; text-decoration: none;
}
.entity-card .avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  margin-bottom: 18px; flex-shrink: 0;
}
.entity-card h3 { font-size: 1.08rem; margin: 0 0 6px; color: var(--card-ink); text-wrap: balance; }
.entity-card .role, .entity-card .era {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.8rem; color: var(--card-muted); margin: 0 0 16px;
}
.entity-card .tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.entity-card .tag-mini {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.7rem; color: var(--card-muted);
  border: 1px solid var(--card-rule); border-radius: 6px;
  padding: 4px 9px;
}
.entity-card .meta-row {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--card-rule);
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.8rem;
}
.entity-card .count { color: var(--card-accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.entity-card .soon-note { display: block; margin-top: 4px; color: var(--card-muted); font-style: italic; }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .card-grid, .card-grid-3, .card-grid-4 { grid-template-columns: 1fr; } }
@media (min-width: 861px) and (max-width: 1080px) { .card-grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* ===================== Topic browse cards (homepage "Jelajahi Berdasarkan Bidang") ===================== */
.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.topic-card {
  display: flex; flex-direction: column; gap: 8px;
  background: #FFFFFF; border: 1px solid var(--card-rule); border-radius: 10px;
  padding: 20px 22px; text-decoration: none; color: var(--card-ink);
  transition: border-color 0.15s ease;
}
.topic-card:hover { border-color: var(--card-accent); }
.topic-card .topic-name { font-size: 1.02rem; text-wrap: balance; }
.topic-card .topic-count { font-size: 0.76rem; color: var(--card-muted); }
@media (max-width: 860px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .topic-grid { grid-template-columns: 1fr; } }

/* ===================== Profile pages (Pengajar / Masyaikh) ===================== */
/* flex-start (not center): with long honorific names (masyaikh especially -
   "Syaikh ... al-Ghautsani" style names routinely wrap to 2 lines) center
   alignment left lopsided empty space above a small fixed-size avatar;
   top-aligning avoids that regardless of how many lines the name wraps to.
   Avatar sized up a step (128->152px) and h1's clamp ceiling brought down
   (2.5rem->2.1rem) so a 2-line name doesn't visually dwarf the photo beside it. */
.profile-header { display: flex; align-items: flex-start; gap: 30px; padding: 40px 0 44px; }
.profile-avatar {
  width: 152px; height: 152px; border-radius: 50%; margin-top: 4px;
  background: linear-gradient(135deg, var(--gold), var(--teal)); flex-shrink: 0;
}
.profile-header h1 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); margin: 0 0 10px; letter-spacing: -0.01em; }
.profile-role { font-size: 0.92rem; color: var(--card-accent); margin: 0 0 14px; }
.profile-stats { display: flex; gap: 28px; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; }
.profile-stats .num { font-size: 1.15rem; font-variant-numeric: tabular-nums; color: var(--ink); display: block; }
.profile-stats .label { font-size: 0.74rem; color: var(--muted); }

.profile-body { display: grid; grid-template-columns: 1fr 0.68fr; gap: 56px; padding-bottom: 30px; }
.section-block { margin-bottom: 46px; margin-top: 0; }
.section-block h2 { font-size: 1.3rem; margin: 0 0 18px; letter-spacing: -0.005em; }
.bio p { font-size: 1rem; color: var(--ink-soft); margin: 0 0 16px; max-width: 62ch; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 6px; padding: 7px 13px;
}

.sanad-intro {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem; color: var(--muted); margin: 0 0 16px; max-width: 56ch;
}
.sanad-group { margin: 0 0 34px; }
.sanad-group:last-child { margin-bottom: 0; }
.sanad-group-title {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--card-accent); margin: 0 0 10px;
}
/* Vertical pedigree/connector chain: a dot per person (filled = has a real
   platform profile via item.link, hollow = plain/historical name) joined by
   a spine segment per edge (solid = proof + an uploaded file, i.e. actually
   verified; dashed = proof claimed but no file yet, mirrors .proof-pending;
   faint = no proof data at all on that edge). Both signals already exist in
   the data (item.link / item.proof / item.proofFile) - this is styling only,
   the has-link/proof-verified/proof-pending-edge classes are set by the
   template from those same fields, nothing new is authored. */
/* Ulumul Hadits program - ordered bab list on a Kitab detail page
   (kitab.njk). .soon-note is unscoped here (unlike the .entity-card-scoped
   rule below) since this list sits outside any .entity-card wrapper. */
.soon-note { color: var(--card-muted, var(--muted)); font-style: italic; font-size: 0.85rem; }
.bab-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bab-list-item { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.bab-list-item:last-child { border-bottom: none; }
.bab-list-item a { text-decoration: none; color: var(--ink); font-weight: 600; }
.bab-list-item a:hover { color: var(--teal); }
.bab-list-item-pending { color: var(--ink-soft); }
.bab-number { display: inline-block; min-width: 1.6em; color: var(--card-accent); font-weight: 700; margin-right: 6px; }
.bab-ringkasan { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }

/* Hand-authored overview diagram on the Ulumul Hadits pillar hub
   (ulumul-hadits-landing.njk) - static, not data-driven like kitab-graph.js/
   sanad-graph.js's generated SVGs, but reuses the same visual language
   (rounded-rect nodes, teal root, thin rule-colored edges). */
.ulumul-diagram { max-width: 100%; height: auto; display: block; margin: 20px 0 8px; }
.ulumul-diagram .ud-title { font-family: "Montserrat", sans-serif; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--card-accent); }
.ulumul-diagram .ud-edge { stroke: var(--rule); stroke-width: 1.5; }
.ulumul-diagram .ud-node { fill: var(--card); stroke: var(--teal); stroke-width: 1.2; }
.ulumul-diagram .ud-node-root { fill: var(--teal); stroke: var(--teal); }
.ulumul-diagram .ud-label { font-family: "Montserrat", sans-serif; font-size: 12px; fill: var(--ink); text-anchor: middle; }
.ulumul-diagram .ud-label-root { fill: var(--teal-ink); font-weight: 600; }

.sanad-list { list-style: none; margin: 0; padding: 0 0 0 26px; }
.sanad-item {
  position: relative; display: flex; justify-content: space-between;
  align-items: baseline; gap: 16px; padding: 15px 0;
}
.sanad-item::before {
  /* Fixed pixel offset (not 50%) so the connector below reaches this exact
     spot regardless of how tall this row grows (role text can wrap). */
  content: ""; position: absolute; left: -26px; top: 26px;
  transform: translateY(-50%); width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--card-accent); z-index: 1;
}
.sanad-item.has-link::before { background: var(--card-accent); }
.sanad-item::after {
  /* Spans from this item's dot (top: 26px) to the next item's dot at the
     same fixed offset (bottom: -26px reaches 26px into the next sibling) -
     exact regardless of either row's actual height. */
  content: ""; position: absolute; left: -21px; top: 26px; bottom: -26px;
  width: 2px; background: var(--rule);
}
.sanad-item.proof-verified::after { background: var(--card-accent); }
.sanad-item.proof-pending-edge::after {
  background: none; border-left: 2px dashed var(--card-accent); opacity: 0.55;
}
.sanad-item:last-child::after { display: none; }
.sanad-item .sanad-name { font-size: 1.02rem; }
.sanad-name-link { font-size: 1.02rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.sanad-name-link:hover { border-bottom-color: var(--card-accent); }
.sanad-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; max-width: 32ch; }
.sanad-item .sanad-role { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.76rem; color: var(--muted); text-align: right; }
/* Masyaikh Riwayah (masyaikh.njk only, via .sanad-item-compact): role
   subtext dropped entirely - only the ijazah/sama' proof badge remains -
   so meta no longer needs to reserve a wide right-hand column for wrapped
   role text. Stack meta below the name instead of beside it, giving the
   name the full row width (some jalur names run to 90+ characters).
   Pengajar's sanad-item (no modifier class) keeps the original row layout. */
.sanad-item-compact { flex-direction: column; align-items: flex-start; gap: 8px; }
.sanad-item-compact .sanad-meta { flex-direction: row; align-items: center; max-width: none; }
.sanad-proof {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem; color: var(--card-accent); text-decoration: none;
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--card-rule);
}
.sanad-proof:hover { border-color: var(--card-accent); }
/* Shared "not uploaded yet" modifier for sanad-proof/proof-link honest-fallback
   spans (pengajar.njk, masyaikh.njk) - was three copies of the same inline
   style, now one class applied alongside the base .sanad-proof/.proof-link. */
.proof-pending { opacity: 0.6; cursor: default; }

/* ===================== /kitab/:slug/ merged sanad graph =====================
   Real graph (not a nested-list tree): each person is one absolutely-
   positioned box, drawn exactly once, with as many SVG lines converging
   into it as the data actually has. Positions/paths are computed
   server-side (server/lib/kitab-graph.js); this is styling + interaction
   only (src/assets/kitab-graph.js). Edge color/dash reuses the same
   verified/pending/no-data signal as the per-profile pedigree list
   (Phase 1's .proof-verified/.proof-pending-edge). */
.zoom-bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 1px solid var(--card-rule); border-radius: 8px; padding: 6px 10px;
  width: fit-content; margin-bottom: 16px; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
}
.zoom-bar button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--card-rule); background: var(--card); font-size: 1rem; cursor: pointer; line-height: 1; }
.zoom-bar button:hover { background: var(--card-rule); }
.zoom-bar input[type="range"] { width: 140px; }
.zoom-bar .pct { font-size: 0.8rem; color: var(--muted); min-width: 3.5em; text-align: right; }
.zoom-bar .hint { font-size: 0.72rem; color: var(--muted); margin-left: 6px; }

.kitab-graph-scroll { overflow: auto; width: 100%; max-width: 100%; border: 1px solid var(--card-rule); border-radius: 8px; }
.kitab-graph-wrap { position: relative; transform-origin: top left; }

.kg-node {
  position: absolute; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 5px 8px; background: var(--card); border: 1px solid var(--card-rule); border-radius: 8px;
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.72rem; line-height: 1.25;
}
.kg-node a { color: var(--card-ink); text-decoration: none; white-space: normal; word-break: break-word; display: block; width: 100%; }
.kg-node a:hover { text-decoration: underline; color: var(--card-accent); }
.kg-node:hover, .kg-node.kg-focused { border-color: var(--card-accent); background: var(--card-rule); box-shadow: 0 0 0 2px rgba(180,113,46,0.28); z-index: 5; }

.kg-edge { fill: none; stroke: var(--rule); stroke-width: 1.6px; transition: stroke 0.15s, stroke-width 0.15s, opacity 0.15s; }
.kg-edge-verified { stroke: var(--card-accent); }
.kg-edge-pending { stroke: var(--card-accent); stroke-dasharray: 5 4; opacity: 0.7; }
.kg-has-focus .kg-edge { opacity: 0.15; }
.kg-has-focus .kg-edge.kg-lit { opacity: 1; stroke: var(--card-accent); stroke-width: 2.6px; stroke-dasharray: none; }
@media (max-width: 760px) {
  .zoom-bar .hint { display: none; }
}

.sanad-note { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.78rem; color: var(--muted); margin: 14px 0 0; font-style: italic; }
.silabus-kitab { margin: 6px 0 0 !important; }
.silabus-kitab a, .sanad-kitab-link { font-size: 0.76rem; color: var(--card-accent); text-decoration: none; border-bottom: 1px solid var(--card-rule); }
.silabus-kitab a:hover, .sanad-kitab-link:hover { border-bottom-color: var(--card-accent); }

.info-card { background: var(--card); color: var(--card-ink); border-radius: 10px; padding: 26px; }
.info-card h3 { margin: 0 0 4px; font-size: 1rem; }
.info-card .role { font-size: 0.82rem; color: var(--card-muted); margin: 0 0 16px; }
.info-meta { list-style: none; margin: 0; padding: 0; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.84rem; }
.info-meta li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--card-rule); }
.info-meta li span:first-child { color: var(--card-muted); }
.info-meta li span:last-child { text-align: right; }

.course-grid-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
/* Full-width section now (see masyaikh.njk - moved out of .profile-body's narrow main
   column, same break-out as pengajar.njk's "Kelas yang diajar" .courses section), so 3
   columns keeps text-only murid-card from stretching too wide/empty at full .wrap width. */
.murid-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.murid-card {
  background: var(--card); color: var(--card-ink); border-radius: 10px; padding: 22px;
  display: flex; flex-direction: column; position: relative;
  border: 1px solid transparent; transition: border-color 0.15s ease;
}
.murid-card:hover { border-color: var(--card-accent); }
.murid-card h3 { font-size: 1.05rem; margin: 0 0 6px; color: var(--card-ink); text-wrap: balance; }
/* Stretched-link: the card itself isn't an <a> (that produced invalid nested
   anchors when a proof-link was also present), so the name link's ::after
   expands to fill the whole card, restoring a full-card click/tap target.
   .proof-link needs position+z-index to still be clickable above it. */
.murid-card-link { color: inherit; border-bottom: 1px solid var(--card-rule); text-decoration: none; }
.murid-card-link::after { content: ""; position: absolute; inset: 0; }
.murid-card-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.murid-card .role-line { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.82rem; color: var(--card-muted); margin: 0 0 20px; }
.murid-card .meta-row { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--card-rule); font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.78rem; }
.murid-card .proof-link { position: relative; z-index: 1; color: var(--card-accent); text-decoration: none; border-bottom: 1px solid var(--card-rule); }
/* .proof-pending alone (0,0,1,0) can't beat the descendant selector above
   (0,0,2,0) - this explicit override keeps the "pending" state's borderless
   look from being clobbered by the base .proof-link underline. */
.murid-card .proof-link.proof-pending { border-bottom: none; }

/* ===================== Proof-document lightbox (proof-viewer.js) =====================
   Gives every sanad "Bukti" / proof-link click-through real archival-document
   chrome (granter, role, field, granting formula, proof label) before the
   embedded file itself - kapur-paper card, no parchment/gilt/arabesque. */
.proof-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 17, 34, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.proof-overlay[hidden] { display: none; }
.proof-lock-scroll { overflow: hidden; }
.proof-dialog {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--card); color: var(--card-ink);
  border: 1px solid var(--card-rule); border-radius: 10px;
  padding: 32px 28px 28px;
}
.proof-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--card-ink);
  border: 1px solid var(--card-rule); border-radius: 6px;
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.proof-close:hover { border-color: var(--card-accent); color: var(--card-accent); }
.proof-header { border-bottom: 1px solid var(--card-rule); padding: 0 32px 16px 0; margin-bottom: 18px; }
.proof-field {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.74rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--card-accent); margin: 0 0 8px;
}
.proof-name { font-size: 1.2rem; margin: 0 0 4px; letter-spacing: -0.005em; }
.proof-role { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.82rem; color: var(--card-muted); margin: 0; }
.proof-formula { font-size: 0.94rem; color: var(--card-ink); margin: 0 0 20px; max-width: 52ch; }
.proof-frame { border: 1px solid var(--card-rule); border-radius: 6px; overflow: hidden; background: #FFFFFF; margin-bottom: 16px; }
.proof-frame img { display: block; width: 100%; height: auto; }
.proof-frame iframe { display: block; width: 100%; height: 60vh; border: 0; }
.proof-footer {
  border-top: 1px solid var(--card-rule); padding-top: 14px;
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem; color: var(--card-muted); font-style: italic;
}
@media (max-width: 640px) {
  .proof-dialog { padding: 28px 20px 22px; max-height: 92vh; }
  .proof-frame iframe { height: 48vh; }
}

/* ===================== Lead-capture popup (lead-capture.js) =====================
   Wishlist / coming-soon / trial-video-unlock popup - same overlay/dialog/close
   chrome as the proof-document lightbox above, own "lead-" prefix since the
   dialog body (a name/email/phone form, not an ijazah frame) is unrelated. */
.lead-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 17, 34, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.lead-overlay[hidden] { display: none; }
.lead-dialog {
  position: relative; width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto;
  background: var(--card); color: var(--card-ink);
  border: 1px solid var(--card-rule); border-radius: 10px;
  padding: 32px 28px 28px;
}
.lead-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--card-ink);
  border: 1px solid var(--card-rule); border-radius: 6px;
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.lead-close:hover { border-color: var(--card-accent); color: var(--card-accent); }
.lead-eyebrow {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.74rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--card-accent); margin: 0 0 8px; padding-right: 32px;
}
.lead-title { font-size: 1.2rem; margin: 0 0 8px; letter-spacing: -0.005em; padding-right: 32px; }
.lead-sub { font-size: 0.9rem; color: var(--card-muted); margin: 0 0 22px; }
.lead-form { display: flex; flex-direction: column; gap: 16px; }
.lead-form input {
  background: #fff; border: 1px solid var(--card-rule); color: var(--card-ink);
}
.lead-error {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.84rem; color: #A23B3B; margin: 0;
}
.lead-error[hidden] { display: none; }
.lead-success { font-size: 0.94rem; color: var(--card-ink); margin: 0; }
.lead-submit:disabled { opacity: 0.6; cursor: default; }

/* .btn-primary/.cta-btn/.btn-ghost are normally <a> — the lead-capture
   triggers reuse them on <button> elements, so strip the native button
   border/appearance the classes don't already override. */
button.btn-primary, button.cta-btn, button.btn-ghost { border: 0; cursor: pointer; font: inherit; }
button.cta-btn { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.92rem; font-weight: 600; }

.trial-cta {
  border: 1px solid var(--rule); border-radius: 10px; padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 8px;
}
.trial-cta-text h3 { margin: 0 0 4px; }
.trial-cta-text p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.trial-video-frame { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: #000; margin-top: 8px; }
.trial-video-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
@media (max-width: 640px) {
  .lead-dialog { padding: 28px 20px 22px; max-height: 92vh; }
}

.courses { padding: 20px 0 56px; }
.course-card {
  background: var(--card); color: var(--card-ink); border-radius: 10px; padding: 22px;
  display: flex; flex-direction: column; text-decoration: none;
}
.course-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.course-thumb {
  height: 140px; width: calc(100% + 44px); margin: -22px -22px 16px -22px;
  overflow: hidden; border-radius: 10px 10px 0 0;
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-card .tag-row { display: flex; gap: 6px; margin-bottom: 14px; }
.course-card h3 { font-size: 1.05rem; margin: 0 0 6px; text-wrap: balance; }
.course-card .teacher { font-size: 0.82rem; color: var(--card-muted); margin: 0 0 20px; }
.course-card .meta-row { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--card-rule); font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.8rem; display: flex; justify-content: space-between; }
.course-card .price { color: var(--card-accent); font-weight: 600; }

.testimonial { max-width: 68ch; margin: 0 auto 60px; padding: 30px 0 0; border-top: 1px solid var(--rule); }
.testimonial blockquote { font-size: 1.2rem; font-style: italic; margin: 0 0 12px; }
.testimonial cite { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.84rem; color: var(--muted); }

@media (min-width: 861px) and (max-width: 1080px) {
  .murid-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .profile-body { grid-template-columns: 1fr; }
  .murid-grid, .course-grid-mini { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; align-items: flex-start; }
}

/* ===================== Course-detail (Kelas) ===================== */
.course-hero { display: grid; grid-template-columns: 1.7fr 1fr; gap: 48px; padding: 40px 0 56px; align-items: start; }
.course-title { font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin: 0 0 16px; text-wrap: balance; letter-spacing: -0.01em; }
.course-sub { font-size: 1.02rem; color: var(--ink-soft); max-width: 56ch; margin: 0 0 24px; }
.teacher-line { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.teacher-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--teal)); flex-shrink: 0; }
.teacher-line .sans { font-size: 0.9rem; }
.teacher-line .role { color: var(--muted); display: block; font-size: 0.8rem; }

.silabus-list { list-style: none; margin: 0; padding: 0; }
.silabus-item { display: flex; gap: 18px; padding: 16px 0; border-top: 1px solid var(--rule); }
.silabus-item:last-child { border-bottom: 1px solid var(--rule); }
.silabus-num { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--muted); width: 32px; flex-shrink: 0; padding-top: 2px; }
.silabus-item h3 { font-size: 1rem; margin: 0 0 4px; font-weight: 600; }
.silabus-item p { margin: 0; font-size: 0.88rem; color: var(--muted); }

.instructor-card { display: flex; gap: 20px; padding: 26px; background: var(--card); color: var(--card-ink); border-radius: 10px; align-items: flex-start; }
.instructor-avatar { width: 68px; height: 68px; border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--gold)); flex-shrink: 0; }
.instructor-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.instructor-card .role { font-size: 0.84rem; color: var(--card-muted); margin: 0 0 10px; }
.instructor-card p { font-size: 0.9rem; margin: 0; color: var(--card-ink); opacity: 0.85; max-width: 58ch; }

.enroll-card { position: sticky; top: 24px; background: var(--card); color: var(--card-ink); border-radius: 10px; padding: 26px; }
.enroll-price { font-size: 1.7rem; font-variant-numeric: tabular-nums; margin: 0 0 4px; }
.enroll-price .period { font-size: 0.8rem; color: var(--card-muted); font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; }
.enroll-card .cta-btn, .article-cta-card .cta-btn { display: block; text-align: center; width: 100%; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.92rem; font-weight: 600; background: var(--gold); color: var(--gold-ink); padding: 13px; border-radius: 6px; text-decoration: none; margin: 18px 0 20px; border: none; cursor: pointer; }
.enroll-meta { list-style: none; margin: 0; padding: 0; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.84rem; }
.enroll-meta li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--card-rule); color: var(--card-ink); }
.enroll-meta li span:first-child { color: var(--card-muted); }

@media (max-width: 820px) {
  .course-hero { grid-template-columns: 1fr; }
  .enroll-card { position: static; }
}

/* ===================== Catalog / listings ===================== */
.result-count { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.84rem; color: var(--muted); margin: 16px 0; }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--card-rule); border-radius: 6px; padding: 12px 16px; margin: 24px 0; }
.search-box input { background: transparent; border: none; color: var(--card-ink); font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.94rem; width: 100%; outline: none; }
.search-box input::placeholder { color: var(--card-muted); }
.filter-panel { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-group .label { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); width: 90px; flex-shrink: 0; }
.chip:hover { border-color: var(--card-accent); color: var(--ink); }
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 8px; }
.catalog-toolbar .result-count { margin: 0; }
.sort-control { display: flex; align-items: center; gap: 10px; }
.sort-control label { font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.sort-control select {
  background: var(--card); border: 1px solid var(--card-rule); color: var(--card-ink);
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.84rem;
  padding: 9px 30px 9px 14px; border-radius: 6px; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6456' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.sort-control select option { background: var(--card); color: var(--card-ink); }
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  text-align: center; padding: 70px 20px; margin: 10px 0 60px;
  border: 1px solid var(--rule); border-radius: 10px;
}
/* Every current call site still sets its own inline display:none/flex
   (kelas-catalog-page.njk and checkout.njk toggle it via JS; member.njk sets
   it once since Nunjucks controls whether the element renders at all) -
   inline styles always win over this rule, so nothing above changes their
   behavior. This is purely so .empty-state is self-sufficient for the next
   call site that forgets to add that inline override. */
.empty-state p { font-size: 1rem; color: var(--ink-soft); margin: 0; }
.pagination {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px;
  padding: 44px 0 60px; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.84rem; color: var(--muted);
}
.pagination a { text-decoration: none; }
.pagination .current { color: var(--card-accent); }
.pagination .sep { margin: 0; color: var(--rule); }
.pagination .disabled { color: var(--muted); opacity: 0.5; cursor: default; }

/* ===================== Article / blog ===================== */
/* .article-layout floats .article-cta-sidebar beside the narrow prose
   column rather than making it a formal grid track (contrast
   .course-hero/.enroll-card, which IS a grid) - .article-page keeps its
   own max-width:68ch/auto-margin untouched so it still lays out
   identically on its own; the flex row just leaves the sidebar room to
   its right when there's space for it. */
.article-layout { display: flex; gap: 44px; align-items: flex-start; }
.article-cta-sidebar { width: 280px; flex-shrink: 0; }
.article-cta-card { position: sticky; top: 24px; background: var(--card); color: var(--card-ink); border-radius: 10px; padding: 24px; }
.cta-kelas-label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--card-accent); margin: 0 0 14px; }
.cta-kelas-link { display: block; text-decoration: none; color: inherit; margin-bottom: 14px; }
.cta-kelas-link .pill { margin-bottom: 10px; }
.cta-kelas-link h3 { font-size: 1.02rem; margin: 0; color: var(--card-ink); text-wrap: balance; }
.cta-kelas-link:hover h3 { color: var(--card-accent); }
.cta-kelas-teacher { font-size: 0.84rem; color: var(--card-muted); margin: 0 0 12px; }
.cta-kelas-price { font-size: 1.15rem; margin: 0; font-variant-numeric: tabular-nums; }
.cta-kelas-price .period { font-size: 0.78rem; color: var(--card-muted); font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; }
.cta-kelas-text { font-size: 0.88rem; color: var(--card-ink); opacity: 0.85; margin: 0 0 4px; }
.cta-divider { border: none; border-top: 1px solid var(--card-rule); margin: 22px 0; }
.cta-author-block { text-align: left; }
.cta-author-block .byline-avatar { margin-bottom: 12px; }
.cta-author-block .byline-info { font-size: 0.9rem; color: var(--card-ink); margin-bottom: 10px; }
.cta-author-block .byline-info div:first-child { font-weight: 600; }
.cta-author-block .byline-meta { font-size: 0.8rem; color: var(--card-muted); margin-top: 3px; }
.cta-author-link { display: inline-block; font-size: 0.86rem; color: var(--card-accent); text-decoration: none; font-weight: 600; }
.cta-author-link:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .article-layout { flex-direction: column; }
  .article-cta-sidebar { width: 100%; }
  .article-cta-card { position: static; }
}
.article-page { max-width: 68ch; margin: 0 auto; }

/* Fathul Mughits bab (server/worker.js: noSidebar) - no sidebar means no
   need to reserve gap/width for one, and the 68ch prose cap that exists to
   keep .article-page comfortably narrower than the sidebar-bearing layout
   just leaves unused space here instead - let it use the full .wrap width. */
.article-layout--no-sidebar { display: block; }
.article-layout--no-sidebar .article-page { max-width: none; }
.article-layout--no-sidebar .article-body p,
.article-layout--no-sidebar .article-body li { max-width: none; }
.article-layout--no-sidebar .article-body .footnotes { max-width: none; }
.article-header { padding: 6px 0 10px; }
.article-hero { margin: 0 0 40px; height: 340px; border-radius: 14px; overflow: hidden; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 720px) {
  .article-hero { height: 220px; border-radius: 10px; }
}
.article-cat { display: inline-block; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.74rem; color: var(--card-accent); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 13px; margin-bottom: 20px; }
.article-header h1 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); margin: 0 0 22px; letter-spacing: -0.01em; line-height: 1.2; }
.article-byline-row { display: flex; align-items: center; gap: 14px; padding-bottom: 30px; margin-bottom: 32px; border-bottom: 1px solid var(--rule); }
.byline-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, var(--gold), var(--teal)); }
.byline-info { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.82rem; color: var(--muted); }
.byline-info a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); font-size: 0.92rem; }
.byline-meta { margin-top: 3px; }
.article-body { padding-bottom: 20px; }
.article-body h2 { font-size: 1.35rem; margin: 44px 0 16px; letter-spacing: -0.005em; }
.article-body p { font-size: 1.04rem; color: var(--ink-soft); margin: 0 0 18px; max-width: 65ch; }
.article-body blockquote { margin: 34px 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--gold); font-size: 1.04rem; font-style: italic; color: var(--ink); line-height: 1.45; }
.article-body blockquote p { font-size: inherit; color: inherit; margin: 0; max-width: none; }
.article-body .ar { font-family: "Noto Naskh Arabic", "Amiri", "Traditional Arabic", serif; font-style: normal; direction: rtl; unicode-bidi: isolate; text-align: right; }
/* Arabic citation blocks: always right-aligned, always visually large - independent of
   whichever container's font-size they sit in (blockquote daleel citation, or a plain <p>
   scholar-definition quote per the sixth content standard) - fixed rem size, not relative
   em, so it doesn't shrink/grow when the surrounding translation text's own size changes. */
.article-body .ar.ar-lg { display: block; font-size: 1.98rem; line-height: 2; text-align: right; margin-bottom: 12px; }
.article-body .footnotes .ar { font-size: 1.1em; }
.article-body sup.footnote-ref { font-size: 0.68em; line-height: 0; margin-left: 1px; }
.article-body sup.footnote-ref a { color: var(--card-accent); text-decoration: none; font-weight: 700; }
.article-body sup.footnote-ref a:hover { text-decoration: underline; }

/* Side-by-side Arabic/translation matan pair: two columns wide, stacked on
   narrow screens. Same box treatment as a regular blockquote when it IS one
   (a real daleel citation); a plain div wrapper (no italic, no gold rule -
   this is a source author's own definitional prose, not a citation) when
   it's a matan pair that isn't a daleel quote. */
.article-body .bilingual-pair { margin: 30px 0; }
.article-body blockquote.bilingual-pair { padding: 20px 24px; border-left: 2px solid var(--gold); font-style: normal; }
.article-body div.bilingual-pair { padding: 18px 22px; background: var(--card); border: 1px solid var(--card-rule); border-radius: 4px; }
.article-body .bilingual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 30px; align-items: start; }
.article-body .bilingual-ar { text-align: right; }
.article-body .bilingual-ar span.ar { display: inline; font-size: 1.5rem; line-height: 1.85; margin-bottom: 0; }
.article-body .bilingual-id { font-size: 1.04rem; color: var(--ink-soft); line-height: 1.6; }
@media (max-width: 680px) {
  .article-body .bilingual-grid { grid-template-columns: 1fr; gap: 12px; }
  .article-body .bilingual-ar span.ar { font-size: 1.35rem; }
}
.article-body .footnotes { margin: 48px 0 0; padding-top: 22px; border-top: 1px solid var(--rule); max-width: 65ch; }
.article-body .footnotes-title { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.article-body .footnotes ol { margin: 0; padding-left: 20px; }
.article-body .footnotes li { font-size: 0.86rem; color: var(--ink-soft); margin: 0 0 10px; line-height: 1.55; }
.article-body .footnotes li:target { color: var(--ink); }
.article-body .footnote-back { margin-left: 5px; color: var(--card-accent); text-decoration: none; font-size: 0.82em; }
.article-body .footnote-back:hover { text-decoration: underline; }

/* Kitab pengantar (kitab.njk) reuses .article-body's typography but never
   sits next to a sidebar the way an artikel page does - the 65ch cap on
   .article-body p exists specifically to leave room for that sidebar, so
   on the kitab page (wrapClass: wide, no sidebar at all) it just reads as
   an oversized empty gutter instead. Let it use the full wide wrap width. */
.kitab-pengantar.article-body p,
.kitab-pengantar.article-body li { max-width: none; }

.article-tags { padding-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: var(--muted); }

.article-share { margin: 20px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: var(--muted); }
.article-share a {
  font-size: 0.78rem; color: var(--ink-soft); text-decoration: none;
  border: 1px solid var(--rule); border-radius: 6px; padding: 6px 13px;
}
.article-share a:hover { border-color: var(--gold); color: var(--gold); }

.related-section { max-width: 68ch; margin: 50px auto 0; padding: 40px 0 60px; border-top: 1px solid var(--rule); }
.related-section h2 { font-size: 1.15rem; margin: 0 0 18px; }
.related-section--grid { max-width: 1080px; }
.related-section--grid .article-card .article-body { padding: 18px 20px 20px; }
.related-section--grid .article-card h2 { font-size: 1rem; margin: 0; }

.article-body figure.article-figure { margin: 34px 0; }
.article-body figure.article-figure img { width: 100%; border-radius: 10px; display: block; }
.article-body figure.article-figure figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 10px; text-align: center; }
.related-list { list-style: none; margin: 0; padding: 0; }
.related-item { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 15px 0; border-top: 1px solid var(--rule); text-decoration: none; }
.related-item:last-child { border-bottom: 1px solid var(--rule); }
.related-item .related-title { font-size: 0.98rem; color: var(--ink); }
.related-item:hover .related-title { color: var(--card-accent); }
.related-item .related-cat { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.74rem; color: var(--muted); flex-shrink: 0; }

.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; padding-bottom: 20px; }
.article-card {
  display: flex; flex-direction: column; background: var(--card); color: var(--card-ink);
  border-radius: 10px; overflow: hidden; text-decoration: none;
  border: 1px solid transparent; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.article-card:hover { border-color: var(--card-accent); box-shadow: 0 6px 20px rgba(27, 30, 51, 0.08); }
.article-thumb { height: 150px; width: 100%; overflow: hidden; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-1 { background: linear-gradient(135deg, rgba(192,138,46,0.55), rgba(76,122,107,0.35) 60%, var(--paper-deep)); }
.thumb-2 { background: linear-gradient(155deg, rgba(76,122,107,0.6), rgba(46,53,100,0.5) 55%, var(--paper-deep)); }
.thumb-3 { background: linear-gradient(140deg, rgba(227,184,96,0.45), rgba(20,23,43,0.9) 65%, var(--paper-deep)); }
.thumb-4 { background: linear-gradient(160deg, rgba(46,53,100,0.7), rgba(192,138,46,0.35) 60%, var(--paper-deep)); }
.thumb-5 { background: linear-gradient(145deg, rgba(76,122,107,0.4), rgba(192,138,46,0.4) 50%, var(--paper-deep)); }
.thumb-6 { background: linear-gradient(150deg, rgba(46,53,100,0.55), rgba(76,122,107,0.4) 55%, var(--paper-deep)); }
/* Resets the generic .article-body prose rule's max-width:68ch/margin:0 auto
   (meant for the full-width detail-page article) - without this, that auto
   margin on the cross axis of .article-card's flex column stops the card
   body from stretching, shrinking it to content width and centering it. */
.article-card .article-body { max-width: none; margin: 0; padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.article-card .article-cat { align-self: flex-start; font-size: 0.7rem; color: var(--card-accent); border-color: var(--card-rule); }
.article-card h2 { font-size: 1.1rem; margin: 0 0 10px; color: var(--card-ink); text-wrap: balance; }
.article-card:hover h2 { color: var(--card-accent); }
.article-excerpt { font-size: 0.92rem; color: var(--card-muted); margin: 0 0 20px; flex: 1; }
.article-byline { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--card-rule); font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.76rem; color: var(--card-muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.article-byline .author { color: var(--card-ink); }

.article-card--featured {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 0;
}
.article-card--featured .article-thumb { height: auto; min-height: 280px; }
.article-card--featured .article-body { padding: 36px 40px; }
.article-card--featured h2 { font-size: 1.7rem; margin-bottom: 14px; }
.article-card--featured .article-excerpt { font-size: 1.02rem; }

@media (max-width: 900px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .article-card--featured { grid-template-columns: 1fr; }
  .article-card--featured .article-thumb { height: 200px; min-height: 0; }
}
@media (max-width: 640px) {
  .article-grid { grid-template-columns: 1fr; }
  .article-card--featured { grid-column: auto; display: flex; flex-direction: column; }
  .article-card--featured .article-thumb { height: 150px; }
  .article-card--featured .article-body { padding: 22px 22px 24px; }
  .article-card--featured h2 { font-size: 1.1rem; margin-bottom: 10px; }
}

/* ===================== Legal (Privacy / Terms) ===================== */
.legal-header { max-width: 68ch; margin: 0 auto; padding: 34px 0 10px; }
.legal-header h1 { font-size: clamp(1.9rem, 4.4vw, 2.5rem); margin: 0 0 14px; letter-spacing: -0.01em; line-height: 1.2; }
.legal-byline { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.8rem; color: var(--muted); padding-bottom: 30px; margin-bottom: 32px; border-bottom: 1px solid var(--rule); }
.legal-body { max-width: 68ch; margin: 0 auto; padding-bottom: 20px; }
.legal-body h2 { font-size: 1.3rem; margin: 44px 0 16px; letter-spacing: -0.005em; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p { font-size: 1.02rem; color: var(--ink-soft); margin: 0 0 18px; max-width: 65ch; }
.legal-body ul { margin: 0 0 18px; padding-left: 22px; max-width: 65ch; }
.legal-body li { font-size: 1.02rem; color: var(--ink-soft); margin: 0 0 10px; }
.legal-body a { border-bottom: 1px solid var(--rule); text-decoration: none; }
.legal-body a:hover { border-bottom-color: var(--card-accent); color: var(--card-accent); }
.legal-body strong { color: var(--ink); font-weight: 600; }
.legal-crosslink { max-width: 65ch; margin: 40px 0 0; padding: 20px 22px; border: 1px solid var(--rule); border-radius: 6px; }
.legal-crosslink p { font-size: 0.92rem; margin: 0; color: var(--ink-soft); }

/* ===================== FAQ ===================== */
.faq-section { padding: 20px 0 60px; }
.faq-group { margin-bottom: 46px; }
.faq-group h2 { font-size: 1.02rem; letter-spacing: 0.03em; text-transform: uppercase; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; color: var(--card-accent); margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.faq-item { border-top: 1px solid var(--rule); }
.faq-item:last-child { border-bottom: 1px solid var(--rule); }
.faq-item summary { cursor: pointer; list-style: none; padding: 18px 30px 18px 0; position: relative; font-size: 1.05rem; color: var(--ink); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 1.3rem; color: var(--card-accent); }
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p { margin: 0 0 22px; max-width: 68ch; color: var(--ink-soft); font-size: 0.98rem; }
.faq-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--card); color: var(--card-ink); border-radius: 10px; padding: 28px 32px; margin-bottom: 70px; flex-wrap: wrap; }
.faq-cta p { margin: 0; font-size: 1rem; max-width: 46ch; }

/* ===================== Contact ===================== */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; padding: 10px 0 70px; }
.contact-info-list { display: flex; flex-direction: column; }
.contact-item { border-top: 1px solid var(--rule); padding: 20px 0; display: flex; flex-direction: column; gap: 6px; }
.contact-item:last-child { border-bottom: 1px solid var(--rule); }
.contact-item .label { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.contact-item .value { font-size: 1.08rem; color: var(--ink); }
.contact-item .value a { text-decoration: none; }
.contact-item .value a:hover { color: var(--card-accent); }
.contact-item .hint { font-size: 0.86rem; color: var(--muted); }
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.78rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
.form-row input, .form-row select, .form-row textarea {
  background: transparent; border: 1px solid var(--rule); color: var(--ink);
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.94rem;
  padding: 12px 14px; border-radius: 6px; width: 100%;
}
.form-row textarea { resize: vertical; min-height: 130px; font-family: inherit; }
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--muted); }
.form-row select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B87A0' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.form-row select option { background: var(--paper); color: var(--ink); }
.form-submit { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.88rem; font-weight: 600; background: var(--gold); color: var(--gold-ink); border: none; border-radius: 6px; padding: 13px 26px; cursor: pointer; align-self: flex-start; margin-top: 6px; }
.form-submit:hover { background: var(--gold-soft); }
.form-note { font-size: 0.82rem; color: var(--muted); margin: -6px 0 0; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ===================== Login ===================== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-column { max-width: 400px; width: 100%; }
.login-wordmark { font-size: 1.6rem; text-align: center; margin-bottom: 36px; }
.login-card { background: var(--card); color: var(--card-ink); border-radius: 10px; padding: 36px; }
.login-card h1 { font-size: 1.5rem; margin: 0 0 8px; }
.login-card .subhead { font-size: 0.92rem; color: var(--card-muted); margin: 0 0 28px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-form .form-row label { color: var(--card-muted); }
.login-form input { background: #fff; border: 1px solid var(--card-rule); color: var(--card-ink); }

/* ===================== Shared form validation states =====================
   Used by kontak.njk, login.njk, admin-login.njk, register.njk (via
   src/assets/form-validation.js) - was four independently-duplicated copies
   of the same rules. This is the light --card-canvas variant (used as-is by
   the three login-family pages); kontak.njk overrides only the color values
   locally for its dark --paper canvas, since the two contexts genuinely
   need different contrast, not different structure. */
.field-error {
  display: block;
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.8rem;
  color: #A23B3B;
  margin-top: -4px;
}
.form-row input[aria-invalid="true"],
.form-row select[aria-invalid="true"],
.form-row textarea[aria-invalid="true"] {
  border-color: #A23B3B;
}
.form-error-summary {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.86rem;
  color: #A23B3B;
  background: rgba(162, 59, 59, 0.08);
  border: 1px solid #A23B3B;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 4px;
}
.form-error-summary p { margin: 0 0 6px; font-weight: 600; }
.form-error-summary ul { margin: 0; padding-left: 18px; }

/* Shared success panel (kontak.njk "Pesan terkirim", register.njk "Akun
   berhasil dibuat") - was two byte-identical rule sets under different
   class names. */
.success-panel {
  /* Overrides var(--teal-ink) with white: the shared token pair is ~4.28:1
     against var(--teal), just under WCAG AA's 4.5:1 for this text size. */
  background: var(--teal); color: #FFFFFF;
  border-radius: 10px; padding: 30px 32px;
}
.success-panel h2 { font-size: 1.25rem; margin: 0 0 8px; }
.success-panel p { font-size: 0.96rem; margin: 0; }
.success-panel a { color: #FFFFFF; text-decoration: underline; }

/* ===================== Member dashboard ===================== */
.stat-row {
  display: flex; background: var(--card); color: var(--card-ink);
  border-radius: 10px; margin-bottom: 40px; overflow: hidden;
}
.stat-tile {
  flex: 1; padding: 22px 24px; border-left: 1px solid var(--card-rule);
  display: flex; align-items: center; gap: 14px;
}
.stat-tile:first-child { border-left: none; }
.stat-tile-icon {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(217, 135, 21, 0.12); color: var(--gold);
}
.stat-tile-icon svg { width: 18px; height: 18px; }
.stat-tile-text { display: flex; flex-direction: column; gap: 4px; }
.stat-tile .stat-num {
  font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--card-ink); line-height: 1;
}
.stat-tile .stat-label {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.76rem; color: var(--card-muted);
}
@media (max-width: 760px) { .stat-row { flex-wrap: wrap; } .stat-tile { flex: 1 1 50%; border-left: none; border-top: 1px solid var(--card-rule); } .stat-tile:nth-child(-n+2) { border-top: none; } }

.dash-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.dash-toolbar-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dash-toolbar .search-box { margin: 0; min-width: 220px; }
@media (max-width: 640px) { .dash-toolbar-controls { width: 100%; } .dash-toolbar .search-box { flex: 1; min-width: 0; } }

.course-cover { height: 120px; position: relative; }
.course-cover .pill.level {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(20, 23, 43, 0.72); color: #FFFFFF;
}
.course-cover-avatar {
  position: absolute; right: 14px; bottom: -16px;
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  border: 2px solid var(--card);
}

/* ===================== Course workspace (member/kelas/:slug/) =====================
   Generic sidebar+content two-column layout, a lighter "kapur" accordion
   variant of .faq-item for the session navigator, and a generic tab-bar -
   all reusable if a second workspace-style page shows up later. Tab-content
   specifics (Nilai table, Aktivitas list, Kompetensi list) stay local to
   member-kelas-detail.njk's own <style> block, same convention as
   member.njk/member-rekaman.njk. */
.workspace-header { margin-bottom: 32px; }
.workspace-header .tag-row { margin-bottom: 14px; display: flex; gap: 8px; }
.workspace-header h1 { font-size: 1.6rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.workspace-header .teacher-line { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.86rem; color: var(--muted); margin: 0 0 20px; }
.workspace-progress { max-width: 420px; }
.workspace-progress .progress-label { display: flex; justify-content: space-between; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }

.workspace-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .workspace-layout { grid-template-columns: 1fr; } }

.session-nav { background: var(--card); color: var(--card-ink); border-radius: 10px; padding: 6px 20px; }
.session-item { border-top: 1px solid var(--card-rule); }
.session-item:first-child { border-top: none; }
.session-item summary {
  cursor: pointer; list-style: none; padding: 16px 24px 16px 0; position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 0.92rem; color: var(--card-ink);
}
.session-item summary::-webkit-details-marker { display: none; }
.session-item summary::after { content: "+"; position: absolute; right: 0; top: 14px; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 1.2rem; color: var(--card-accent); }
.session-item[open] summary::after { content: "\2013"; }
.session-item .session-title { flex: 1; min-width: 0; }
.lesson-list { list-style: none; margin: 0; padding: 0 0 18px; }
.lesson-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.86rem; }
.lesson-check {
  width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--card-rule); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.62rem; color: var(--success);
}
.lesson-check.is-done { background: var(--success); border-color: var(--success); color: #FFFFFF; }
.lesson-label { flex: 1; color: var(--card-ink); }
.lesson-row .lesson-action { font-weight: 600; color: var(--card-accent); text-decoration: none; border-bottom: 1px solid transparent; flex-shrink: 0; }
.lesson-row .lesson-action:hover { border-bottom-color: var(--card-accent); }
.lesson-row .lesson-action:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.lesson-video-toggle { flex-shrink: 0; }
.lesson-video-toggle summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--card-accent); font-size: 0.86rem; }
.lesson-video-toggle summary::-webkit-details-marker { display: none; }
.lesson-video-toggle summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.lesson-video-toggle .video-frame { position: relative; width: 100%; padding-top: 56.25%; border-radius: 6px; overflow: hidden; background: var(--paper-deep); margin-top: 10px; }
.lesson-video-toggle .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 24px; flex-wrap: wrap; }
.tab-btn {
  font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.88rem; font-weight: 600;
  color: var(--muted); background: transparent; border: none; border-bottom: 2px solid transparent;
  padding: 12px 18px; cursor: pointer;
}
.tab-btn:hover { color: var(--ink-soft); }
.tab-btn[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.tab-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tab-panel[hidden] { display: none; }
/* masyaikh.njk's 5 outer page-section tabs (Profil Singkat/Riwayah/Dirayah/
   Murid/Spesialisasi) sit directly above the footer band with nothing else
   below them - unlike the old always-stacked layout, whichever tab happens
   to be active is now the last thing before the footer, so each one needs
   its own bottom breathing room rather than relying on a trailing section's
   margin. min-height keeps switching between a short tab (e.g. Profil
   Singkat) and a long one (Riwayah) from visibly jumping the footer up/down. */
.masyaikh-page-panel { padding: 8px 0 64px; min-height: 240px; }

/* ===================== 404 ===================== */
.error-main { flex: 1; display: flex; align-items: center; padding: 40px 0 80px; }
.error-content { max-width: 620px; }
.error-code { font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--card-accent); margin: 0 0 18px; }
.error-content h1 { font-size: clamp(2rem, 4.6vw, 3rem); margin: 0 0 18px; letter-spacing: -0.015em; line-height: 1.15; }
.error-content p { font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 34px; max-width: 54ch; }
.error-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.error-links { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--rule); display: flex; gap: 24px; flex-wrap: wrap; font-family: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; font-size: 0.86rem; }
.error-links a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.error-links a:hover { border-bottom-color: var(--card-accent); color: var(--card-accent); }
body.error-page { min-height: 100vh; display: flex; flex-direction: column; }

/* ===================== Back to top (global, base.njk) ===================== */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 500;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--teal); color: var(--teal-ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--paper-deep); }
.back-to-top:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.back-to-top svg { width: 20px; height: 20px; }
@media (max-width: 640px) {
  .back-to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}
