/* Kafr Baldam CDA — "Green of the Delta": calm, trustworthy, readable for older visitors on phones.
   One stylesheet for RTL and LTR (logical properties only). */

:root {
  --bg: #ffffff;
  --tint: #f2f6f1;          /* pale field green for alternate sections */
  --green-950: #0d3322;     /* hero, footer */
  --green-800: #164f34;
  --green: #1f6b45;         /* brand green, links, buttons (6.5:1 on white) */
  --green-100: #e2eee5;
  --gold: #b8841c;          /* brand gold (logo) */
  --gold-300: #e7b84c;      /* gold on dark green */
  --gold-100: #f8efd9;
  --text: #18221d;
  --muted: #4f5d55;
  --line: #d8e1db;
  --radius: 14px;
  --radius-sm: 10px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.125rem;          /* 18px */
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
:lang(en) body, body:lang(en) { line-height: 1.65; }
img, svg { display: block; max-width: 100%; }
a { color: var(--green); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 800; color: var(--green-950); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); line-height: 1.2; }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--green-950); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }
.lead { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); color: var(--muted); max-width: 40em; }
.prose { max-width: 42em; }
.prose h2, .prose h3 { margin-bottom: .5em; }

/* ---------- Buttons & links ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 10px 26px;
  border: 2px solid var(--green); border-radius: 999px;
  background: #fff; color: var(--green);
  font: 700 1.05rem/1.2 var(--font); text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--green-100); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-800); border-color: var(--green-800); }
.btn--gold { background: var(--gold-300); border-color: var(--gold-300); color: var(--green-950); }
.btn--gold:hover { background: #f1c965; border-color: #f1c965; }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.link { font-weight: 700; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(8px)) { .site-header { background: rgba(255,255,255,.88); backdrop-filter: blur(8px); } }
.site-header__inner { display: flex; align-items: center; gap: 12px; min-height: 72px; }
.brand { margin-inline-end: auto; flex-shrink: 0; }
.brand img { height: 44px; width: auto; }
.site-nav ul { display: flex; gap: 4px; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 999px;
  color: var(--text); font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.site-nav a:hover { background: var(--tint); color: var(--green); }
.site-nav a[aria-current="page"] { background: var(--green-100); color: var(--green-950); font-weight: 700; }
.lang-switch {
  display: inline-flex; align-items: center; min-height: 40px; padding: 4px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); font-weight: 700; font-size: .95rem; text-decoration: none;
}
.lang-switch:hover { border-color: var(--green); color: var(--green); }
.menu-btn {
  display: none; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px;
  border: 0; border-radius: 999px; background: var(--green); color: #fff;
  font: 700 1rem/1 var(--font); cursor: pointer;
}
.menu-btn__bars, .menu-btn__bars::before, .menu-btn__bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-btn__bars { position: relative; }
.menu-btn__bars::before, .menu-btn__bars::after { content: ""; position: absolute; inset-inline-start: 0; }
.menu-btn__bars::before { top: -6px; }
.menu-btn__bars::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-btn__bars { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-btn__bars::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 959.98px) {
  .js .menu-btn { display: inline-flex; }
  .js .site-nav {
    position: absolute; inset-inline: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -18px rgba(13, 51, 34, .35);
    padding: 8px var(--gutter) 20px;
    display: none;
  }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; gap: 2px; max-width: var(--wrap); margin-inline: auto; }
  .js .site-nav a { padding: 14px 16px; font-size: 1.15rem; border-radius: var(--radius-sm); }
  /* without JS the links simply wrap under the logo */
  html:not(.js) .site-header__inner { flex-wrap: wrap; padding-block: 10px; }
  html:not(.js) .site-nav { order: 3; width: 100%; overflow-x: auto; }
}
@media (max-width: 420px) {
  .brand img { height: 38px; }
  .menu-btn__label { display: none; }
  .menu-btn { padding-inline: 13px; }
}

/* ---------- Hero ---------- */
.hero { background: var(--green-950); color: #fff; overflow: hidden; }
.hero__inner {
  display: grid; gap: 32px; align-items: center;
  padding-block: clamp(40px, 7vw, 96px);
}
.hero h1 { color: #fff; }
.hero__place { display: block; color: var(--gold-300); }
.hero .lead { color: rgba(255,255,255,.86); }
.hero__art { position: relative; width: min(70%, 260px); aspect-ratio: 1; justify-self: center; }
.hero__sun {
  position: absolute; inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(231,184,76,.32), rgba(231,184,76,.08) 62%, transparent 70%);
}
.hero__sprout { position: absolute; inset-inline: 17%; top: 27%; }
.hero__sprout svg { width: 100%; height: auto; color: #fff; --base: var(--gold-300); }
@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 1.25fr 1fr; gap: 56px; }
  .hero__art { width: min(100%, 440px); }
}

/* Sprout grows once per visit (Tier 1 motion: off under reduced motion; content is never hidden) */
@media (prefers-reduced-motion: no-preference) {
  html.grow:not(.reduce) .sprout-base { animation: kb-fade .6s var(--ease) .1s both; }
  html.grow:not(.reduce) .sprout-leaf {
    transform-box: fill-box; transform-origin: 50% 100%;
    animation: kb-rise 1.1s var(--ease) .45s both;
  }
  html.grow:not(.reduce) .hero__sun { animation: kb-sun 1.4s var(--ease) both; }
  html.grow:not(.reduce) .hero__text > * { animation: kb-up .7s var(--ease) both; }
  html.grow:not(.reduce) .hero__text > :nth-child(2) { animation-delay: .1s; }
  html.grow:not(.reduce) .hero__text > :nth-child(3) { animation-delay: .2s; }
}
@keyframes kb-fade { from { opacity: 0; } }
@keyframes kb-rise { 0% { transform: scale(.15, 0); } 60% { transform: scale(.9, 1.04); } 100% { transform: none; } }
@keyframes kb-sun { from { opacity: 0; transform: scale(.85); } }
@keyframes kb-up { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(48px, 7vw, 88px); }
.section--tint { background: var(--tint); }
.section--flush { padding-top: 0; }
.section-head { max-width: 44em; margin-bottom: 32px; }
.section-head h2 { margin-bottom: .35em; }
.section-head p { color: var(--muted); }

/* split: heading column + body column on wide screens */
.split { display: grid; gap: 20px 56px; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(220px, 1fr) 2.2fr; align-items: start; } .split > h2 { position: sticky; top: 100px; } }
.split__body { grid-column: 1 / -1; }
@media (min-width: 900px) { .split__body { grid-column: 2; } }

/* Inner page header */
.page-head { background: var(--tint); border-bottom: 1px solid var(--line); }
.page-head__inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: clamp(36px, 6vw, 72px); }
.page-head h1 { margin-bottom: .3em; }
.page-head__icon {
  flex-shrink: 0; display: grid; place-items: center;
  width: clamp(88px, 14vw, 150px); aspect-ratio: 1; border-radius: 50%;
  background: #fff; color: var(--green); border: 1px solid var(--line);
}
.page-head__icon svg { width: 58%; height: auto; }
@media (max-width: 599.98px) { .page-head__icon { display: none; } }

/* Icons */
.icon { display: grid; place-items: center; width: 56px; height: 56px; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--green-100); color: var(--green); }
.icon svg { width: 66%; height: 66%; }
.icon--lg { width: 72px; height: 72px; }

/* Bread feature */
.feature { display: grid; gap: 28px; align-items: center; }
.feature__art {
  display: grid; place-items: center; width: min(100%, 300px); aspect-ratio: 1; justify-self: center;
  border-radius: 50%; background: var(--gold-100); color: var(--gold);
}
.feature__art svg { width: 58%; height: auto; }
@media (min-width: 800px) { .feature { grid-template-columns: 300px 1fr; gap: 64px; } }

/* Field tiles (home) */
.tiles { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  display: flex; align-items: center; gap: 16px; height: 100%;
  padding: 18px 20px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--line);
  color: var(--text); text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}
.tile:hover { border-color: var(--green); box-shadow: 0 6px 20px -12px rgba(13,51,34,.45); }
.tile__name { font-weight: 700; font-size: 1.15rem; line-height: 1.4; }

/* Registration facts */
.seal { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); border-inline-start: 6px solid var(--green); }
.seal h2 { margin-bottom: 20px; }
.seal .link { display: inline-block; margin-top: 24px; }
.facts { display: grid; gap: 18px 32px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.facts dt { color: var(--muted); font-size: .95rem; }
.facts dd { font-weight: 700; font-size: 1.15rem; line-height: 1.45; color: var(--green-950); }

/* Get involved band */
.band { background: var(--green); color: #fff; }
.band__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; padding-block: clamp(36px, 5vw, 56px); }
.band h2 { color: #fff; margin-bottom: .2em; }
.band p { color: rgba(255,255,255,.88); max-width: 36em; }

/* Programs */
.fields { display: grid; gap: 16px; }
@media (min-width: 800px) { .fields { grid-template-columns: 1fr 1fr; } }
.field {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.field:target { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-100); }
.field h3 { margin-bottom: .35em; }
.field p { color: var(--muted); }

/* Ruled lists (activities, bylaws, finance) */
.ruled li { position: relative; padding-block: 14px; padding-inline-start: 30px; border-bottom: 1px solid var(--line); }
.ruled li:first-child { border-top: 1px solid var(--line); }
.ruled li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 1.45em; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }

/* Timeline (a real sequence) */
.timeline { position: relative; display: grid; gap: 22px; padding-inline-start: 28px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--green-100); }
.timeline li { position: relative; display: grid; gap: 2px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -28px; top: .55em; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--green); }
.timeline__year { font-weight: 800; font-size: 1.35rem; color: var(--green); line-height: 1.3; }

/* Definition lists (legal status, contact) */
.contact-list { display: grid; }
.contact-list > div { display: grid; gap: 2px 24px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.contact-list > div:first-child { border-top: 1px solid var(--line); }
@media (min-width: 700px) { .contact-list > div { grid-template-columns: 220px 1fr; } }
.contact-list dt { color: var(--muted); }
.contact-list dd { font-weight: 700; overflow-wrap: anywhere; }
.soon { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--gold-100); color: #7a5610; font-weight: 700; font-size: .95rem; }

/* Board */
.board { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.board li { display: grid; gap: 2px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.board__name { font-weight: 700; font-size: 1.1rem; line-height: 1.45; }
.board__role { color: var(--green); font-weight: 600; font-size: 1rem; }
.board li:first-child { background: var(--tint); border-color: var(--green-100); }

/* Get involved */
.ways { display: grid; gap: 16px; }
@media (min-width: 900px) { .ways { grid-template-columns: repeat(3, 1fr); } }
.way { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); }
.way h2 { font-size: 1.45rem; margin-bottom: .5em; }
.way--panel { background: var(--gold-100); border-color: transparent; }
.ways + .actions { margin-top: 32px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-950); color: rgba(255,255,255,.85); font-size: 1rem; padding-block: 56px 28px; }
.site-footer a { color: #fff; }
.footer__grid { display: grid; gap: 32px; }
@media (min-width: 800px) { .footer__grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer__logo img { height: 46px; width: auto; margin-bottom: 16px; }
.footer__about { max-width: 30em; }
.footer__nav li + li { margin-top: 6px; }
.footer__nav a { text-decoration: none; }
.footer__nav a:hover { text-decoration: underline; }
.site-footer .lang-switch { margin-top: 14px; color: #fff; border-color: rgba(255,255,255,.35); }
.footer__meta { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); font-size: .9rem; color: rgba(255,255,255,.7); display: grid; gap: 4px; }

/* ---------- Language chooser & 404 ---------- */
.chooser { min-height: 100vh; display: grid; align-content: center; justify-items: center; gap: 32px; padding-block: 48px; text-align: center; }
.chooser__logo { width: 260px; height: auto; }
.chooser__grid { display: grid; gap: 16px; width: 100%; max-width: 760px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.chooser__opt { display: grid; gap: 4px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .2s; }
.chooser__opt:hover { border-color: var(--green); }
.chooser__opt strong { font-size: 1.5rem; color: var(--green); }
.chooser .prose { text-align: start; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.chooser .prose h1 { font-size: 1.8rem; margin-bottom: .4em; }

/* ---------- Reduced motion safety net ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .hero__art, .band { display: none; }
  .hero { background: none; color: #000; }
  .hero h1, .hero .lead { color: #000; }
}
