/*
 * Landing page for the two cemetery registers.
 *
 * The page is two doors. Each door wears the look of the site behind it,
 * so a visitor recognises where they arrive: Wortel in warm black with
 * copper and a lead plaque, Merksplas in slate with cornflower blue and a
 * serif. The page around them stays white and quiet.
 * Plain CSS, light mode only, no web fonts, no build step.
 */

:root {
    --inkt: #1c1d1f;
    --inkt-zacht: #54585d;
    --papier: #ffffff;
    --lijn: #d9dbdc;

    /* Wortel: tokens from ../begraafplaats-wortel/resources/css/site.css */
    --w-nacht: #1d1a16;
    --w-op-nacht: #f3efe8;
    --w-op-nacht-zacht: #bbb3a7;
    --w-koper: #a4461a;
    --w-koper-donker: #7c3211;
    --w-lood: #6f767c;
    --w-lood-licht: #d5d9dc;

    /* Merksplas: tokens from ../begraafplaats-vluchtelingen-merksplas/resources/css/site.css */
    --m-leisteen: #1e2933;
    --m-leisteen-lijn: #43525f;
    --m-kalk: #f7f8f7;
    --m-mist: #b9c4cd;
    --m-korenbloem: #2c4c8c;
    --m-korenbloem-donker: #1f376a;
    --m-korenbloem-helder: #a9c1f0;

    --sans: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;

    --rand: clamp(1rem, 4vw, 2.5rem);
    --uit: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 106.25%; /* 17px */
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--papier);
    color: var(--inkt);
    font-family: var(--sans);
    line-height: 1.55;
}

::selection {
    background: var(--inkt);
    color: var(--papier);
}

h1,
h2,
p,
ul {
    margin: 0;
}

a {
    color: inherit;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

:focus-visible {
    outline: 3px solid var(--inkt);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* The first screen: the title and the two doors, nothing else. */

.eerste {
    display: flex;
    flex-direction: column;
}

.kop {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.15rem;
    padding: 0.35rem var(--rand) 1.1rem;
}

.kop nav {
    align-self: flex-end;
    margin-right: -0.5rem;
}

.kop h1 {
    font-size: clamp(1.25rem, 1rem + 1.4vw, 1.9rem);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.kop p {
    margin-top: 0.3rem;
    color: var(--inkt-zacht);
    text-wrap: pretty;
}

.talen {
    display: flex;
    gap: 0.15rem;
    padding: 0;
    list-style: none;
}

.talen a {
    display: grid;
    place-items: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--inkt-zacht);
}

.talen a:hover {
    color: var(--inkt);
    background: #f1f2f2;
}

.talen a[aria-current] {
    color: var(--papier);
    background: var(--inkt);
}

/* The doors. */

.deuren {
    flex: 1;
    display: grid;
}

.deur {
    position: relative;
    display: grid;
    grid-template-rows: auto auto;
    background: var(--vlak);
    color: var(--op-vlak);
}

.deur__beeld {
    overflow: hidden;
    aspect-ratio: 16 / 8;
    background: var(--vlak);
}

.deur__beeld img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--kijk, 50% 50%);
    transition: transform 900ms var(--uit);
}

.deur__tekst {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(1.25rem, 3.2vw, 2.5rem) var(--rand) clamp(1.5rem, 3.6vw, 2.75rem);
}

.deur h2 {
    max-width: 18ch;
    font-size: clamp(1.6rem, 1.1rem + 2.1vw, 2.6rem);
    line-height: 1.08;
    text-wrap: balance;
}

.deur__register {
    margin-top: 0.85rem;
}

.deur__uitleg {
    max-width: 40ch;
    margin: 0.9rem 0 1.5rem;
    color: var(--op-vlak-zacht);
    text-wrap: pretty;
}

.deur__knop {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 3rem;
    /* Pushed down, so the two buttons sit on one line whatever the texts. */
    margin-top: auto;
    padding: 0.7rem 1.15rem;
    background: var(--knop);
    color: #fff;
    font-weight: 650;
    line-height: 1.25;
    text-decoration: none;
    transition: background-color 200ms var(--uit);
}

/* The whole door is the link. */
.deur__knop::after {
    content: "";
    position: absolute;
    inset: 0;
}

.deur__knop svg {
    flex: none;
    transition: transform 400ms var(--uit);
}

.deur:hover .deur__knop,
.deur__knop:focus-visible {
    background: var(--knop-donker);
}

.deur:hover .deur__knop svg,
.deur__knop:focus-visible svg {
    transform: translateX(0.3rem);
}

.deur:hover .deur__beeld img,
.deur:focus-within .deur__beeld img {
    transform: scale(1.035);
}

.deur__knop:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* Wortel: warm black, copper, heavy sans, the years stamped on a lead plaque. */

.deur--wortel {
    --vlak: var(--w-nacht);
    --op-vlak: var(--w-op-nacht);
    --op-vlak-zacht: var(--w-op-nacht-zacht);
    --knop: var(--w-koper);
    --knop-donker: var(--w-koper-donker);
    --kijk: 50% 100%;
}

.deur--wortel h2 {
    font-weight: 800;
    letter-spacing: -0.025em;
}

.deur--wortel .deur__register {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    background: var(--w-lood-licht);
    color: var(--w-nacht);
    font-family: var(--mono);
    font-size: clamp(0.74rem, 0.62rem + 0.5vw, 0.82rem);
    font-weight: 600;
}

/* The two nails of the plaque. */
.deur--wortel .deur__register::before,
.deur--wortel .deur__register::after {
    content: "";
    flex: none;
    width: 0.32rem;
    height: 0.32rem;
    border-radius: 50%;
    background: var(--w-lood);
}

.deur--wortel .deur__knop {
    border-radius: 6px;
}

/* Merksplas: slate, cornflower blue, names in a serif, the photo in grey tones. */

.deur--merksplas {
    --vlak: var(--m-leisteen);
    --op-vlak: var(--m-kalk);
    --op-vlak-zacht: var(--m-mist);
    --knop: var(--m-korenbloem);
    --knop-donker: var(--m-korenbloem-donker);
    --kijk: 50% 70%;
}

.deur--merksplas .deur__beeld img {
    filter: grayscale(1) brightness(0.86) contrast(1.05);
}

.deur--merksplas h2 {
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: -0.005em;
}

.deur--merksplas .deur__register {
    padding-top: 0.55rem;
    border-top: 2px solid var(--m-korenbloem-helder);
    color: var(--m-korenbloem-helder);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.deur--merksplas .deur__knop {
    border-radius: 2px;
}

/* Below the doors. */

.uitleg {
    max-width: calc(38rem + 2 * var(--rand));
    padding: clamp(2.5rem, 7vw, 4.5rem) var(--rand) clamp(2rem, 5vw, 3rem);
}

.uitleg h2 {
    font-size: 1.3rem;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.uitleg p {
    margin-top: 0.8rem;
    text-wrap: pretty;
}

.voet {
    padding: 1.25rem var(--rand) 2rem;
    border-top: 1px solid var(--lijn);
    color: var(--inkt-zacht);
    font-size: 0.85rem;
}

.voet p {
    max-width: 70ch;
}

.voet a:hover {
    color: var(--inkt);
}

/* Side by side from tablet width on, filling the screen. */

@media (min-width: 48rem) {
    .eerste {
        min-height: 100vh;
        min-height: 100svh;
    }

    .kop {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem 2rem;
        padding: 1.1rem var(--rand) 1.2rem;
    }

    .kop nav {
        align-self: auto;
    }

    /* The photos take what is left of the screen above the texts, and the
       two texts share one row, so they start at the same height. */
    .deuren {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(10rem, 1fr) auto;
    }

    .deur {
        grid-row: span 2;
        grid-template-rows: subgrid;
    }

    .deur__beeld {
        position: relative;
        aspect-ratio: auto;
    }

    .deur__beeld img {
        position: absolute;
        inset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
