/* Bayan Center. Fonts are self-hosted, so the page makes no calls to third parties. */

@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Amiri Bayan"; src: url(fonts/amiri-bayan.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: block; }

:root {
  --navy: #17233a;
  --burgundy: #6e2a3a;
  --burgundy-dark: #55202d;
  --gold: #c29a55;
  --gold-deep: #8a6420;
  --mist: #edf0f5;
  --ink: #17233a;
  --muted: #4a5772;
  --line: #cbd3e0;
  --field-line: #7c8aa3;
  --cream: #f5ecda;
  --error: #8e1b2e;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --arabic: "Amiri Bayan", "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 1rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--sans);
  color: var(--ink);
  background: #fff;
}
img { max-width: 100%; }
a { color: inherit; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.75rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(2rem, 4.2vw, 2.9rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
p { margin: 0 0 1em; max-width: 38rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 2px; }
.hero :focus-visible, .contact :focus-visible { outline-color: #fff; }
.skip { position: absolute; left: 1rem; top: -4rem; background: #fff; color: var(--navy); padding: .6rem 1rem; z-index: 10; border-radius: 6px; }
.skip:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .7rem 1.6rem;
  font: 700 1.0625rem/1.2 var(--sans);
  border: 0; border-radius: 8px; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--burgundy); color: #fff; }
.btn-primary:hover { background: var(--burgundy-dark); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #d3ac69; }
.btn-quiet { background: transparent; color: var(--burgundy); border: 1.5px solid var(--burgundy); }
.btn-quiet:hover { background: #f5eef0; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .7; cursor: wait; }

/* ---------- Welcome ---------- */
.hero { background: var(--navy); color: #f4f0e6; overflow: hidden; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.25rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: #fff; }
.brand-ar { font: 700 2rem/1 var(--arabic); color: var(--gold); padding-bottom: .2rem; }
.brand-en { font: 600 1.25rem/1 var(--serif); white-space: nowrap; }
.nav { display: flex; gap: clamp(.75rem, 3vw, 1.75rem); }
.nav a { color: #e6e9f0; text-decoration: none; padding: .5rem .15rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--gold); }

.hero-body { display: grid; gap: 0; align-items: center; padding-block: 1rem clamp(3rem, 8vw, 6.5rem); }
.hero-word {
  order: -1;
  font: 700 clamp(7rem, 34vw, 19rem)/1.3 var(--arabic);
  color: var(--gold);
  text-align: center;
  padding-block: .05em;
  animation: write-in .9s steps(27, end) .1s both; /* 27 steps in 0.9s: about 30 frames per second, half the work of 60 */
}
.hero-copy h1 { max-width: 15ch; }
.lede { margin-top: 1.25rem; font-size: 1.1875rem; color: #d7dce7; max-width: 32rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-top: 1.75rem; }
.enrolling {
  display: inline-flex; align-items: center; gap: .6rem;
  color: #fff; text-decoration: none; font-weight: 700;
  padding: .65rem 1.1rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
}
.enrolling::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--gold); flex: none; }
.enrolling:hover { border-color: var(--gold); }

@media (min-width: 48rem) {
  .hero-body { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 2rem; padding-top: clamp(2rem, 5vw, 4rem); }
  .hero-word { order: 0; font-size: clamp(11rem, 25vw, 19rem); }
}

@keyframes write-in {
  from { clip-path: inset(-10% 0 -10% 100%); opacity: .2; }
  to   { clip-path: inset(-10% 0 -10% 0);    opacity: 1; }
}

/* ---------- Programs ---------- */
.programs { background: var(--mist); padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-lede { margin-top: .9rem; color: var(--muted); font-size: 1.125rem; }

.skeleton { min-height: 28rem; margin-top: 3rem; background: #e2e7ef; border-radius: 8px; }
.notice { margin-top: 2rem; padding: 1rem 1.25rem; background: #fff; border-left: 4px solid var(--gold-deep); }
.notice.is-error { border-left-color: var(--error); }

.jump { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.75rem; }
.jump a { padding: .5rem 1rem; border: 1.5px solid var(--navy); border-radius: 999px; text-decoration: none; font-weight: 700; }
.jump a:hover { background: var(--navy); color: #fff; }

.event { display: grid; gap: 2rem; margin-top: 3rem; scroll-margin-top: 1.5rem; }
.event + .event { margin-top: 5rem; padding-top: 5rem; border-top: 1px solid var(--line); }
.poster { margin: 0; }
.poster a { display: block; cursor: zoom-in; }
.poster img {
  display: block; width: 100%; height: auto;
  background: var(--cream); border-radius: 6px;
  box-shadow: 0 1px 2px rgba(23, 35, 58, .14), 0 22px 44px -14px rgba(23, 35, 58, .35);
}
@media (min-width: 56rem) {
  .event { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 3rem; align-items: start; }
  .poster { position: sticky; top: 1.5rem; }
}

/* The registration form is styled as a slip cut from the poster. */
.slip {
  position: relative;
  background: #fff;
  border: 2px dashed #b9a06e;
  border-radius: 12px;
  padding: clamp(1.5rem, 3.5vw, 2.25rem) clamp(1.25rem, 3.5vw, 2.25rem) clamp(1.5rem, 3.5vw, 2.25rem);
}
.scissors { position: absolute; top: -.8rem; left: 1.5rem; background: var(--mist); padding: 0 .45rem; color: var(--gold-deep); line-height: 0; }
.slip .summary { margin-top: .9rem; color: var(--muted); }

.facts { margin: 1.25rem 0 1.75rem; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 1fr; gap: .1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .9375rem; }
.facts dd { margin: 0; }
@media (min-width: 30rem) { .facts > div { grid-template-columns: 7rem 1fr; gap: 1rem; } }

/* ---------- Forms ---------- */
.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
label, legend { font-weight: 700; }
.opt, .hint { font-weight: 400; color: var(--muted); }
.hint { display: block; font-size: .9375rem; }
fieldset { border: 0; margin: 0 0 .25rem; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: .7rem; }

input, textarea {
  width: 100%; min-height: 3rem;
  font: inherit; color: var(--ink); background: #fff;
  padding: .7rem .85rem;
  border: 1.5px solid var(--field-line); border-radius: 8px;
}
textarea { resize: vertical; min-height: 6rem; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }

.stepper { display: inline-grid; grid-template-columns: 3rem 4.5rem 3rem; width: max-content; }
.stepper button {
  font: 700 1.4rem/1 var(--sans); color: var(--navy); background: var(--mist);
  border: 1.5px solid var(--field-line); cursor: pointer; min-height: 3rem;
}
.stepper button:first-child { border-radius: 8px 0 0 8px; }
.stepper button:last-child { border-radius: 0 8px 8px 0; }
.stepper button:hover { background: #dde3ed; }
.stepper input { text-align: center; border-radius: 0; border-inline-width: 0; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.error { color: var(--error); font-weight: 700; margin: 0 0 1rem; }
.fine { margin: 1rem 0 0; font-size: .9375rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.done { padding: 1.25rem 1.25rem 1.4rem; background: var(--mist); border-left: 4px solid var(--gold-deep); border-radius: 0 8px 8px 0; margin-top: .5rem; }
.done h4 { font-size: 1.6rem; margin-bottom: .5rem; }
.done p { margin-bottom: 1.1rem; }

.empty { margin-top: 2.5rem; padding: clamp(1.5rem, 4vw, 2.5rem); background: #fff; border: 2px dashed #b9a06e; border-radius: 12px; }
.empty h3 { margin-bottom: .6rem; }
.empty .btn { margin-top: .5rem; }

/* ---------- About ---------- */
.about { padding-block: clamp(3.5rem, 8vw, 6rem); }
.about-grid { display: grid; gap: 3rem; }
.about h2 { margin-bottom: 1.25rem; }
.about p { font-size: 1.125rem; }
.teacher { padding-top: 1.5rem; border-top: 3px solid var(--gold); }
.teacher h3 { margin-bottom: .75rem; }
@media (min-width: 56rem) {
  .about-grid { grid-template-columns: 1.25fr .75fr; gap: 5rem; align-items: start; }
  .teacher { margin-top: .6rem; }
}

/* ---------- Contact ---------- */
.contact { background: var(--navy); color: #f4f0e6; padding-top: clamp(3.5rem, 8vw, 6rem); }
.contact-grid { display: grid; gap: 2rem; }
.contact h2 { margin-bottom: 1rem; }
.contact p { color: #d7dce7; }
.contact-form .error { color: #ffc9d1; }
.contact-form label { color: #fff; }
.contact .done, .contact .done p { color: var(--ink); }
@media (min-width: 56rem) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 5rem; } }

.foot { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: clamp(3rem, 7vw, 5rem); padding-block: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .18); color: #b9c1d1; font-size: .9375rem; }
.foot-name { font-family: var(--serif); font-weight: 600; color: #fff; font-size: 1.05rem; }

/* ---------- Simple pages (thanks, 404) ---------- */
.plain { min-height: 100vh; display: grid; place-items: center; padding: 2rem var(--gutter); background: var(--navy); color: #f4f0e6; text-align: center; }
.plain h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 1rem; }
.plain p { margin-inline: auto; color: #d7dce7; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-word { animation: none; }
}

/* ---------- Series page ---------- */

/* The full Arabic face is only downloaded on pages that show Arabic beyond the logo. */
@font-face { font-family: "Amiri"; src: url(fonts/amiri-arabic-700.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ongoing: #14573f;
  --completed: #6e2a3a;
  --tbd: #3e4658;
}
.tone-ongoing { --tone: var(--ongoing); }
.tone-completed { --tone: var(--completed); }
.tone-tbd { --tone: var(--tbd); }

.band { background: var(--navy); color: #f4f0e6; }
.band[class*="tone-"] { background: var(--tone); }
.band-body { padding-block: 1rem clamp(2.5rem, 6vw, 4.5rem); }
.band-body h1 { max-width: 18ch; }
.band-body:not(.band-detail) .lede { max-width: 34rem; }
.band-detail { display: grid; gap: 0; align-items: center; }
.band-text { min-width: 0; }
.band-status { margin: 1.25rem 0 .9rem; }
.band-meta { margin: 0; color: #e4e8ee; font-weight: 700; }
.band-ar { font: 700 clamp(5rem, 22vw, 11rem)/1.4 var(--arabic); color: var(--gold); text-align: center; }
@media (min-width: 48rem) {
  .band-detail { grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); gap: 2rem; }
}
.crumb { display: inline-flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.crumb::before { content: ""; width: .6rem; height: .6rem; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); }
.crumb:hover { border-bottom-color: var(--gold); }
.band .lede { margin-top: 1rem; }
.band :focus-visible { outline-color: #fff; }
#page-title:focus { outline: none; }

.series-page { background: var(--mist); padding-block: clamp(2.5rem, 6vw, 4.5rem); min-height: 55vh; }
.series-page:focus { outline: none; }

/* Status pill: always carries a word, so color is never the only signal. */
.status { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem; border-radius: 999px; background: #fff; color: var(--tone); font: 700 .9rem/1.2 var(--sans); }
.status i { order: -1; width: .6rem; height: .6rem; border-radius: 50%; background: var(--tone); }
.tone-ongoing .status i { animation: blink 2s steps(4, end) infinite; }
@keyframes blink { 50% { opacity: .2; } }

.series-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19.5rem), 1fr)); list-style: none; margin: 0; padding: 0; }
.series-grid > li { display: flex; }
.card {
  position: relative; display: flex; flex-direction: column; width: 100%;
  background: #fff; color: var(--ink); text-decoration: none;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(23, 35, 58, .14), 0 16px 30px -18px rgba(23, 35, 58, .4);
  transition: box-shadow .15s;
}
.card:hover { box-shadow: 0 1px 2px rgba(23, 35, 58, .18), 0 24px 36px -16px rgba(23, 35, 58, .5); }
.card > .status { position: absolute; top: .9rem; left: .9rem; }
.card-art { display: grid; place-items: center; aspect-ratio: 16 / 8; background: var(--tone); color: var(--gold); padding-top: 1.5rem; }
.tone-tbd .card-art { outline: 2px dashed rgba(255, 255, 255, .35); outline-offset: -12px; }
.card-art .ar { font: 700 clamp(3.25rem, 9vw, 4.5rem)/1.6 var(--arabic); }
.card-art .initial { font: 600 4.5rem/1 var(--serif); }
.card-body { display: flex; flex-direction: column; gap: .6rem; padding: 1.25rem 1.4rem 1.5rem; flex: 1; }
.card-body h3 { font-size: 1.5rem; }
.card-desc { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: grid; gap: .15rem; margin: auto 0 0; padding-top: .6rem; font-size: .9375rem; color: var(--ink); }
.card-meta span:last-child { font-weight: 700; color: var(--tone); }

.videos { display: grid; gap: 1.75rem; }
.video {
  display: grid; gap: 1.25rem; padding: clamp(1rem, 2.5vw, 1.5rem);
  background: #fff; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(23, 35, 58, .14), 0 16px 30px -18px rgba(23, 35, 58, .4);
  content-visibility: auto; contain-intrinsic-size: auto 24rem;
}
@media (min-width: 56rem) {
  .video { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 2rem; align-items: start; }
}
.player { position: relative; aspect-ratio: 16 / 9; background: #0f1a2e; border-radius: 10px; overflow: hidden; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-note { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: #d7dce7; max-width: none; }
.facade { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.facade img { display: block; width: 100%; height: 100%; object-fit: cover; }
.play { position: absolute; inset: 0; margin: auto; width: 4.25rem; height: 4.25rem; border-radius: 50%; background: rgba(255, 255, 255, .95); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.play::after { content: ""; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%); border-style: solid; border-width: .8rem 0 .8rem 1.35rem; border-color: transparent transparent transparent var(--tone, var(--navy)); }
.facade:hover .play { background: #fff; }
.facade:focus-visible { outline: 4px solid var(--gold); outline-offset: -4px; }
.video-text h3 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
.video-date { display: block; margin: .35rem 0 1rem; color: var(--tone, var(--muted)); font-weight: 700; font-size: .9375rem; }
.video-summary { margin: 0 0 1rem; }
.points { margin: 0; padding-left: 1.2rem; }
.points li { margin-bottom: .35rem; padding-left: .2rem; }

.footer-band { background: var(--navy); color: #f4f0e6; padding-top: .5rem; }
.footer-band .foot { margin-top: 0; border-top: 0; padding-block: 2rem; }

/* Narrow phones: the menu drops under the logo instead of running off the screen. */
@media (max-width: 40rem) {
  .top { flex-wrap: wrap; row-gap: .25rem; }
  .nav { width: 100%; gap: 1.1rem; flex-wrap: wrap; }
}
