html {
    background: #faf8f2;
}

body {
    margin: 0;
    color: #26343b;
    font-family: Arial, Helvetica, sans-serif;
}

body::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    background: url("assets/favicon.png") center / min(80vw, 680px) auto no-repeat;
    opacity: 0.07;
    pointer-events: none;
    content: "";
}

.page-frame {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    max-width: 1280px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 7rem clamp(1.5rem, 12vw, 10rem) 7rem;
    background: transparent;
}

.foliage {
    position: fixed;
    z-index: 2;
    top: 0;
    left: 50%;
    box-sizing: border-box;
    width: min(100%, 1280px);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(-50%);
}

.foliage img {
    position: absolute;
    display: block;
    height: auto;
    user-select: none;
}

.foliage-corner {
    width: clamp(180px, 22vw, 275px);
}

.top-left { top: 0; left: 0; }
.top-right { top: 0; right: 0; }
.bottom-left { bottom: 0; left: 0; }
.bottom-right { bottom: 0; right: 0; }

.top-edge,
.bottom-edge {
    width: clamp(220px, 28vw, 340px);
    left: 50%;
}

.top-edge { top: 0; transform: translateX(-50%); }
.bottom-edge { bottom: 0; transform: translateX(-50%) rotate(180deg); }

.left-edge,
.right-edge {
    width: clamp(75px, 8vw, 110px);
    top: 50%;
}

.left-edge { left: 0; transform: translateY(-50%); }
.right-edge { right: 0; transform: translateY(-50%) scaleX(-1); }

.titre,
.episodes {
    position: relative;
    z-index: 1;
}

.titre {
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 1.5rem;
    padding: 0.1em 0.35em;
    color: darkblue;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 1.15;
    text-align: center;
}

.episodes {
    max-width: 900px;
    margin: 0 auto;
}

.episode {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 44px;
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #d7ded5;
}

.titre-episode,
.player,
.lien-container {
    min-width: 0;
}

.titre-episode {
    text-align: left;
    font-size: 1.3rem;
    font-weight: bold;
}

.player audio {
    display: block;
    width: 100%;
}

.lien-photo {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.lien-photo img {
    display: block;
    width: 28px;
    height: 28px;
}

.lien-photo:hover {
    background-color: #edf1fb;
}

.lien-photo:focus-visible {
    outline: 2px solid darkblue;
    outline-offset: 2px;
}

.lien-photo:disabled {
    opacity: 0.4;
    cursor: default;
}

.lien-photo:disabled:hover {
    background: transparent;
}

.photo-dialog {
    box-sizing: border-box;
    width: fit-content;
    max-width: 90vw;
    max-height: 90vh;
    max-height: 90dvh;
    padding: 1rem;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgb(0 0 0 / 25%);
}

.photo-dialog::backdrop {
    background: rgb(0 0 0 / 70%);
}

.photo-dialog figure {
    margin: 0;
}

.photo-dialog-image {
    display: block;
    max-width: 100%;
    object-fit: contain;
}

.photo-dialog-credit {
    margin-top: 0.5rem;
    color: #555;
    font-size: 0.7rem;
    text-align: right;
    overflow-wrap: anywhere;
}

.photo-dialog-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 90%);
    color: #222;
    font-size: 1.5rem;
    cursor: pointer;
}

.photo-dialog-close:focus-visible {
    outline: 2px solid darkblue;
    outline-offset: 2px;
}

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

@media (max-width: 750px) {
    .page-frame {
        min-height: 100vh;
        padding: 6.5rem 1rem 6.5rem;
    }

    .foliage-corner {
        width: clamp(105px, 27vw, 170px);
    }

    .foliage .foliage-edge {
        display: none;
    }

    .titre {
        margin-bottom: 1.25rem;
        font-size: clamp(2rem, 8vw, 2.8rem);
    }

    .episode {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .titre-episode {
        text-align: center;
    }

    .lien-container {
        text-align: center;
    }
}
