/* Shared foundation for all three directions: fonts, reset, a11y helpers,
 * legal dialog and map pin structure. Colours come from each direction's tokens:
 * --ink, --paper, --surface, --line, --accent, --accent-ink, --focus. */

@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-var-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-var.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-var-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("../fonts/dmserif-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("../fonts/dmserif-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-var.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
html.has-dialog { overflow: hidden; }
body { margin: 0; min-height: 100dvh; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
:where(ul, ol)[role="list"] { list-style: none; padding: 0; }
[hidden] { display: none !important; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 1000; padding: 12px 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 3px; }

/* ---------- Form base (structure only; each direction styles the look) ---------- */
.field { display: grid; gap: 6px; }
.field-error { min-height: 0; font-size: .875rem; line-height: 1.35; }
.field-error:empty { display: none; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: .9rem; line-height: 1.45; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[data-submit][aria-busy="true"] { pointer-events: none; }
[data-submit]:disabled:not([aria-busy="true"]) { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; filter: saturate(.6); }
[data-submit]:disabled::after { display: none; }
[data-form-status].is-info { color: inherit !important; opacity: .85; }
[data-submit] .spinner { display: none; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
[data-submit][aria-busy="true"] .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Legal dialog ---------- */
.legal-dialog {
  width: min(760px, calc(100vw - 24px)); max-height: min(86dvh, 900px);
  padding: 0; border: 0; border-radius: 22px; overflow: hidden;
  background: var(--dialog-bg, #fff); color: var(--dialog-ink, #10252b);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .55);
  display: none; flex-direction: column;
}
.legal-dialog[open] { display: flex; animation: dialog-in .32s cubic-bezier(.2, .8, .2, 1); }
.legal-dialog::backdrop { background: rgba(2, 22, 27, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.legal-dialog__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 24px; border-bottom: 1px solid rgba(3, 46, 55, .12); }
.legal-dialog__title { font-weight: 600; font-size: 1.05rem; }
.legal-dialog__actions { display: flex; align-items: center; gap: 8px; }
.legal-dialog__pdf { padding: 10px 16px; border-radius: 999px; background: rgba(3, 46, 55, .07); font-size: .9rem; font-weight: 600; text-decoration: none; transition: background .2s; }
.legal-dialog__pdf:hover { background: rgba(3, 46, 55, .14); }
.legal-dialog__close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; transition: background .2s; }
.legal-dialog__close:hover { background: rgba(3, 46, 55, .08); }
.legal-dialog__body { overflow: auto; padding: 8px 28px 36px; overscroll-behavior: contain; }
.legal { font-size: .975rem; line-height: 1.65; }
.legal h2 { font-size: 1.45rem; line-height: 1.2; margin: 18px 0 10px; }
.legal h3 { font-size: 1.02rem; margin: 22px 0 6px; }
.legal p, .legal ul, .legal ol { margin: 0 0 10px; }
.legal ul, .legal ol { padding-left: 1.2em; }
.legal li { margin-bottom: 6px; }
.legal__draft { display: inline-block; margin-top: 16px; padding: 6px 12px; border-radius: 8px; background: #fff4d6; color: #6b4b00; font-size: .85rem; font-weight: 600; }
@media (max-width: 600px) {
  .legal-dialog { width: 100vw; max-height: 92dvh; border-radius: 22px 22px 0 0; margin: auto 0 0; }
  .legal-dialog__body { padding: 4px 18px 32px; }
  .legal-dialog__bar { padding-left: 18px; }
}

/* ---------- Map pins and popups ---------- */
.natal-map { position: relative; z-index: 0; }
.natal-map[data-tiles="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.92) saturate(.45) sepia(.12); }
.natal-map[data-tiles="dark"] { background: #0b1e23; }
.natal-pin { background: none; border: 0; }
.natal-pin__photo {
  display: block; width: 52px; height: 52px; border-radius: 50%;
  background: center / cover no-repeat; border: 3px solid var(--pin-ring, #fff);
  box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .5), 0 0 0 6px var(--pin-halo, rgba(43, 217, 134, .28));
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.natal-pin__tip { display: block; width: 12px; height: 12px; margin: -7px auto 0; transform: rotate(45deg); background: var(--pin-ring, #fff); border-radius: 0 0 3px 0; }
.leaflet-marker-icon:hover .natal-pin__photo, .leaflet-marker-icon:focus .natal-pin__photo { transform: translateY(-4px) scale(1.06); }
.natal-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .5); }
.natal-popup .leaflet-popup-content { margin: 0; width: 240px !important; font-family: inherit; }
.natal-pop img { width: 100%; height: 170px; object-fit: cover; object-position: 50% 14%; } /* portraits: faces sit in the upper third */
.natal-pop__body { padding: 12px 16px 16px; }
.natal-pop__cat { font-size: .78rem; opacity: .7; margin: 0 0 2px !important; }
.natal-pop__name { font-weight: 700; font-size: 1.02rem; margin: 0 0 4px !important; }
.natal-pop__addr { font-size: .85rem; margin: 0 0 8px !important; }
.natal-pop__flag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: #fff4d6; color: #6b4b00; margin: 0 0 10px !important; }
.natal-pop__go { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink) !important; font-weight: 600; text-decoration: none; }
.natal-popup a.leaflet-popup-close-button { width: 32px; height: 32px; top: 6px; right: 6px; border-radius: 50%; background: rgba(255, 255, 255, .9); color: #032e37; font-size: 20px; line-height: 30px; }

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