/* Activities — "Index" design.
   Two columns: a sticky control panel on the left, the result on the right.
   White ground, black rules, one cobalt accent. */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6f6f6f;
  --line: #e3e3e3;
  --rule: #111111;
  --accent: #1f3fbf;
  --accent-tint: #eef1fb;
  --stop: #b8312f;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 40px 64px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  column-gap: 72px;
  row-gap: 40px;
  align-items: start;
}
/* Sticky, and as tall as the first screen so the page switcher can sit at the
   bottom of it, just above the fold, on every page. */
.panel { position: sticky; top: 56px; display: flex; flex-direction: column; gap: 32px; min-height: calc(100vh - 112px); }

/* ---------- Title ---------- */
.hero { display: flex; flex-direction: column; gap: 32px; }
.title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
/* The whole heading links home and looks exactly like plain text. */
.title-link { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: inherit; text-decoration: none; }
.title-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.title-name { display: block; height: 56px; width: auto; max-width: 100%; }
.tagline { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 36ch; text-wrap: pretty; }

/* ---------- Fields ----------
   Each select carries its own label as the first option. A select still showing
   that label is optional and rendered grey; Age is required and stays black. */
.filters { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field select {
  appearance: none; -webkit-appearance: none;
  width: 100%; min-width: 0;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  padding: 0 36px 0 12px;
  cursor: pointer;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111111' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color .12s ease, color .12s ease;
}
.field select.is-placeholder { color: var(--muted); border-color: #bdbdbd; }
.field-required select.is-placeholder { color: var(--ink); border-color: var(--rule); }
.field select option { color: var(--ink); }
.field select:hover { border-color: var(--accent); }
.field select.is-missing { border-color: var(--stop); box-shadow: inset 0 0 0 1px var(--stop); }

.field select:focus-visible,
.go:focus-visible,
.thumb:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.go {
  margin-top: 8px;
  height: 46px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.go:hover { background: var(--accent); border-color: var(--accent); }
.go:disabled { background: var(--line); border-color: var(--line); color: var(--muted); cursor: default; }

/* ---------- Page link at the bottom of the panel ---------- */
.panel-nav { font-size: 13px; display: flex; align-items: center; gap: 8px; margin-top: auto; position: relative; }
.panel-nav a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .12s ease; }
.panel-nav a:hover { color: var(--accent); }
.panel-nav a[aria-current="page"] { text-decoration: none; }
.panel-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel-nav-sep { color: #d4d4d4; }

/* ---------- Profile: gear in the nav, drawer opening upward ---------- */
.settings { position: static; display: inline-flex; }
.gear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  border: 0; background: none; color: var(--ink);
  cursor: pointer; transition: color .12s ease, transform .18s ease;
}
.gear:hover { color: var(--accent); transform: rotate(45deg); }
.gear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gear[aria-expanded="true"] { color: var(--accent); }

.drawer {
  position: absolute; left: 0; bottom: calc(100% + 12px); z-index: 20;
  width: 100%; max-width: min(340px, calc(100vw - 40px));
  background: var(--bg); border: 1px solid #d4d4d4;
  padding: 18px 18px 14px;
  animation: drawer-in .16s ease-out;
}
@keyframes drawer-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } .gear:hover { transform: none; } }

.drawer-form { display: flex; flex-direction: column; gap: 10px; }
/* Label left, value right, on one baseline. Same family and size for both; only
   the colour separates the label from the thing it labels. */
.drawer-field { display: grid; grid-template-columns: 62px minmax(0, 1fr); column-gap: 14px; align-items: baseline; }
.drawer-field span { font-size: 15px; font-weight: 400; letter-spacing: 0; text-transform: none; line-height: 1.4; color: var(--muted); }
.drawer-field input, .drawer-field select {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: auto; padding: 0;
  border: 0; border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.4;
  text-overflow: ellipsis;
}
.drawer-field select {
  padding-right: 20px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111111' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center;
}
/* The native date field keeps its own picker button; pull it flush left too. */
.drawer-field input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; padding: 0; cursor: pointer; }
.drawer-field input:focus-visible, .drawer-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.drawer-error { margin: 0; font-size: 13px; color: var(--stop); }
.linkish {
  font-family: var(--sans); font-size: inherit; color: var(--muted);
  background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px;
}
.linkish:hover { color: var(--accent); text-decoration-color: var(--accent); }
.mini {
  height: 34px; padding: 0 14px;
  border: 1px solid var(--ink); border-radius: 0;
  background: var(--ink); color: #fff;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.mini:hover { background: var(--accent); border-color: var(--accent); }
.linkish:focus-visible, .mini:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drawer-actions { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.drawer-reset { margin-left: auto; }
.drawer-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* Set as text when the name is not the one the lettering was drawn for. */
.title-name-text { display: block; font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }

/* ---------- Result ---------- */
.result { display: flex; flex-direction: column; gap: 20px; }
.card-empty { border: 1px dashed #bdbdbd; padding: 40px 32px; color: var(--muted); }
.empty-title { margin: 0 0 6px; font-size: 18px; font-weight: 500; color: var(--ink); text-wrap: balance; }
.empty-sub { margin: 0; font-size: 14px; }

.card-body { padding: 32px 32px 28px; }
.badge {
  display: inline-block; margin: 0 0 16px;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-tint); padding: 4px 8px;
}
.activity-name {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
}
.activity-how { margin: 0; font-size: 18px; line-height: 1.5; max-width: 60ch; text-wrap: pretty; }

.activity-meta {
  margin: 0;
  border-top: 1px solid var(--line);
}
.meta-row {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  gap: 0 16px;
  padding: 14px 32px;
  border-top: 1px solid var(--line);
  font-size: 14px; line-height: 1.45;
}
.meta-row:first-child { border-top: 0; }
.meta-row dt { font-weight: 700; }
.meta-row dd { margin: 0; }
.stop-cue { display: block; color: var(--stop); }

.feedback { border-top: 1px solid var(--line); display: flex; align-items: stretch; justify-content: flex-end; padding: 0 12px; }
.thumb {
  font-family: var(--sans);
  font-size: 14px; font-weight: 700; line-height: 1.45;
  color: var(--ink); background: transparent;
  border: 0;
  padding: 14px 20px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.thumb:hover { background: var(--accent-tint); }
.thumb[aria-pressed="true"] { background: var(--ink); color: #fff; }
#down[aria-pressed="true"] { background: var(--stop); }
.feedback-note { font-size: 13px; color: var(--muted); align-self: center; padding: 0 16px 0 20px; margin-right: auto; }


/* ---------- Footer (under the result column) ---------- */
.foot { grid-column: 2; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.liked summary { cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; }
.liked summary::-webkit-details-marker { display: none; }
.liked summary::after { content: " ↓"; color: var(--muted); }
.liked[open] summary::after { content: " ↑"; }
.liked summary span { color: var(--muted); font-weight: 400; }
.liked ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 24px; }
.liked li strong { display: block; color: var(--ink); font-weight: 600; }
.liked li small { font-size: 13px; }
.fineprint { margin: 0; }

/* card swap animation */
.card-activity.swap { animation: slide .22s ease-out; }
@keyframes slide { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card-activity.swap { animation: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; padding: 32px 20px 48px; row-gap: 32px; }
  /* The panel dissolves into the single-column grid so the page switcher can
     move to the very bottom, below the footer; the drawer still opens upward. */
  .panel { display: contents; }
  .panel-nav { margin-top: 0; order: 2; }
  .foot { order: 1; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .field:first-child, .go { grid-column: 1 / -1; }
  .foot { grid-column: 1; }
}
@media (max-width: 560px) {
  .card-body { padding: 24px 20px 22px; }
  .meta-row { grid-template-columns: 1fr; gap: 4px 0; padding: 12px 20px; }
  .feedback { flex-wrap: wrap; padding: 0; }
  .feedback-note { width: 100%; order: -1; padding: 10px 20px; border-bottom: 1px solid var(--line); }
  .feedback-note:empty { display: none; }
}
