/*
 * One stylesheet for the whole site.
 *
 * Sand and coral: Figueira da Foz is a beach town, and a listing has to be
 * read at a glance on a phone, outdoors, deciding where to go tonight. The
 * accent is the coral of a festival poster; featured listings are gold, and
 * every one of them also says "Featured" in words — never colour alone.
 * Dark is designed, not inverted, and follows the system. Controls are at
 * least 48 px tall.
 */
:root {
  color-scheme: light;
  --ink: #1f1a17;
  --bg: #fbf7f1;
  --panel: #ffffff;
  --raise: #f3ece1;
  --line: #e4d9c8;
  --muted: #6a5f55;
  --accent: #b8400e;
  --accent-ink: #ffffff;
  --soft: #fbe6da;
  --gold: #d39b00;
  --gold-ink: #7a5600;
  --gold-soft: #fbf0cf;
  --good: #1d7a43;
  --good-soft: #e0f2e6;
  --bad: #b3261e;
  --bad-soft: #fbe3e0;
  --warn: #8a5a00;
  --warn-soft: #fbf0d6;
  --radius: 14px;
  --tap: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #f1ebe3;
    --bg: #15120f;
    --panel: #1e1a16;
    --raise: #28221d;
    --line: #3a322b;
    --muted: #b3a798;
    --accent: #ff8a4c;
    --accent-ink: #2a1105;
    --soft: #3a2216;
    --gold: #f2c14e;
    --gold-ink: #f2c14e;
    --gold-soft: #3a2f12;
    --good: #7fcf9a;
    --good-soft: #1b3123;
    --bad: #f08f86;
    --bad-soft: #3d1f1c;
    --warn: #f0c76a;
    --warn-soft: #3a2f14;
  }
}

* { box-sizing: border-box; }
/* `hidden` must win over every display rule below. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
h1 { font-size: clamp(26px, 5vw, 40px); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 10px; }
h2 { font-size: 20px; margin: 28px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.lede { font-size: 18px; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { color: var(--bad); }
.ok { color: var(--good); }

/* ── Frame ──────────────────────────────────────────────────────────── */

.masthead {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
.wordmark { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; font-size: 18px; }
.wordmark img { width: 28px; height: 28px; }
.masthead nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.masthead nav a { color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.masthead nav a[aria-current="page"], .masthead nav a:hover { color: var(--ink); background: var(--raise); }
@media (max-width: 560px) {
  /* The links under the wordmark, wrapping onto a second row rather than
     hiding "Sign in" off the edge of the screen. */
  .masthead { flex-wrap: wrap; gap: 2px 12px; padding: 8px 14px; position: static; }
  .masthead nav { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 0 2px; }
  .masthead nav a { padding: 8px 10px; white-space: nowrap; font-size: 15px; }
}

main { max-width: 760px; margin: 0 auto; padding: 24px 18px 40px; }

.siteftr { border-top: 1px solid var(--line); padding: 22px 18px 30px; color: var(--muted); font-size: 14px; text-align: center; }
.siteftr nav { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }

/* ── Controls ───────────────────────────────────────────────────────── */

label { display: block; font-weight: 600; margin: 14px 0 6px; }
label .hint { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: var(--tap);
}
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); vertical-align: middle; flex: none; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 12px; border: 0;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 750;
  cursor: pointer; text-decoration: none; touch-action: manipulation;
}
button.quiet, .button.quiet { background: var(--raise); color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
button:disabled { opacity: .55; cursor: default; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 12px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
@media (max-width: 640px) { .two, .three { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ── Lists ──────────────────────────────────────────────────────────── */

.list { list-style: none; padding: 0; margin: 0; }
.list > li {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; min-height: 64px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px;
}
.list > li a.fill { color: inherit; text-decoration: none; flex: 1; min-width: 0; }
.list .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { color: var(--muted); font-size: 14px; }
.list > li.pending { border-left: 5px solid var(--warn); }
.list > li.rejected { border-left: 5px solid var(--bad); }
.list > li.past { opacity: .7; }
.list .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  /* The title gets the whole width; the state and the buttons go underneath. */
  .list > li { flex-wrap: wrap; }
  .list > li a.fill { flex-basis: 100%; }
  .list .title { white-space: normal; }
  .list .actions { justify-content: flex-start; }
}

.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.good { color: var(--good); border-color: var(--good); background: var(--good-soft); }
.pill.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.pill.accent { color: var(--accent); border-color: var(--accent); background: var(--soft); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .n { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.chips button { min-height: 40px; white-space: nowrap; }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips button[aria-pressed="false"] { background: var(--raise); color: var(--ink); border: 1px solid var(--line); }

.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }

/* ── The calendar ───────────────────────────────────────────────────── */

.wide { max-width: 1040px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.toolbar .chips { flex: 1 1 100%; }
.day { margin: 22px 0 8px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none;
}
.card:hover { border-color: var(--accent); }
.card.featured { border: 2px solid var(--gold); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--raise); display: block; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.card .title { font-weight: 750; font-size: 17px; line-height: 1.3; }
.card .when { font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }
.card .where, .card .meta { color: var(--muted); font-size: 14px; }

.pill.featured { color: var(--gold-ink); border-color: var(--gold); background: var(--gold-soft); }

.map { height: 460px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--raise); z-index: 0; }
.map.small { height: 260px; }
.map.picker { height: 320px; cursor: crosshair; }
.map-popup { display: flex; flex-direction: column; gap: 2px; font: 14px/1.4 ui-sans-serif, system-ui, sans-serif; }
.map-popup .title { font-weight: 750; font-size: 15px; }
@media (max-width: 560px) { .map { height: 380px; } }

.event-hero img { width: 100%; max-height: 520px; object-fit: contain; background: var(--raise); border-radius: var(--radius); display: block; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }

.poster-preview { width: 160px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--raise); display: block; }

/* ── The marketing pages ────────────────────────────────────────────── */

.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); }
.cta { font-size: 18px; min-height: 56px; padding: 0 24px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.features .panel { margin: 0; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.join { display: flex; gap: 10px; flex-wrap: wrap; }
.join input { flex: 1 1 240px; width: auto; }
.facts { margin: 0; display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr); gap: 8px 16px; }
.facts dt { font-weight: 750; }
.facts dd { margin: 0; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 8px; } }
