/* Story skin: editorial cards with a reading dialog. Every colour is a custom property with a fallback. */
.fv-contest-theme-story {
    --fvs-accent: var(--fv-story-accent, var(--fv-accent, #b8472f));
    --fvs-accent-ink: var(--fv-accent-contrast, #fff);
    --fvs-ink: var(--fv-story-ink, var(--fv-text, #1f2528));
    --fvs-muted: var(--fv-muted, #66707a);
    --fvs-surface: var(--fv-story-surface, var(--fv-surface, #fff));
    --fvs-soft: var(--fv-surface-alt, #f5f1ec);
    --fvs-line: var(--fv-story-line, var(--fv-border, #e9e2da));
    --fvs-line-hover: var(--fv-story-line-hover, #dccfc2);
    --fvs-radius: var(--fv-story-radius, var(--fv-radius, 18px));
    --fvs-card-min: 290px;
    --fvs-gap: var(--fv-story-gap, clamp(16px, 2vw, 28px));
    --fvs-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
    --fvs-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--fvs-ink);
    font-family: var(--fvs-sans);
}

.fv-contest-theme-story .fv-contest-photos-container-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--fvs-card-min)), 1fr));
    gap: var(--fvs-gap);
    align-items: stretch;
}

/* ---- Card ---- */
.fv-contest-theme-story .fv-story-card {
    position: relative; display: flex; flex-direction: column; box-sizing: border-box;
    width: 100% !important; min-width: 0 !important; float: none !important; margin: 0 !important; padding: 0 !important;
    background: var(--fvs-surface); border: 1px solid var(--fvs-line); border-radius: var(--fvs-radius);
    box-shadow: 0 1px 2px rgba(31, 37, 40, .05), 0 8px 24px -12px rgba(31, 37, 40, .18);
    transition: box-shadow .25s ease, border-color .25s ease;
}
.fv-contest-theme-story .fv-story-card:hover { border-color: var(--fvs-line-hover); box-shadow: 0 2px 4px rgba(31, 37, 40, .05), 0 22px 40px -18px rgba(31, 37, 40, .32); }
.fv-contest-theme-story .fv-story-card__image { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: calc(var(--fvs-radius) - 1px) calc(var(--fvs-radius) - 1px) 0 0; background: var(--fvs-soft); }
.fv-contest-theme-story .fv-story-card__image .fv-story-open { display: block; position: relative; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; cursor: zoom-in; }
.fv-contest-theme-story .fv-story-card__image img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.fv-contest-theme-story .fv-story-card:hover .fv-story-card__image img { transform: scale(1.04); }
.fv-contest-theme-story .fv-story-card__image::after { content: ""; position: absolute; inset: auto 0 0; height: 38%; background: linear-gradient(to top, rgba(20, 24, 26, .38), transparent); pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.fv-contest-theme-story .fv-story-card:hover .fv-story-card__image::after { opacity: 1; }
.fv-contest-theme-story .fv-story-card__count {
    position: absolute; z-index: 1; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; box-sizing: border-box;
    border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--fvs-ink); font: 700 13px/1 var(--fvs-sans); font-variant-numeric: tabular-nums;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(0, 0, 0, .16); pointer-events: none;
}
.fv-contest-theme-story .fv-story-heart { flex: none; fill: var(--fvs-accent); }
.fv-contest-theme-story .fv-story-card__content { display: flex; text-align: left; flex: 1; flex-direction: column; align-items: stretch; padding: clamp(16px, 1.8vw, 22px); cursor: pointer; }
.fv-contest-theme-story .fv-story-card__eyebrow { margin: 0 0 6px; color: var(--fvs-accent); font: 700 11px/1.4 var(--fvs-sans); letter-spacing: .12em; text-transform: uppercase; }
.fv-contest-theme-story .fv-story-card__author, .fv-contest-theme-story .fv-story-panel__author a { color: inherit; text-decoration: none; }
.fv-contest-theme-story .fv-story-card__author:hover, .fv-contest-theme-story .fv-story-panel__author a:hover { text-decoration: underline; }
.fv-contest-theme-story .fv-story-card__title { margin: 0 0 8px; padding: 0; color: var(--fvs-ink); font: 700 clamp(19px, 1.5vw, 23px)/1.22 var(--fvs-serif); letter-spacing: -.005em; text-align: left; text-transform: none; }
.fv-contest-theme-story .fv-story-card__excerpt { margin: 0 0 16px; padding: 0; color: var(--fvs-muted); font: 14px/1.55 var(--fvs-sans); text-align: left; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fv-contest-theme-story .fv-story-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--fvs-line); }
.fv-contest-theme-story .fv-story-card__read { margin: 0; padding: 4px 0; border: 0; background: none; color: var(--fvs-ink); font: 600 14px/1.4 var(--fvs-sans); text-transform: none; letter-spacing: 0; box-shadow: none; cursor: pointer; }
.fv-contest-theme-story .fv-story-card__read span { display: inline-block; transition: transform .2s ease; }
.fv-contest-theme-story .fv-story-card__read:hover { color: var(--fvs-accent); background: none; }
.fv-contest-theme-story .fv-story-card__read:hover span { transform: translateX(3px); }

/* ---- Vote button (card + dialog) ---- */
.fv-contest-theme-story .fv-story-vote {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin: 0; padding: 9px 16px; box-sizing: border-box; border: 1.5px solid var(--fvs-accent); border-radius: 999px;
    background: var(--fvs-accent); color: var(--fvs-accent-ink); font: 700 13px/1.2 var(--fvs-sans); letter-spacing: .01em; text-transform: none; box-shadow: none; cursor: pointer;
    transition: background-color .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.fv-contest-theme-story .fv-story-vote .fv-story-heart { fill: currentColor; transition: transform .25s ease; }
.fv-contest-theme-story .fv-story-vote:hover { box-shadow: 0 6px 16px -6px var(--fvs-accent); transform: translateY(-1px); }
.fv-contest-theme-story .fv-story-vote:hover .fv-story-heart { transform: scale(1.18); }
.fv-contest-theme-story .fv-story-vote:active { transform: translateY(0); }
.fv-contest-theme-story .fv-story-vote__done { display: none; }
.fv-contest-theme-story .is-voted .fv-story-vote { background: transparent; color: var(--fvs-accent); box-shadow: none; }
.fv-contest-theme-story .is-voted .fv-story-vote__idle { display: none; }
.fv-contest-theme-story .is-voted .fv-story-vote__done { display: inline; }

/* ---- Focus ---- */
.fv-contest-theme-story button:focus-visible, .fv-contest-theme-story a:focus-visible { outline: 3px solid var(--fvs-accent); outline-offset: 2px; }
.fv-contest-theme-story .fv-story-card__image .fv-story-open:focus-visible { outline-offset: -3px; }

/* ---- Dialog ---- */
.fv-contest-theme-story .fv-story-panel[hidden] { display: none !important; }
.fv-contest-theme-story .fv-story-panel {
    position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: clamp(10px, 2.5vw, 32px); box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
    background: rgba(18, 22, 25, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fvs-fade .2s ease;
}
.fv-contest-theme-story .fv-story-panel__window {
    position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); grid-template-rows: minmax(0, 1fr); width: min(1180px, 100%); max-height: calc(100vh - clamp(20px, 5vw, 64px)); max-height: calc(100dvh - clamp(20px, 5vw, 64px));
    overflow: hidden; background: var(--fvs-surface); border-radius: calc(var(--fvs-radius) + 4px); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); animation: fvs-rise .28s cubic-bezier(.2, .7, .2, 1);
}
.fv-contest-theme-story .fv-story-panel__art { display: flex; align-items: center; justify-content: center; min-height: 0; background: #14181a; }
.fv-contest-theme-story .fv-story-panel__art img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; object-fit: contain; }
.fv-contest-theme-story .fv-story-panel__info { position: relative; text-align: left; display: flex; flex-direction: column; align-items: flex-start; min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: clamp(24px, 3.4vw, 48px); }
.fv-contest-theme-story .fv-story-close {
    position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 50%;
    background: var(--fvs-soft); color: var(--fvs-ink); box-shadow: none; cursor: pointer; transition: background-color .2s ease;
}
.fv-contest-theme-story .fv-story-close:hover { background: var(--fvs-line); }
.fv-contest-theme-story .fv-story-panel__counter { margin: 0 48px 18px 0; color: var(--fvs-muted); font: 600 12px/1.4 var(--fvs-sans); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.fv-contest-theme-story .fv-story-panel__author { margin: 0 0 8px; color: var(--fvs-accent); font: 700 12px/1.4 var(--fvs-sans); letter-spacing: .12em; text-transform: uppercase; }
.fv-contest-theme-story .fv-story-panel h2 { margin: 0 0 18px; padding: 0; color: var(--fvs-ink); font: 700 clamp(26px, 2.6vw, 40px)/1.12 var(--fvs-serif); letter-spacing: -.01em; text-transform: none; text-align: left; }
.fv-contest-theme-story .fv-story-panel__description { max-width: 62ch; margin-bottom: 24px; overflow-wrap: anywhere; color: #424c53; font: 16px/1.7 var(--fvs-sans); }
.fv-contest-theme-story .fv-story-panel__description p { margin: 0 0 1em; }
.fv-contest-theme-story .fv-story-panel__foot { display: flex; flex-direction: column; gap: 16px; width: 100%; margin-top: auto; padding-top: 20px; }
/* Desktop: long text scrolls inside the info column while votes/actions/navigation stay pinned at the bottom. */
@media (min-width: 861px) {
    .fv-contest-theme-story .fv-story-panel__foot { position: sticky; bottom: calc(-1 * clamp(24px, 3.4vw, 48px)); z-index: 1; margin-bottom: calc(-1 * clamp(24px, 3.4vw, 48px)); padding-bottom: clamp(24px, 3.4vw, 48px); padding-top: 32px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--fvs-surface) 28px); }
}
.fv-contest-theme-story .fv-story-panel__votes { display: flex; align-items: baseline; gap: 8px; margin: 0; color: var(--fvs-muted); font: 600 13px/1.4 var(--fvs-sans); text-transform: uppercase; letter-spacing: .06em; }
.fv-contest-theme-story .fv-story-panel__votes-num { color: var(--fvs-ink); font: 700 34px/1 var(--fvs-serif); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.fv-contest-theme-story .fv-story-panel__actions { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.fv-contest-theme-story .fv-story-panel__actions .fv-story-vote { padding: 13px 26px; font-size: 15px; }
.fv-contest-theme-story .fv-story-share { margin: 0; padding: 13px 22px; border: 1.5px solid var(--fvs-line); border-radius: 999px; background: transparent; color: var(--fvs-ink); font: 700 15px/1.2 var(--fvs-sans); text-transform: none; box-shadow: none; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.fv-contest-theme-story .fv-story-share:hover { border-color: var(--fvs-ink); background: transparent; color: var(--fvs-ink); }
.fv-contest-theme-story .fv-story-panel__navigation { display: flex; justify-content: space-between; width: 100%; padding-top: 14px; border-top: 1px solid var(--fvs-line); }
.fv-contest-theme-story .fv-story-panel__navigation button { margin: 0; padding: 6px 0; border: 0; background: none; color: var(--fvs-ink); font: 600 13px/1.4 var(--fvs-sans); text-transform: none; box-shadow: none; cursor: pointer; }
.fv-contest-theme-story .fv-story-panel__navigation button:hover:not(:disabled) { color: var(--fvs-accent); background: none; }
.fv-contest-theme-story .fv-story-panel__navigation button:disabled { opacity: .3; cursor: default; }
html.fv-story-dialog-open, body.fv-story-dialog-open { overflow: hidden; }

/* Voting inside the dialog: spinner on the button, then a small inline message (the popup stays closed). */
.fv-contest-theme-story .fv-story-vote.is-loading { position: relative; color: transparent; pointer-events: none; }
.fv-contest-theme-story .fv-story-vote.is-loading .fv-story-heart { opacity: 0; }
.fv-contest-theme-story .fv-story-vote.is-loading::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; box-sizing: border-box;
    border: 2px solid var(--fvs-accent-ink); border-right-color: transparent; border-radius: 50%; animation: fvs-spin .7s linear infinite;
}
.fv-contest-theme-story .is-voted .fv-story-vote.is-loading::after { border-color: var(--fvs-accent); border-right-color: transparent; }
.fv-contest-theme-story .fv-story-toast { display: none; width: 100%; margin: 0; padding: 11px 14px; box-sizing: border-box; border-radius: 12px; background: var(--fvs-soft); color: var(--fvs-ink); font: 600 14px/1.45 var(--fvs-sans); text-align: left; }
.fv-contest-theme-story .fv-story-toast.is-visible { display: block; animation: fvs-rise .25s ease; }
.fv-contest-theme-story .fv-story-toast.is-error { box-shadow: inset 3px 0 0 var(--fvs-accent); }
@keyframes fvs-spin { to { transform: rotate(360deg); } }

@keyframes fvs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fvs-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
    .fv-contest-theme-story .fv-story-panel { align-items: flex-end; padding: 0; }
    .fv-contest-theme-story .fv-story-panel__window { grid-template-columns: 1fr; grid-template-rows: minmax(0, 38dvh) minmax(0, 1fr); width: 100%; max-height: 94vh; max-height: 94dvh; border-radius: 20px 20px 0 0; }
    .fv-contest-theme-story .fv-story-panel__art { min-height: 0; }
    .fv-contest-theme-story .fv-story-close { top: 10px; right: 10px; background: rgba(255, 255, 255, .92); }
    .fv-contest-theme-story .fv-story-panel__info { position: static; padding: 22px 20px 26px; }
    .fv-contest-theme-story .fv-story-panel__counter { margin-right: 0; }
}
@media (max-width: 480px) {
    .fv-contest-theme-story { --fvs-card-min: 100%; }
    .fv-contest-theme-story .fv-story-card__image { aspect-ratio: 3 / 2; }
}
@media (prefers-reduced-motion: reduce) {
    .fv-contest-theme-story *, .fv-contest-theme-story *::before, .fv-contest-theme-story *::after { animation: none !important; transition: none !important; }
}
/* Next/prev inside an open dialog: no fade/rise replay (prevents the flash between entries). */
.fv-contest-theme-story .fv-story-panel--instant,
.fv-contest-theme-story .fv-story-panel--instant .fv-story-panel__window { animation: none; }

/* Pagination: themed per skin through the --fv-pg-* contract (see assets-src/scss/_pagination.scss). */
.fv-contest-theme-story .fv-pagination {
    --fv-pg-accent: var(--fvs-accent);
    --fv-pg-accent-ink: var(--fvs-accent-ink);
    --fv-pg-ink: var(--fvs-ink);
    --fv-pg-muted: var(--fvs-muted);
    --fv-pg-border: var(--fvs-line);
    --fv-pg-surface: var(--fvs-surface);
    --fv-pg-hover: var(--fvs-soft);
    --fv-pg-radius: var(--fvs-radius);
}
.fv-contest-theme-story .fv-pagination { font-family: var(--fvs-serif); }

.fv-contest-theme-story .fv-pagination .fv-pagination-list a, .fv-contest-theme-story .fv-pagination .fv-pagination-list span:not(.pages):not(.current) { border-color: transparent; background: transparent; font-style: italic; font-size: 1.5rem; }
.fv-contest-theme-story .fv-pagination .fv-pagination-list a:hover { border-color: var(--fvs-line-hover); }
.fv-contest-theme-story .fv-pagination .fv-pagination-list .current { font-style: normal; border-radius: 50%; }
