.personside {
    padding-block: 0;
    color: var(--tekst, #26342e);
    background: var(--papir, #faf7ef);
}

.person-intro {
    color: var(--papir, #faf7ef);
    background: var(--skov, #172d28);
}

.person-intro-indhold {
    display: grid;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 4rem);
    padding-block: clamp(2rem, 4vw, 3.5rem);
}

.person-intro-indhold:has(.person-portraet) {
    grid-template-columns: minmax(0, 1fr) minmax(12rem, 24rem);
}

.person-intro h1 {
    width: auto;
    margin: 0 0 0.8rem;
    color: var(--guld, #e3c483);
    font: 400 clamp(2.6rem, 6vw, 5rem)/1.15
        var(--font-display, "Quintessential", Georgia, serif);
    letter-spacing: normal;
    text-transform: none;
}

.person-intro p {
    max-width: 52ch;
    margin: 0;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    font-weight: 400;
    line-height: 1.55;
}

.person-portraet {
    display: block;
    width: 100%;
    max-height: 20rem;
    object-fit: contain;
    object-position: left center;
}

.person-menu {
    padding-block: 0.9rem;
    border-bottom: 1px solid var(--streg, #d8cfba);
    background: transparent;
    color: var(--tekst, #26342e);
}

.person-menu ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem clamp(1rem, 3vw, 2.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.person-menu a {
    display: inline-block;
    padding-block: 0.4rem;
    color: inherit;
    font-weight: 400;
    text-decoration: underline;
    text-decoration-color: #b49962;
    text-underline-offset: 0.3em;
}

.person-menu a:hover {
    color: #765b29;
}

.person-kapitel {
    padding-block: clamp(2rem, 4vw, 3.5rem);
    border-bottom: 1px solid var(--streg, #d8cfba);
}

.person-kapitel:last-child {
    border-bottom: 0;
}

.person-kapitel h2 {
    margin: 0 0 1rem;
    color: var(--skov, #172d28);
    font: 600 clamp(1.6rem, 3.2vw, 2.5rem)/1.15
        var(--font-tekst, "Roboto", Arial, sans-serif);
    text-transform: none;
    scroll-margin-top: 1.5rem;
}

.person-kapitel > p {
    max-width: 66ch;
    margin: 0 0 0.8rem;
}

/* Kapitlets første billede får mere plads på brede skærme. */
.person-album {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: clamp(1rem, 2vw, 1.75rem);
    margin-top: 1.5rem;
}

.person-album figure {
    min-width: 0;
    margin: 0;
}

.person-album figure:first-child {
    grid-column: span 2;
}

.person-album a,
.person-album img,
.person-album video {
    display: block;
    width: 100%;
}

.person-album img,
.person-album video {
    height: auto;
}

.person-album figcaption {
    margin-top: 0.45rem;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: no-preference) {
    html:has(.personside) {
        scroll-behavior: smooth;
    }
}

@media (max-width: 50rem) {
    .person-album {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 38rem) {
    .person-intro-indhold:has(.person-portraet),
    .person-album {
        grid-template-columns: minmax(0, 1fr);
    }

    .person-album figure:first-child {
        grid-column: auto;
    }

    .person-portraet {
        max-height: 15rem;
    }
}


.personside img,
.personside video {
    border-radius: 12px;
}

.person-collage {
    margin-top: 1.5rem;
}

.collage-spor {
    display: flex;
    height: clamp(19rem, 40vw, 32rem);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #aa966c transparent;
}

.collage-side {
    flex: 0 0 100%;
    min-width: 0;
    height: 100%;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: clamp(0.4rem, 1vw, 0.85rem);
    scroll-snap-align: start;
}

/* Hver side fyldes ud, også når serien slutter med færre end fem billeder. */
.collage-antal-1 { grid-template-areas: "a a a" "a a a"; }
.collage-antal-2 { grid-template-areas: "a b b" "a b b"; }
.collage-antal-3 { grid-template-areas: "a b b" "a c c"; }
.collage-antal-4 { grid-template-areas: "a b b" "a c d"; }
.collage-antal-5 { grid-template-areas: "a b c" "a d e"; }

.collage-felt:nth-child(1) { grid-area: a; }
.collage-felt:nth-child(2) { grid-area: b; }
.collage-felt:nth-child(3) { grid-area: c; }
.collage-felt:nth-child(4) { grid-area: d; }
.collage-felt:nth-child(5) { grid-area: e; }

.collage-felt {
    position: relative;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #e6e0d3;
}

.collage-felt a,
.collage-felt img,
.collage-felt video {
    display: block;
    width: 100%;
    height: 100%;
}

.collage-felt img {
    object-fit: cover;
    object-position: center top;
}

.collage-felt video {
    object-fit: contain;
    background: #172d28;
}

.collage-felt figcaption {
    position: absolute;
    inset: auto 0 0;
    padding: 1.3rem 0.7rem 0.5rem;
    color: white;
    background: linear-gradient(transparent, rgb(0 0 0 / 80%));
    font-size: 0.875rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    pointer-events: none;
}

/* Hold videoens betjeningsknapper fri. */
.collage-felt:has(video) figcaption {
    inset: 0 0 auto;
    padding: 0.45rem 0.7rem 1rem;
    background: linear-gradient(rgb(0 0 0 / 75%), transparent);
}

.collage-navigation:not([hidden]) {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.6rem;
    font-size: 0.9rem;
}

.collage-navigation button {
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--streg, #d8cfba);
    border-radius: 50%;
    background: transparent;
    color: var(--skov, #172d28);
    font-size: 1.2rem;
    cursor: pointer;
}

.collage-navigation button:disabled {
    opacity: 0.35;
    cursor: default;
}

.collage-felt a:focus-visible {
    outline: 3px solid var(--guld, #e3c483);
    outline-offset: -4px;
}

@media (max-width: 38rem) {
    .collage-spor {
        height: clamp(20rem, 95vw, 28rem);
    }

    .collage-side {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: 2fr 1fr 1fr;
    }

    .collage-antal-1 { grid-template-areas: "a a a a" "a a a a" "a a a a"; }
    .collage-antal-2 { grid-template-areas: "a a a a" "b b b b" "b b b b"; }
    .collage-antal-3 { grid-template-areas: "a a a a" "b b c c" "b b c c"; }
    .collage-antal-4 { grid-template-areas: "a a a a" "b b c c" "b b d d"; }
    .collage-antal-5 { grid-template-areas: "a a a a" "b b c c" "d d e e"; }
}




/* LIGHTBOX: Originalbilledet og dets billedtekst */

html.lightbox-aaben {
    overflow: hidden;
}

.person-lightbox {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #10241f;
    color: #faf7ef;
    font-family: var(--font-tekst, "Roboto", Arial, sans-serif);
}

.person-lightbox::backdrop {
    background: #10241f;
}

.person-lightbox [hidden] {
    display: none;
}

/* Top, foto med tekst og pile deler pladsen i vinduet. */
.lightbox-indhold {
    box-sizing: border-box;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding: clamp(0.75rem, 2vw, 1.5rem);
}

.lightbox-top,
.lightbox-bund {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.lightbox-kapitel {
    flex: 1;
    min-width: 0;
    color: var(--guld, #e3c483);
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 400;
    line-height: 1.25;
}

.lightbox-bund {
    justify-content: center;
}

.person-lightbox button {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid #73877c;
    border-radius: 0.4rem;
    background: transparent;
    color: #faf7ef;
    font: inherit;
    cursor: pointer;
}

.person-lightbox button:hover {
    background: #29463d;
}

.person-lightbox button:focus-visible {
    outline: 2px solid var(--guld, #e3c483);
    outline-offset: 3px;
}

.lightbox-figur {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
}

.lightbox-billedfelt {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    touch-action: pan-y pinch-zoom;
}

/* Hele originalen vises, også ved højformat og gamle kvadratiske fotos. */
.lightbox-billedfelt .lightbox-billede {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
}

.lightbox-tekst {
    box-sizing: border-box;
    width: min(100%, 65ch);
    max-height: 25vh;
    overflow-y: auto;
    margin: 0.65rem auto 0;
    color: #faf7ef;
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.lightbox-taeller {
    min-width: 8rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}


/* På mobil følger billedteksten og pilene nu billedets faktiske højde. */

@media (max-width: 44rem) {
    .lightbox-indhold {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        overflow-y: auto;
    }

    .lightbox-top,
    .lightbox-figur,
    .lightbox-bund {
        flex: none;
    }

    /* Foto, tekst og pile centreres samlet i pladsen under topmenuen. */
    .lightbox-figur {
        display: block;
        margin-block-start: auto;
    }

    .lightbox-bund {
        margin-block-end: auto;
    }

    .lightbox-billedfelt {
        display: block;
    }

    /* Liggende fotos kan fylde bredden. Høje fotos skaleres proportionalt. */
    .lightbox-billedfelt .lightbox-billede {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 65vh;
        max-height: 65dvh;
        margin-inline: auto;
    }

    /* En lang billedtekst kan læses ved at scrolle i selve lightboxen. */
    .lightbox-tekst {
        max-height: none;
        overflow: visible;
        margin: 0.65rem auto 0;
    }
}



/* Markøren viser, at billedet i collagen kan åbnes. */
.person-collage .collage-felt > a {
    cursor: zoom-in;
}

   /*75 % gennemsigtighed svarer til 25 % synlig grøn. */

.person-lightbox {
    background: transparent;
}

.person-lightbox::backdrop {
    background: rgb(16 36 31 / 85%);
}
