/* ========== Style global ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Lora', serif;
}

body {
    background-color: #9B1C2F;
    color: #5C5C5C;
    text-align: center;
    padding: 0 10px;
}

body::before,
body::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: 3.5%;
    background-color: #9B1C2F;
    z-index: -1;
}

body::before { left: 0; }
body::after  { right: 0; }

/* ========== Cadre central beige ========== */
.cadre-total {
    background-color: #D9CBA7;
    max-width: 1100px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ========== Header ========== */
header {
    background-color: #9B1C2F;
    padding: 20px 0;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

header nav a {
    color: #F1E6D6;
    text-decoration: none;
    font-size: 1.2em;
    font-family: 'Playfair Display', serif;
    text-transform: uppercase;
    margin: 10px 20px;
    transition: color 0.3s ease;
}

header nav a.active,
header nav a:hover {
    text-decoration: underline;
    color: #FFF;
}

a:focus-visible {
    outline: 2px solid #FFF;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ========== Galerie desktop ========== */
section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

figure {
    width: 250px;
    display: block;
    background-color: #F1E6D6;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 3px solid #e0d8c5;
    padding: 5px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

figure:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    z-index: 10;
}

figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border-bottom: 3px solid #9B1C2F;
    transition: transform 0.5s ease;
    transform-origin: var(--x, 50%) var(--y, 50%);
    cursor: pointer;
}

figure:hover img {
    transform: scale(1.2);
    cursor: zoom-in;
}

figcaption {
    display: block;
    font-size: 0.8em;
    font-family: 'Playfair Display', serif;
    color: #5C5C5C;
    padding: 5px 8px;
    min-height: 40px;
    line-height: 1.4;
    text-align: center;
}

/* ========== Footer ========== */
footer {
    background-color: #9B1C2F;
    color: #F1E6D6;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
    font-family: 'Lora', serif;
    line-height: 1.5;
    margin-top: 40px;
    border-radius: 10px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
}

footer p {
    color: #F1E6D6;
    font-size: 0.9em;
}

/* ========== Modale ========== */
#modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

#modal.visible { display: flex; }

#modal img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
    object-fit: contain;
}

#modal p {
    color: #F1E6D6;
    font-family: 'Playfair Display', serif;
    font-size: 1em;
    text-align: center;
}

#modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #F1E6D6;
    font-size: 1.8em;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

#modal-close:hover { color: #fff; }

/* ========== Desktop 1024px ========== */
@media (max-width: 1024px) {
    section {
        width: 80%;
        max-width: 900px;
        margin: 0 auto;
    }
    footer { padding: 15px 0; }
    footer p { font-size: 0.85em; }
}

/* ========== TACTILE ========== */
.touch figure:hover {
    transform: none;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.touch figure:hover img {
    transform: none;
    cursor: pointer;
}

/* ========== PORTRAIT = 1 colonne ========== */
@media (orientation: portrait) {
    .touch .cadre-total {
        padding: 10px;
    }

    .touch section {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
        padding: 10px;
    }

    .touch figure {
        width: 85vw;
        max-width: 360px;
    }

    .touch figure img {
        width: 100%;
        height: auto;
    }

    .touch figcaption {
        width: 100%;
        font-size: 0.85em;
        padding: 8px;
        text-align: center;
    }

    .touch #modal img {
        max-width: 95vw;
        max-height: 65vh;
    }

    .touch #modal-close {
        top: 10px;
        right: 15px;
        font-size: 1.5em;
    }
}

/* ========== PAYSAGE = 2 colonnes ========== */
@media (orientation: landscape) {
    .touch section {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .touch figure {
        width: 45vw;
        max-width: 350px;
    }

    .touch figure img {
        width: 100%;
        height: auto;
    }

    .touch figcaption {
        width: 100%;
        font-size: 0.8em;
        text-align: center;
    }

    .touch #modal img {
        max-width: 80vw;
        max-height: 75vh;
    }
}