/* MijnUitjes.nl — editorial agenda for Utrecht.
   The events are the page; the interface stays out of their way.
   Colour carries one job only: which kind of outing this is. */

:root {
    --paper: #FCFBF8;
    --paper-sunk: #F4F2EC;
    --ink: #191715;
    --ink-2: #5A554E;
    --rule: #E2DED4;
    --rule-strong: #CFC9BC;

    /* Red-onion skin: the one accent, used for the mark, links and the live "today" signal. */
    --accent: #A32C5F;
    --accent-deep: #7A2047;
    --accent-tint: #F8EBF1;

    --shell: 1180px;
    --gap: 1.5rem;

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Category colours. Muted enough to sit under photography, distinct enough to scan. */
.cat-concert { --cat: #2B5AA6; }
.cat-festival { --cat: #B85417; }
.cat-theater { --cat: #6E4596; }
.cat-comedy { --cat: #C2452F; }
.cat-film { --cat: #2F6B55; }
.cat-expo { --cat: #8A6D22; }
.cat-markt { --cat: #A32C5F; }
.cat-eten-drinken { --cat: #A8412A; }
.cat-nightlife { --cat: #39406B; }
.cat-familie { --cat: #2A7078; }
.cat-sport-spel { --cat: #4F6B2A; }
.cat-beurs { --cat: #6A5B4A; }
.cat-rondleiding { --cat: #35635F; }
.cat-lezing { --cat: #7A5230; }
.cat-overig { --cat: #5A554E; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
    caret-color: var(--accent);
    scrollbar-color: var(--rule-strong) var(--paper);
}

::selection { background: var(--accent-tint); color: var(--accent-deep); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border: 3px solid var(--paper); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-2); }

a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }

img { max-width: 100%; display: block; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-variation-settings: "SOFT" 20, "WONK" 1;
    line-height: 1.12;
    letter-spacing: -0.012em;
    text-wrap: balance;
    margin: 0;
}

p { margin: 0 0 1rem; }

.shell {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 50;
    background: var(--ink); color: var(--paper);
    padding: 0.6rem 1rem; font-size: 0.875rem;
    transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* ---------- Masthead ---------- */

.masthead {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--rule);
}

.masthead__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 4.25rem;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--ink);
    flex: none;
}
.wordmark svg { width: 1.5rem; height: 1.5rem; color: var(--accent); flex: none; }
.wordmark em { font-style: normal; color: var(--ink-2); font-weight: 600; }

.search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    background: var(--paper-sunk);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.25rem 0.25rem 0.25rem 0.85rem;
    min-width: min(22rem, 45vw);
    transition: border-color 0.2s var(--ease-out);
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 1rem; height: 1rem; color: var(--ink-2); flex: none; }
.search input {
    flex: 1; min-width: 0;
    border: 0; background: none; font: inherit; color: inherit;
    padding: 0.35rem 0;
}
.search input::placeholder { color: var(--ink-2); }
.search input:focus { outline: none; }
.search button {
    flex: none;
    border: 0; border-radius: 999px;
    background: var(--ink); color: var(--paper);
    font: inherit; font-size: 0.875rem; font-weight: 500;
    padding: 0.4rem 0.95rem;
    cursor: pointer;
    transition: background 0.2s var(--ease-out);
}
.search button:hover { background: var(--accent-deep); }

.search-toggle {
    display: none;
    flex: none;
    width: 2.5rem; height: 2.5rem;
    align-items: center; justify-content: center;
    background: var(--paper-sunk);
    border: 1px solid var(--rule);
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
}
.search-toggle svg { width: 1.05rem; height: 1.05rem; }

.city-badge {
    flex: none;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-2);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
}

/* ---------- Intro + filters ---------- */

.intro { padding: 2.5rem 0 1.25rem; }

.intro__title {
    font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.9rem);
    max-width: 18ch;
}

.intro__count {
    font-size: 1.0625rem;
    color: var(--ink-2);
    margin: 0.9rem 0 0;
    letter-spacing: -0.005em;
}
.intro__count strong { color: var(--ink); font-weight: 600; }
.intro__dot { color: var(--rule-strong); margin: 0 0.4rem; }

.filters { padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }

.periods {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1.75rem 0 1rem;
}
.periods a {
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    color: var(--ink-2);
    transition: color 0.18s var(--ease-out), border-color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}
.periods a:hover { color: var(--ink); border-color: var(--ink-2); }
.periods a[aria-current] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    font-size: 0.875rem;
}
.categories a {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--ink-2);
    padding: 0.15rem 0;
    transition: color 0.18s var(--ease-out);
}
.categories a::before {
    content: "";
    width: 0.5rem; height: 0.5rem;
    border-radius: 50%;
    background: var(--cat, var(--rule-strong));
    transform: translateY(-0.05rem);
    flex: none;
}
.categories a:hover { color: var(--ink); }
.categories a[aria-current] { color: var(--ink); font-weight: 600; }
.categories a span { font-size: 0.8125rem; color: var(--rule-strong); }
.categories a[aria-current] span { color: var(--ink-2); }

.active-filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
    margin-top: 1.1rem;
    font-size: 0.875rem; color: var(--ink-2);
}
.active-filters a { color: var(--accent); }

/* ---------- Day groups ---------- */

.day { padding: 2.25rem 0 0; }

.day__heading {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 1.75rem;
}
.day__date {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    font-variation-settings: "SOFT" 20, "WONK" 1;
}
.day__relative {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--accent);
}
.day__count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--ink-2);
}

/* ---------- Event grid ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
    gap: 2.5rem var(--gap);
}

.event { position: relative; min-width: 0; }

.event__frame {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--paper-sunk);
    border-radius: 3px;
    margin-bottom: 0.9rem;
}
.event__frame img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}
.event:hover .event__frame img { transform: scale(1.035); }

/* No image from the source: a drawn placeholder rather than a grey box. */
.event__frame--empty {
    display: grid;
    place-items: center;
    color: var(--rule-strong);
}
.event__frame--empty svg { width: 3rem; height: 3rem; }

.event__time {
    position: absolute;
    left: 0.6rem; bottom: 0.6rem;
    background: var(--paper);
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
}

.event__free {
    position: absolute;
    right: 0.6rem; top: 0.6rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
}

.event__cat {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cat, var(--ink-2));
    display: block;
    margin-bottom: 0.3rem;
}

.event__title {
    font-size: 1.125rem;
    line-height: 1.25;
    margin: 0 0 0.35rem;
}
.event__title a { text-decoration: none; }
.event__title a::after { content: ""; position: absolute; inset: 0; }
.event:hover .event__title { text-decoration: underline; text-decoration-color: var(--rule-strong); }

.event__meta {
    font-size: 0.875rem;
    color: var(--ink-2);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: baseline;
}
.event__meta .dot { color: var(--rule-strong); }

.event__summary {
    font-size: 0.9375rem;
    color: var(--ink-2);
    margin: 0.5rem 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* One authored moment: the listing settles in on load, top-down. */
@media (prefers-reduced-motion: no-preference) {
    .day { animation: rise 0.6s var(--ease-out) both; }
    .day:nth-of-type(2) { animation-delay: 0.06s; }
    .day:nth-of-type(3) { animation-delay: 0.12s; }
    .day:nth-of-type(n+4) { animation-delay: 0.18s; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(0.75rem); }
    to { opacity: 1; transform: none; }
}

/* ---------- Empty state ---------- */

.empty {
    padding: 4rem 0 5rem;
    max-width: 38ch;
}
.empty svg { width: 3.5rem; height: 3.5rem; color: var(--rule-strong); margin-bottom: 1.25rem; }
.empty h2 { font-size: 1.5rem; margin-bottom: 0.6rem; }
.empty p { color: var(--ink-2); }

.button {
    display: inline-block;
    background: var(--ink);
    color: var(--paper);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    transition: background 0.2s var(--ease-out);
}
.button:hover { background: var(--accent-deep); }
.button--ghost {
    background: none;
    color: var(--ink);
    border: 1px solid var(--rule-strong);
}
.button--ghost:hover { background: var(--paper-sunk); color: var(--ink); }

/* ---------- Endless feed ---------- */

.feed-end {
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    min-height: 3rem;
    text-align: center;
}
.feed-end__status { color: var(--ink-2); font-size: 0.9375rem; margin: 0; }

@media (prefers-reduced-motion: no-preference) {
    .day--appended { animation: rise 0.5s var(--ease-out) both; }
}

/* ---------- Detail page ---------- */

.detail { padding-block: 2.5rem 4rem; }

.detail__back {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.detail__back:hover { color: var(--ink); }
.detail__back svg { width: 0.9rem; height: 0.9rem; }

.detail__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.9fr);
    gap: 3rem;
    margin-top: 2rem;
    align-items: start;
}

.detail__title {
    font-size: clamp(1.9rem, 1.3rem + 2vw, 2.75rem);
    margin: 0.5rem 0 0.75rem;
}

.detail__lead {
    font-size: 1.0625rem;
    color: var(--ink-2);
    max-width: 68ch;
}

.detail__body {
    max-width: 68ch;
    margin-top: 1.25rem;
    font-size: 1.0625rem;
}
.detail__body p:first-child { color: var(--ink); }
.detail__body p { margin-bottom: 1.1rem; }

.detail__image {
    border-radius: 3px;
    overflow: hidden;
    background: var(--paper-sunk);
    /* figure carries a browser default side margin that would inset the photo. */
    margin: 0 0 1.75rem;
    aspect-ratio: 16 / 9;
}
.detail__image img { width: 100%; height: 100%; object-fit: cover; }

.facts {
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 1.4rem 1.5rem;
    background: var(--paper-sunk);
    position: sticky;
    top: 6rem;
}
.facts dl { margin: 0; display: grid; gap: 1.1rem; }
.facts dt {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin-bottom: 0.15rem;
}
.facts dd { margin: 0; font-size: 0.9375rem; }
.facts .button { margin-top: 1.4rem; width: 100%; text-align: center; }
.facts__source {
    margin-top: 0.9rem;
    font-size: 0.8125rem;
    color: var(--ink-2);
    text-align: center;
}

.related { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.related h2 { font-size: 1.375rem; margin-bottom: 1.75rem; }

/* ---------- Sources page ---------- */

.sources { padding-block: 2.5rem 4rem; }
.sources__intro { max-width: 68ch; color: var(--ink-2); margin: 1.25rem 0 2.5rem; font-size: 1.0625rem; }

.source-list { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.source {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--rule);
    align-items: start;
}
.source h2 { font-size: 1.25rem; margin-bottom: 0.1rem; }
.source__note { font-size: 0.9375rem; color: var(--ink-2); margin: 0.4rem 0 0; max-width: 68ch; }
.source__count {
    font-size: 0.9375rem;
    color: var(--ink-2);
    white-space: nowrap;
}
.source__count b { color: var(--ink); font-weight: 500; }
.source--off { opacity: 0.72; }
.source--off .source__count { color: var(--accent-deep); }

/* ---------- Footer ---------- */

.footer {
    margin-top: 5rem;
    border-top: 1px solid var(--rule);
    background: var(--paper-sunk);
    padding: 2.5rem 0;
}
.footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    align-items: flex-end;
}
.footer__lead { max-width: 52ch; color: var(--ink-2); font-size: 0.9375rem; margin-bottom: 0.5rem; }
.footer__meta { font-size: 0.9375rem; color: var(--ink-2); margin: 0; }
.footer__mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--rule-strong);
    margin: 0;
}
.footer__mark em { font-style: normal; }

/* ---------- Responsive ---------- */

@media (max-width: 60rem) {
    .detail__grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
    .facts { position: static; }
}

@media (max-width: 48rem) {
    .shell { padding: 0 1rem; }

    /* Header, title and filters used to fill the whole first screen on a phone.
       Each now takes one row, so the first cards are visible without scrolling. */
    .masthead__inner { gap: 0.6rem; min-height: 0; padding: 0.7rem 0; }
    .wordmark { font-size: 1.125rem; }
    .search { display: none; }
    .search--open {
        display: flex;
        position: absolute;
        left: 0; right: 0; top: 100%;
        margin: 0 0 0.75rem;
        min-width: 0;
        z-index: 2;
    }
    .search-toggle { display: inline-flex; margin-left: auto; }
    .city-badge { margin-left: 0; }

    .intro { padding: 1.25rem 0 0.5rem; }
    .intro__title { font-size: 1.75rem; max-width: none; }
    .intro__count { font-size: 0.9375rem; margin-top: 0.5rem; }

    .filters { padding-bottom: 1rem; }

    /* One swipeable row instead of four wrapped ones. */
    .periods,
    .categories {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .periods::-webkit-scrollbar,
    .categories::-webkit-scrollbar { display: none; }
    .periods { margin-top: 1rem; margin-bottom: 0.85rem; }
    .periods a, .categories a { white-space: nowrap; flex: none; }
    .categories { gap: 0 1rem; }

    .day { padding-top: 1.5rem; }
    .day__heading { margin-bottom: 1.25rem; padding-bottom: 0.7rem; }
    .day__date { font-size: 1.1875rem; }
    .grid { gap: 1.75rem 1.25rem; }
    .day__count { display: none; }
}
}

/* These classes share their element with .shell, so they only set block padding:
   a padding shorthand here would wipe the shell's gutters. */

/* ---------- Long-form pages ---------- */

.prose { max-width: 68ch; padding-block: 2.5rem 4rem; }
.prose h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.6rem); margin-bottom: 1rem; }
.prose h2 { font-size: 1.375rem; margin: 2.25rem 0 0.6rem; }
.prose p { color: var(--ink); }
.prose__lead { font-size: 1.125rem; color: var(--ink-2); margin-bottom: 1.5rem; }
.prose__eyebrow-free { font-size: 0.9375rem; color: var(--ink-2); margin-bottom: 1.25rem; }
.prose code { background: var(--paper-sunk); padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.9em; }

.city-list { list-style: none; padding: 0; margin: 2rem 0 0; }
.city-list__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
}
.city-list__item a { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; text-decoration: none; }
.city-list__item a:hover { text-decoration: underline; }
.city-list__state { color: var(--ink-2); font-size: 0.9375rem; }
.city-list__item--live .city-list__state { color: var(--accent); }
.city-list--inline { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.city-list--inline .city-list__item { border: 0; padding: 0.3rem 0; }

/* ---------- Disclaimer + consent ---------- */

.footer__main { max-width: 62ch; }
.footer__links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-top: 0.75rem; font-size: 0.9375rem; }
.footer__links a { color: var(--ink-2); }
.footer__links a:hover { color: var(--ink); }

.disclaimer {
    margin: 2.5rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule-strong);
    max-width: 90ch;
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--ink-2);
}
.disclaimer strong { color: var(--ink); font-weight: 600; }

.consent {
    position: fixed;
    left: 1rem; right: 1rem; bottom: 1rem;
    z-index: 40;
    background: var(--ink);
    color: var(--paper);
    border-radius: 6px;
    box-shadow: 0 12px 32px -8px rgb(25 23 21 / 45%);
    padding: 1.25rem 1.4rem;
}
.consent__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    align-items: center;
    justify-content: space-between;
    max-width: var(--shell);
    margin: 0 auto;
}
.consent__title { font-size: 1.0625rem; color: var(--paper); margin-bottom: 0.3rem; }
.consent__text { margin: 0; max-width: 62ch; font-size: 0.9375rem; color: #DCD6CC; }
.consent__text a { color: var(--paper); }
.consent__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.consent .button { background: var(--paper); color: var(--ink); }
.consent .button:hover { background: #FFFFFF; }
.consent .button--ghost { background: none; color: var(--paper); border-color: #6A6259; }
.consent .button--ghost:hover { background: #2A2724; color: var(--paper); }

/* ---------- Admin ---------- */

.admin { padding-block: 2.5rem 4rem; }
.admin__header { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.admin__header h1 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.25rem); }
.admin__subtitle { color: var(--ink-2); margin: 0.5rem 0 0; }
.admin__logout { margin: 0; }
.admin__ranges { display: flex; gap: 0.4rem; margin: 1.75rem 0 2rem; }
.admin__ranges a {
    font-size: 0.9375rem; font-weight: 500; text-decoration: none;
    padding: 0.4rem 0.85rem; border: 1px solid var(--rule-strong); border-radius: 999px; color: var(--ink-2);
}
.admin__ranges a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.admin__note { margin-top: 2.5rem; font-size: 0.875rem; color: var(--ink-2); max-width: 72ch; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; }
.tile {
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--paper-sunk);
    padding: 1.1rem 1.2rem;
    display: flex; flex-direction: column; gap: 0.15rem;
}
.tile__label { font-size: 0.8125rem; color: var(--ink-2); }
.tile__value { font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.tile__note { font-size: 0.8125rem; color: var(--ink-2); }

.panel { margin-top: 2.5rem; }
.panel h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.panel__empty { color: var(--ink-2); }

.admin__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0 2.5rem; }

.chart {
    --chart-h: 9rem;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: var(--chart-h);
    border-bottom: 1px solid var(--rule-strong);
}

/* A bar is a fraction of a fixed chart height, set inline as --bar, and not a percentage of its
   column. A percentage height on a flex item only resolves in some browsers, and where it does
   not every bar collapsed to its min-height and the chart read as a flat line. */
.chart__col { position: relative; height: var(--chart-h); }
.chart__bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--bar, 0) * var(--chart-h));
    min-height: 2px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
    opacity: 0.85;
}
.chart__col:hover .chart__bar { opacity: 1; }
.chart__scale {
    display: flex; justify-content: space-between;
    font-size: 0.8125rem; color: var(--ink-2); margin: 0.6rem 0 0;
}

/* ---------- Hourly chart ---------- */

/* Visitors are a subset of visits, so the two series are drawn on the same baseline with the
   darker one in front. That reads as "of these visits, this many people" without needing twice
   as many bars across 24 hours. */
.chart--hours { --chart-h: 7.5rem; gap: 3px; }
.chart--hours .chart__col { flex: 1; min-width: 0; }

.chart__bar--visits { opacity: 0.32; }
.chart__bar--visitors { opacity: 1; }
.chart--hours .chart__col:hover .chart__bar--visits { opacity: 0.5; }

/* An hour with nothing in it keeps its place: the gaps are part of the shape of a day. */
.chart--hours .chart__col::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--rule);
}

.chart__legend {
    display: flex;
    align-items: center;
    gap: 0.4rem 1rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--ink-2);
    margin: 0 0 0.75rem;
}
.chart__key {
    display: inline-block;
    width: 0.7rem; height: 0.7rem;
    border-radius: 2px;
    background: var(--accent);
    margin-right: 0.1rem;
    vertical-align: -1px;
}
.chart__key--visits { opacity: 0.32; }

.chart__hours {
    display: flex;
    gap: 3px;
    font-size: 0.75rem;
    color: var(--ink-2);
    margin: 0.45rem 0 0;
    font-variant-numeric: tabular-nums;
}
/* Same flex basis and gap as the columns, so label and bar share a centre line. */
.chart__hours span { flex: 1; min-width: 0; text-align: center; }


.ranked { list-style: none; padding: 0; margin: 0; }
.ranked li {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: 0.55rem 0; border-bottom: 1px solid var(--rule);
    font-size: 0.9375rem;
}
.ranked li > span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; flex: none; }
.ranked__path { overflow-wrap: anywhere; }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td { text-align: left; padding: 0.55rem 0.9rem 0.55rem 0; border-bottom: 1px solid var(--rule); }
.table th { font-weight: 600; color: var(--ink-2); font-size: 0.8125rem; }
.table td { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Login ---------- */

.login { display: flex; justify-content: center; padding-block: 4rem 6rem; }
.login__form { width: min(24rem, 100%); }
.login__form h1 { font-size: 1.875rem; }
.login__intro { color: var(--ink-2); margin: 0.5rem 0 1.75rem; }
.login__error { color: var(--accent-deep); margin-bottom: 1rem; font-size: 0.9375rem; }
.login__error ul { margin: 0; padding-left: 1.1rem; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 0.9375rem; font-weight: 500; margin-bottom: 0.35rem; }
.field input {
    width: 100%;
    font: inherit;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--rule-strong);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field__error { display: block; color: var(--accent-deep); font-size: 0.875rem; margin-top: 0.3rem; }
.login__form .button { width: 100%; text-align: center; border: 0; cursor: pointer; font-family: inherit; }

@media (max-width: 48rem) {
    .consent { left: 0.5rem; right: 0.5rem; bottom: 0.5rem; padding: 0.9rem 1rem; }
    .consent__inner { gap: 0.85rem; }
    .consent__title { font-size: 0.9375rem; }
    .consent__text { font-size: 0.875rem; line-height: 1.5; }
    .consent__actions { width: 100%; }
    .consent__actions .button { flex: 1; text-align: center; font-size: 0.875rem; padding: 0.5rem 0.75rem; }
    .admin__grid { gap: 0; }
    .chart--hours { --chart-h: 6rem; gap: 1px; }
    .chart__hours { gap: 1px; font-size: 0.6875rem; }
}
