/* Virtual NICU — one stylesheet for Arabic (RTL) and English (LTR).
   Layout: deep-green masthead taken from the logo, light clinical page, gold used only for emphasis. */
:root {
  --green-900: #0f2f20;
  --green-800: #163f2a;   /* the logo's own green */
  --green-600: #2a6a4b;
  --green-100: #e3eee7;
  --page: #f5f8f6;
  --card: #ffffff;
  --ink: #15231c;
  --muted: #52635a;
  --line: #d5e0d9;
  --gold: #a98432;        /* gold on light surfaces */
  --gold-lit: #dcbf73;    /* gold on green */
  --sand: #fbf6ea;        /* parents' corner */
  --sand-line: #eadfc4;
  --wa: #1f7a4d;
  --radius: 14px;
  --display: "Readex Pro", "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  --body: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 17px/1.75 var(--body); overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.35; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem); font-weight: 600; }
h3 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--gold-lit); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1140px; margin-inline: auto; padding-inline: max(18px, env(safe-area-inset-left, 0px)) max(18px, env(safe-area-inset-right, 0px)); }
.sr, .skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 12px; top: 12px; z-index: 50; background: #fff; padding: 8px 14px; border-radius: 8px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--green-800); color: #fff; border-bottom: 1px solid rgba(220, 191, 115, .28); }
.top-row { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.05rem var(--display); color: #fff; white-space: nowrap; }
.brand img { width: 44px; height: 44px; border-radius: 50%; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .96rem; color: #e9f1ec; white-space: nowrap; }
.nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.lang { text-decoration: none; border: 1px solid var(--gold-lit); color: var(--gold-lit); padding: 5px 14px; border-radius: 999px; font: 500 .92rem var(--body); white-space: nowrap; }
.lang:hover { background: var(--gold-lit); color: var(--green-900); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 22px; border-radius: 10px; border: 1.5px solid transparent; text-decoration: none; font: 600 1rem var(--display); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn-gold { background: var(--gold-lit); color: var(--green-900); }
.btn-gold:hover { background: #e8cf8d; }
.btn-line { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-line:hover { background: rgba(255, 255, 255, .12); }
.btn-green { background: var(--green-800); color: #fff; }
.btn-green:hover { background: var(--green-600); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #17633e; }
.btn-outline { border-color: var(--green-800); color: var(--green-800); }
.btn-outline:hover { background: var(--green-100); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- hero ---------- */
.hero { position: relative; background: radial-gradient(120% 140% at 80% 0%, #1b4a33 0%, var(--green-800) 45%, var(--green-900) 100%); color: #fff; padding-block: 56px 120px; overflow: hidden; }
[dir="rtl"] .hero { background: radial-gradient(120% 140% at 20% 0%, #1b4a33 0%, var(--green-800) 45%, var(--green-900) 100%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.eyebrow { font: 500 .9rem var(--display); color: var(--gold-lit); letter-spacing: .02em; margin-bottom: 12px; }
.eyebrow.dark { color: var(--gold); }
.hero h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3.1rem); font-weight: 700; line-height: 1.3; }
.lead { margin-block: 18px 28px; font-size: 1.1rem; color: #dbe8e0; max-width: 34em; }
.hero-mark { display: flex; align-items: center; justify-content: center; gap: 8px; }
.emblem { width: min(250px, 46%); border-radius: 50%; mix-blend-mode: lighten; -webkit-mask-image: radial-gradient(closest-side, #000 88%, transparent 100%); mask-image: radial-gradient(closest-side, #000 88%, transparent 100%); }
.wordmark { width: min(260px, 50%); mix-blend-mode: lighten; }
html[lang="en"] .emblem { width: min(300px, 80%); }
.trace { position: absolute; inset-inline: 0; bottom: 74px; width: 100%; height: 44px; }
.trace path { fill: none; stroke: var(--gold-lit); stroke-width: 1.5; opacity: .55; vector-effect: non-scaling-stroke; }

/* ---------- who are you ---------- */
.who-section { position: relative; margin-top: -64px; }
.who-section h2 { color: #fff; font-size: 1.05rem; font-weight: 500; margin-bottom: 12px; }
.who-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.who { min-width: 0; }
.who { position: relative; display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 46px; text-decoration: none; box-shadow: 0 10px 28px rgba(15, 47, 32, .12); transition: transform .15s, border-color .15s; }
.who:hover { transform: translateY(-3px); border-color: var(--gold); }
.who h3 { color: var(--green-800); font-size: 1.15rem; margin-bottom: 6px; }
.who p { color: var(--muted); font-size: .95rem; line-height: 1.6; }
.who .go { position: absolute; bottom: 14px; inset-inline-start: 20px; color: var(--gold); font-size: 1.2rem; line-height: 1; }

/* ---------- sections ---------- */
.section { padding-block: 64px 0; }
.head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.head h2 { color: var(--green-800); }
.head p { color: var(--muted); max-width: 44em; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; transition: transform .15s, box-shadow .15s; min-width: 0; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(15, 47, 32, .12); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--green-100); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--green-800), var(--green-600)); }
.ph span { font: 700 2.4rem var(--display); color: var(--gold-lit); letter-spacing: .12em; }
.play { position: absolute; inset-block-end: 10px; inset-inline-start: 10px; width: 38px; height: 38px; border-radius: 50%; background: rgba(15, 47, 32, .82); }
.play::after { content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%); border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 20px; }
.card-body p { color: var(--muted); font-size: .96rem; line-height: 1.65; }
.video h3 { font-size: 1rem; font-weight: 500; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { align-self: flex-start; background: var(--green-100); color: var(--green-800); font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.chip-quiet { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }

.coming, .series { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 22px; }
.coming > span, .series > span { font: 600 .92rem var(--display); color: var(--gold); }
.coming ul, .series ul, .topics { display: flex; flex-wrap: wrap; gap: 8px; }
.coming li { border: 1px dashed #b9c9bf; color: var(--muted); padding: 4px 14px; border-radius: 999px; font-size: .92rem; }
.series li a { display: block; border: 1px solid var(--line); background: var(--card); padding: 4px 14px; border-radius: 999px; font-size: .92rem; text-decoration: none; }
.series li a:hover { border-color: var(--green-600); color: var(--green-800); }
.more { margin-inline-start: auto; font-weight: 600; color: var(--green-800); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* ---------- tool ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.tool-pic img { border-radius: 12px; width: 100%; }
.tool-text { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.tool-text .eyebrow { margin: 0; }
.tool-text h2 { color: var(--green-800); font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem); }
.tool-text p { color: var(--muted); }
.quiet { color: var(--muted); font-size: .88rem; }

/* ---------- parents ---------- */
.parents { background: var(--sand); border-block: 1px solid var(--sand-line); margin-top: 64px; padding-block: 56px; }
.parents .card { border-color: var(--sand-line); }
.topics { margin-top: 22px; }
.topics li { background: #fff; border: 1px solid var(--sand-line); padding: 5px 14px; border-radius: 999px; font-size: .94rem; }
.note { margin-top: 22px; padding-inline-start: 14px; border-inline-start: 3px solid var(--gold); color: var(--muted); font-size: .95rem; max-width: 52em; }

/* ---------- newsletter ---------- */
.news { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; background: var(--green-100); border-radius: 18px; padding: 34px; }
.news h2 { color: var(--green-800); font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem); margin-bottom: 10px; }
.news p { color: #3c4f45; }
.news-side { display: flex; flex-direction: column; gap: 10px; }
.signup { display: flex; gap: 8px; }
.signup input { flex: 1; min-width: 0; min-height: 46px; border: 1.5px solid #b9c9bf; border-radius: 10px; padding: 8px 14px; font: 400 1rem var(--body); background: #fff; color: var(--ink); }
[dir="rtl"] .signup input::placeholder { text-align: right; direction: rtl; }
.follow { margin-top: 10px; font: 600 .95rem var(--display); color: var(--green-800) !important; }

/* ---------- events ---------- */
.events { display: grid; gap: 14px; }
.event { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.when { display: flex; flex-direction: column; gap: 2px; border-inline-end: 1px solid var(--line); padding-inline-end: 20px; }
.when strong { font: 600 1.1rem var(--display); color: var(--green-800); font-variant-numeric: tabular-nums; }
.when span, .event p { color: var(--muted); font-size: .95rem; }
.event h3 { margin-bottom: 4px; }

/* ---------- footer ---------- */
.foot { margin-top: 72px; background: var(--green-900); color: #cfded5; padding-block: 44px 22px; font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 36px; }
.foot .brand { white-space: normal; margin-bottom: 12px; }
.foot h3 { color: var(--gold-lit); font-size: .95rem; margin-bottom: 10px; }
.foot-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.foot-nav a { text-decoration: none; }
.foot-nav a:hover { color: #fff; text-decoration: underline; }
.credit { margin-top: 10px; color: #a9bfb2; font-size: .9rem; }
.legal { margin-top: 30px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .14); color: #a9bfb2; font-size: .88rem; }

/* ---------- language gate (root page) ---------- */
.gate { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 24px; background: var(--green-800); }
.gate img { border-radius: 50%; }

/* ---------- tablet and phone ---------- */
@media (max-width: 980px) {
  .top-row { flex-wrap: wrap; gap: 0 12px; padding-top: 8px; }
  .lang { margin-inline-start: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 0; overflow-x: auto; padding-block: 6px 8px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 10px; }
  html { scroll-padding-top: 110px; }
  .who-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .hero { padding-block: 32px 110px; }
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero-mark { order: -1; justify-content: flex-start; }
  .emblem, html[lang="en"] .emblem { width: 96px; }
  .wordmark { width: 120px; }
  .grid { grid-template-columns: 1fr; }
  .tool, .news { grid-template-columns: 1fr; gap: 20px; }
  .news { padding: 24px 20px; }
  .event { grid-template-columns: 1fr; gap: 10px; }
  .when { border: 0; padding: 0; }
  .more { margin-inline-start: 0; flex-basis: 100%; }
  .section { padding-top: 48px; }
}
@media (max-width: 400px) {
  .who-grid { gap: 10px; }
  .who { padding: 14px 14px 40px; }
  .who .go { inset-inline-start: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .who { transition: none; }
}

/* ================= inner pages ================= */
.nav a[aria-current="page"] { background: rgba(220, 191, 115, .16); color: var(--gold-lit); }
.page-head { background: linear-gradient(180deg, var(--green-800), var(--green-900)); color: #fff; padding-block: 34px 40px; }
.page-head h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); font-weight: 700; }
.page-head .lead { margin-block: 10px 0; max-width: 46em; }
.crumbs { font-size: .9rem; color: #b9cfc2; margin-bottom: 10px; }
.crumbs a { text-decoration: none; color: var(--gold-lit); }
.crumbs a:hover { text-decoration: underline; }
.section.first { padding-top: 36px; }
[hidden] { display: none !important; }

.chip-gold { background: #f6ecd0; color: #7a5c14; }
.card-soon { opacity: .9; }
.card-soon .thumb { filter: saturate(.55); }
.card-soon:hover { transform: none; box-shadow: none; }
.card-go { margin-top: 4px; font: 600 .95rem var(--display); color: var(--green-800); }
.ph span { font-size: clamp(1.4rem, 1rem + 2vw, 2.2rem); }
.series .more:only-child, .series ul + .more { margin-inline-start: auto; }

/* library toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 6px 16px; min-height: 40px; border-radius: 999px; font: 500 .95rem var(--body); cursor: pointer; }
.filter:hover { border-color: var(--green-600); }
.filter.is-on { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.finders { display: flex; gap: 8px; flex: 1 1 320px; max-width: 460px; }
.finders input, .finders select { min-height: 42px; border: 1.5px solid #b9c9bf; border-radius: 10px; padding: 6px 12px; font: 400 1rem var(--body); background: #fff; color: var(--ink); }
.finders input { flex: 1; min-width: 0; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }
#video-grid { margin-top: 14px; }

/* course page */
.course { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.player { aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-start { position: relative; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.player-start img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.play.big { width: 72px; height: 72px; inset: 50% auto auto 50%; transform: translate(-50%, -50%); background: rgba(22, 63, 42, .9); }
.play.big::after { border-width: 13px 0 13px 21px; }
.player-col { display: flex; flex-direction: column; gap: 10px; }
.player-col h2, .lessons-col h2 { font-size: 1.25rem; color: var(--green-800); }
.lessons { display: grid; gap: 10px; margin-top: 12px; }
.lesson { display: grid; grid-template-columns: 28px 112px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; text-align: start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font: 500 .95rem/1.55 var(--body); color: var(--ink); cursor: pointer; }
.lesson:hover { border-color: var(--green-600); }
.lesson.is-on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: #fffdf6; }
.lesson img { border-radius: 8px; aspect-ratio: 16 / 9; object-fit: cover; }
.num { font: 700 1.1rem var(--display); color: var(--gold); text-align: center; font-variant-numeric: tabular-nums; }

/* parents page */
.parents-page { margin-top: 0; border-top: 0; padding-top: 36px; }
.danger { background: #fff; border: 1px solid #e9c9b8; border-inline-start: 5px solid #c0553a; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 28px; }
.danger h2 { font-size: 1.2rem; color: #9c3d26; margin-bottom: 10px; }
.danger ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 28px; list-style: disc; padding-inline-start: 20px; }

/* about */
.prose { display: grid; gap: 28px; }
.prose > * { max-width: 760px; }
.prose h2 { font-size: 1.2rem; color: var(--green-800); margin-bottom: 6px; }
.prose .actions { margin-top: 14px; }
.note-box { background: var(--sand); border: 1px solid var(--sand-line); border-radius: var(--radius); padding: 20px 24px; }
.note-box p + p { margin-top: 8px; }

@media (max-width: 980px) {
  .course { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .danger ul { grid-template-columns: 1fr; }
  .finders { max-width: none; }
  .lesson { grid-template-columns: 24px 88px minmax(0, 1fr); gap: 10px; }
}

/* newsletter issues */
.issues-h { margin-top: 18px; font-size: 1rem; color: var(--green-800); }
.issues { display: grid; gap: 8px; margin-block: 8px 12px; }
.issues li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.issues a { font-weight: 600; color: var(--green-800); text-decoration: none; }
.issues a:hover { text-decoration: underline; }
.issues span { color: var(--muted); font-size: .9rem; }
.news-side .btn { align-self: flex-start; }
