/* Publication: the weekend and the visual's generation. Built on imports.css (gi-); what
   publication adds is prefixed gv- (visuel). The visual itself is visual.css, kept apart because
   the rasteriser carries that sheet, and only that one, into the image. */

:root {
    --gv-home: #F0C030;
    --gv-away: #34A4E0;
}

/* ── A day of the weekend: a card, its head, one row a match ─ */

.gv-dayh {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin: 0;
    padding: 12px 20px;
    background: var(--thonon-surface-2);
    font: 700 13px/1.2 var(--font-condensed);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dark-fg-2);
}

.gv-match {
    display: grid;
    grid-template-columns: 70px 70px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 10px 20px;
    border-top: 1px solid var(--dark-border-1);
}

.gv-match--off {
    opacity: 0.72;
}

.gv-match--off .gv-match__club b,
.gv-match--off .gv-match__time {
    text-decoration: line-through;
    text-decoration-color: rgba(240, 32, 48, 0.7);
}

.gv-match__time {
    font: 700 18px/1 var(--font-mono);
    color: #fff;
}

.gv-match__team {
    font: 800 17px/1.1 var(--font-condensed);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
}

.gv-match__club {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gv-match__club b {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gv-match__club small {
    font-size: 13px;
    color: var(--dark-fg-2);
}

.gv-match__club .gv-match__venue--todo {
    color: var(--thonon-yellow);
    font-weight: 600;
}

.gv-match__end {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.gv-match__score {
    font: 700 16px/1 var(--font-mono);
    color: #fff;
    white-space: nowrap;
}

.gv-rest {
    margin: 0;
    padding: 12px 20px;
    border-top: 1px solid var(--dark-border-1);
    font-size: 13px;
    line-height: 1.5;
    color: var(--dark-fg-3);
}

/* ── The two visuals: a tile each ──────────────────────── */

.gv-states {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.gv-state {
    --tone: var(--dark-fg-3);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 44px;
    padding: 16px 18px;
    border: 1px solid var(--dark-border-1);
    border-radius: var(--radius-card);
    background: var(--thonon-black);
    color: inherit;
    text-decoration: none;
}

.gv-state--ready {
    --tone: var(--thonon-blue-bright);
    box-shadow: inset 0 -3px 0 var(--tone);
}

.gv-state--held {
    --tone: var(--thonon-yellow);
    box-shadow: inset 0 -3px 0 var(--tone);
}

a.gv-state:hover {
    border-color: var(--dark-border-2);
}

.gv-state__label {
    font: 700 13px/1.25 var(--font-condensed);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dark-fg-3);
}

/* The state in words, accents kept: the condensed face, not the display one. */
.gv-state__word {
    font: 800 24px/1 var(--font-condensed);
    text-transform: uppercase;
    color: var(--tone);
}

.gv-state small {
    font-size: 13px;
    line-height: 1.35;
    color: var(--dark-fg-2);
}

/* ── The programme in the rail ─────────────────────────── */

.gv-railvis {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

/* ── The visual at a reduced scale ─────────────────────── */

.gv-preview {
    position: relative;
    flex: 0 0 auto;
    width: calc(1080px * var(--gv-scale));
    height: calc(1350px * var(--gv-scale));
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.gv-preview__frame {
    width: 1080px;
    height: 1350px;
    transform: scale(var(--gv-scale));
    transform-origin: top left;
    pointer-events: none;
}

/* ── Generation ────────────────────────────────────────── */

.gv-gen {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.gv-gen__side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* A long export name would otherwise widen its card past the phone's edge. */
.gv-gen__side > * {
    min-width: 0;
    max-width: 100%;
}

.gv-gen__stage {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.gv-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gv-options__title {
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dark-fg-3);
}

.gv-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 13px;
    border: 1px solid var(--dark-border-1);
    border-radius: 5px;
    background: var(--thonon-night);
    color: #fff;
    text-decoration: none;
}

.gv-option:hover {
    border-color: var(--dark-border-2);
    color: #fff;
}

.gv-option--on {
    border-color: rgba(240, 192, 48, 0.55);
    background: linear-gradient(90deg, rgba(240, 192, 48, 0.10), var(--thonon-night));
}

.gv-option--off {
    opacity: 0.55;
}

.gv-option__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font: 700 14px/1.1 var(--body-font);
}

.gv-option__label::before {
    content: "";
    flex: 0 0 12px;
    height: 12px;
    border: 2px solid var(--dark-border-2);
    border-radius: 50%;
}

.gv-option--on .gv-option__label::before {
    border-color: var(--thonon-yellow);
    background: radial-gradient(circle, var(--thonon-yellow) 45%, transparent 50%);
}

.gv-option__sub {
    padding-left: 20px;
    font-size: 12px;
    color: var(--dark-fg-3);
}

.gv-stagehead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.gv-stagehead__label {
    font: 600 12px/1 var(--font-mono);
    letter-spacing: 0.04em;
    color: var(--dark-fg-2);
}

.gv-stagehead__actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.gv-previews {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--dark-border-1);
    border-radius: 6px;
    background: repeating-conic-gradient(rgba(255, 255, 255, 0.025) 0 25%, transparent 0 50%) 0 0 / 20px 20px;
}

.gv-previews__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gv-previews__name {
    font: 600 12px/1 var(--font-mono);
    color: var(--dark-fg-3);
}

.gv-phone-foot {
    display: none;
}

/* ── Post text ─────────────────────────────────────────── */

.gv-caption {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--dark-border-1);
    border-radius: 6px;
    background: var(--thonon-night);
}

.gv-caption__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.gv-caption__title {
    margin: 0;
    font: 700 12px/1.2 var(--font-condensed);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dark-fg-3);
}

.gv-caption__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gv-caption__text {
    width: 100%;
    min-height: 220px;
    padding: 12px 14px;
    border: 1px solid var(--dark-border-2);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font: 400 14px/1.55 var(--body-font);
    resize: vertical;
    color-scheme: dark;
}

.gv-caption__text:focus {
    outline: 0;
    border-color: var(--thonon-yellow);
}

.gv-caption__note {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--dark-fg-3);
}

.gv-caption__settings {
    border-top: 1px solid var(--dark-border-1);
    padding-top: 12px;
}

.gv-caption__settings > summary {
    cursor: pointer;
    font: 600 13px/1.4 var(--body-font);
    color: var(--dark-fg-2);
}

.gv-caption__fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

.gl-input.gv-caption__tags {
    height: auto;
    padding: 10px 14px;
    line-height: 1.5;
    resize: vertical;
}

/* ── Narrow screens ────────────────────────────────────── */

@media (max-width: 1180px) {
    .gv-gen {
        grid-template-columns: minmax(0, 1fr);
    }

    .gv-gen__side {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        align-items: start;
    }
}

/* The rail's programme: the rail goes under the content, two columns on a tablet, one on a phone. */
@media (max-width: 1099px) {
    .gv-railvis .gv-preview {
        --gv-scale: 0.3 !important;
    }
}

@media (max-width: 900px) {
    .gv-hide-phone {
        display: none !important;
    }

    .gv-match {
        grid-template-columns: 56px minmax(0, 1fr) auto;
        grid-template-areas:
            "time team end"
            "club club club";
        row-gap: 6px;
        padding: 10px 16px;
    }

    .gv-match__time { grid-area: time; font-size: 16px; }
    .gv-match__team { grid-area: team; }
    .gv-match__club { grid-area: club; }
    .gv-match__end { grid-area: end; }

    .gv-dayh,
    .gv-rest {
        padding-left: 16px;
        padding-right: 16px;
    }

    .gv-gen__side {
        display: flex;
    }

    .gv-stagehead__actions {
        display: none;
    }

    .gv-previews {
        padding: 12px;
    }

    /* CSS cannot divide a length by a length, so the phone's scales are stepped: one image fills
       the width, two sit side by side. */
    .gv-previews .gv-preview {
        --gv-scale: 0.56 !important;
    }

    .gv-previews--two .gv-preview {
        --gv-scale: 0.3 !important;
    }

    .gv-phone-foot {
        position: sticky;
        bottom: var(--mob-dock-height);
        z-index: 2;
        display: flex;
        gap: 8px;
        margin: 4px -16px -20px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--dark-border-1);
        background: var(--thonon-black);
    }

    .gv-phone-foot > * {
        flex: 1 1 0;
        height: 48px;
    }
}

@media (max-width: 700px) {
    .gv-previews .gv-preview {
        --gv-scale: 0.4 !important;
    }

    .gv-previews--two .gv-preview {
        --gv-scale: 0.2 !important;
    }
}

@media (max-width: 480px) {
    .gv-states {
        grid-template-columns: minmax(0, 1fr);
    }

    .gv-railvis .gv-preview {
        --gv-scale: 0.26 !important;
    }

    .gv-previews .gv-preview {
        --gv-scale: 0.29 !important;
    }

    .gv-previews--two .gv-preview {
        --gv-scale: 0.14 !important;
    }
}
