/* bin.adelaidelive.app — which bins go out tonight, and what goes in them.
   Three questions once, then one screen that answers itself. */
:root {
  --font-sans: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(1rem, 3vw, 2.5rem);
  --blue: #2f6fb0; --yellow: #d9a218; --green: #2f9e44; --none: #8b8f96;
}
:root[data-theme="day"] {
  color-scheme: light;
  --bg: #f1f2ee; --surface: #fafbf8; --ink: #191b18; --dim: #646a63;
  --line: rgba(25, 27, 24, 0.12); --line-strong: rgba(25, 27, 24, 0.3);
  --accent: #2f9e44; --body: #b9bec4;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #121512; --surface: #1a1e1a; --ink: #e8ebe6; --dim: #98a096;
  --line: rgba(232, 235, 230, 0.12); --line-strong: rgba(232, 235, 230, 0.3);
  --accent: #4fcf7a; --body: #4a5158;
  --blue: #5a9fe0; --yellow: #e6c14a; --green: #4fcf7a; --none: #7d848c;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: clamp(16px, 0.45vw + 11px, 19px); line-height: 1.45; font-variant-ligatures: none; transition: background-color 700ms ease, color 700ms ease; }
body { margin: 0; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; font-variation-settings: "opsz" 14; }
body > *, main > * { min-width: 0; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--line-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
p, h1 { margin: 0; }
ol { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.8rem var(--gutter); font-family: var(--font-mono); font-size: 0.8rem; }
.brand { text-decoration: none; font-weight: 500; }
.top nav { display: flex; align-items: center; gap: 1.1rem; }
.top nav a { color: var(--dim); text-decoration: none; }
.theme { color: var(--dim); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.22rem 0.75rem; cursor: pointer; }
.theme:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- first run ---------- */
.setup { display: grid; place-items: center; padding: var(--gutter); }
.setup-card { width: min(100%, 34rem); background: var(--surface); border: 1px solid var(--line); border-radius: 0.9rem; padding: clamp(1.2rem, 4vw, 2rem); }
.step { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }
.ask h1 { font-size: clamp(1.4rem, 3.2vw, 2rem); font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; margin: 0.5rem 0 0.4rem; font-variation-settings: "opsz" 60; }
.ask h1 em { font-style: normal; color: var(--accent); }
.hint { color: var(--dim); font-size: 0.9rem; line-height: 1.4; }
.hint.dim { font-size: 0.82rem; margin-top: 0.8rem; }
.big-btn { display: block; width: 100%; margin-top: 1rem; padding: 0.8rem 1rem; background: var(--ink); color: var(--bg); border: 0; border-radius: 0.6rem; font-weight: 600; cursor: pointer; }
.big-btn:hover { opacity: 0.9; }
.or { text-align: center; font-family: var(--font-mono); font-size: 0.75rem; color: var(--dim); margin: 0.7rem 0; }
#council-select { width: 100%; padding: 0.7rem 0.8rem; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 0.6rem; }
.err { margin-top: 0.7rem; font-size: 0.85rem; color: #c0392b; }
.days { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.2rem, 1fr)); gap: 0.4rem; margin-top: 1rem; }
.days button { padding: 0.7rem 0.3rem; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 0.6rem; cursor: pointer; font-family: var(--font-mono); font-size: 0.85rem; }
.days button:hover { border-color: var(--ink); }
.bin-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 1rem; }
.bin-choice button { display: grid; justify-items: center; gap: 0.4rem; padding: 1rem 0.5rem; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 0.7rem; cursor: pointer; font-weight: 600; }
.bin-choice button:hover { border-color: var(--ink); }
.bin-choice svg { width: 3.4rem; height: 3.4rem; }

/* ---------- the answer ---------- */
main { width: min(100% - 2 * var(--gutter), 76rem); margin: 0 auto; display: grid; gap: clamp(1rem, 3vh, 2rem); align-content: start; padding-bottom: 1rem; }
/* wide screens: the answer on the left, the weeks and the A-Z on the right */
@media (min-width: 1000px) {
  main { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: auto auto; column-gap: clamp(2rem, 5vw, 4rem); row-gap: clamp(1rem, 3vh, 2rem); align-content: center; }
  .answer { grid-column: 1; grid-row: 1 / 3; align-self: start; padding-top: 0; }
  .ahead { grid-column: 2; grid-row: 1; align-self: start; }
  .lookup { grid-column: 2; grid-row: 2; align-self: start; }
  .weeks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body { height: 100dvh; grid-template-rows: auto minmax(0, 1fr) auto; }
  .results { max-height: min(34vh, 20rem); }
}
.where { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 0.8rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--dim); }
.link-btn { background: transparent; border: 0; padding: 0; color: var(--dim); font-family: var(--font-mono); font-size: 0.78rem; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.answer { padding-top: clamp(0.5rem, 3vh, 2rem); }
.when { font-size: clamp(2.6rem, 6.5vw, 5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin: 0.25rem 0 0.1rem -0.03em; font-variation-settings: "opsz" 96; }
.bins { display: flex; flex-wrap: wrap; gap: clamp(0.8rem, 3vw, 2rem); margin: 1rem 0 0.8rem; }
.bin { display: grid; justify-items: center; gap: 0.3rem; }
.bin svg { width: clamp(4rem, 11vw, 7rem); height: clamp(4rem, 11vw, 7rem); }
.bin .label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--dim); }
.sub { font-size: 1.05rem; color: var(--dim); max-width: 42rem; line-height: 1.4; }
.holiday { margin-top: 0.7rem; font-size: 0.88rem; color: var(--ink); background: color-mix(in srgb, var(--yellow) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--yellow) 40%, var(--line)); border-radius: 0.5rem; padding: 0.5rem 0.7rem; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); margin-bottom: 0.5rem; }
.section-head .count { text-transform: none; letter-spacing: 0; }
.weeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.5rem; }
.week { display: grid; gap: 0.35rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.6rem 0.7rem; }
.week.is-next { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.week .d { font-family: var(--font-mono); font-size: 0.78rem; }
.week .d b { font-weight: 500; }
.week .lids { display: flex; gap: 0.3rem; }
.week .lids i { display: block; width: 1.5rem; height: 0.55rem; border-radius: 999px; background: var(--tone); }
.week .hol { font-size: 0.72rem; color: var(--dim); }

.lookup input { width: 100%; padding: 0.7rem 0.9rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 0.6rem; }
.results { margin-top: 0.5rem; display: grid; gap: 0.35rem; max-height: 40vh; overflow-y: auto; scrollbar-width: thin; }
.result { display: grid; grid-template-columns: 0.9rem minmax(0, 1fr); gap: 0.1rem 0.7rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.5rem 0.7rem; }
.result .lid { grid-column: 1; grid-row: 1 / -1; width: 0.9rem; border-radius: 0.25rem; background: var(--tone); }
.result .n, .result .b, .result .t { grid-column: 2; min-width: 0; }
.result .n { font-weight: 600; font-size: 0.95rem; }
.result .b { font-family: var(--font-mono); font-size: 0.72rem; color: var(--tone); }
.result .t { font-size: 0.85rem; color: var(--dim); line-height: 1.35; }
.empty { color: var(--dim); font-size: 0.9rem; padding: 0.6rem 0; }
[data-tone="blue"] { --tone: var(--blue); }
[data-tone="yellow"] { --tone: var(--yellow); }
[data-tone="green"] { --tone: var(--green); }
[data-tone="none"] { --tone: var(--none); }

.foot { padding: 0.8rem var(--gutter) 1.2rem; font-size: 0.75rem; color: var(--dim); line-height: 1.5; max-width: 70rem; }
.foot a { color: var(--dim); }

@media (max-width: 620px) {
  .top nav a { display: none; }
  .bin-choice { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
