/*
  What the site asks for and typed styles cannot say: type and spacing that follow the window
  (clamp), and the azulejo pattern, a tile of radial gradients under a radial mask. Every rule is
  keyed on an id one of the seven pages already has, a band's anchor, and an id outranks the atomic
  classes the SDK writes, so the typed values remain what a wide window gets and what native draws.

  The values are the prototypes' own, in docs/design/site.
*/

/* The decorative fields and the overhanging cards reach past the page's edges, and the page never
   scrolls sideways. On a wrapper, as in the design: on body the clip moves to the viewport, and a
   phone widens its layout to fit what overflows instead. */
#page { overflow-x: clip; }

/* ── The bands' padding ─────────────────────────────────────────────────────────────────────── */
#header { padding-left: clamp(20px, 4vw, 48px); padding-right: clamp(20px, 4vw, 48px); }
/* On a phone the bar's button narrows, as the prototype's does under 480, so "Lista de espera" and the
   menu fit beside the mark on a 360 px screen. */
@media (max-width: 480px) {
  #header a[href$="-form"] > div { padding-left: 12px; padding-right: 12px; }
  #header a[href$="-form"] span { font-size: 15px; }
}
#top { padding: clamp(40px, 7vw, 96px) clamp(20px, 4vw, 48px) clamp(72px, 9vw, 128px); }
#caregivers, #pre-registration, #families, #trust, #pricing, #waiting-list, #team, #faq,
#sides, #how-it-works, #why, #verification-steps, #rules, #support, #fee, #payment, #price-questions,
#region, #principles, #roadmap {
  padding: clamp(72px, 9vw, 128px) clamp(20px, 4vw, 48px);
}
#about, #more-questions { padding: clamp(56px, 7vw, 96px) clamp(20px, 4vw, 48px); }
#get-started { padding: clamp(72px, 9vw, 120px) clamp(20px, 4vw, 48px); }
#footer { padding: 56px clamp(20px, 4vw, 48px) 40px; }

/* ── The headings ───────────────────────────────────────────────────────────────────────────── */
#top h1 { font-size: clamp(46px, 7vw, 96px); line-height: .96; letter-spacing: -.035em; }
/* The reading pages open on their first band's heading, which is the page's h1. */
#trust h1, #pricing h1, #team h1, #faq h1,
#caregivers h2, #pre-registration h2, #families h2,
#sides h2, #how-it-works h2, #why h2, #verification-steps h2, #rules h2, #support h2, #fee h2, #payment h2,
#price-questions h2, #region h2, #principles h2, #roadmap h2 {
  font-size: clamp(36px, 4.8vw, 64px); line-height: 1.02; letter-spacing: -.03em;
}
#about h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.15; letter-spacing: -.015em; }
#more-questions h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -.01em; }
#sides h3 { font-size: clamp(28px, 3vw, 40px); line-height: 1.08; letter-spacing: -.02em; }
#waiting-list h2 { font-size: clamp(34px, 4vw, 54px); line-height: 1.04; letter-spacing: -.03em; }
#get-started h2 { font-size: clamp(42px, 6.4vw, 88px); line-height: .98; letter-spacing: -.035em; max-width: 13ch; }
#hero-lead span { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; }

/* ── The azulejo ────────────────────────────────────────────────────────────────────────────── */
/* Behind the hero's profile: pale green tiles fading towards the bottom left. */
#hero-card { position: relative; isolation: isolate; }
#hero-card::before {
  content: ""; position: absolute; z-index: -1; top: -64px; right: -80px; width: 92%; height: 96%;
  border-radius: 28px; background-color: #E6EFEA;
  background-image:
    linear-gradient(90deg, #FAF7F2 0 2px, transparent 2px), linear-gradient(#FAF7F2 0 2px, transparent 2px),
    radial-gradient(circle at 50% 50%, #C5DDD3 0 12%, transparent 13%),
    radial-gradient(circle at 0 0, #D3E5DD 0 32%, transparent 33%), radial-gradient(circle at 100% 0, #D3E5DD 0 32%, transparent 33%),
    radial-gradient(circle at 0 100%, #D3E5DD 0 32%, transparent 33%), radial-gradient(circle at 100% 100%, #D3E5DD 0 32%, transparent 33%);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 35%, #000 35%, transparent 76%);
  mask-image: radial-gradient(ellipse 70% 70% at 70% 35%, #000 35%, transparent 76%);
}

/* On the brown slabs and the green final call: the same tile in white, faint, fading out from one corner. The
   slab is its own stacking context, so the field sits over its background and under its content. */
#pre-registration, #get-started, #caregivers-quote { position: relative; isolation: isolate; overflow: hidden; }
#pre-registration::before, #get-started::before, #caregivers-quote::before {
  content: ""; position: absolute; z-index: -1; background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
  mask-image: radial-gradient(closest-side, #000, transparent);
}
#caregivers-quote::before {
  top: -60px; right: -60px; width: 240px; height: 240px;
  background-image:
    linear-gradient(90deg, #3E2723 0 2px, transparent 2px), linear-gradient(#3E2723 0 2px, transparent 2px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.10) 0 12%, transparent 13%),
    radial-gradient(circle at 0 0, rgba(255,255,255,.07) 0 32%, transparent 33%), radial-gradient(circle at 100% 0, rgba(255,255,255,.07) 0 32%, transparent 33%),
    radial-gradient(circle at 0 100%, rgba(255,255,255,.07) 0 32%, transparent 33%), radial-gradient(circle at 100% 100%, rgba(255,255,255,.07) 0 32%, transparent 33%);
}
#pre-registration::before {
  top: -120px; left: -120px; width: 640px; height: 640px;
  background-image:
    linear-gradient(90deg, #3E2723 0 2px, transparent 2px), linear-gradient(#3E2723 0 2px, transparent 2px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.08) 0 12%, transparent 13%),
    radial-gradient(circle at 0 0, rgba(255,255,255,.055) 0 32%, transparent 33%), radial-gradient(circle at 100% 0, rgba(255,255,255,.055) 0 32%, transparent 33%),
    radial-gradient(circle at 0 100%, rgba(255,255,255,.055) 0 32%, transparent 33%), radial-gradient(circle at 100% 100%, rgba(255,255,255,.055) 0 32%, transparent 33%);
}
#get-started::before {
  top: -100px; right: -100px; width: 560px; height: 560px;
  background-image:
    linear-gradient(90deg, #1B5E4B 0 2px, transparent 2px), linear-gradient(#1B5E4B 0 2px, transparent 2px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.12) 0 12%, transparent 13%),
    radial-gradient(circle at 0 0, rgba(255,255,255,.08) 0 32%, transparent 33%), radial-gradient(circle at 100% 0, rgba(255,255,255,.08) 0 32%, transparent 33%),
    radial-gradient(circle at 0 100%, rgba(255,255,255,.08) 0 32%, transparent 33%), radial-gradient(circle at 100% 100%, rgba(255,255,255,.08) 0 32%, transparent 33%);
}

/* ── Details ────────────────────────────────────────────────────────────────────────────────── */
/* The stamp is pressed by hand: tilted, with a second ring inside the first. */
#stamp { transform: rotate(-10deg); box-shadow: inset 0 0 0 5px #FFFFFF, inset 0 0 0 6.5px #1B5E4B; }

/* The map is laid out at its district's size and shrinks with its box, keeping its shape. */
#map svg { width: 100%; height: auto; display: block; }

/* A link's colour under the pointer, which a typed style says of a box and not of a text: green in
   the bar, but for the mark and the green buttons, and gold in the footer. */
#header a:not([href="/"]):not([href*="#"]):hover span { color: #1B5E4B; }
#footer a:hover span { color: #C9A96E; }

/* The design balances its headings' lines rather than filling the first ones greedily. */
h1, h2, h3 { text-wrap: balance; }

/* A link inside a sentence of buttons, underlined as the design's plain anchor is. */
#families a[href="/trust"] { text-decoration: underline; text-underline-offset: 3px; }

/* "Oceano Atlântico" along the coast, read upwards. Where it starts on each district's map, and its
   size as the map shrinks, are coverage-map.css's, by the district's INE code, which
   tools/district-map.py writes: the map is the container its size is measured against. */
#map { position: relative; container-type: inline-size; }
[id^="map-ocean-"] {
  position: absolute; transform-origin: left bottom; transform: rotate(-90deg);
  white-space: nowrap; pointer-events: none;
  /* The typed spacing in proportion to the letters, so the label shrinks whole with its size. */
  letter-spacing: 0.08em !important;
}
/* The stack's layer around the label covers the whole map: without this it would take every press
   meant for a concelho, now that the concelhos are inputs (#210). */
#map :has(> [id^="map-ocean-"]) { pointer-events: none; }

/* The cards that overhang the profile, by less on a narrow window, as the design's clamp() does: a
   margin on the card itself, past the edge of the profile its Positioned holds it to. */
#hero-request { margin-right: clamp(-28px, -2.4vw, 0px); }
#hero-checks { margin-left: clamp(-24px, -2vw, 0px); }

/* The form cards' padding follows the window, and so does the home page's two sides'. */
#caregiver-form, #family-form { padding: clamp(22px, 3.4vw, 40px); }
#sides-families, #sides-caregivers { padding: clamp(26px, 3vw, 40px); }

/* ── The photographs ────────────────────────────────────────────────────────────────────────── */
/* The SDK draws an Image at a fixed size, its typed values being what a wide window gets. The
   design's frames follow their column instead: the column's width, the design's proportions, and
   the photograph covering the frame, which the SDK's class already says. The profile's 76 is fixed
   in the design too, and keeps the SDK's size. */
#families img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; }
/* Beside the words, the picture stops at the design's 540 and the words take what it leaves. */
#families-photo { max-width: 540px; }
#team img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
#home-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
