/*
  Amanat Baghdad — shared base for every page type

  Color
  Green #1b6435 is the primary, used as lines, text and outlines, never as a fill.
  Teal #1484a9 (the seal's ring) is a quiet second accent for water and walking.

  Image ratios
  Hero band  3:1 (16:9 on phones, capped at 26rem tall)
  All other photos  3:2

  Type roles
  Kufi   — the institution: wordmark and headings
  Naskh  — the city's story voice: The City only
  Plex   — everything people read and use
*/

:root {
  --green: #1b6435;
  --green-deep: #0f3f21;
  --green-tint: #eef5f0;
  --teal: #1484a9;
  --teal-text: #10708f;
  --ink: #13201a;
  --muted: #5a665f;
  --line: #dde3df;
  --paper: #fbfaf6;
  --white: #ffffff;
  --soft: #f4f5f2;
  --ok: #2f7d4a;
  --amber: #a36a00;
  --focus: #ffbf47;
  --wrap: 74rem;
  --ratio-hero: 3 / 1;
  --ratio-photo: 3 / 2;
  --kufi: "Noto Kufi Arabic", "IBM Plex Sans Arabic", sans-serif;
  --naskh: "Noto Naskh Arabic", "IBM Plex Sans Arabic", serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 6rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.75 "IBM Plex Sans Arabic", system-ui, sans-serif;
}
a { color: var(--green); text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1rem; }

/* Skip link: above the top of the window until it has keyboard focus, then under the prototype bar */

.skip { position: absolute; top: var(--proto-h, 0px); inset-inline-start: 1rem; z-index: 1001; translate: 0 calc(-100% - var(--proto-h, 0px)); background: var(--white); color: var(--green); font-weight: 600; padding: 0.5rem 1rem; border: 2px solid var(--green); border-top: 0; border-radius: 0 0 3px 3px; }
.skip:focus { translate: 0 0; }
h1, h2, h3 { font-family: var(--kufi); line-height: 1.4; margin: 0; }
figure { margin: 0; }
figcaption { font-size: 0.6875rem; color: var(--muted); margin-top: 0.3rem; }
.note { font-size: 0.8125rem; color: var(--muted); margin: 0.75rem 0 0; }

/* Outline button: the green primary without fill */
.btn, .answer-action {
  display: inline-block;
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
  border-radius: 3px;
  padding: 0.4rem 1.1rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover, .answer-action:hover { background: var(--green-tint); color: var(--green-deep); }

/* Masthead: sticky white glass between two green lines */
.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,0.97);
  background: color-mix(in srgb, #fff 84%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  border-top: 4px solid var(--green);
  border-bottom: 1px solid var(--green);
}
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 0.7rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.85rem; color: var(--ink); text-decoration: none; }
.brand img { width: 56px; height: 56px; }
.brand strong { display: block; font-family: var(--kufi); font-size: 1.5rem; font-weight: 800; line-height: 1.2; color: var(--green); }
.brand span { display: block; font-size: 0.75rem; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; font-weight: 500; }
.nav a { color: var(--ink); text-decoration: none; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { border-color: var(--green); }

/* Dropdown: the parent stays a link to its index; its children open on hover or keyboard focus.
   Nav items fill the masthead row, so the panel hangs from the masthead's green line,
   its text aligned with the label above. */

.nav { align-self: stretch; align-items: stretch; }
.nav > li { display: flex; align-items: center; }
.nav .has-sub { position: relative; }
.nav .has-sub > a::after { content: ""; display: inline-block; width: 0.35rem; height: 0.35rem; margin-inline-start: 0.45rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; rotate: 45deg; vertical-align: 0.25em; opacity: 0.6; }
.nav .sub { display: none; position: absolute; top: calc(100% + 0.7rem + 1px); inset-inline-start: -1.25rem; z-index: 20; min-width: 15rem; margin: 0; padding: 0.5rem 0; list-style: none; background: var(--white); border: 1px solid var(--line); border-top: 0; box-shadow: 0 10px 24px rgba(15,63,33,0.08); font-weight: 400; }
.nav .sub::before { content: ""; position: absolute; inset-inline: 0; bottom: 100%; height: calc(0.7rem + 1px); }
.nav .has-sub:hover > .sub, .nav .has-sub:focus-within > .sub { display: block; }
.nav .sub a { display: block; padding: 0.4rem 1.25rem; border: 0; }
.nav .sub a:hover { background: var(--green-tint); color: var(--green-deep); }
.nav .sub a[aria-current] { color: var(--green); font-weight: 600; }

/* Language links: stacked at the end, in grey, behind a thin rule, centred on the nav labels */
.nav .lang { display: flex; flex-direction: column; align-items: flex-start; align-self: center; padding-inline-start: 1.25rem; border-inline-start: 1px solid var(--line); line-height: 1.45; }
.nav .lang a { font-size: 0.8125rem; color: var(--muted); padding-block: 0; border-bottom: 0; }
.nav .lang a:hover { text-decoration: underline; }

/* Menu: the plain nav on desktop; on phones a popover sheet behind a button */
.menu { display: contents; }
.menu-btn, .menu-close { display: none; }

/* Sections */
section.block { padding-block: 3rem; }
.ruled { border-top: 1px solid var(--line); }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.block-head h2 { font-size: 1.6rem; font-weight: 700; }
.block-head h2::after { content: ""; display: block; width: 2.5rem; height: 4px; background: var(--green); margin-top: 0.4rem; }
.block-head p { margin: 0; color: var(--muted); }

/* Status dots */
.status { white-space: nowrap; font-weight: 600; }
.status::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; margin-inline-end: 0.4rem; background: currentColor; vertical-align: 0.1em; }
.status.ok { color: var(--ok); }
.status.plan { color: var(--amber); }
.status.walk { color: var(--teal-text); }
.status.stall { color: var(--muted); }

/* Footer: soft, framed by a green line */
footer { background: var(--soft); border-top: 4px solid var(--green); padding-block: 2.5rem 1.5rem; font-size: 0.9375rem; }
.foot { display: grid; grid-template-columns: 1.3fr; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1.5rem; }
.foot-brand { display: flex; gap: 0.75rem; align-items: center; align-self: start; font-family: var(--kufi); font-size: 1.125rem; font-weight: 700; color: var(--green); }
.foot-brand img { width: 44px; height: 44px; }
.foot h2 { font-family: inherit; font-size: 0.875rem; font-weight: 600; color: var(--muted); margin-bottom: 0.5rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { padding-block: 0.15rem; }
.foot a { color: var(--ink); }
.fine { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; color: var(--muted); font-size: 0.8125rem; }
.fine p { margin: 0.25rem 0; }
.fine .hotline { color: var(--ink); font-size: 0.9375rem; }

/* Hotline and social icons share one row */

.fine .hotline:has(> .social) { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1.5rem; }
.social { display: flex; gap: 1.1rem; }
.social a { display: inline-flex; color: var(--ink); }
.social a:hover { color: var(--green); }
.social svg { width: 1.3rem; height: 1.3rem; }

@media (max-width: 860px) {
  :root { --ratio-hero: 16 / 9; }
  html { scroll-padding-top: 0; }
  .masthead { position: static; background: #fff; }
  .foot { grid-template-columns: 1fr 1fr; grid-auto-flow: row; }
  .brand img { width: 48px; height: 48px; }

  .menu-btn, .menu-close { display: flex; align-items: center; gap: 0.5rem; font: inherit; font-weight: 600; color: var(--green); background: none; border: 1.5px solid var(--green); border-radius: 3px; padding: 0.3rem 0.8rem; cursor: pointer; }
  .menu-btn::before { content: ""; width: 1rem; height: 2px; background: currentColor; box-shadow: 0 -5px currentColor, 0 5px currentColor; }
  .menu-close { margin-inline-start: auto; }
  .menu-close::before { content: "×"; font-size: 1.4rem; line-height: 1; }
  .menu { inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; border: 0; border-top: 4px solid var(--green); padding: 1.05rem 1rem 2rem; background: var(--white); color: var(--ink); overflow-y: auto; }
  .menu:not(:popover-open) { display: none; }
  .menu:popover-open { display: block; }

  /* The sheet fades in while it settles down a little; closing runs the same way back */
  .menu {
    opacity: 0;
    translate: 0 -0.75rem;
    transition: opacity 0.18s ease-in, translate 0.18s ease-in, display 0.18s allow-discrete, overlay 0.18s allow-discrete;
  }
  .menu:popover-open {
    opacity: 1;
    translate: 0 0;
    transition-duration: 0.26s;
    transition-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  @starting-style {
    .menu:popover-open { opacity: 0; translate: 0 -0.75rem; }
  }
  @media (prefers-reduced-motion: reduce) {
    .menu, .menu:popover-open { translate: none; }
  }
  .menu .nav { flex-direction: column; align-items: stretch; gap: 0; margin-top: 1.25rem; font-size: 1.125rem; }
  .menu .nav > li:not(.lang) { display: block; }
  .menu .nav > li > a { display: block; padding-block: 0.6rem; border: 0; }
  .menu .nav a[aria-current] { color: var(--green); font-weight: 700; }

  /* In the sheet, children always show, indented under their parent */
  .menu .nav .has-sub > a::after { display: none; }
  .menu .nav .sub { display: block; position: static; min-width: 0; padding: 0 0 0.5rem; border: 0; border-inline-start: 2px solid var(--line); margin-inline-start: 0.15rem; box-shadow: none; background: none; font-size: 0.9375rem; }
  .menu .nav .sub a { padding: 0.3rem 0.9rem; }
  .menu .nav .sub a[aria-current] { font-weight: 700; }
  .menu .nav .lang { align-self: stretch; gap: 0.5rem; margin-top: 1rem; padding: 1.25rem 0 0; border-inline-start: 0; border-top: 1px solid var(--line); }
  .menu .nav .lang a { font-size: 0.9375rem; padding: 0; }
}

/* Narrow phones: the menu button shows only its icon so the name and button share one row */

@media (max-width: 480px) {
  .masthead .wrap { gap: 0.75rem; }
  .masthead .brand strong { font-size: 1.25rem; }
  .menu-btn { font-size: 0; gap: 0; padding: 0.75rem 0.55rem; }
}

