/* Algarve Offseason — one stylesheet for the whole site.
   Colours: Atlantic in winter. Mist for the page, deep sea for text,
   azulejo blue for actions, low-sun ochre for the horizon line. */

@font-face {
  font-family: "Bricolage";
  src: url("/assets/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --mist: #eef2f2;
  --paper: #fbfcfc;
  --ink: #14262f;
  --muted: #4c6470;
  --line: #c6d2d5;
  --sea: #1e4d63;
  --azulejo: #2456a4;
  --ochre: #d8a23a;
  --f: #2456a4;      /* friendship sticker */
  --d: #b8395f;      /* dating sticker */
  --b: #9a6a12;      /* business sticker */
  --ok: #2c7a4b;
  --bad: #b3261e;
  --radius: 10px;
  --measure: 40rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mist: #0f1c24; --paper: #15252f; --ink: #e4ecef; --muted: #9fb3bc; --line: #2b4250;
    --sea: #9cc7db; --azulejo: #8fb3f0; --ochre: #e2b456;
    --f: #8fb3f0; --d: #f08aa8; --b: #e2b456; --ok: #6fcf97; --bad: #ff8a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--azulejo); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, label.sticker:has(input:focus-visible) {
  outline: 3px solid var(--ochre); outline-offset: 2px;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 16px; }

/* Header: wordmark sits on the horizon line */
.site-head { padding: 22px 0 0; }
.site-head .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wordmark {
  font-family: "Bricolage", system-ui, sans-serif;
  font-weight: 750; font-stretch: 80%;
  font-size: 1.35rem; letter-spacing: -0.01em;
  color: var(--sea); text-decoration: none;
}
.site-head nav a { color: var(--muted); text-decoration: none; margin-left: 14px; font-size: .95rem; }
.site-head nav a:hover { color: var(--ink); text-decoration: underline; }
.horizon { height: 3px; background: var(--ochre); margin-top: 14px; }

h1, h2, h3 { font-family: "Bricolage", system-ui, sans-serif; color: var(--sea); line-height: 1.12; }
h1 { font-weight: 780; font-stretch: 78%; font-size: clamp(2.3rem, 7vw, 3.6rem); letter-spacing: -0.02em; margin: 1.6rem 0 .6rem; }
h2 { font-weight: 700; font-stretch: 85%; font-size: 1.6rem; margin: 2.4rem 0 .5rem; }
h3 { font-weight: 650; font-size: 1.15rem; margin: 1.6rem 0 .3rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
p, li { max-width: 38rem; }
small, .small { font-size: .88rem; color: var(--muted); }

main { padding-bottom: 4rem; }
.site-foot { border-top: 1px solid var(--line); padding: 22px 0 40px; font-size: .9rem; color: var(--muted); }
.site-foot a { color: var(--muted); }

/* Home: what lives on the site */
.offers { list-style: none; padding: 0; margin: 2rem 0; }
.offers li { border-left: 3px solid var(--line); padding: 2px 0 2px 16px; margin: 0 0 1.6rem; }
.offers li.live { border-left-color: var(--ochre); }
.offers h2 { margin: 0 0 .2rem; font-size: 1.45rem; }
.offers .status { font-size: .85rem; color: var(--muted); }

/* Steps in "how it works" really are a sequence */
ol.steps { padding-left: 1.3rem; }
ol.steps li { margin-bottom: .6rem; padding-left: .3rem; }

/* Event list */
.event { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; }
.event h3 { margin: 0 0 .2rem; }
.event .when { font-weight: 600; }

/* Forms */
form { margin: 1rem 0; }
fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
legend { font-family: "Bricolage", system-ui, sans-serif; font-weight: 680; font-size: 1.15rem; color: var(--sea); margin-bottom: .5rem; padding: 0; }
label { display: block; font-weight: 550; margin: .8rem 0 .25rem; }
.hint { display: block; font-weight: 400; font-size: .88rem; color: var(--muted); }
input[type=text], input[type=email], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
textarea { min-height: 5rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 8rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: .8rem 0; }
.check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label { margin: 0; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--paper); cursor: pointer; }
.radio-row input { margin: 0; }
.radio-row label:has(input:checked) { border-color: var(--azulejo); box-shadow: inset 0 0 0 1px var(--azulejo); }

/* The stickers: the one bold thing. They mirror the printed card. */
.stickers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
label.sticker { margin: 0; cursor: pointer; text-align: center; font-weight: 600; font-size: .95rem; }
label.sticker input { position: absolute; opacity: 0; pointer-events: none; }
label.sticker .dot {
  display: grid; place-items: center; margin: 0 auto 6px;
  width: 4.4rem; height: 4.4rem; border-radius: 50%;
  border: 3px dashed var(--line); color: var(--muted);
  font-family: "Bricolage", system-ui, sans-serif; font-weight: 800; font-size: 1.9rem;
  background: var(--paper);
  transition: transform .15s ease, background-color .15s ease;
}
label.sticker .dot::after { content: "✕"; font-size: 1.3rem; }
label.sticker input:checked + .dot { border: 3px solid transparent; color: #fff; transform: rotate(-6deg); }
label.sticker input:checked + .dot::after { content: "✓"; font-size: 1.9rem; }
label.sticker.f input:checked + .dot { background: var(--f); }
label.sticker.d input:checked + .dot { background: var(--d); }
label.sticker.b input:checked + .dot { background: var(--b); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) label.sticker input:checked + .dot { color: #0f1c24; } }
@media (prefers-reduced-motion: reduce) { label.sticker .dot { transition: none; } label.sticker input:checked + .dot { transform: none; } }

input[type=range] { display: block; width: 100%; margin: .4rem 0; accent-color: var(--d); }
.dating-only { border-left: 3px solid var(--d); padding-left: 14px; }
.dating-only[hidden] { display: none; }

button, .button {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--azulejo); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px;
  text-decoration: none; display: inline-block;
}
button.secondary, .button.secondary { background: transparent; color: var(--azulejo); box-shadow: inset 0 0 0 1.5px var(--azulejo); }
button.danger { background: var(--bad); }
button:disabled { opacity: .6; cursor: progress; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button:not(.secondary), :root:not([data-theme="light"]) .button:not(.secondary) { color: #0f1c24; } }

.notice { border-radius: var(--radius); padding: 14px 16px; margin: 1rem 0; background: var(--paper); border: 1px solid var(--line); }
.notice.ok { border-color: var(--ok); }
.notice.error { border-color: var(--bad); color: var(--bad); }
.notice p { margin: .3rem 0; }
.secret-link { word-break: break-all; font-size: .9rem; background: var(--mist); padding: 8px 10px; border-radius: 6px; display: block; margin: .5rem 0; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* Admin */
.admin { --measure: 72rem; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 1rem 0; }
.tabs button[aria-selected="true"] { background: var(--sea); }
.tabs button[aria-selected="false"] { background: transparent; color: var(--sea); box-shadow: inset 0 0 0 1.5px var(--line); }
.pill { display: inline-block; border-radius: 999px; padding: 0 8px; font-size: .8rem; font-weight: 700; color: #fff; }
.pill.f { background: var(--f); } .pill.d { background: var(--d); } .pill.b { background: var(--b); }
.picks-grid input[type=number] { width: 5rem; }

/* Printable cards */
.cards { display: none; }
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .no-print, .site-head, .site-foot { display: none !important; }
  .cards { display: block; }
  .card { page-break-after: always; padding: 10mm; }
  .card h2 { color: #000; font-size: 28pt; margin: 0 0 4mm; }
  .card .big { font-size: 64pt; font-weight: 800; line-height: 1; }
  .card table th, .card table td { border: 1px solid #000; padding: 3mm; font-size: 12pt; }
  .card .row-sticker { font-size: 20pt; margin: 3mm 0; }
}
