/* Emerald, white and gold, inspired by the owner's visual reference. */
.site-header {
  border-top: 8px solid #3e8566;
  border-bottom-color: #e1e9e2;
  background: #fff;
}

.header-row { min-height: 100px; }
.brand-mark { display: block; width: 58px; height: 58px; flex-shrink: 0; }
.brand strong { font-weight: 600; }
.desktop-nav a { padding-block: 12px; }

.desktop-nav a:hover, .text-link:hover { color: #286a4f; }

.scholar-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  min-height: 540px;
  margin-top: 24px;
  padding: 56px;
  background: #1b604b;
  background-image: url("/assets/geometric-pattern-22b44139.svg"), linear-gradient(120deg, #124d3d, #287555);
  border-radius: 5px;
  border-bottom: 4px solid var(--accent);
}

.hero-copy { position: relative; z-index: 1; }
.scholar-hero .eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  padding: 3px 14px;
  color: #eff4ce;
  background: #ffffff12;
  border-inline-start: 2px solid var(--accent);
  letter-spacing: .02em;
}
.scholar-hero h1 { color: #fff; font-size: clamp(2.6rem, 4.5vw, 4.3rem); line-height: 1.4; }
.scholar-hero .hero-subtitle { color: #f0da81; margin-top: 14px; }
.scholar-hero .lead { color: #edf4ec; font-size: 17px; margin-top: 22px; }
.scholar-hero .actions { gap: 24px; margin-top: 28px; }
.scholar-hero .button { color: #194e3b; background: #f3df91; border-color: #f3df91; }
.scholar-hero .button:hover { background: #fff1be; border-color: #fff1be; }
.scholar-hero .text-link { color: #fff; text-decoration-color: #ddc66c; }
.scholar-hero :is(a, button):focus-visible { outline-color: #fff2ab; }

.library-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: 100%;
  max-width: 390px;
  justify-self: center;
}
.library-art::before, .library-art::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid #dfc86680;
  border-radius: 50%;
}
.library-art::before { inset: -13px; border-style: dashed; opacity: .5; }
.library-art::after { inset: 18px; border: 1px solid #dfc86699; }
.library-medallion {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  border: 2px solid #d4ba55;
  border-radius: 50%;
  background: radial-gradient(circle, #34815d, #114c3b 75%);
  box-shadow: 0 18px 45px #092e302b;
}
.library-medallion img { display: block; width: 57%; height: auto; }
.library-medallion p { color: #f3df91; font-size: 17px; padding-inline: 30px; text-align: center; }
.library-medallion > span { width: 50px; height: 1px; background: #d4ba55; }
.scholar-hero .hero-portrait { width: 100%; height: 410px; border: 3px solid var(--accent); border-radius: 50%; }

.intro-strip { margin-top: 24px; border-block-color: var(--line); padding-block: 23px; }
.intro-strip .eyebrow { color: var(--green); }
.intro-strip p { color: var(--muted); font-size: 15px; }
.section-heading h2::after, .official-section > h2::after {
  content: '';
  display: block;
  width: 68px;
  height: 2px;
  margin-top: 14px;
  background: var(--accent);
}
.section-heading .eyebrow, .official-section > .eyebrow { color: #54715f; }
.lesson-card, .topic-card, .channel-card { border-radius: 3px; border-color: #dfe8df; }
.lesson-card { box-shadow: 0 3px 12px #1a503305; }
.lesson-card:hover, .topic-card:hover, .channel-card:hover { border-color: #41906d; }
.lesson-action { color: var(--green); }
.lesson-copy .eyebrow { color: #62705c; }
.play-badge { background: #25684e; border: 1px solid #eed781; }
.topic-section { padding-inline: 30px; background: #f3f7f0; border-block-color: #e1e9db; }
.topic-card { background: #fff; border-inline-start: 3px solid #83a984; }
.topic-number { color: #78631f; }
.topic-card > span:last-child { color: #48694f; }
.channel-symbol { background: #eef4e6; color: #286e50; }
.channel-card > span:last-child { color: #78631f; }
.channel-card { border-top: 2px solid #9bb898; }
.library-search { background: #eef4e9; }
.button { border-radius: 2px; border-inline-end: 3px solid #c4ab48; }
.button.secondary { border-inline-end-color: #c4ab48; }
.danger { background: #813d30; border-color: #813d30; }

.site-footer {
  position: relative;
  margin-top: 40px;
  padding-block: 36px;
  color: #fff;
  border-top: 3px solid var(--accent);
  background: #337858;
  background-image: url("/assets/geometric-pattern-22b44139.svg");
}
.site-footer nav { gap: 22px; }
.site-footer a { text-decoration-color: #efdc85; text-underline-offset: 5px; }
.site-footer a:hover { color: #fff1b0; text-decoration: underline; }
.site-footer :is(a, button):focus-visible { outline-color: #fff1b0; }

@media (max-width: 1100px) {
  .scholar-hero { gap: 32px; padding: 40px; }
  .library-art { max-width: 320px; }
}

@media (max-width: 900px) {
  .header-row { min-height: 86px; }
  .brand-mark { width: 42px; height: 42px; }
  .scholar-hero { grid-template-columns: 1fr; gap: 44px; padding: 38px 28px; margin-top: 18px; }
  .scholar-hero h1 { font-size: clamp(2.5rem, 7vw, 3.4rem); }
  .scholar-hero .lead { max-width: 600px; }
  .library-art { max-width: 300px; }
  .library-medallion p { font-size: 14px; }
  .scholar-hero .hero-portrait { max-width: 340px; height: 340px; justify-self: center; }
}

@media (max-width: 480px) {
  .brand { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand strong { font-size: 17px; }
  .scholar-hero { padding: 30px 22px; }
  .scholar-hero h1 { font-size: 2.55rem; }
  .scholar-hero .hero-subtitle { font-size: 18px; }
  .library-art { max-width: 230px; }
  .library-medallion { gap: 8px; }
  .library-medallion p { font-size: 13px; }
  .scholar-hero .hero-portrait { max-width: 250px; height: 250px; }
  .topic-section { padding-inline: 18px; }
  .intro-strip p { margin-top: 8px; }
}

/* Mobile-first topic navigation and clear current-section indicators. */
.desktop-nav { gap: 4px; }
.menu-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  text-decoration: none;
}
.menu-link:hover { background: #f0f5ee; }
.menu-link.is-active {
  color: #174e39;
  background: #e9f1e4;
  border-color: #b2c9ad;
  box-shadow: inset 0 -3px #367653;
  font-weight: 700;
}
.mobile-nav nav { gap: 4px; padding-block: 8px; }
.mobile-nav nav .menu-link { padding: 12px 16px; }
.mobile-nav summary { gap: 8px; padding: 8px; border: 1px solid #d7e3d3; border-radius: 4px; }
.mobile-nav summary::before { content: '☰'; font-size: 17px; color: var(--green); }
.channel-symbol { width: 44px; height: 44px; background: transparent; }
.channel-symbol img { display: block; width: 40px; height: 40px; }
.scholar-hero { min-height: 430px; }
.library-art { max-width: 320px; }

.topic-choices { display: grid; grid-template-columns: 1fr; gap: 12px; }
.topic-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 16px;
  color: var(--green);
  background: #fff;
  border: 1px solid #d2dfce;
  border-radius: 6px;
  text-decoration: none;
}
.topic-choice:hover { background: #f3f8ef; border-color: #659360; }
.topic-choice:active { background: #e8f0e2; }
.topic-folder { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; color: #3e7853; background: #eef4e8; border-radius: 6px; }
.topic-folder svg { width: 25px; height: 25px; }
.topic-choice-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.topic-choice-copy strong { font-size: 17px; font-weight: 600; line-height: 1.6; }
.topic-choice-meta { font-size: 13px; color: #596c56; }
.topic-chevron { width: 20px; height: 20px; flex-shrink: 0; margin-inline-start: auto; }
[dir=rtl] .topic-chevron { transform: rotate(180deg); }
.library-heading { padding-block: 30px 20px; }
.library-heading h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.library-heading .lead { font-size: 16px; margin-top: 12px; }
.breadcrumbs { gap: 6px 10px; font-size: 13px; align-items: center; margin-bottom: 10px; }
.breadcrumbs a { padding-block: 6px; }
.breadcrumbs [aria-current] { font-weight: 600; color: var(--green); }
.topic-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--green); font-size: 14px; margin-bottom: 12px; text-decoration: underline; text-underline-offset: 5px; }
.topic-back::before { content: '←'; }
[dir=rtl] .topic-back::before { content: '→'; }
.material-title + .topic-back { margin-top: 18px; }
.topic-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; background: #eff5e9; padding: 16px; margin-bottom: 28px; border-radius: 6px; }
.topic-search label { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.topic-search input[type=search] { min-width: 0; }
.topic-search .button { padding-inline: 18px; }
.topic-browser { margin-bottom: 32px; }
.topic-browser-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.topic-browser-heading h2 { font-size: 21px; }
.topic-browser-heading .text-link { font-size: 14px; min-height: 44px; }
.library-lessons { margin-bottom: 44px; scroll-margin-top: 20px; }
.library-lessons:focus-visible { outline: 3px solid var(--green); outline-offset: 6px; }
.library-lessons .results-heading { align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
.library-lessons .results-heading h2 { font-size: 23px; }
.library-results { grid-template-columns: 1fr; margin-top: 20px; }
.library-lessons .empty-state { margin-block: 20px; padding: 24px; }
.library-lessons .empty-state .button { margin-top: 20px; }
.search-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px; font-size: 14px; margin-top: 16px; overflow-wrap: anywhere; }
.pagination { gap: 16px; margin-block: 24px; }

@media (max-width: 760px) {
  .scholar-hero { min-height: 0; padding: 28px 22px; }
  .scholar-hero .library-art, .scholar-hero .hero-portrait { display: none; }
  .scholar-hero .hero-subtitle { font-size: 17px; }
  .scholar-hero .lead { font-size: 16px; }
  .scholar-hero h1 { font-size: 2.4rem; }
  .intro-strip { padding-block: 16px; margin-top: 16px; }
  .topic-section { padding: 26px 16px; }
  .topic-section .section-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .topic-section h2 { font-size: 24px; }
  .channel-card { min-height: 84px; padding: 16px; }
}
@media (min-width: 700px) {
  .topic-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-search { padding: 20px; }
}
@media (min-width: 1100px) {
  .topic-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .library-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Arabic text must remain connected, and mixed/long strings must reflow. */
body { overflow-wrap: anywhere; }
:lang(ar) { letter-spacing: normal !important; }
.language { display: inline-flex; align-items: center; min-height: 44px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.topic-choice-copy, .breadcrumbs > *, .topic-back { overflow-wrap: anywhere; }
.consent-banner { bottom: max(18px, env(safe-area-inset-bottom)); }
@media (max-width: 380px) {
  .header-row { column-gap: 8px; }
  .language { padding-inline-start: 8px; }
  .mobile-nav summary { padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .menu-link.is-active { border: 2px solid Highlight; }
  .topic-choice { border-color: ButtonText; }
}

.header-row { flex-wrap: wrap; padding-block: 8px; }
.desktop-nav { flex: 1 1 520px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.field-error { color: #8a2e20; font-size: 14px; margin-block: 8px 14px; }
[aria-invalid=true] { border: 2px solid #9c3d2b !important; }
.verification-panel { max-width: 100%; margin-block: 20px; }
.inquiry-form > .button { min-height: 48px; }
.error-summary:focus { outline: 3px solid #8a2e20; outline-offset: 5px; }
@media (max-width: 760px) { .inquiry-form > .button { width: 100%; } }

.brand { min-width: 0; max-width: 100%; flex-shrink: 1; }
.brand > span { min-width: 0; }
.topic-search { grid-template-columns: 1fr; }
@media (min-width: 700px) { .topic-search { grid-template-columns: minmax(0, 1fr) auto; } }
.turbo-progress-bar { height: 4px; background: #c4ab48; }

.library-modes { display: flex; gap: 10px; margin-top: 24px; }
.library-modes a { display: flex; align-items: center; justify-content: center; min-height: 48px; flex: 1; padding: 10px 16px; border: 1px solid #c4d4bb; border-radius: 5px; background: #f6f8f3; color: var(--green); }
.library-modes a[aria-current] { background: var(--green); color: white; border-color: var(--green); font-weight: 700; }
.catalog-filters { grid-column: 1 / -1; }
.catalog-filters summary { cursor: pointer; color: var(--green); min-height: 44px; padding-block: 10px; }
.catalog-filter-fields { display: grid; gap: 12px; grid-template-columns: 1fr; }
.catalog-filter-fields label { margin-top: 8px; }
.series-choices { margin-bottom: 28px; }
.resource-cover { background: #eaf1e4; background-image: linear-gradient(135deg,#eaf1e4,#c9dabe); }
.resource-cover.youtube_playlist { background-image: linear-gradient(135deg,#215b43,#398463); }
.resource-cover.youtube_playlist .resource-cover-icon { color: #efdc85; font-size: 76px; }
.resource-cover-icon { color: var(--green); font-size: 48px; }
.resource-type-badge { position: absolute; inset-inline-start: 12px; bottom: 12px; color: #174e39; background: #fffdf2; border: 1px solid #dac977; padding: 3px 10px; border-radius: 4px; font-size: 13px; font-weight: 600; }
.resource-series { color: var(--muted); font-size: 14px; margin-block: 10px; }
.resource-facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: #48634a; }
.material-classification { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.resource-type-label { display: inline-block; color: #174e39; background: #eef4e6; border: 1px solid #bacbad; border-radius: 4px; padding: 4px 10px; font-size: 14px; }
.category-checklist { margin-block: 24px; padding: 18px; border: 1px solid #c4d4bb; }
.category-checklist .checkbox-label { margin: 0; }
@media (min-width: 700px) { .catalog-filter-fields { grid-template-columns: repeat(3,minmax(0,1fr)); } .category-checklist { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; } }

.article-search { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; padding: 18px; background: #eff5e9; border-radius: 6px; margin-bottom: 24px; }
.article-search label { margin-top: 0; }
.article-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 22px; margin-top: 24px; }
.article-card { padding: 24px; border: 1px solid #d7e3d0; border-radius: 5px; background: white; min-width: 0; }
.article-card h2, .article-card h3 { font-size: 23px; margin-block: 14px; }
.article-card > p { color: var(--muted); font-size: 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 18px; font-size: 14px; color: #52684f; }
.article-labels { display: flex; flex-wrap: wrap; gap: 8px; }
.article-labels a { display: inline-flex; align-items: center; padding: 8px 12px; min-height: 44px; border: 1px solid #d5e0ce; border-radius: 4px; color: var(--green); background: #f3f7ee; font-size: 14px; }
.article-body { max-width: 760px; margin-inline: auto; font-size: 18px; line-height: 1.95; }
.article-body p { margin-block: 0 1.5em; }
.article-detail { margin-bottom: 48px; }
.article-taxonomies { max-width: 760px; margin: 32px auto; padding-top: 24px; border-top: 1px solid var(--line); }
.article-tags { margin-top: 16px; }
.article-tags a { background: white; }
.article-results { scroll-margin-top: 20px; }
@media (min-width: 700px) { .article-search { grid-template-columns: minmax(0,2fr) minmax(0,1fr) minmax(0,1fr); align-items: end; } .article-search > .button { grid-column: 1 / -1; } .article-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }

/* Install guidance stays in the footer; no automatic prompt or overlay. */
.pwa-install { flex-basis: 100%; max-width: 42rem; }
.pwa-install summary { cursor: pointer; min-height: 44px; padding-block: 10px; }
.pwa-install-help { line-height: 1.9; }
.pwa-install-help p { margin-block: 10px; }
.pwa-install .button { margin-block: 10px; }
.pwa-install[hidden], .pwa-install [hidden] { display: none; }
