/* HOST Health · Relay identity
   Colours and type follow hosthealth-ai/brand.css. Arabic is the default reading direction,
   so every layout rule uses logical properties and mirrors on its own for English. */

:root {
  --navy: #183C87;
  --teal: #158F88;
  --sky: #EDF3FC;
  --ink: #12284A;
  --white: #FFFFFF;

  --navy-deep: #102B60;   /* footer field */
  --night: #081428;       /* behind the film while a scene turns */
  --teal-ink: #0A6661;    /* teal for small text on light fields: 6:1 on sky */
  --mint: #8FE1D0;        /* teal tint for the dark film field */
  --mint-soft: #BDEBE0;
  --mist: #C6D5EC;        /* secondary text on dark */
  --slate: #44587A;       /* secondary text on light */
  --line: #D2DDEC;
  --edge: #B4C5DA;

  --font-latin: 'Host Sans', 'Segoe UI', system-ui, Arial, sans-serif;
  --font-arabic: 'Host Arabic', 'Host Sans', 'Segoe UI', Tahoma, Arial, sans-serif;

  --measure: 1320px;
  --gutter: clamp(18px, 4.6vw, 72px);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-block-start: 20px;
}

body {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
  min-block-size: 100svh;
  margin: 0;
  font: 400 1.0625rem/1.6 var(--font-latin);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
html[lang=ar] body { font-family: var(--font-arabic); line-height: 1.8; }
main { flex: 1; }

/* Links within a page glide; arriving from another page at "#services" jumps straight there.
   site.js adds the class once the page has loaded. */
html.smooth-scroll { scroll-behavior: smooth; }

/* Both languages are in the page; only the one matching <html lang> is shown. */
html[lang=en] span[lang=ar], html[lang=ar] span[lang=en] { display: none; }

h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { color: var(--navy); font-weight: 500; line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
html[lang=ar] :is(h1, h2, h3) { font-weight: 600; line-height: 1.35; letter-spacing: 0; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { margin: 0; font: inherit; color: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: manipulation; }
img, video, canvas { display: block; }
b { font-weight: 600; }

:focus-visible { outline: 3px solid var(--teal-ink); outline-offset: 3px; }
:is(.cinema, .site-footer) :focus-visible { outline-color: var(--mint); }

.wrap { inline-size: min(var(--measure), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sprite { position: absolute; overflow: hidden; pointer-events: none; }
.icon { flex: none; inline-size: 20px; block-size: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
html[dir=rtl] .directional, html[dir=ltr] .directional.reverse { transform: scaleX(-1); }
html[dir=rtl] .directional.reverse { transform: none; }

.skip {
  position: absolute; z-index: 20; inset-block-start: 0; inset-inline-start: 0;
  padding: 12px 20px; border-end-end-radius: 12px;
  background: var(--white); color: var(--navy); font-weight: 500;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* ---------- Masthead ---------- */
.masthead { position: relative; z-index: 5; background: var(--white); border-block-end: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-block-size: clamp(60px, 6vw, 76px); }
.brand { display: flex; align-items: center; min-block-size: 44px; border-radius: 6px; }
.brand img { inline-size: clamp(138px, 14vw, 196px); block-size: auto; }
.site-nav { display: flex; align-items: center; gap: clamp(6px, 2vw, 28px); }
.site-nav-link {
  display: inline-flex; align-items: center; min-block-size: 44px; padding-inline: 8px; border-radius: 8px;
  color: var(--navy); font-size: .9375rem; font-weight: 500;
  text-decoration: underline transparent 2px; text-underline-offset: 7px; transition: text-decoration-color .15s;
}
.site-nav-link:hover { text-decoration-color: var(--teal); }
.language {
  display: inline-flex; align-items: center; gap: 8px; min-block-size: 44px; padding: 0 16px;
  border: 1px solid var(--edge); border-radius: 999px; background: var(--white); color: var(--navy);
  font: 500 .9375rem/1.2 var(--font-latin); transition: background-color .15s, border-color .15s;
}
.language[lang=ar] { font-family: var(--font-arabic); }
.language:hover { background: var(--sky); border-color: var(--navy); }
.language .icon { inline-size: 18px; block-size: 18px; }

/* ---------- Homepage film ---------- */
.cinema {
  color: var(--white);
  background: radial-gradient(120% 130% at 50% -35%, #1E427C 0%, var(--ink) 60%) var(--ink);
  padding-block: clamp(16px, 2.6vw, 40px) clamp(26px, 3.4vw, 52px);
}
.cinema-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "reel" "caption";
  row-gap: clamp(14px, 2.2vw, 24px);
}
.cinema-intro { grid-area: intro; display: grid; gap: 2px; }
.cinema h1 { color: var(--white); font-size: clamp(2.125rem, 1.25rem + 4.3vw, 4.625rem); }
.cinema h1 em { color: var(--mint); font-style: normal; }
.slogan { max-inline-size: 30ch; color: var(--mist); font-size: clamp(1rem, .92rem + .42vw, 1.3125rem); }

/* From tablet width up the film never grows taller than the window allows, so its controls
   and caption stay in view with it (--reel-size is set in the media queries below). */
.reel { grid-area: reel; justify-self: center; min-inline-size: 0; inline-size: var(--reel-size, 100%); }
.reel-screen {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  border-radius: clamp(12px, 1.6vw, 22px); background: var(--night);
  box-shadow: 0 26px 54px -30px #000C;
}
.reel-screen.is-interactive { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.reel-stage, .reel-face, .reel-out { position: absolute; inset: 0; }
.reel-face, .reel-out { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.reel-face > video, .reel-still, .reel-out > canvas { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.reel-out { z-index: 2; }
.reel-out[hidden] { display: none; }
.reel-shade { position: absolute; inset: 0; background: #040B18; opacity: 0; pointer-events: none; }
.reel-still { transition: opacity .4s ease; }
.reel[data-media=video] .reel-still { opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s .4s; }

/* Shown until the film first plays (autoplay blocked, reduced motion, data saver) and if it
   fails. It sits in the lower start corner, below every face in the six scenes. */
.reel-cue {
  position: absolute; z-index: 3; inset-inline-start: clamp(12px, 2vw, 22px); inset-block-end: clamp(12px, 2vw, 22px);
  display: grid; place-items: center; inline-size: 56px; block-size: 56px; border-radius: 50%;
  background: #FFFFFFF2; color: var(--navy); box-shadow: 0 8px 22px #0007;
  opacity: 0; transform: scale(.86); transition: opacity .2s ease, transform .25s var(--ease-out); pointer-events: none;
}
.reel-cue .icon { inline-size: 24px; block-size: 24px; }
.reel[data-media=still]:is([data-state=paused], [data-state=error]) .reel-cue { opacity: 1; transform: none; }

.reel-bar { display: flex; align-items: stretch; gap: clamp(8px, 1.2vw, 16px); margin-block-start: clamp(8px, 1vw, 14px); }
.reel-toggle {
  flex: none; display: grid; place-items: center; inline-size: 48px; block-size: 48px; padding: 0;
  border: 1px solid #FFFFFF57; border-radius: 50%; background: #FFFFFF14; color: var(--white);
  transition: background-color .15s, border-color .15s;
}
.reel-toggle:hover { background: #FFFFFF2B; border-color: #FFFFFFA6; }
.when-playing, .when-error { display: none; }
[data-state=playing] .when-playing, [data-state=error] .when-error { display: block; }
[data-state=playing] .when-paused, [data-state=error] .when-paused { display: none; }

.chapter-rail { flex: 1; min-inline-size: 0; container: chapters / inline-size; }
.chapters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(4px, .7vw, 10px); block-size: 100%; }
.chapter {
  display: grid; align-content: center; gap: 9px; inline-size: 100%; min-block-size: 48px; padding: 0;
  border: 0; border-radius: 6px; background: none; color: var(--mist); text-align: start;
  transition: color .15s;
}
.chapter-meter { display: block; block-size: 4px; overflow: hidden; border-radius: 4px; background: #FFFFFF38; transition: background-color .15s; }
.chapter-meter > i { display: block; block-size: 100%; border-radius: inherit; background: var(--mint); transform: scaleX(var(--fill, 0)); transform-origin: 0 50%; }
html[dir=rtl] .chapter-meter > i { transform-origin: 100% 50%; }
.chapter[data-seen] .chapter-meter > i { opacity: .5; }
.chapter-label { display: none; font-size: .8125rem; font-weight: 500; line-height: 1.4; text-wrap: balance; }
.chapter:hover, .chapter[aria-current=true] { color: var(--white); }
.chapter:hover .chapter-meter { background: #FFFFFF73; }
.chapter[aria-current=true] .chapter-meter { box-shadow: 0 0 0 1px #FFFFFF38; }

.reel-caption { grid-area: caption; display: grid; align-content: start; gap: 10px; min-inline-size: 0; }
.scene-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; color: var(--mist); font-size: .8125rem; }
.scene-count { display: inline-flex; align-items: center; gap: 10px; color: var(--mint); font-weight: 500; }
.scene-count::before { content: ''; inline-size: 22px; block-size: 2px; border-radius: 2px; background: currentColor; }
.scene-count b { color: var(--white); font-variant-numeric: tabular-nums; }
.scene-stack { display: grid; }
.scene, .scene[hidden] { grid-area: 1 / 1; display: grid; justify-items: start; align-content: start; gap: 8px; }
.scene {
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s ease, transform .5s var(--ease-out), visibility 0s .25s;
}
.scene.is-current {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .45s ease .14s, transform .65s var(--ease-out) .14s, visibility 0s;
}
.scene h2 { color: var(--white); font-size: clamp(1.625rem, 1.15rem + 1.75vw, 2.625rem); }
.scene p { max-inline-size: 34ch; color: #DDE8F6; font-size: clamp(1rem, .95rem + .3vw, 1.1875rem); }
.scene-link {
  display: inline-flex; align-items: center; gap: 10px; min-block-size: 48px; margin-block-start: 8px; padding: 10px 20px;
  border-radius: 999px; background: var(--mint-soft); color: var(--ink);
  font-size: .9375rem; font-weight: 600; line-height: 1.3; transition: background-color .15s;
}
.scene-link:hover { background: var(--white); }
.scene-link .icon { inline-size: 18px; block-size: 18px; transition: translate .2s var(--ease-out); }
.scene-link:hover .icon { translate: 3px 0; }
html[dir=rtl] .scene-link:hover .icon { translate: -3px 0; }
.reel-status, .reel-noscript { justify-self: start; padding: 8px 12px; border-radius: 10px; background: #FFFFFF1C; color: var(--white); font-size: .875rem; }
.reel-status:empty { display: none; }

@media (max-width: 599.98px) {
  /* On phones the picture runs edge to edge. */
  .reel-screen { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; box-shadow: none; }
  .scene-link { min-block-size: 50px; }
}
@media (min-width: 600px) {
  /* Stacked layout on tablets: headline, film and caption share one centred column, and in a
     short window the film gives up height so its controls stay in view. */
  .cinema-grid { --reel-size: min(100%, max(520px, (100svh - 330px) * 16 / 9)); }
  .cinema-intro, .reel-caption { justify-self: center; inline-size: var(--reel-size, 100%); }
  .cinema-intro { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 32px; }
}
@media (min-width: 700px) {
  /* The scene link sits beside its title and line. */
  .scene, .scene[hidden] { grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; row-gap: 4px; }
  .scene h2, .scene p { grid-column: 1; }
  .scene-link { grid-column: 2; grid-row: 1 / span 2; align-self: end; margin-block-start: 0; }
}
/* Scene names appear under the bars only when each has room for its name. */
@container chapters (min-width: 600px) {
  .chapter { align-content: start; padding-block: 12px 2px; }
  .chapter-label { display: block; }
}
/* Side by side on desktops, and on landscape tablets and small windows, where height is scarce. */
@media (min-width: 1100px), (min-width: 880px) and (min-aspect-ratio: 5/4) {
  .cinema-grid {
    --reel-size: min(100%, max(520px, (100svh - 236px) * 16 / 9));
    grid-template-columns: minmax(0, .5fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: "intro reel" "caption reel"; column-gap: clamp(32px, 4.6vw, 76px); row-gap: 24px;
  }
  .cinema-intro, .reel-caption { justify-self: stretch; inline-size: auto; }
  .cinema-intro { display: grid; gap: 14px; padding-block-start: 4px; }
  .cinema h1 { font-size: clamp(2.5rem, 5.1vw, 4.625rem); }
  .cinema h1 em { display: block; }
  .reel { justify-self: end; align-self: center; }
  .reel-caption { align-self: end; padding-block-end: 4px; }
  .scene, .scene[hidden] { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .scene-link { grid-column: 1; grid-row: auto; align-self: auto; margin-block-start: 8px; }
}

/* ---------- Service directory and cards ---------- */
.directory { background: var(--sky); padding-block: clamp(40px, 5.4vw, 84px) clamp(48px, 6vw, 96px); }
.directory h2 { font-size: clamp(1.875rem, 1.4rem + 2vw, 3rem); }
.directory-groups { display: grid; gap: clamp(26px, 3vw, 40px); margin-block-start: clamp(18px, 2.4vw, 32px); }
.directory-group h3 {
  display: flex; align-items: center; gap: 10px; margin-block-end: 12px;
  color: var(--teal-ink); font-size: 1rem; font-weight: 600; letter-spacing: 0; line-height: 1.5;
}
.directory-group h3::before { content: ''; inline-size: 22px; block-size: 3px; border-radius: 3px; background: var(--teal); }

.service-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.service-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  block-size: 100%; min-block-size: 96px; padding: 10px; padding-inline-end: 16px;
  border-radius: 18px; background: var(--white);
  box-shadow: 0 1px 0 #183C8714, 0 12px 26px -22px #12284A80;
  transition: box-shadow .2s ease, transform .2s var(--ease-out);
}
.service-thumb { inline-size: clamp(88px, 24vw, 116px); block-size: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #D7E3EC; }
/* A service with no photograph shows the brand mark in the picture's place. */
.service-thumb--mark { display: grid; place-items: center; background: var(--sky); }
.service-thumb--mark svg { inline-size: 46%; block-size: auto; aspect-ratio: 193 / 165; }
.related .service-thumb--mark { background: var(--white); }
.service-card-text { display: grid; gap: 2px; min-inline-size: 0; }
.service-card-title { color: var(--navy); font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); font-weight: 600; line-height: 1.35; transition: color .15s; }
.service-card-line { color: var(--slate); font-size: .9375rem; line-height: 1.5; }
html[lang=ar] .service-card-title { line-height: 1.55; }
html[lang=ar] .service-card-line { line-height: 1.7; }
.service-card-arrow { color: var(--teal-ink); transition: translate .2s var(--ease-out); }
@media (hover: hover) {
  .service-card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 #183C8714, 0 20px 32px -20px #12284A8C; }
  .service-card:hover .service-card-title { color: var(--teal-ink); }
  .service-card:hover .service-card-arrow { translate: 4px 0; }
  html[dir=rtl] .service-card:hover .service-card-arrow { translate: -4px 0; }
}
.service-card:active { transform: scale(.99); }
@media (min-width: 700px) {
  .service-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (min-width: 1100px) {
  /* Family services two abreast beside one column of workplace services. */
  .directory-groups { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); column-gap: 40px; }
  .directory-group--team .service-cards { grid-template-columns: minmax(0, 1fr); }
  .directory-group .service-cards { align-content: start; }
  /* The groups share one set of rows, so their cards line up across the gap although one group
     has more rows than the other. build.mjs sets --card-rows to the longer group's count. */
  @supports (grid-template-rows: subgrid) {
    .directory-groups { grid-template-rows: auto repeat(var(--card-rows, 3), auto); row-gap: 14px; }
    .directory-group { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; }
    .directory-group h3 { margin-block-end: 0; }
    .directory-group .service-cards { grid-row: 2 / -1; grid-template-rows: subgrid; }
  }
}

/* ---------- Service page ---------- */
.service { background: var(--sky); border-block-end: 1px solid var(--line); }
.service-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "clip" "body";
  gap: 16px; padding-block: clamp(10px, 2.4vw, 30px) clamp(32px, 5vw, 80px);
}
.service-head { grid-area: head; display: grid; justify-items: start; gap: 2px; }
.return-link {
  display: inline-flex; align-items: center; gap: 8px; min-block-size: 44px;
  color: var(--teal-ink); font-size: .9375rem; font-weight: 600; text-underline-offset: 5px;
}
.return-link .icon { inline-size: 18px; block-size: 18px; }
.return-link:hover, .all-link:hover, .footer-link:hover { text-decoration: underline; }
.service-group { display: flex; align-items: center; gap: 10px; margin-block-start: 6px; color: var(--teal-ink); font-size: .9375rem; font-weight: 600; }
.service-group::before { content: ''; inline-size: 22px; block-size: 3px; border-radius: 3px; background: var(--teal); }
.service h1 { font-size: clamp(2.25rem, 1.5rem + 3.4vw, 4.375rem); }

.clip { grid-area: clip; min-inline-size: 0; }
.clip-screen {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  border-radius: clamp(12px, 1.6vw, 22px); background: #D7E3EC; box-shadow: 0 26px 46px -32px #12284AB3;
}
.clip-screen.is-interactive { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.clip-screen video, .clip-fallback, .clip-photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.clip-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-block-start: 10px; padding-block-end: 12px; color: var(--slate); font-size: .875rem; }
.clip-toggle {
  flex: none; display: grid; place-items: center; inline-size: 46px; block-size: 46px; padding: 0;
  border: 1px solid var(--edge); border-radius: 50%; background: var(--white); color: var(--navy);
  transition: background-color .15s, border-color .15s;
}
.clip-toggle:hover { border-color: var(--navy); }
.clip-text { display: grid; min-inline-size: 0; line-height: 1.5; }
.clip-caption { color: var(--ink); font-weight: 500; }
.clip-length { font-size: .8125rem; }
@media (min-width: 600px) {
  .clip-text { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
  .clip-length { display: inline-flex; align-items: center; gap: 12px; font-size: inherit; }
  .clip-length::before { content: ''; inline-size: 18px; block-size: 1px; background: currentColor; opacity: .55; }
}
.clip-meter { position: absolute; inset-inline: 0; inset-block-end: 0; block-size: 3px; overflow: hidden; border-radius: 3px; background: #C9D7E8; }
.clip-meter > i { display: block; block-size: 100%; background: var(--teal); transform: scaleX(var(--fill, 0)); transform-origin: 0 50%; }
html[dir=rtl] .clip-meter > i { transform-origin: 100% 50%; }
.clip-status { flex-basis: 100%; color: var(--ink); font-weight: 500; }
.clip-status:empty { display: none; }

.service-body { grid-area: body; display: grid; justify-items: start; gap: 14px; }
.service-body p { max-inline-size: 44ch; font-size: clamp(1.0625rem, 1rem + .5vw, 1.375rem); }
.guide-link {
  display: inline-flex; align-items: center; gap: 10px; min-block-size: 48px; margin-block-start: 6px; padding-inline: 18px;
  border: 1px solid #9BACC5; border-radius: 999px; color: var(--navy); font-size: .9375rem; font-weight: 500;
  transition: background-color .15s, border-color .15s;
}
.guide-link:hover { background: var(--white); border-color: var(--navy); }
.guide-link .icon { color: var(--teal-ink); }
.service-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; margin-block-start: 6px; }
.service-actions .guide-link { margin-block-start: 0; }
.more-link { display: inline-flex; align-items: center; gap: 8px; min-block-size: 48px; color: var(--navy); font-size: .9375rem; font-weight: 600; text-underline-offset: 5px; }
.more-link .icon { inline-size: 18px; block-size: 18px; color: var(--teal-ink); transition: translate .2s var(--ease-out); }
.more-link:hover { text-decoration: underline; }
@media (hover: hover) { .more-link:hover .icon { translate: 0 3px; } }

@media (min-width: 900px) {
  .service-grid {
    grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); grid-template-areas: "head clip" "body clip";
    column-gap: clamp(32px, 5vw, 84px); row-gap: 18px;
  }
  .service-head { align-self: end; }
  .service-body { align-self: start; }
  .clip { align-self: center; }
}

/* A service without a film: the heading runs across the page and the description takes the content
   column of the sections below it. */
.service--text .service-grid { grid-template-areas: "head" "body"; }
@media (min-width: 900px) {
  .service--text .service-grid { grid-template-columns: minmax(0, .5fr) minmax(0, 1fr); grid-template-areas: "head head" ". body"; column-gap: 40px; }
}

/* ---------- Service details ----------
   Each section sets its heading beside its content on wide screens, in the same two columns as
   "Related care" below, so the headings read down one edge of the page. The lists inside arrange
   themselves by the width of their own column (the "detail" container), not of the window. */
.detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 40px; padding-block: clamp(30px, 4.2vw, 60px); border-block-end: 1px solid var(--line); }
.detail h2, .related h2 { font-size: clamp(1.5rem, 1.18rem + 1.4vw, 2.25rem); }
.detail h3 { color: var(--navy); font-size: 1.125rem; font-weight: 600; letter-spacing: 0; line-height: 1.4; text-wrap: pretty; }
html[lang=ar] .detail h3 { line-height: 1.6; }
.detail-body { display: grid; gap: 22px; min-inline-size: 0; container: detail / inline-size; }
.detail-intro { max-inline-size: 62ch; font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); }
@media (min-width: 900px) {
  .detail { grid-template-columns: minmax(0, .5fr) minmax(0, 1fr); align-items: start; }
}

/* A plain list, or labelled entries with the label beside its text. Every entry sits under a hairline. */
.points { display: grid; grid-template-columns: minmax(0, 1fr); }
.point { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 3px; padding-block: 14px; border-block-start: 1px solid var(--line); }
.point p { color: var(--slate); }
.points:not(.points--labelled) .point { position: relative; padding-inline-start: 34px; }
.points:not(.points--labelled) .point p { color: var(--ink); }
.points:not(.points--labelled) .point::before {
  content: ''; position: absolute; inset-inline-start: 0; inset-block-start: calc(14px + .8em - 1px);
  inline-size: 18px; block-size: 3px; border-radius: 3px; background: var(--teal);
}
html[lang=ar] .points:not(.points--labelled) .point::before { inset-block-start: calc(14px + .9em - 1px); }
@container detail (min-width: 520px) {
  .points--labelled .point { grid-template-columns: minmax(0, .42fr) minmax(0, 1fr); align-items: baseline; column-gap: clamp(18px, 2.4vw, 32px); }
}

/* A visit in order. The numeral comes from a counter, in Arabic-Indic digits for Arabic. */
.steps { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: clamp(20px, 2.6vw, 36px); counter-reset: step; }
.step {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: 16px; row-gap: 2px;
  padding-block: 14px; border-block-start: 1px solid var(--line); counter-increment: step;
}
.step::before {
  content: counter(step); grid-row: 1 / span 2; min-inline-size: 1.4ch;
  color: var(--teal-ink); font: 500 2.125rem/1.15 var(--font-latin); font-variant-numeric: tabular-nums;
}
html[lang=ar] .step::before { content: counter(step, arabic-indic); font-family: var(--font-arabic); line-height: 1.3; }
.step h3, .step p { grid-column: 2; }
.step p { color: var(--slate); }
@container detail (min-width: 620px) {
  .steps { row-gap: 14px; }
  .steps--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { grid-template-columns: minmax(0, 1fr); row-gap: 4px; padding-block-start: 16px; border-block-start: 3px solid var(--teal); }
  .step::before { grid-row: auto; margin-block-end: 4px; }
  .step h3, .step p { grid-column: 1; }
}
@container detail (min-width: 800px) {
  .steps--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Plain paragraphs. */
.prose { display: grid; gap: 12px; max-inline-size: 62ch; font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); }

/* Short remarks. Emergency advice is set apart on navy. */
.notes { display: grid; gap: 10px; }
.note { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 14px 18px; border-radius: 16px; background: var(--sky); }
.note .icon { inline-size: 22px; block-size: 22px; margin-block-start: .2em; color: var(--teal-ink); }
html[lang=ar] .note .icon { margin-block-start: .35em; }
.note-text { display: grid; justify-items: start; gap: 2px; }
.note-link { display: inline-flex; align-items: center; gap: 8px; min-block-size: 44px; color: var(--navy); font-weight: 600; text-underline-offset: 5px; }
.note-link .icon { inline-size: 18px; block-size: 18px; margin: 0; }
.note-link:hover { text-decoration: underline; }
.note--urgent { background: var(--navy); color: var(--white); font-weight: 500; }
.note--urgent .icon { color: var(--mint); }

.related { padding-block: clamp(36px, 5vw, 76px); }
.related-inner { display: grid; gap: 18px 40px; }
.related-list { display: grid; justify-items: start; gap: 14px; }
/* Two abreast only where each card keeps room for its text. */
.related-list .service-cards { inline-size: 100%; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.related .service-card { background: var(--sky); box-shadow: none; }
.all-link { display: inline-flex; align-items: center; gap: 8px; min-block-size: 44px; color: var(--navy); font-weight: 600; text-underline-offset: 5px; }
.all-link .icon { inline-size: 18px; block-size: 18px; color: var(--teal-ink); }
@media (min-width: 900px) {
  .related-inner { grid-template-columns: minmax(0, .5fr) minmax(0, 1fr); align-items: start; }
}

/* ---------- Missing page ---------- */
.page-missing main { display: grid; background: var(--sky); }
.missing { align-self: center; padding-block: clamp(56px, 10vw, 140px); }
.missing .wrap { display: grid; justify-items: start; gap: 12px; }
.missing h1 { font-size: clamp(2.25rem, 1.5rem + 3.4vw, 4rem); }
.missing .scene-link { background: var(--navy); color: var(--white); }
.missing .scene-link:hover { background: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: var(--white); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; padding-block: clamp(24px, 3vw, 38px); }
.footer-brand, .footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.footer-brand img { inline-size: 158px; block-size: auto; }
.footer-slogan, .footer-domain { color: #C8D6EF; font-size: .9375rem; }
.footer-domain { font-family: var(--font-latin); }
.footer-link { display: inline-flex; align-items: center; gap: 8px; min-block-size: 44px; font-size: .9375rem; font-weight: 500; text-underline-offset: 5px; }
.footer-link .icon { inline-size: 18px; block-size: 18px; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .clip-screen { view-transition-name: host-film; }
  ::view-transition-group(host-film) { animation-duration: .5s; animation-timing-function: cubic-bezier(.3, .7, .15, 1); }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

  .cinema-intro > *, .service-head > h1, .service-body > * { animation: rise .7s var(--ease-out) both; }
  .cinema-intro > :nth-child(2), .service-body > :nth-child(1) { animation-delay: .08s; }
  .service-body > :nth-child(n + 2) { animation-delay: .16s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  html, html.smooth-scroll { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation-duration: .01ms !important; animation-delay: 0s !important; }
}

@media (forced-colors: active) {
  .chapter-meter, .clip-meter { background: ButtonText; }
  .chapter-meter > i, .clip-meter > i { background: Highlight; }
  .chapter[aria-current=true] { outline: 2px solid Highlight; outline-offset: 2px; }
  .reel-toggle, .clip-toggle, .scene-link, .service-card, .note { border: 1px solid ButtonText; }
  .points:not(.points--labelled) .point::before { background: ButtonText; }
}
