.events__list {
    display: grid;
    gap: 0.75rem;
    max-width: 40rem;
}

/*
 * An event as a card (components/event-card.html.twig, docs/adr/0040,
 * 0097). Layout only - the look comes from .card--highlighted (card.css).
 * The title's link covers the whole card, over everything in it, so a click
 * anywhere opens the event.
 */
.event-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
}

.event-card:has(.event-card__link:hover),
.event-card:has(.event-card__link:focus-visible) {
    box-shadow: 0.5rem 0.5rem var(--black);
}

.event-card__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.event-card__title {
    font-size: 1rem;
    font-weight: 700;
}

.event-card__link {
    color: inherit;
    text-decoration: none;
}

.event-card__link::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
}

.event-card__link:focus-visible {
    outline: none;
}

.event-card:has(.event-card__link:focus-visible) {
    outline: 0.2rem solid var(--black);
    outline-offset: 0.2rem;
}

.event-card__when {
    font-size: 0.875rem;
    opacity: 0.85;
}

/* A played match's result as a disc at the start of its card (docs/adr/0118). */
.event-card__outcome {
    flex-shrink: 0;
}

/* Nobody's replied: the one line, and who we're waiting for (docs/adr/0118). */
.event__no-replies-note {
    margin-bottom: 0.75rem;
    font-weight: 700;
}

/* Ahead of the names here, so the space goes below it. */
.event__no-replies .attendance-group__nudge {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Your own reply, as a tag (reply.css): replying is on the event's page. */
.event-card__mine {
    font-size: 0.875rem;
}

/* Every event but the next one: white, so the next one stands out. */
.event-card--plain {
    background-color: var(--white);
}

/* A cancelled event (docs/adr/0047): still listed, its time struck through. */
.event-card--cancelled .event-card__when time {
    text-decoration: line-through;
}

/*
 * "Cancelled" or "Time changed" beside an event's title (docs/adr/0047):
 * in words, in a reply's colour - not attending for cancelled, maybe for
 * a change to check.
 */
.status-tag {
    display: inline-block;
    margin-left: 0.375rem;
    padding: 0 0.4rem;
    border: 0.0625rem solid var(--black);
    font-size: 0.8rem;
    font-weight: 700;
    vertical-align: 0.1em;
    white-space: nowrap;
}

.status-tag--cancelled {
    background-color: var(--reply-not-attending);
}

.status-tag--changed {
    background-color: var(--reply-maybe);
}

.event__facts,
.event__count,
.event__share,
.event__manage {
    margin-bottom: 1rem;
}

/* Share, Add to calendar and Edit: one row, one size (docs/adr/0118). */
.event__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.event__actions > .event__share,
.event__actions > .event__manage {
    margin-bottom: 0;
}

/* Phones: each the width of the screen, one under another, so they're the same size and easy to hit. */
@media (max-width: 40rem) {
    .event__actions,
    .event__actions > p {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
        text-align: center;
    }
}

/* A fact a line (docs/adr/0118). */
.event__facts {
    display: grid;
    gap: 0.25rem;
}

.event__team {
    font-size: 0.9375rem;
}

.event__cancelled {
    max-width: 40rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 0.125rem solid var(--black);
    background-color: var(--reply-not-attending);
}

/* Adding or editing an event: its kind first, then the form (docs/adr/0047). */
.event-form__kind {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page--event-new .tabs {
    margin-bottom: 1.5rem;
}

/*
 * Until, once it repeats (docs/adr/0110): out of the way while "Doesn't
 * repeat" is chosen - without scripts, and after a failed save too.
 */
.form:has(input[name$="[repeats]"][value="never"]:checked) .event-form__until {
    display: none;
}

.event-edit__section {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 0.125rem solid var(--border);
    max-width: 32rem;
}

.event-edit__section > p {
    margin: 0.5rem 0 1rem;
}

.event__mine {
    margin: 1.5rem 0;
}

.event__mine h2 {
    margin-bottom: 0.75rem;
}

/* The attendance sheet: a row per person, name then the three replies. */
.attendance-sheet {
    display: grid;
    margin-bottom: 0.75rem;
}

.attendance-sheet__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.25rem;
    margin: 0;
    padding: 0.5rem 0;
    border: 0;
    border-top: 0.0625rem solid var(--row-stripe);
}

.attendance-sheet__row:nth-child(odd) {
    background-color: var(--row-stripe);
}

.attendance-sheet__name {
    float: left; /* lets the legend sit in the row's flex layout */
    min-width: 12rem;
    padding: 0 0.5rem;
    font-weight: 700;
}

.attendance-sheet__options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.875rem;
    padding: 0 0.5rem;
}

/* Phones: the name over its three choices, which fit one row (docs/adr/0112). */
@media (max-width: 47.99rem) {
    .attendance-sheet__name {
        min-width: 100%;
    }

    .attendance-sheet__options {
        gap: 0.375rem 0.625rem;
        padding: 0 0.25rem;
        font-size: 0.875rem;
    }

    .attendance-sheet__options .form__choice {
        gap: 0.25rem;
    }
}

/* Who came?: collapsible (docs/adr/0048). */
.event__section {
    margin-top: 1rem;
    padding: 0 1rem;
    border: 0.125rem solid var(--border);
}

.event__mine + .event__section {
    margin-top: 2rem;
}

.event__section[open] {
    padding-bottom: 1rem;
}

.event__summary {
    display: flex;
    align-items: baseline;
    padding: 0.75rem 0;
    cursor: pointer;
}

.event__section[open] > .event__summary {
    margin-bottom: 0.25rem;
}

.form--wide {
    max-width: 60rem;
}

.form__choices--people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

/*
 * Formations (docs/adr/0067): always open, across the page after
 * everything else, on the page's white (docs/adr/0079).
 */
.event-formations {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* Tighter than a page intro: these sit between controls. */
.event-formations .section__intro {
    margin-bottom: 0.75rem;
}

/*
 * Attendance (docs/adr/0041, 0080): tab panels (tab-panels.css), a tab per
 * reply with how many, joined to the open one's people.
 */
.event__attendance {
    margin-top: 2rem;
}

.event__heading {
    margin-bottom: 0.75rem;
}

/* A column on phones, as many as fit side by side on wider screens. */
.attendance-group__people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
    gap: 0.375rem 1rem;
}

.attendance-group__person {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attendance-group__nobody {
    opacity: 0.75;
}

.attendance-group__nudge {
    margin-top: 0.75rem;
}

/* Managers: everyone's replies as a form, closed until wanted. */
.event__change-replies {
    margin-top: 1rem;
    border: 0.125rem solid var(--border);
    border-radius: 0.5rem;
}

.event__change-summary {
    padding: 0.625rem 0.875rem;
    font-weight: 700;
    cursor: pointer;
}

.event__change-replies[open] {
    padding: 0 0.875rem 1rem;
}

.event__change-replies[open] .event__change-summary {
    margin: 0 -0.875rem 0.75rem;
    border-bottom: 0.125rem solid var(--border);
}

/* Who came (docs/adr/0048): a tick per person, and for a match who started. */
.event__register .form {
    margin-bottom: 1rem;
}

.register {
    max-width: 32rem;
    margin-bottom: 0.75rem;
}

.register__tick {
    width: 6rem;
    text-align: center;
}

/* Narrower on phones, so names have room beside them (docs/adr/0108). */
@media (max-width: 40rem) {
    .register__tick {
        width: 4rem;
    }
}

/* The whole cell is the tick's target. */
.register__tick label {
    display: inline-flex;
    padding: 0.375rem 1rem;
    cursor: pointer;
}

/* Ticked by a thumb on a touchline (docs/adr/0096, 0112): bigger than the browser's own. */
.register__tick input[type="checkbox"] {
    width: 1.75rem;
    height: 1.75rem;
    accent-color: var(--tertiary);
}

.event__reply-by {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Not attending because of their away dates (docs/adr/0049). */
.attendance-group__away,
.attendance-group__left {
    padding: 0 0.3rem;
    border: 0.0625rem solid var(--black);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* A match's result (docs/adr/0061): the score, and the two sides' goals side by side. */
.event__result {
    margin-top: 2rem;
}

.event__score {
    margin: 0.5rem 0 1rem;
    font-size: 1.5rem;
}

.result-form__scores {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form__input--goals {
    width: 6rem;
}

/* Fines given at the event (docs/adr/0062), and the form to give one. */
.event__fines {
    margin-top: 2rem;
}

.event__no-fines {
    margin-bottom: 1rem;
}

.fine-list__fine {
    padding: 0.375rem 0;
}

.give-fine__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1rem;
}
