/* ── Fonts ─────────────────────────────────────────── */
@font-face {
    font-family: 'League Gothic';
    src: url('fonts/league-gothic.woff2') format('woff2');
    font-weight: 400 900;
    font-display: swap;
}
@font-face {
    font-family: 'Newsreader';
    src: url('fonts/newsreader-400.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Newsreader';
    src: url('fonts/newsreader-400-italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Newsreader';
    src: url('fonts/newsreader-600.woff2') format('woff2');
    font-weight: 600 700;
    font-display: swap;
}
@font-face {
    font-family: 'Libre Franklin';
    src: url('fonts/libre-franklin-400.woff2') format('woff2');
    font-weight: 400 500;
    font-display: swap;
}
@font-face {
    font-family: 'Libre Franklin';
    src: url('fonts/libre-franklin-600.woff2') format('woff2');
    font-weight: 600 700;
    font-display: swap;
}
@font-face {
    font-family: 'Libre Franklin';
    src: url('fonts/libre-franklin-800.woff2') format('woff2');
    font-weight: 800 900;
    font-display: swap;
}

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ink: #101113;
    --paper: #fbfbf9;
    --sheet: #fff;
    --wash: #f0f0ec;
    --hair: #cfcfca;
    --mute: #55575c;
    --faint: #85878c;

    --hl: #ffee3b;
    --hl-pale: #fff8b0;
    --hl-pink: #ff9cc8;
    --hl-orange: #ffb84d;
    --hl-green: #a6ef92;
    --hl-blue: #9bdcff;
    --hl-grey: #dddcd7;

    --display: 'League Gothic', 'Avenir Next Condensed', 'Bahnschrift', 'Roboto Condensed', 'Arial Narrow', Impact, sans-serif;
    --text: 'Newsreader', Charter, 'Iowan Old Style', 'Sitka Text', Cambria, Georgia, serif;
    --ui: 'Libre Franklin', 'Franklin Gothic Medium', 'Helvetica Neue', Arial, sans-serif;

    --page: 1120px;
    --gutter: 1.5rem;
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--text);
    font-size: 1.0625rem;
    line-height: 1.5;
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: var(--hl); color: var(--ink); }

a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    background: var(--hl);
    text-decoration-color: transparent;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}

strong { font-weight: 600; }

/* ── Masthead ─────────────────────────────────────────── */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
}

.site-strap {
    background: var(--ink);
    color: var(--paper);
    font-family: var(--ui);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.5rem max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter))) 0.45rem;
}

.site-header::after {
    content: '';
    display: block;
    height: 4px;
    background: var(--ink);
    margin-bottom: 3px;
}

.site-header-inner {
    max-width: var(--page);
    margin: 0 auto;
    padding: 1.1rem var(--gutter) 0.9rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
}

.site-logo {
    font-family: var(--display);
    font-size: 3.1rem;
    font-weight: 700;
    line-height: 0.85;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.14em;
}

.site-logo:hover { background: none; }

.site-logo__icon {
    width: 0.62em;
    height: 0.62em;
    stroke: var(--ink);
    stroke-width: 3;
    flex-shrink: 0;
    margin-right: 0.04em;
}

.site-logo span {
    background: var(--hl);
    padding: 0.07em 0.12em 0;
    margin-left: 0.06em;
    border-radius: 0.06em 0.16em 0.08em 0.14em / 0.14em 0.06em 0.16em 0.08em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.6rem;
    padding-bottom: 0.2rem;
}

.site-nav a {
    font-family: var(--ui);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    padding: 0.15rem 0;
    background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 100% / 0 0.55em;
    transition: background-size 0.18s ease-out;
}

.site-nav a:hover { background-size: 100% 0.55em; }

/* ── Page ─────────────────────────────────────────────── */
.content {
    max-width: var(--page);
    margin: 0 auto;
    padding: 2.75rem var(--gutter) 5rem;
}

/* ── Typography ───────────────────────────────────────── */
h1 {
    font-family: var(--display);
    font-size: clamp(2.7rem, 7.2vw, 4.9rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

h2 {
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.subtitle {
    font-size: 1.3rem;
    line-height: 1.42;
    color: #2a2b2e;
    max-width: 34em;
    margin-bottom: 0.5rem;
}

.section-rule {
    border: none;
    border-top: 3px solid var(--ink);
    margin: 2.75rem 0 0;
}

.section-rule + * { margin-top: 1.5rem; }

.results-header {
    display: table;
    font-family: var(--ui);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--paper);
    padding: 0.5rem 0.85rem 0.45rem;
    margin-bottom: 1.5rem;
}

.section-rule + .results-header { margin-top: 0; }

/* ── Ledgers: councils and councillors ────────────────── */
.council-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--ink);
    border-left: 1px solid var(--ink);
}

@media (max-width: 960px) { .council-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .council-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 350px) { .council-grid { grid-template-columns: minmax(0, 1fr); } }

.council-card,
.councillor-card {
    display: flex;
    flex-direction: column;
    background: var(--sheet);
    color: var(--ink);
    text-decoration: none;
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    min-width: 0;
    transition: background-color 0.12s;
}

.council-card:hover,
.councillor-card:hover {
    background: var(--hl);
}

.council-card {
    justify-content: space-between;
    gap: 1.1rem;
    padding: 0.9rem 0.95rem 0.8rem;
    min-height: 6.4rem;
}

.council-card__name {
    font-family: var(--display);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.council-card__count {
    font-family: var(--ui);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mute);
}

.council-card:hover .council-card__count { color: var(--ink); }

.council-card--majority {
    background: var(--ink);
    color: var(--paper);
    border-right-color: #4a4b50;
    border-bottom-color: #4a4b50;
}

.council-card--majority .council-card__count { color: #b4b6bb; }

.council-card--majority:hover { color: var(--ink); }

.results-header + .council-grid {
    gap: 1.9rem 1.1rem;
    border: none;
    padding-top: 0.9rem;
}

.results-header + .council-grid .council-card {
    position: relative;
    border: 1px solid var(--ink);
}

.results-header + .council-grid .council-card::before {
    content: '';
    position: absolute;
    left: -1px;
    bottom: 100%;
    width: 4.4rem;
    height: 0.9rem;
    background: inherit;
    border: 1px solid var(--ink);
    border-bottom: none;
    border-radius: 3px 9px 0 0;
}

.council-grid ~ .council-grid ~ .council-grid {
    gap: 0;
    padding-top: 0;
    border-top: 1px solid var(--ink);
    border-left: 1px solid var(--ink);
}

.council-grid ~ .council-grid ~ .council-grid .council-card {
    flex-direction: row;
    align-items: baseline;
    gap: 0.75rem;
    min-height: 0;
    padding: 0.55rem 0.7rem 0.5rem;
    border: none;
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}

.council-grid ~ .council-grid ~ .council-grid .council-card::before { content: none; }

.council-grid ~ .council-grid ~ .council-grid .council-card__name {
    font-family: var(--ui);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none;
}

.council-grid ~ .council-grid ~ .council-grid .council-card__count {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .council-grid ~ .council-grid ~ .council-grid { grid-template-columns: minmax(0, 1fr); }
}

.councillor-card__body {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.8rem;
}

.councillor-card__thumb {
    width: 54px;
    height: 72px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    filter: grayscale(1) contrast(1.15);
    mix-blend-mode: multiply;
}

.councillor-card__thumb--placeholder {
    background: var(--hl-grey);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    width: 46%;
    height: 46%;
    color: var(--faint);
}

.councillor-card__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.councillor-card__name {
    font-family: var(--ui);
    font-size: 0.93rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.councillor-card__ward {
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--mute);
    margin-top: 0.3rem;
}

.councillor-card:hover .councillor-card__ward { color: var(--ink); }

/* ── Status: the colour of the pen ────────────────────── */
.status-badge {
    display: inline-block;
    font-family: var(--ui);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    line-height: 1.35;
    color: var(--ink);
    background: var(--hl-grey);
    padding: 0.22em 0.6em 0.16em;
    margin-top: 0.35rem;
    border-radius: 0.25em 0.7em 0.35em 0.6em / 0.6em 0.3em 0.7em 0.35em;
}

.status-badge--serving { background: var(--hl-green); }
.status-badge--resigned { background: var(--hl-grey); }
.status-badge--defected { background: var(--hl-orange); }
.status-badge--suspended { background: var(--hl-pink); }
.status-badge--deselected { background: var(--hl-blue); }
.status-badge--other { background: var(--hl); }

.status-badge--expelled,
.status-badge--disqualified {
    background: var(--ink);
    color: var(--paper);
}

a:hover .status-badge:not(.status-badge--expelled):not(.status-badge--disqualified) {
    box-shadow: 0 0 0 1px var(--ink);
}

/* ── Tables ───────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--ui);
    font-size: 0.92rem;
}

thead th {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: left;
    padding: 0.75rem 0.75rem 0.55rem;
    border-bottom: 3px solid var(--ink);
    user-select: none;
    position: sticky;
    top: 0;
    background: var(--paper);
}

thead th[data-col] { cursor: pointer; }
thead th[data-col]:hover { background: var(--hl); }

.arrow { font-size: 0.65rem; margin-left: 0.25rem; }

tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--hair);
}

tbody td:first-child { font-weight: 600; }
tbody td a { text-decoration: none; }
tbody tr:hover { background: var(--hl-pale); }
tbody tr:hover td a { background: none; text-decoration: underline; }

tr.ward-match { background: var(--hl-pale); }
tr.ward-match:hover { background: var(--hl); }

.ward-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--paper);
    padding: 0.2rem 0.45rem 0.15rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ── Filters ──────────────────────────────────────────── */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    font-family: var(--ui);
    font-size: 0.9rem;
    color: var(--ink);
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--sheet);
}

.filters select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23101113' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.7rem;
    max-width: 100%;
}

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 20rem;
    max-width: 100%;
}

.filters .search-wrap input { width: 100%; padding-right: 2rem; }

.search-clear {
    position: absolute;
    right: 0.4rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--mute);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}

.search-clear:hover { color: var(--ink); }

.filters input:focus,
.filters select:focus {
    outline: 3px solid var(--hl);
    outline-offset: 0;
}

.count {
    font-family: var(--ui);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mute);
    margin-bottom: 0.5rem;
}

/* ── Councillor profile ───────────────────────────────── */
.profile { position: relative; }

.profile-label {
    display: table;
    font-family: var(--ui);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.2;
    padding: 0.28em 0.5em 0.2em;
    margin: 0 0 1rem;
    background: var(--hl);
    border-radius: 0.2em 0.55em 0.3em 0.5em / 0.5em 0.25em 0.55em 0.3em;
}

.admin-edit-link {
    position: absolute;
    top: 0;
    right: 0;
    font-family: var(--ui);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    background: var(--hl);
    color: var(--ink);
    padding: 0.4rem 0.7rem 0.35rem;
}

.admin-edit-link:hover {
    background: var(--ink);
    color: var(--paper);
}

.profile-header {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.profile-photo {
    width: 118px;
    height: 155px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--sheet);
    border: 1px solid var(--ink);
    padding: 4px;
    filter: grayscale(1) contrast(1.15);
}

.profile-photo--placeholder {
    background: var(--hl-grey);
    background-clip: content-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile h1 { margin-bottom: 0; }

.profile-header .status-badge {
    font-size: 0.78rem;
    margin-top: 0.7rem;
}

.profile dl {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: auto auto;
    grid-auto-columns: minmax(0, 1fr);
    border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}

.profile dt {
    font-family: var(--ui);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mute);
    padding: 0.8rem 1rem 0 0;
}

.profile dd {
    font-family: var(--ui);
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.3;
    padding: 0.2rem 1rem 0.9rem 0;
}

.profile dt:not(:first-of-type),
.profile dd:not(:first-of-type) {
    border-left: 1px solid var(--hair);
    padding-left: 1rem;
}

@media (max-width: 600px) {
    .profile-header { align-items: flex-start; gap: 1rem; }
    .profile-photo { width: 84px; height: 110px; }

    .profile dl {
        grid-auto-flow: row;
        grid-template-rows: none;
        grid-template-columns: 7.5rem minmax(0, 1fr);
    }

    .profile dt,
    .profile dd,
    .profile dt:not(:first-of-type),
    .profile dd:not(:first-of-type) {
        display: flex;
        align-items: center;
        border-left: none;
        padding: 0.6rem 0.75rem 0.55rem 0;
    }

    .profile dt:not(:first-of-type),
    .profile dd:not(:first-of-type) { border-top: 1px solid var(--hair); }
}

/* ── Press articles ───────────────────────────────────── */
.press-section { position: relative; }

.press-none {
    font-style: italic;
    color: var(--mute);
}

.press-article {
    background: var(--sheet);
    border: 1px solid var(--ink);
    padding: 0.8rem 0.95rem 0.75rem;
}

.press-article > :last-child { margin-bottom: 0; }

.press-article__headline {
    font-size: 1.28rem;
    font-weight: 600;
    line-height: 1.22;
    margin-bottom: 0.35rem;
}

.press-article__headline a { text-decoration: none; }

.press-article__headline a:hover {
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.press-article__excerpt {
    font-size: 1rem;
    line-height: 1.5;
    color: #3a3c40;
    margin-bottom: 0.4rem;
}

.press-article__source {
    font-family: var(--ui);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
}

/* ── Timeline ─────────────────────────────────────────── */
.timeline-section {
    position: relative;
    --margin-col: 9rem;
}

.timeline-entry {
    position: relative;
    display: grid;
    grid-template-columns: var(--margin-col) minmax(0, 1fr);
    column-gap: 2rem;
    padding: 1.15rem 0 1.4rem;
    border-top: 1px solid var(--hair);
    background: linear-gradient(var(--ink), var(--ink)) no-repeat calc(var(--margin-col) + 1rem) 0 / 1px 100%;
}

.timeline-entry > * { grid-column: 2; }
.timeline-entry > * + * { margin-top: 0.5rem; }

.timeline-entry > .timeline-date {
    grid-column: 1;
    grid-row: 1 / span 6;
    text-align: right;
    padding-top: 0.2rem;
}

.timeline-entry > .timeline-date + * { margin-top: 0; }

.timeline-entry::before {
    content: '';
    position: absolute;
    left: calc(var(--margin-col) + 1rem - 4px);
    top: 1.5rem;
    width: 9px;
    height: 9px;
    background: var(--paper);
    border: 1px solid var(--ink);
}

.timeline-entry--article::before { background: var(--ink); }
.timeline-entry--status::before { background: var(--hl); }

.timeline-date {
    display: block;
    font-family: var(--ui);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.timeline-entry__status { line-height: 1.3; }

.timeline-entry__status .status-badge { margin-top: 0; }

.timeline-entry__status-date {
    font-style: italic;
    font-size: 0.92rem;
    color: var(--mute);
    margin-left: 0.4rem;
}

.timeline-entry__text {
    font-size: 1.06rem;
    line-height: 1.5;
    max-width: 44em;
}

.timeline-entry > * + .press-article { margin-top: 0.7rem; }
.timeline-entry > .timeline-date + .press-article { margin-top: 0; }

@media (max-width: 640px) {
    .timeline-entry {
        display: block;
        background: none;
        padding: 1rem 0 1.2rem;
    }

    .timeline-entry::before { display: none; }

    .timeline-entry > .timeline-date {
        text-align: left;
        padding-top: 0;
        margin-bottom: 0.45rem;
    }
}

/* ── Calls to action and messages ─────────────────────── */
.submit-cta {
    margin-top: 2.75rem;
    padding: 1.1rem 1.4rem 1rem;
    background: var(--hl);
    font-size: 1.15rem;
}

.submit-cta a {
    font-family: var(--ui);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    margin-left: 0.35rem;
}

.submit-cta a:hover {
    background: var(--ink);
    color: var(--paper);
}

.login-form { max-width: 24rem; }

.login-error,
.submit-success {
    font-family: var(--ui);
    font-size: 0.9rem;
    color: var(--ink);
    border: 1px solid var(--ink);
    padding: 0.8rem 1rem;
    margin-bottom: 1.5rem;
}

.login-error { background: var(--hl-pink); }
.submit-success { background: var(--hl-green); }

.admin-logout {
    font-family: var(--ui);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    vertical-align: middle;
    margin-left: 0.75rem;
}

/* ── Forms and admin ──────────────────────────────────── */
.admin-banner {
    font-family: var(--ui);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--hl);
    padding: 0.55rem 0.85rem 0.5rem;
    margin-bottom: 1.5rem;
}

.admin-article {
    background: var(--sheet);
    border: 1px solid var(--ink);
    padding: 1.4rem;
    margin-bottom: 1rem;
}

.admin-article--new { border-top-width: 5px; }

.admin-field { margin-bottom: 0.9rem; }

.admin-field label {
    display: block;
    font-family: var(--ui);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
    width: 100%;
    font-family: var(--ui);
    font-size: 0.93rem;
    color: var(--ink);
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--paper);
    line-height: 1.4;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
    outline: 3px solid var(--hl);
    outline-offset: 0;
    background: var(--sheet);
}

.admin-field textarea { resize: vertical; }

.admin-hint {
    font-family: var(--text);
    font-size: 0.92rem;
    font-style: italic;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--mute);
}

p.admin-hint { margin-bottom: 0.9rem; }
.admin-field p.admin-hint { margin: 0.4rem 0 0; }

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-btn {
    display: inline-block;
    font-family: var(--ui);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.3;
    color: var(--ink);
    background: var(--sheet);
    padding: 0.7rem 1.2rem 0.65rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s;
}

.admin-btn:hover { background: var(--hl); }

.admin-btn--save {
    background: var(--ink);
    color: var(--paper);
}

.admin-btn--save:hover {
    background: var(--hl);
    color: var(--ink);
}

.admin-btn--delete:hover { background: var(--hl-pink); }

.admin-btn--approve { background: var(--hl-green); }

.admin-btn--approve:hover {
    background: var(--ink);
    color: var(--paper);
}

.pending-count {
    display: inline-block;
    font-family: var(--ui);
    font-size: 0.62rem;
    font-weight: 800;
    background: var(--hl);
    color: var(--ink);
    padding: 0.15rem 0.45rem;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.moderation-card { border-left: 6px solid var(--hl); }

.moderation-card__headline {
    font-weight: 600;
    font-size: 1.15rem;
    line-height: 1.25;
    margin-bottom: 0.3rem;
}

.moderation-card__excerpt {
    font-size: 0.98rem;
    color: #3a3c40;
    margin-bottom: 0.3rem;
}

.moderation-card__url {
    font-family: var(--ui);
    font-size: 0.78rem;
    margin-bottom: 0.6rem;
    word-break: break-all;
}

.moderation-card__date {
    font-family: var(--ui);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mute);
}

.moderation-card__tags,
.admin-slugs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.6rem;
}

.admin-slugs {
    max-height: 12rem;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.moderation-card__tags code,
.admin-slugs code {
    font-family: var(--ui);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--wash);
    padding: 0.2rem 0.5rem;
}

.admin-tab-panel__hint { margin-bottom: 1rem; }

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 3px solid var(--ink);
    margin-bottom: 1.5rem;
}

.admin-tab {
    font-family: var(--ui);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    padding: 0.7rem 1.1rem 0.6rem;
    background: none;
    border: none;
    border-radius: 0;
    cursor: pointer;
}

.admin-tab:hover { background: var(--hl); }

.admin-tab--active,
.admin-tab--active:hover {
    background: var(--ink);
    color: var(--paper);
}

.admin-tab__count {
    font-size: 0.62rem;
    background: var(--wash);
    color: var(--ink);
    padding: 0.1rem 0.4rem;
    margin-left: 0.3rem;
    vertical-align: middle;
}

.admin-timeline__name {
    font-family: var(--ui);
    font-weight: 700;
    font-size: 0.95rem;
}

.admin-timeline__notes {
    font-size: 0.98rem;
    color: #3a3c40;
    margin-top: 0.4rem;
    line-height: 1.5;
}

/* ── Tag input ────────────────────────────────────────── */
.tag-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--ink);
    background: var(--paper);
    cursor: text;
    position: relative;
}

.tag-input:focus-within {
    outline: 3px solid var(--hl);
    background: var(--sheet);
}

.tag-input__text,
.admin-field .tag-input__text {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-family: var(--ui);
    font-size: 0.93rem;
    padding: 0.25rem 0.15rem;
    flex: 1;
    width: auto;
    min-width: 10rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--ui);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--ink);
    color: var(--paper);
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
}

.tag-chip__remove {
    background: none;
    border: none;
    color: var(--faint);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.tag-chip__remove:hover { color: var(--paper); }

.tag-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    background: var(--sheet);
    border: 1px solid var(--ink);
    max-height: 14rem;
    overflow-y: auto;
    z-index: 100;
}

.tag-suggestion {
    font-family: var(--ui);
    font-size: 0.85rem;
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--hair);
    cursor: pointer;
}

.tag-suggestion:hover,
.tag-suggestion--active { background: var(--hl); }

.tag-suggestion strong { font-weight: 800; }

/* ── Councillor picker ────────────────────────────────── */
.councillor-picker__rows:not(:empty) { margin-bottom: 0.4rem; }

.councillor-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem 0.6rem;
    padding: 0.45rem 0.55rem;
    margin-bottom: 0.3rem;
    background: var(--wash);
    border-left: 4px solid var(--ink);
}

.councillor-row__name {
    font-family: var(--ui);
    font-size: 0.82rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.councillor-row select,
.councillor-row input {
    width: 100%;
    font-size: 0.82rem;
    padding: 0.3rem 0.4rem;
    background: var(--sheet);
}

.councillor-row__remove {
    background: none;
    border: none;
    color: var(--mute);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
}

.councillor-row__remove:hover { color: var(--ink); background: var(--hl-pink); }

.councillor-row__detail {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 0.35rem 0.6rem;
}

.councillor-row__detail[hidden],
.councillor-row__detail label[hidden] { display: none; }

.councillor-row__detail label {
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

.councillor-row__detail label:only-child,
.councillor-row__detail label[hidden] + label { grid-column: 1 / -1; }

@media (max-width: 600px) {
    .councillor-row,
    .councillor-row__detail { grid-template-columns: minmax(0, 1fr) auto; }

    .councillor-row__name,
    .councillor-row__detail label { grid-column: 1 / -1; }
}

/* ── Admin timeline entries ───────────────────────────── */
.event-row {
    background: var(--wash);
    border-left: 4px solid var(--ink);
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.event-row__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.75rem;
    align-items: end;
}

.event-row__fields .event-text-field { grid-column: 1 / -1; }

.event-row .admin-field input,
.event-row .admin-field textarea,
.event-row .admin-field select { background: var(--sheet); }

.event-row .event-remove {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.66rem;
    padding: 0.3rem 0.55rem 0.25rem;
}

.event-row__source {
    margin-bottom: 0.75rem;
    font-weight: 600;
    padding-right: 5rem;
}

.event-row__source .timeline-date { margin-bottom: 0.15rem; }

.event-row__remove {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--ui);
    font-size: 0.75rem;
    color: var(--mute);
}

/* ── Fetch status ─────────────────────────────────────── */
.fetch-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-style: italic;
    font-size: 0.92rem;
    color: var(--mute);
    margin-top: 0.4rem;
}

.fetch-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--hl);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Latest updates ───────────────────────────────────── */
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    margin-top: 2rem;
}

.stat-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.9rem 1rem 1rem;
}

.stat-tile + .stat-tile { border-left: 1px solid var(--hair); }

a.stat-tile {
    color: var(--ink);
    text-decoration: none;
    transition: background-color 0.12s;
}

a.stat-tile:hover { background-color: var(--hl-pale); }

a.stat-tile--active,
a.stat-tile--active:hover { background-color: var(--hl); }

.stat-row + .count { margin: 1rem 0 0; }

.stat-tile__value {
    font-family: var(--display);
    font-size: 4.4rem;
    font-weight: 700;
    line-height: 0.85;
    font-variant-numeric: tabular-nums;
}

.stat-tile .status-badge {
    font-size: 0.72rem;
    margin-top: 0.55rem;
}

@media (max-width: 600px) {
    .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-tile:nth-child(odd) { border-left: none; }
    .stat-tile:nth-child(n+3) { border-top: 1px solid var(--hair); }
    .stat-tile__value { font-size: 3.4rem; }
}

.update-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 3.5rem;
    background: linear-gradient(var(--ink), var(--ink)) no-repeat 50% 0 / 1px 100%;
}

.section-rule + .update-grid { margin-top: 0; }

.update-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem 0 1.5rem;
    border-top: 1px solid var(--ink);
}

.update-card:nth-child(-n+2) { border-top: none; }

@media (max-width: 800px) {
    .update-grid {
        grid-template-columns: minmax(0, 1fr);
        background: none;
    }

    .update-card:nth-child(2) { border-top: 1px solid var(--ink); }
}

.update-card__photos {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.update-card__photos a { display: block; }
.update-card__photos a:hover { background: none; outline: 3px solid var(--hl); }

.update-card__photo {
    width: 56px;
    height: 74px;
    object-fit: cover;
    display: block;
    filter: grayscale(1) contrast(1.15);
    border: 1px solid var(--ink);
}

.update-card__body {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.update-card__body:first-child { margin-left: calc(56px + 1rem); }

.update-change + .update-change { margin-top: 0.75rem; }

.update-change .timeline-entry__status { margin-bottom: 0.3rem; }

.update-change__name {
    font-family: var(--ui);
    font-size: 0.98rem;
    font-weight: 700;
    margin-left: 0.3rem;
}

.update-change__name a { text-decoration: none; }

.update-card .timeline-entry__text {
    font-size: 1rem;
    line-height: 1.48;
}

.update-change + .press-article { margin-top: 0.9rem; }

.timeline-date + .press-article { margin-top: 0.55rem; }

.update-card .press-article__headline { font-size: 1.16rem; }

.update-mentions {
    font-style: italic;
    font-size: 0.94rem;
    line-height: 1.45;
    color: var(--mute);
    margin-top: 0.5rem;
}

.update-mentions a { color: var(--ink); }

/* ── Donate ───────────────────────────────────────────── */
.donate-campaign { margin-bottom: 1.5rem; }

.donate-goal { margin-bottom: 2.25rem; }

.donate-goal__label,
.donate-amounts__label,
.donate-share__label {
    font-family: var(--ui);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.donate-goal__label {
    font-family: var(--display);
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 0.95;
}

.donate-goal__bar {
    height: 22px;
    background: var(--sheet);
    border: 1px solid var(--ink);
    position: relative;
}

.donate-goal__fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: var(--hl);
    border-right: 1px solid var(--ink);
}

.donate-goal__target {
    font-family: var(--ui);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mute);
    margin-top: 0.4rem;
    text-align: right;
}

.donate-amounts { margin-bottom: 2rem; }

.donate-amounts__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--ink);
    border-left: 1px solid var(--ink);
}

@media (max-width: 600px) {
    .donate-amounts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.donate-amounts__grid input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.donate-amount {
    display: block;
    text-align: center;
    font-family: var(--display);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1;
    padding: 1rem 0.5rem 0.8rem;
    background: var(--sheet);
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s;
}

.donate-amount:hover { background: var(--hl); }

input[type="radio"]:checked + .donate-amount {
    background: var(--ink);
    color: var(--hl);
}

input[type="radio"]:focus-visible + .donate-amount {
    outline: 3px solid var(--ink);
    outline-offset: -6px;
}

.donate-form { margin-bottom: 3rem; }

.donate-form .admin-field { max-width: 36rem; }

.donate-consent {
    font-size: 1rem;
    margin-bottom: 1.1rem;
}

.donate-consent label {
    font-family: var(--ui);
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 1rem;
}

.donate-form > .admin-hint { margin-top: 0.75rem; }

.donate-thanks {
    background: var(--hl);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}

.donate-thanks p { margin: 0.2rem 0; }

.donate-wall {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
}

@media (max-width: 600px) {
    .donate-wall { grid-template-columns: 1fr; gap: 2rem; }
}

.donate-wall__heading {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.donate-wall__item {
    border-top: 1px solid var(--hair);
    padding: 0.65rem 0 0.7rem;
}

.donate-wall__author {
    font-family: var(--ui);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mute);
}

.donate-wall__author strong {
    color: var(--ink);
    font-weight: 800;
}

.donate-wall__text {
    font-size: 1rem;
    font-style: italic;
    line-height: 1.45;
    margin-top: 0.25rem;
}

.donate-wall__pager {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.donate-pager__btn {
    font-family: var(--ui);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    padding: 0.4rem 0.75rem 0.35rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--sheet);
    cursor: pointer;
}

.donate-pager__btn:hover { background: var(--hl); }

.donate-pager__info {
    font-family: var(--ui);
    font-size: 0.72rem;
    color: var(--mute);
}

.donate-fade--out {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.donate-fade--in { animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.donate-share { padding-top: 0; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
    max-width: var(--page);
    margin: 0 auto;
    padding: 0 var(--gutter) 2.5rem;
}

.site-footer p {
    border-top: 3px solid var(--ink);
    padding-top: 1rem;
    font-family: var(--ui);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.9;
    text-transform: uppercase;
    color: var(--mute);
}

.site-footer a { font-weight: 800; }

/* ── Small screens ────────────────────────────────────── */
@media (max-width: 640px) {
    :root { --gutter: 1.1rem; }

    table { table-layout: fixed; font-size: 0.84rem; }
    thead th, tbody td { padding-left: 0; padding-right: 0.6rem; overflow-wrap: anywhere; }
    thead th { letter-spacing: 0.08em; }

    .site-strap { font-size: 0.58rem; letter-spacing: 0.1em; }
    .site-logo { font-size: 2.5rem; }
    .site-nav { gap: 0.3rem 1.1rem; }
    .site-nav a { font-size: 0.68rem; }

    .content { padding-top: 2rem; }
    .subtitle { font-size: 1.15rem; }

    .council-card { min-height: 5.2rem; padding: 0.8rem 0.75rem 0.7rem; }
    .results-header + .council-grid { gap: 1.7rem 0.8rem; }
    .council-grid ~ .council-grid ~ .council-grid { gap: 0; }
    .council-card__name { font-size: 1.3rem; }
    .council-card__count { font-size: 0.6rem; }

    .councillor-card__body { flex-direction: column; gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation-duration: 0.01ms !important; }
}
