/* AKRAB JIM public site: warm and welcoming, in the colours of the AKRAB logo. */

/* Tokens */

:root {
  --ink: #1d2b45;
  --ink-soft: #3d4b63;
  --muted: #66728a;
  --paper: #fbf8f3;
  --surface: #ffffff;
  --line: #ece4d8;
  --line-cool: #dde6ef;

  --blue: #1f6fb2;
  --blue-deep: #17558a;
  --blue-tint: #e8f2fb;
  --red: #d63c45;
  --red-tint: #fdecec;
  --red-ink: #b8323a;
  --yellow: #f2b52b;
  --yellow-tint: #fdf4dc;
  --green-tint: #e9f5ee;
  --focus: #f2b52b;

  /* Supporting colours, so nothing outside :root hardcodes a value. */
  --on-color: #ffffff;
  --accent-yellow: #b07c0c;
  --accent-green: #2f855a;
  --success: #2f9e62;
  --yellow-line: #f4e3b5;
  --border-strong: #7d8aa0;
  --wire: #9a8a74;
  --footer-text: #c7d1e0;
  --footer-line: #33425c;

  --sans: "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(29, 43, 69, .05), 0 10px 30px -18px rgba(29, 43, 69, .28);
  --shadow-lift: 0 2px 4px rgba(29, 43, 69, .06), 0 18px 40px -20px rgba(29, 43, 69, .35);
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 108px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: var(--text-md); font-weight: 750; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--on-color); padding: 8px 16px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

/* Header */

.site-header { background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 88px; }

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { height: 68px; width: auto; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 8px); gap: 3px; height: 34px; }
.brand-mark span { border-radius: 999px; }
.brand-mark span:nth-child(1) { background: var(--blue); }
.brand-mark span:nth-child(2) { background: var(--yellow); margin-top: 8px; }
.brand-mark span:nth-child(3) { background: var(--red); margin-top: 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--display); font-weight: 800; font-size: var(--text-xl); letter-spacing: .04em; }
.brand-text small { font-size: var(--text-sm); color: var(--muted); }

.nav-toggle { display: none; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.site-nav a, .site-nav summary {
  display: block; padding: 10px 12px; border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; font-size: var(--text-md); font-weight: 650; cursor: pointer; white-space: nowrap;
}
.site-nav a:hover, .site-nav summary:hover { background: var(--blue-tint); color: var(--blue-deep); }
.site-nav a[aria-current="page"], .site-nav .is-current > summary { background: var(--blue); color: var(--on-color); }
.site-nav summary { list-style: none; }
.site-nav summary::-webkit-details-marker { display: none; }
.site-nav summary::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.site-nav details { position: relative; }
.site-nav details ul {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px;
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px; box-shadow: var(--shadow-lift);
}
.site-nav details ul a { border-radius: 10px; }
.site-nav details ul a[aria-current="page"] { background: var(--blue-tint); color: var(--blue-deep); }

/* Buttons */

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 12px 24px; border-radius: 999px; font-weight: 750; font-size: var(--text-base); text-decoration: none;
  background: var(--blue); color: var(--on-color); border: 2px solid var(--blue);
  box-shadow: 0 8px 18px -10px rgba(31, 111, 178, .7);
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: var(--on-color); text-decoration: none; transform: translateY(-1px); }
.btn-quiet { background: var(--surface); color: var(--blue); box-shadow: none; border-color: var(--line-cool); }
.btn-quiet:hover { background: var(--blue-tint); color: var(--blue-deep); border-color: var(--blue-tint); }

/* Home: hero */

.hero { position: relative; overflow: hidden; padding: clamp(24px, 4vw, 48px) 0 clamp(28px, 4vw, 52px); }
.hero + .section { padding-top: 0; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); z-index: -1; }
.hero::before { width: 520px; height: 520px; right: -140px; top: -180px; background: radial-gradient(circle, var(--blue-tint) 0%, rgba(232, 242, 251, 0) 70%); }
.hero::after { width: 420px; height: 420px; left: -160px; bottom: -200px; background: radial-gradient(circle, var(--yellow-tint) 0%, rgba(253, 244, 220, 0) 70%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 6vw, 72px); align-items: center; }

/* Photo hero: AKRAB activity photos cross-fade behind the text (Admin > Slaid Utama). */
.hero.has-photos { isolation: isolate; display: grid; align-content: center; min-height: clamp(460px, 70vh, 660px); padding: clamp(48px, 6vw, 80px) 0 clamp(96px, 8vw, 112px); background: var(--ink); color: var(--on-color); }
.hero.has-photos::before, .hero.has-photos::after { display: none; }
.hero.has-photos + .section { padding-top: clamp(32px, 4vw, 48px); }
.has-photos .hero-grid { grid-template-columns: minmax(0, 700px); width: 100%; }
.hero-slides { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
/* Darken from the left so the text stays readable on any photo. */
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(16, 24, 40, .9) 0%, rgba(16, 24, 40, .74) 38%, rgba(16, 24, 40, .3) 70%, rgba(16, 24, 40, .12) 100%), linear-gradient(0deg, rgba(16, 24, 40, .6) 0%, rgba(16, 24, 40, 0) 30%); }
.hero-slide figcaption { position: absolute; z-index: 1; right: var(--gutter); bottom: 28px; max-width: 46%; padding: 6px 14px; border-radius: 999px; background: rgba(16, 24, 40, .55); color: var(--on-color); font-size: var(--text-sm); font-weight: 650; }
.hero.has-photos h1 { color: var(--on-color); text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.hero.has-photos h1 span { color: var(--yellow); }
.hero.has-photos .kicker { color: var(--on-color); }
.hero.has-photos .kicker::before { background: var(--yellow); }
.hero.has-photos .hero-intro { color: rgba(255, 255, 255, .94); text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.hero.has-photos .btn-quiet { background: rgba(255, 255, 255, .12); color: var(--on-color); border-color: rgba(255, 255, 255, .55); }
.hero.has-photos .btn-quiet:hover { background: rgba(255, 255, 255, .24); color: var(--on-color); border-color: var(--on-color); }
.hero.has-photos .values li { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); color: var(--on-color); }
.hero-controls { position: absolute; left: 0; right: 0; bottom: 20px; display: flex; align-items: center; gap: 8px; }
.hero-dots { display: flex; }
.hero-dots button { position: relative; display: grid; place-items: center; width: 32px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.hero-dots button::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .55); transition: width .3s ease, background-color .3s ease; }
.hero-dots button[aria-current="true"]::before { width: 26px; background: var(--yellow); }
.hero-dots button::after { content: ""; position: absolute; left: 3px; top: 17px; width: 0; height: 10px; border-radius: 999px; background: var(--yellow); }
.hero-dots button:hover::before { background: var(--on-color); }
.hero .hero-pause { background: rgba(255, 255, 255, .14); color: var(--on-color); border-color: rgba(255, 255, 255, .45); }
.hero .hero-pause:hover { background: var(--on-color); color: var(--ink); }


/* Home: e-poster slider */
.slider-nav { display: flex; align-items: center; gap: 8px; }
.slider-nav a { margin-left: 8px; }
.slider-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-cool); background: var(--surface);
  color: var(--blue); font-size: var(--text-xl); line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 3px;
}
.slider-btn:hover { background: var(--blue); color: var(--on-color); border-color: var(--blue); }
.slider-btn:disabled { opacity: .35; cursor: default; background: var(--surface); color: var(--blue); border-color: var(--line-cool); }
.slider-pause .icon-play, .slider-pause[aria-pressed="true"] .icon-pause, .hero-pause .icon-play, .hero-pause[aria-pressed="true"] .icon-pause { display: none; }
.slider-pause[aria-pressed="true"] .icon-play, .hero-pause[aria-pressed="true"] .icon-play { display: block; }
.slider {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 20px) / 4); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
  padding: 8px 4px 16px; margin: -8px -4px 0; scrollbar-width: thin;
}
.slider > * { scroll-snap-align: start; }
.slider:focus-visible { outline-offset: 0; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin: 0 0 16px; }
.kicker::before { content: ""; width: 26px; height: 3px; border-radius: 3px; background: var(--red); }
.hero h1 { margin-bottom: 16px; }
.hero h1 span { color: var(--blue); }
.hero-intro { font-size: clamp(1.08rem, 1.7vw, 1.25rem); max-width: 34em; color: var(--ink-soft); margin: 0 0 28px; }
.values { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.values li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: var(--text-sm); font-weight: 650; color: var(--ink-soft); }
.values .letter { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--on-color); font-family: var(--display); font-weight: 800; font-size: var(--text-sm); background: var(--blue); }
.values li:nth-child(2) .letter { background: var(--red); }
.values li:nth-child(3) .letter { background: var(--yellow); color: var(--ink); }
.values li:nth-child(5) .letter { background: var(--red); }

/* Home: quick links */

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quick a {
  --tint: var(--blue-tint); --accent: var(--blue);
  display: grid; gap: 8px; padding: 24px; border-radius: var(--radius); background: var(--tint);
  text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease;
}
.quick a:nth-child(2) { --tint: var(--yellow-tint); --accent: var(--accent-yellow); }
.quick a:nth-child(3) { --tint: var(--red-tint); --accent: var(--red); }
.quick a:nth-child(4) { --tint: var(--green-tint); --accent: var(--accent-green); }
.quick a:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.quick svg { width: 30px; height: 30px; color: var(--accent); margin-bottom: 8px; }
.quick strong { font-family: var(--display); font-size: var(--text-md); font-weight: 800; }
.quick span { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.45; }

/* Sections */

.section { padding: clamp(44px, 7vw, 80px) 0; }
.section + .section { padding-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 700; text-decoration: none; }
.section-head a::after { content: " →"; }

.help {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center;
  background: linear-gradient(120deg, var(--yellow-tint), var(--surface) 75%); border: 1px solid var(--yellow-line);
  border-radius: var(--radius); padding: clamp(24px, 4vw, 40px);
}
.help h2 { margin-bottom: 8px; }
.help p { margin: 0; color: var(--ink-soft); max-width: 40em; }
.help-aside { display: grid; gap: 12px; justify-items: start; }
.help-count { font-size: var(--text-base); color: var(--muted); }
.help-count strong { color: var(--ink); font-size: var(--text-md); }

.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 56px); align-items: start; }

.meta { font-size: var(--text-sm); color: var(--muted); margin: 0 0 8px; }
.caption { color: var(--ink-soft); white-space: pre-line; }

/* Posters */


.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: clamp(16px, 3vw, 28px); }
.poster-card { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border-radius: var(--radius); padding: 12px 12px 16px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.poster-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.poster-card img { aspect-ratio: 1 / 1.414; width: 100%; object-fit: cover; object-position: top; border-radius: var(--radius-sm); background: var(--blue-tint); }
.poster-card h3 { font-size: var(--text-base); margin: 12px 4px 2px; line-height: 1.35; }
.poster-card .meta { display: block; margin: 0 4px; font-size: var(--text-sm); }

.poster-full { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 56px); align-items: start; margin-top: 12px; }
.poster-full > img { border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.poster-full h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { display: inline-block; padding: 8px 0; font-weight: 700; }

/* Announcements */

.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.notice-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; background: var(--surface); border-radius: var(--radius-sm); padding: 16px 16px; box-shadow: var(--shadow); }
.notice-list time { font-size: var(--text-sm); font-weight: 750; color: var(--blue-deep); background: var(--blue-tint); border-radius: 8px; padding: 4px 8px; text-align: center; line-height: 1.3; }
.notice-list .title { font-weight: 750; color: var(--ink); }
.notice-list a.title { color: var(--blue); }
.notice-list p { margin: 4px 0 0; color: var(--ink-soft); font-size: var(--text-base); }

/* People */

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.person { background: var(--surface); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: 60px 1fr; gap: 16px; align-items: start; box-shadow: var(--shadow); }
.avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background: var(--blue-tint); color: var(--blue-deep); display: grid; place-items: center; font-weight: 800; font-size: var(--text-md); }
.person h5 { font-size: var(--text-base); margin: 0 0 2px; line-height: 1.3; }
.person .role { display: inline-block; font-size: var(--text-xs); font-weight: 800; letter-spacing: .02em; color: var(--red-ink); background: var(--red-tint); padding: 2px 12px; border-radius: 999px; margin-bottom: 8px; }
.person .detail { font-size: var(--text-sm); color: var(--muted); margin: 0; line-height: 1.45; }
.person .contact { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 4px; font-size: var(--text-sm); }
.person .contact a { display: inline-block; padding: 3px 0; font-weight: 650; overflow-wrap: anywhere; }

/* Jawatankuasa Induk org chart: a trunk runs down the centre, each row
   hangs from a horizontal bar, and each box drops from the bar. */
.org { --gap: 16px; --drop: 16px; }
.org-level { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: var(--gap); padding-top: calc(var(--drop) * 2); }
/* A branch: the Setiausaha with the Penolong Setiausaha hanging directly beneath it. */
.org-stack { position: relative; flex: 0 1 180px; min-width: 0; display: grid; gap: var(--drop); }
.org-level:first-child { padding-top: 0; }
.org-level:not(:first-child)::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid var(--wire); }
.org-level:last-child::before { bottom: auto; height: calc(var(--drop) * 2); }
.org-level.is-row:last-child::before { height: var(--drop); }.org-node {
  position: relative; z-index: 1; flex: 0 1 180px; min-width: 0;
  background: var(--surface); border-top: 4px solid var(--blue); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 16px 12px; text-align: center; display: grid; justify-items: center; align-content: start; gap: 8px;
}
.org-node.is-head { flex-basis: 230px; border-top-color: var(--red); }
.org-level:not(:first-child) .org-node::before { content: ""; position: absolute; top: calc(-1 * var(--drop) - 4px); left: 50%; height: var(--drop); border-left: 2px solid var(--wire); }
.org-level.is-row > .org-node::after, .org-level.is-row > .org-stack::after { content: ""; position: absolute; top: calc(-1 * var(--drop) - 4px); left: calc(var(--gap) / -2); right: calc(var(--gap) / -2); border-top: 2px solid var(--wire); }
.org-level.is-row > .org-stack::after { top: calc(-1 * var(--drop)); }
.org-level.is-row > :first-child::after { left: 50%; }
.org-level.is-row > :last-child::after { right: 50%; }
.org-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--blue-tint); color: var(--blue-deep); display: grid; place-items: center; font-weight: 800; font-size: var(--text-sm); }
.org-post { display: block; font-size: var(--text-xs); font-weight: 800; color: var(--red); line-height: 1.3; }
.org-node h3 { font-size: var(--text-sm); margin: 3px 0 0; line-height: 1.3; }
.org-node a { display: inline-block; padding: 4px 0; margin-top: 0; font-size: var(--text-sm); overflow-wrap: anywhere; }

/* Member list: one chart per division or state office. The Penyelaras heads it and
   members hang off a spine. Small units stack vertically; wide ones put the lead on the left. */
.person h5 { font-family: var(--display); font-weight: 750; color: var(--ink); }
.unit-section + .unit-section { margin-top: clamp(32px, 5vw, 48px); }
.unit-section-title { display: flex; align-items: center; gap: 12px; font-size: var(--text-lg); margin-bottom: 16px; }
.unit-section-title span { font-family: var(--sans); font-size: var(--text-sm); font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; }
.unit-section-title::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.unit { --tick: 24px; --mid: 34px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 16px; }
.unit.is-wide { grid-column: 1 / -1; }
.unit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.unit-head h4 { margin: 0; font-size: var(--text-md); }
.unit-count { font-size: var(--text-sm); font-weight: 700; color: var(--muted); white-space: nowrap; }
.unit .person { position: relative; box-shadow: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; grid-template-columns: 44px 1fr; gap: 12px; }
.unit .avatar { width: 44px; height: 44px; font-size: var(--text-sm); }
.unit-lead .person { background: var(--blue-tint); border-color: var(--blue-tint); }

.unit-tree { display: grid; gap: 16px; }
.unit-cols { display: grid; gap: 12px; }
.unit-col { position: relative; display: grid; gap: 12px; }
/* Lines, only when there is a lead to hang from. */
.has-lines .unit-cols { margin-left: var(--tick); }
.has-lines .unit-col { padding-left: var(--tick); }
.has-lines .unit-col::before { content: ""; position: absolute; left: 0; top: -16px; bottom: 0; border-left: 2px solid var(--wire); }
.has-lines .unit-col + .unit-col::before { top: -12px; }
.has-lines .unit-col .person::before { content: ""; position: absolute; left: calc(-1 * var(--tick) - 1px); top: var(--mid); width: var(--tick); border-top: 2px solid var(--wire); }
/* Stop the spine at the last branch by painting over the rest in the card colour. */
.has-lines .unit-col:last-child .person:last-child::after { content: ""; position: absolute; left: calc(-1 * var(--tick) - 2px); top: calc(var(--mid) + 2px); bottom: -2px; width: 4px; background: var(--surface); }

@media (min-width: 961px) {
  .unit.is-wide .unit-tree { grid-template-columns: minmax(0, 290px) minmax(0, 1fr); gap: 0 40px; align-items: start; }
  .unit.is-wide .unit-cols { position: relative; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px 24px; margin-left: 0; }
  .unit.is-wide .has-lines .unit-lead { position: relative; }
  .unit.is-wide .has-lines .unit-lead::after { content: ""; position: absolute; top: var(--mid); left: 100%; width: 40px; border-top: 2px solid var(--wire); }
  .unit.is-wide .has-lines .unit-cols::before { content: ""; position: absolute; top: var(--mid); left: 0; right: calc((100% - (var(--cols) - 1) * 24px) / var(--cols)); border-top: 2px solid var(--wire); }
  .unit.is-wide .has-lines .unit-col::before, .unit.is-wide .has-lines .unit-col + .unit-col::before { top: var(--mid); }
  .unit.is-wide .has-lines .unit-col .person:last-child::after { content: ""; position: absolute; left: calc(-1 * var(--tick) - 2px); top: calc(var(--mid) + 2px); bottom: -2px; width: 4px; background: var(--surface); }
}

/* Ahli AKRAB page: tabs, then a unit directory (sidebar on desktop, dropdown on phones). */
.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; }
.tabs-bar { position: relative; z-index: 2; margin-top: -28px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-lift); }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 20px; border-radius: 999px; font-weight: 750; text-decoration: none; color: var(--ink-soft); }
.tab:hover { background: var(--blue-tint); color: var(--blue-deep); }
.tab[aria-selected="true"] { background: var(--blue); color: var(--on-color); }
.tab-count { font-size: var(--text-xs); font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--blue-tint); color: var(--blue-deep); }
.tab[aria-selected="true"] .tab-count { background: rgba(255, 255, 255, .22); color: var(--on-color); }
/* Beats .section + .section: the second panel follows the first (hidden) one and must keep its gap. */
.section.tab-panel { padding-top: clamp(24px, 4vw, 40px); }

.directory { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(20px, 3vw, 32px); align-items: start; }
.dir-nav { position: sticky; top: 108px; display: grid; gap: 12px; padding: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); max-height: calc(100vh - 128px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.dir-nav .field input, .dir-nav .field select { width: 100%; min-width: 0; }
.dir-nav .dir-select { display: none; }
.dir-group { margin: 8px 8px 4px; font-size: var(--text-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dir-units ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dir-units a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; text-decoration: none; color: var(--ink-soft); font-size: var(--text-sm); font-weight: 650; line-height: 1.35; }
.dir-units a span { font-size: var(--text-xs); font-weight: 800; color: var(--muted); }
.dir-units a:hover { background: var(--blue-tint); color: var(--blue-deep); }
.dir-units a[aria-current="true"], .dir-units a[aria-current="true"] span { background: var(--blue); color: var(--on-color); }
.dir-main .result-count { margin-top: 4px; }
/* One unit at a time: let it use the full width. */
#member-list.is-single .unit { grid-column: 1 / -1; }
#member-list.is-single .unit-section-title span { display: none; }

/* Committee chart: state and agency reps as one compact group on the trunk. */
.org + .org-group { margin-top: 40px; }
.org-group { position: relative; z-index: 1; width: 100%; background: var(--surface); border-top: 4px solid var(--yellow); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.org-group-title { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: var(--text-md); margin: 0 0 12px; }
.org-group-title span { font-family: var(--sans); font-size: var(--text-xs); font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--yellow-tint); color: var(--accent-yellow); }
.org-reps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.org-rep { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.org-rep .org-avatar { width: 36px; height: 36px; font-size: var(--text-xs); }
.org-rep h4 { margin: 2px 0 0; font-size: var(--text-sm); line-height: 1.3; }

/* Member search */

.field { display: grid; gap: 8px; font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft); }
.field input, .field select {
  font: inherit; font-weight: 400; color: var(--ink); min-height: 48px; padding: 8px 16px; min-width: 260px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--paper);
}
.field input:focus, .field select:focus { background: var(--surface); border-color: var(--blue); }
.result-count { color: var(--muted); font-size: var(--text-base); font-weight: 650; margin: 0 0 16px; }
.empty { background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; color: var(--ink-soft); }

/* Content pages */

.page-head { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--blue-tint) 0%, var(--paper) 70%); padding: clamp(36px, 6vw, 64px) 0 clamp(28px, 4vw, 44px); }
.page-head::after { content: ""; position: absolute; width: 280px; height: 280px; right: -80px; top: -120px; border-radius: 50%; background: var(--yellow-tint); opacity: .8; }
.page-head .wrap { position: relative; z-index: 1; }
.page-head h1 { margin: 0; }
.page-head .lede { color: var(--ink-soft); font-size: var(--text-md); max-width: 40em; margin: 12px 0 0; }
.crumbs { font-size: var(--text-sm); font-weight: 650; margin-bottom: 12px; }
.crumbs a { color: var(--blue); text-decoration: none; }
.crumbs a::before { content: "← "; }

.with-side { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(28px, 5vw, 56px); align-items: start; }
.side-nav { position: sticky; top: 96px; background: var(--surface); border-radius: var(--radius); padding: 16px 12px; box-shadow: var(--shadow); }
.side-nav h2 { font-size: var(--text-sm); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; margin: 0 0 8px 12px; }
.side-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.side-nav a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-soft); font-weight: 600; }
.side-nav a:hover { color: var(--blue-deep); background: var(--blue-tint); }
.side-nav a[aria-current="page"] { color: var(--on-color); background: var(--blue); }

.prose { max-width: 44em; background: var(--surface); border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin-top: 1.4em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.3em; color: var(--blue-deep); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--red); }
.prose blockquote { margin: 1.4em 0; padding: 16px 20px; border-left: 4px solid var(--yellow); background: var(--yellow-tint); border-radius: 0 12px 12px 0; font-family: var(--serif); font-style: italic; font-size: var(--text-md); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* Yearly reports (Aktiviti page): one card per PDF, above the page text. */
.reports { margin: 0 0 2em; padding-bottom: 2em; border-bottom: 1px solid var(--line); }
.prose .report-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.prose .report { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg, #fbf8f3); }
.report-icon { display: grid; place-items: center; gap: 2px; width: 56px; height: 64px; border-radius: 10px; background: var(--red-tint); color: var(--red-ink); font-size: var(--text-xs); font-weight: 800; letter-spacing: .06em; }
.report-year { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--blue-tint); color: var(--blue-deep); font-size: var(--text-xs); font-weight: 800; }
.prose .report h3 { margin: 6px 0 2px; font-size: var(--text-md); line-height: 1.3; color: var(--ink); }
.report-text p { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.prose .report-actions .btn { text-decoration: none; }
@media (max-width: 720px) {
  .prose .report { grid-template-columns: auto 1fr; }
  .report-actions { grid-column: 1 / -1; justify-content: stretch; }
  .report-actions .btn { flex: 1; justify-content: center; white-space: nowrap; padding-inline: 16px; }
}

.link-list { list-style: none; padding: 0; margin: 0; max-width: 46em; display: grid; gap: 12px; }
.link-list li { background: var(--surface); border-radius: var(--radius-sm); padding: 16px 20px; box-shadow: var(--shadow); }
.link-list a { font-weight: 750; font-size: var(--text-md); }
.link-list a::after { content: " ↗"; font-size: .9em; }
.link-list p { margin: 4px 0 0; color: var(--muted); font-size: var(--text-base); }

.pagination { margin-top: 32px; }
.pagination nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

/* Footer */

.site-footer { background: var(--ink); color: var(--footer-text); margin-top: clamp(16px, 3vw, 32px); padding: 48px 0 28px; font-size: var(--text-base); border-radius: 32px 32px 0 0; }
.site-footer a { color: var(--on-color); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h2 { color: var(--on-color); font-size: var(--text-md); margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
/* Taller hit areas: at least 24px tall to tap (WCAG 2.5.8). */
.site-footer li a, .footer-bottom a { display: inline-block; padding: 4px 0; }
.footer-bottom { border-top: 1px solid var(--footer-line); margin-top: 32px; padding-top: 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: var(--text-sm); }
.footer-bottom a { color: var(--footer-text); }

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: .06s; }
  .hero-copy > :nth-child(3) { animation-delay: .12s; }
  .hero-copy > :nth-child(4) { animation-delay: .18s; }
  .hero-copy > :nth-child(5) { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  /* Slow camera movement: odd photos zoom out, even photos zoom in with a slight drift. */
  .hero-slide.is-active img { animation: kenburns 9s ease-out both; }
  .hero-slide:nth-child(even).is-active img { animation-name: kenburns-in; }
  @keyframes kenburns { from { transform: scale(1.08); } to { transform: scale(1); } }
  @keyframes kenburns-in { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.08) translate(-1.5%, -1%); } }
  /* Caption eases in just after its photo. */
  .hero-slide.is-active figcaption { animation: caption-in .6s .5s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes caption-in { from { opacity: 0; transform: translateY(10px); } }
  /* The active dot fills over the 4 seconds until the next photo; frozen while paused. */
  .hero-dots button[aria-current="true"]::before { background: rgba(255, 255, 255, .35); }
  .hero-dots button[aria-current="true"]::after { animation: dot-fill 4s linear forwards; }
  .hero-controls.is-paused .hero-dots button[aria-current="true"]::after { animation-play-state: paused; }
  @keyframes dot-fill { from { width: 0; } to { width: 26px; } }

  /* Scroll reveal: site.js adds .reveal only to things below the fold, then .is-in as they arrive. */
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 70ms); }
  .reveal.is-in { opacity: 1; transform: none; }


  /* Small touches. */
  .quick svg { transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
  .quick a:hover svg { transform: translateY(-2px) rotate(-8deg) scale(1.08); }
  .btn:active, .slider-btn:active { transform: scale(.96); }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .quick a, .poster-card { transition: none; }
  .slider { scroll-behavior: auto; }
}

/* Responsive */

@media (max-width: 1239px) {
  /* The 68px logo plus the full menu at 18px need ~1240px; below that the menu opens from a button. */
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
    font: inherit; font-weight: 750; color: var(--blue-deep); background: var(--blue-tint); border: 0; border-radius: 999px; cursor: pointer;
  }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; box-shadow: var(--shadow-lift); }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a, .site-nav summary { padding: 12px 16px; }
  .site-nav details ul { position: static; box-shadow: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; margin: 0 0 8px 16px; padding: 0 0 0 8px; min-width: 0; }
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .slider { grid-auto-columns: calc((100% - 2 * 20px) / 3); }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .help, .split, .poster-full, .with-side, .footer-grid { grid-template-columns: 1fr; }
  .side-nav { position: static; }
}

@media (max-width: 720px) {
  /* Too narrow for rows: one spine down the left, a branch to each box. */
  .org { position: relative; margin-left: 8px; padding-left: 24px; display: grid; gap: 12px; }
  .org::before { content: ""; position: absolute; left: 0; top: 0; bottom: 34px; border-left: 2px solid var(--wire); }
  .org-level, .org-level.is-row { flex-direction: column; align-items: stretch; gap: 12px; padding-top: 0; }
  .org-level::before, .org-level.is-row > *::after { display: none; }
  .org-stack { flex-basis: auto; gap: 12px; }
  .org-node, .org-node.is-head { flex-basis: auto; grid-template-columns: 46px 1fr; justify-items: start; align-items: center; text-align: left; gap: 12px; }
  .org .org-level .org-node::before { content: ""; position: absolute; left: -24px; top: 50%; width: 24px; height: 0; border-left: 0; border-top: 2px solid var(--wire); }
}

@media (max-width: 560px) {
  .hero-slide::after { background: rgba(16, 24, 40, .7); }
  .hero.has-photos { padding-bottom: 132px; }
  .hero-slide figcaption { left: var(--gutter); right: auto; bottom: 72px; max-width: none; font-size: var(--text-xs); }
  body { font-size: var(--text-base); }
  .brand-text small { display: none; }
  .brand img { height: 52px; }
  .slider { grid-auto-columns: 72%; gap: 16px; }
  .quick { grid-template-columns: 1fr; }
  .quick a { grid-template-columns: 30px 1fr; column-gap: 16px; align-items: start; padding: 16px; }
  .quick svg { grid-row: span 2; margin: 2px 0 0; }
  .notice-list li { grid-template-columns: 1fr; gap: 8px; }
  .notice-list time { justify-self: start; }
  .field, .field input, .field select { width: 100%; min-width: 0; }
  .person { grid-template-columns: 52px 1fr; }
  .avatar { width: 52px; height: 52px; font-size: var(--text-base); }
  .site-footer { border-radius: 24px 24px 0 0; }
}

@media (max-width: 960px) {
  .directory { grid-template-columns: 1fr; }
  .dir-nav { position: static; max-height: none; overflow: visible; }
  .dir-units { display: none; }
  .dir-nav .dir-select { display: grid; }
  .tabs { display: flex; width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 8px 12px; }
}

@media (max-width: 720px) {
  .org .org-group::before { content: ""; position: absolute; left: -24px; top: 28px; width: 24px; border-top: 2px solid var(--wire); }
  .org-group-title { justify-content: flex-start; }
}

@media print {
  .site-header, .site-footer, .nav-toggle, .pager { display: none; }
  body { background: var(--surface); }
  .prose, .person { box-shadow: none; }
}
