@import url("https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:ital,wght@0,400..900;1,400..700&display=swap");

:root {
  --paper: #eef1f4;
  --sheet: #ffffff;
  --ink: #1b2433;
  --ink-2: #4a5568;
  --ink-3: #6b778a;
  --rule: #d5dbe3;
  --rule-strong: #b7c0cc;
  --action: #2443c9;
  --action-ink: #ffffff;
  --focus: #2443c9;
  --danger: #b42318;
  --ok: #0e7c66;

  --c-industry: #2443c9;
  --c-vendor: #0e7c66;
  --c-community: #a86b00;
  --c-privacy: #6e3fae;

  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --s-1: 0.8125rem;
  --s0: 1rem;
  --s1: 1.25rem;
  --s2: 1.5625rem;
  --s3: 2.441rem;
  --s4: 3.815rem;
  --radius-s: 4px;
  --radius-m: 8px;
  --measure: 72ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--s0)/1.5 var(--font);
  font-feature-settings: "tnum" 1, "ss01" 1;
}
a { color: var(--action); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { line-height: 1.1; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(1240px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- Masthead ---------- */
.masthead { padding: 2.75rem 0 1.75rem; }
.masthead-row { display: flex; gap: 2rem; align-items: end; justify-content: space-between; flex-wrap: wrap; }
.site-title { font-size: clamp(2.2rem, 5vw, var(--s4)); font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; }
.site-title a { color: inherit; text-decoration: none; }
.tagline { color: var(--ink-2); max-width: 52ch; margin-top: 0.85rem; font-size: var(--s1); line-height: 1.4; }
.masthead-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: 600 var(--s0)/1 var(--font);
  padding: 0.7rem 1rem; border-radius: var(--radius-m);
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--sheet); text-decoration: none; }
.btn-primary { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.btn-primary:hover { background: #1b35a6; border-color: #1b35a6; }
.btn-small { font-size: var(--s-1); padding: 0.45rem 0.7rem; border-width: 1px; border-radius: var(--radius-s); }
.btn-quiet { border-color: var(--rule-strong); color: var(--ink-2); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Season timeline (the hero) ---------- */
.season { background: var(--sheet); border-block: 1px solid var(--rule); padding: 1.5rem 0 1.25rem; }
.season-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.season-head h2 { font-size: var(--s1); }
.season-head p { color: var(--ink-3); font-size: var(--s-1); }
.timeline-scroll { overflow-x: auto; padding-bottom: 0.5rem; }
.timeline { position: relative; min-width: 980px; }
.tl-months { display: grid; grid-template-columns: repeat(12, 1fr); border-bottom: 1px solid var(--rule-strong); }
.tl-month { font-size: var(--s-1); color: var(--ink-2); padding: 0 0 0.4rem 0.4rem; border-left: 1px solid var(--rule); font-weight: 600; }
.tl-month small { color: var(--ink-3); font-weight: 400; margin-left: 0.25rem; }
.tl-lanes { position: relative; }
.tl-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, 1fr); pointer-events: none; }
.tl-grid span { border-left: 1px solid var(--rule); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--ink); z-index: 2; }
.tl-today::after { content: "Today"; position: absolute; bottom: 2px; left: 4px; font-size: 0.6875rem; font-weight: 700; background: var(--sheet); padding: 0 3px; }
.tl-event {
  position: absolute; height: 22px; display: flex; align-items: center; gap: 0.4rem;
  font: 600 0.78rem/1 var(--font); color: var(--ink); text-decoration: none; white-space: nowrap;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.tl-event.flip { flex-direction: row-reverse; transform: translateX(-100%); }
.tl-bar { display: block; height: 100%; min-width: 6px; border-radius: 3px; background: var(--cat); flex: none; }
.tl-event:hover .tl-label, .tl-event:focus-visible .tl-label { text-decoration: underline; }
.tl-event.is-cancelled .tl-bar { background: repeating-linear-gradient(135deg, var(--cat) 0 3px, transparent 3px 6px); outline: 1px solid var(--cat); }
.tl-event.is-cancelled .tl-label { text-decoration: line-through; color: var(--ink-3); }
.tl-empty { padding: 2rem 0; color: var(--ink-3); }
.legend { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: 0.9rem; font-size: var(--s-1); color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.dot { width: 10px; height: 10px; border-radius: 2px; background: var(--cat); flex: none; }

[data-cat="industry"] { --cat: var(--c-industry); }
[data-cat="vendor"] { --cat: var(--c-vendor); }
[data-cat="community"] { --cat: var(--c-community); }
[data-cat="privacy"] { --cat: var(--c-privacy); }

/* ---------- Main layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 3rem; padding: 2.25rem 0 4rem; align-items: start; }
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .rail { display: contents; }
  .rail .subscribe { order: -1; }
  .rail .panel:not(.subscribe) { order: 1; }
}

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin-bottom: 1.75rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font: 500 var(--s-1)/1 var(--font); padding: 0.5rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--rule-strong); background: var(--sheet); color: var(--ink); cursor: pointer;
}
.chip[aria-pressed="false"] { background: transparent; color: var(--ink-3); }
.chip[aria-pressed="false"] .dot { background: transparent; outline: 1.5px solid var(--cat); outline-offset: -1.5px; }
.search { flex: 1 1 220px; min-width: 180px; }
.search input { width: 100%; }
.check { display: inline-flex; white-space: nowrap; gap: 0.4rem; align-items: center; font-size: var(--s-1); color: var(--ink-2); }

.month-group + .month-group { margin-top: 2.25rem; }
.month-title { font-size: var(--s2); font-weight: 800; letter-spacing: -0.02em; padding-bottom: 0.6rem; border-bottom: 2px solid var(--ink); }
.month-title small { font-size: var(--s0); font-weight: 500; color: var(--ink-3); margin-left: 0.5rem; letter-spacing: 0; }

.event { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: 1.25rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 1rem; }
.event.is-highlighted { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: #dfe6ff; } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .event.is-highlighted { animation: none; background: #dfe6ff; } }
.when { font-weight: 700; line-height: 1.2; }
.when .days { display: block; font-size: var(--s1); letter-spacing: -0.01em; }
.when .span { display: block; font-size: var(--s-1); color: var(--ink-3); font-weight: 500; margin-top: 0.2rem; }
.event-name { font-size: var(--s1); font-weight: 700; line-height: 1.25; }
.event-name a { color: var(--ink); text-decoration: none; }
.event-name a:hover { color: var(--action); text-decoration: underline; }
.event-meta { color: var(--ink-2); margin-top: 0.3rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
.event-meta .cat { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--s-1); }
.event-desc { color: var(--ink-2); margin-top: 0.5rem; max-width: 64ch; font-size: 0.9375rem; }
.event-actions { display: flex; flex-direction: column; gap: 0.4rem; align-items: stretch; }
.add-cal { position: relative; }
.add-cal > summary { list-style: none; justify-content: center; width: 100%; }
.add-cal > summary::-webkit-details-marker { display: none; }
.add-cal > summary::after { content: ""; width: 0.4em; height: 0.4em; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); margin-left: 0.15rem; }
.add-cal[open] > summary { background: var(--sheet); border-color: var(--ink-2); }
.add-cal[open] > summary::after { transform: translateY(1px) rotate(225deg); }
.add-cal-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 13.5rem;
  display: flex; flex-direction: column; padding: 0.3rem;
  background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius-s);
  box-shadow: 0 8px 24px rgba(27, 36, 51, 0.14);
}
.add-cal-menu a { padding: 0.55rem 0.7rem; border-radius: 4px; color: var(--ink); font-size: var(--s-1); font-weight: 500; text-decoration: none; white-space: nowrap; }
.add-cal-menu a:hover, .add-cal-menu a:focus-visible { background: #e8edfb; color: var(--action); }
@media (max-width: 640px) { .add-cal-menu { left: 0; right: auto; } }
.event.is-cancelled .event-name a { text-decoration: line-through; color: var(--ink-3); }
.badge { font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: var(--radius-s); background: #fde7e5; color: var(--danger); }
.badge-past { background: #e6e9ee; color: var(--ink-2); }
@media (max-width: 640px) {
  .event { grid-template-columns: 1fr; gap: 0.5rem; }
  .when .days { display: inline; font-size: var(--s0); }
  .when .span { display: inline; margin-left: 0.5rem; }
  .event-actions { flex-direction: row; flex-wrap: wrap; }
}
.empty { padding: 3rem 0; color: var(--ink-2); }
.empty p + p { margin-top: 0.75rem; }

/* ---------- Rail ---------- */
.rail { display: flex; flex-direction: column; gap: 2rem; position: sticky; top: 1.25rem; }
.panel h2 { font-size: var(--s1); margin-bottom: 0.6rem; }
.panel p { color: var(--ink-2); font-size: 0.9375rem; }
.subscribe { background: var(--ink); color: #fff; padding: 1.4rem; border-radius: var(--radius-m); }
.subscribe h2 { color: #fff; }
.subscribe p { color: #c5cedb; }
.subscribe label { display: block; font-size: var(--s-1); color: #c5cedb; margin: 1rem 0 0.35rem; }
.subscribe select { width: 100%; }
.sub-buttons { display: grid; gap: 0.5rem; margin-top: 1rem; }
.sub-buttons .btn { justify-content: center; border-color: #fff; color: #fff; }
.sub-buttons .btn:hover { background: rgba(255,255,255,0.08); }
.sub-buttons .btn-primary { background: #fff; color: var(--ink); }
.sub-buttons .btn-primary:hover { background: #e7ecf3; }
.feed-url { display: flex; gap: 0.4rem; margin-top: 0.9rem; }
.feed-url input { flex: 1; min-width: 0; font-size: var(--s-1); background: #2a3547; color: #fff; border-color: #3d4a5f; }
.feed-note { font-size: var(--s-1) !important; margin-top: 0.9rem; }
.recent { list-style: none; padding: 0; margin: 0; }
.recent li { padding: 0.6rem 0; border-bottom: 1px solid var(--rule); font-size: 0.9375rem; }
.recent li:first-child { border-top: 1px solid var(--rule); }
.recent a { color: var(--ink); font-weight: 600; text-decoration: none; }
.recent a:hover { text-decoration: underline; }
.recent span { display: block; color: var(--ink-3); font-size: var(--s-1); }
.rules { padding-left: 1.1rem; margin: 0.5rem 0 0; color: var(--ink-2); font-size: 0.9375rem; }
.rules li + li { margin-top: 0.35rem; }

.site-footer { border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; color: var(--ink-3); font-size: var(--s-1); }
.site-footer .wrap { display: flex; gap: 1.5rem; justify-content: space-between; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); }

/* ---------- Forms ---------- */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule-strong); border-radius: var(--radius-s); padding: 0.6rem 0.7rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
textarea { resize: vertical; min-height: 5.5rem; }
.form-page { padding: 1rem 0 4rem; }
.form-intro { max-width: 60ch; color: var(--ink-2); font-size: var(--s1); line-height: 1.45; margin-bottom: 2rem; }
.form { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: clamp(1.25rem, 3vw, 2.25rem); max-width: 760px; }
fieldset { border: 0; padding: 0; margin: 0 0 2rem; }
legend { font-size: var(--s1); font-weight: 700; margin-bottom: 1rem; padding: 0; }
.fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem 1rem; }
.field { grid-column: span 6; display: flex; flex-direction: column; gap: 0.35rem; }
.field.half { grid-column: span 3; }
.field.third { grid-column: span 2; }
@media (max-width: 600px) { .field.half, .field.third { grid-column: span 6; } }
.field label, .field .label { font-weight: 600; font-size: 0.9375rem; }
.hint { color: var(--ink-3); font-size: var(--s-1); }
.field-error { color: var(--danger); font-size: var(--s-1); font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.radio-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.radio-row label { display: inline-flex; gap: 0.45rem; align-items: center; border: 1px solid var(--rule-strong); border-radius: var(--radius-s); padding: 0.55rem 0.8rem; font-weight: 500; cursor: pointer; }
.radio-row label:has(input:checked) { border-color: var(--action); background: #eef1ff; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.notice { border-left: 4px solid var(--action); background: #eef1ff; padding: 0.9rem 1rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; margin-bottom: 1.5rem; }
.notice.error { border-color: var(--danger); background: #fdf0ef; }
.notice.success { border-color: var(--ok); background: #e7f5f1; }
.done { max-width: 60ch; }
.done h2 { font-size: var(--s3); letter-spacing: -0.03em; margin-bottom: 1rem; }
.done p { font-size: var(--s1); color: var(--ink-2); line-height: 1.45; }
.done .form-actions { margin-top: 1.75rem; }
