/* Screen Auckland Brand Guidelines (Feb 2024), as used in Tāwaha: palette, National 2, black panel with teal glow. */
@font-face { font-family: "National 2"; font-weight: 300; font-style: normal; font-display: swap; src: url("fonts/national-2-light.woff2") format("woff2"), url("fonts/national-2-light.woff") format("woff"); }
@font-face { font-family: "National 2"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/national-2-regular.woff2") format("woff2"), url("fonts/national-2-regular.woff") format("woff"); }
@font-face { font-family: "National 2"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/national-2-bold.woff2") format("woff2"), url("fonts/national-2-bold.woff") format("woff"); }
@font-face { font-family: "National 2"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/national-2-extrabold.woff2") format("woff2"), url("fonts/national-2-extrabold.woff") format("woff"); }

:root {
  --teal: #00a6a7; --aqua: #5ae9c6; --sand: #f1d9bd; --cream: #f6ecdf; --white: #fff; --black: #000;
  --on-black-soft: #c9d3d0; --rule: rgba(255, 255, 255, .16);
  --font: "National 2", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --glow: radial-gradient(120% 55% at -10% 100%, rgba(0, 166, 167, .62), rgba(0, 120, 100, .22) 45%, transparent 72%);
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 16px; line-height: 1.45; letter-spacing: -0.01em; color: var(--black); background: var(--cream); font-variant-numeric: proportional-nums lining-nums; }
button, input { font: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#map { position: absolute; inset: 0; }

/* Start state: map greyed out behind a centred search. */
#veil { position: absolute; inset: 0; background: rgba(246, 236, 223, .45); backdrop-filter: grayscale(1); -webkit-backdrop-filter: grayscale(1);
        transition: opacity .5s; pointer-events: none; opacity: 0; }
body.start #veil { opacity: 1; pointer-events: auto; }

#finder { position: absolute; z-index: 2; top: 12px; left: 12px; width: 400px; max-height: calc(100% - 24px); overflow: auto;
          padding: 22px 22px 20px; color: var(--white); background: var(--glow), var(--black); border-radius: 3px; box-shadow: var(--shadow);
          transition: top .45s ease, left .45s ease, transform .45s ease, width .45s ease, padding .45s ease; }
body.start #finder { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100% - 32px)); padding: 34px 36px 30px; }

.logo { display: block; width: 132px; height: auto; margin-bottom: 18px; }
body.start .logo { width: 158px; margin-bottom: 26px; }
.intro::before { content: ""; display: block; width: 68px; height: 2px; background: var(--aqua); margin-bottom: 18px; }
.intro h1 { margin: 0; font-size: 46px; line-height: .98; font-weight: 800; letter-spacing: -0.025em; }
.intro p { margin: 12px 0 22px; font-size: 19px; font-weight: 300; letter-spacing: -0.015em; }
body:not(.start) .intro, body:not(.start) .hint { display: none; }

#search { display: flex; background: var(--white); border-radius: 3px; }
#q { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 14px; color: var(--black); border-radius: 3px; }
body.start #q { padding: 16px 18px; font-size: 19px; }
#q::placeholder { color: #8a9391; }
#q:focus { outline: none; }
#search:focus-within { box-shadow: 0 0 0 2px var(--aqua); }
#q::-webkit-search-cancel-button { display: none; }
#search button { border: 0; background: transparent; padding: 0 14px; color: var(--black); cursor: pointer; }

#matches { list-style: none; margin: 10px 0 0; padding: 0; }
#matches button { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--rule); background: none; color: var(--white); padding: 9px 0; cursor: pointer; }
#matches button:hover, #matches button:focus { color: var(--aqua); outline: none; }
.msg { color: var(--on-black-soft); margin: 10px 0 0; font-weight: 300; }
.msg.warn { color: var(--sand); font-weight: 400; }
.hint { margin: 16px 0 0; color: var(--on-black-soft); font-size: 15px; font-weight: 300; }
.link { border: 0; background: none; padding: 0; color: var(--aqua); text-decoration: underline; cursor: pointer; }

#results { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 14px; }
.place { margin: 0 0 4px; font-size: 22px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.place small { display: block; margin-top: 4px; font-size: 13px; font-weight: 300; letter-spacing: 0; color: var(--on-black-soft); }
h2 { font-size: 16px; font-weight: 700; margin: 16px 0 8px; }
h2 span { font-weight: 300; color: var(--on-black-soft); }
.iwi { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--rule); columns: 2; column-gap: 14px; }
.iwi li { padding: 3px 0 3px 20px; position: relative; break-inside: avoid; font-size: 15px; line-height: 1.3; }
.iwi li::before { content: ""; position: absolute; left: 1px; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); border: 2px solid var(--white); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 8px; }
.btn { padding: 10px 12px; border: 2px solid var(--aqua); background: var(--aqua); color: var(--black); border-radius: 3px; font-weight: 700; cursor: pointer; line-height: 1.2; }
.btn.alt { background: transparent; color: var(--white); border-color: var(--white); }
.btn:hover { filter: brightness(1.08); }
.copy-row { font-size: 14px; font-weight: 300; color: var(--on-black-soft); }
.note { margin: 14px 0 0; padding: 12px 14px; background: rgba(255, 255, 255, .08); font-size: 14px; font-weight: 300; color: var(--on-black-soft); }
.note strong { color: var(--white); font-weight: 700; }
.spsmw-flag { margin: 12px 0 0; padding: 10px 12px; background: var(--cream); color: var(--black); font-size: 14px; }
.spsmw-flag b { display: block; }

/* Marker popup (white card, black buttons, as Tāwaha's place card) */
.maplibregl-popup-content { border-radius: 3px; padding: 14px 16px; font-family: var(--font); box-shadow: var(--shadow); }
.pop p { margin: 0 0 10px; font-size: 17px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.pop .actions { margin: 0; grid-template-columns: 1fr; gap: 8px; }
.pop .btn { background: var(--black); border-color: var(--black); color: var(--white); }
.pop .btn.alt { background: var(--white); color: var(--black); }

#layers { position: absolute; right: 12px; bottom: 34px; z-index: 2; width: 290px; padding: 12px 14px; background: var(--white); border-radius: 3px; box-shadow: var(--shadow); font-size: 14px; }
#layers label { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; cursor: pointer; }
#layers input { accent-color: var(--teal); margin-top: 3px; }
#layers p { margin: 6px 0 0 24px; font-weight: 300; }

#toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 3; max-width: min(600px, calc(100% - 24px));
         padding: 12px 16px; background: var(--black); color: var(--white); border-left: 4px solid var(--aqua); border-radius: 3px; box-shadow: var(--shadow); font-size: 15px; }
.maplibregl-ctrl-attrib { font-family: var(--font); }

@media (max-width: 700px) {
  #finder { left: 8px; right: 8px; top: 8px; width: auto; max-height: 58%; padding: 18px; }
  body.start #finder { width: calc(100% - 16px); padding: 24px 22px; }
  .intro h1 { font-size: 34px; }
  .iwi { columns: 1; }
  .intro p { font-size: 17px; }
  .logo { width: 110px; margin-bottom: 12px; }
  #layers { left: 8px; right: 8px; width: auto; bottom: 30px; }
  /* The panel already carries the two email buttons; the map popup would sit underneath it. */
  .maplibregl-popup { display: none; }
}
@media (prefers-reduced-motion: reduce) { #finder, #veil { transition: none; } }
