/* ---------- The season's story as a comic strip (GameDesign §17.10, Components/ComicStrip.razor) ---------- */

.comic {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0.75rem 0 1rem;
    padding: 8px;
    background: #0d0b1e;
    border-radius: 6px;
    /* Inside a story card ([data-photo]) the words would inherit its dark glow, which blurs dark lettering on cream. */
    text-shadow: none;
}

.comic-panel {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 3px solid #15132b;
    outline: 2px solid #f7f0e1;
    outline-offset: -5px;
    background: #15132b;
}

.comic-panel.wide {
    grid-column: 1 / -1;
    aspect-ratio: 800 / 340;
}

.comic-art,
.comic-art svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* The painted version of a scene, laid over its drawing (wwwroot/js/comic.js). */
.comic-art .comic-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The panel stays dark until its photo loads, rather than flashing the drawing. A photo that fails is removed, which brings the drawing back. */
.comic-art:has(.comic-photo) svg {
    visibility: hidden;
}

/* Narration: a box in the top corner, as in print. */
.comic-caption {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: min(78%, 34ch);
    padding: 0.35rem 0.55rem;
    background: #fff4c9;
    color: #15132b;
    border: 2px solid #15132b;
    box-shadow: 3px 3px 0 rgba(21, 19, 43, 0.55);
    font: 600 0.8rem/1.3 system-ui, sans-serif;
}

/* Speech: a bubble with a tail, in the bottom corner, lettered in capitals. */
.comic-say {
    position: absolute;
    right: 10px;
    bottom: 16px;
    max-width: min(70%, 26ch);
    margin: 0;
    padding: 0.45rem 0.75rem;
    background: #ffffff;
    color: #15132b;
    border: 2px solid #15132b;
    border-radius: 999px;
    font: 800 0.76rem/1.25 system-ui, sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-align: center;
}

.comic-say::after {
    content: "";
    position: absolute;
    left: 22%;
    bottom: -11px;
    width: 14px;
    height: 12px;
    background: #ffffff;
    border-right: 2px solid #15132b;
    border-bottom: 2px solid #15132b;
    transform: skewX(-35deg) rotate(18deg);
}

.comic-panel:not(:has(.comic-caption)) .comic-say {
    bottom: auto;
    top: 12px;
    right: auto;
    left: 12px;
}

details.chronicle-log summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.85rem;
}

@media (max-width: 560px) {
    .comic {
        grid-template-columns: minmax(0, 1fr);
        padding: 6px;
    }

    .comic-panel,
    .comic-panel.wide {
        aspect-ratio: 4 / 3;
    }

    .comic-caption {
        font-size: 0.74rem;
    }

    .comic-say {
        font-size: 0.7rem;
    }
}
