/*
 * Tableaux photo : mise en situation (app/Views/Site/partials/tableau_scene.php),
 * liste /tableaux, fiche d'un tableau et bloc de la page d'accueil.
 */

/* ---------- Mise en situation ---------- */

.tb-scene {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: var(--tb-ratio, 1.5);
    overflow: hidden;
    background: #ddd6cc;
}

.tb-decor {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mur clair dessiné (quand aucun décor photo n'est disponible) */
.tb-mur {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 0%, rgba(255, 255, 255, .55), transparent 60%),
        linear-gradient(180deg, #ece7df 0%, #e2dbd0 78%, #d4ccbf 78.2%, #d9d1c5 79.4%, #b89a78 79.6%, #a5876a 100%);
}

.tb-mur::after {
    /* lames du parquet */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 20.4%;
    background: repeating-linear-gradient(90deg, transparent 0 11.8%, rgba(60, 40, 20, .12) 11.8% 12%);
}

.tb-meuble {
    /* console basse en bois sombre */
    position: absolute;
    left: 50%;
    bottom: 20.4%;
    width: 42%;
    height: 9%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #4a3a2d, #3a2d22);
    box-shadow: 0 1.2vw 1.6vw -0.6vw rgba(0, 0, 0, .35);
}

.tb-meuble::before,
.tb-meuble::after {
    content: "";
    position: absolute;
    bottom: -38%;
    width: 2.5%;
    height: 38%;
    background: #2f241b;
}

.tb-meuble::before { left: 6%; }
.tb-meuble::after  { right: 6%; }

/* L'œuvre accrochée : position, taille réelle (% de la largeur du décor) et proportions */
.tb-oeuvre {
    position: absolute;
    left: var(--tb-x);
    top: var(--tb-y);
    width: var(--tb-l);
    aspect-ratio: var(--tb-ar);
    transform: translate(-50%, -50%);
    container-type: inline-size;
    transition: width .45s ease, aspect-ratio .45s ease;
}

.tb-cadre {
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.tb-cadre img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tirage encadré : cadre noir mat et passe-partout blanc */
.tb-oeuvre--papier_encadre .tb-cadre {
    padding: var(--tb-passe);
    border: var(--tb-cadre) solid #1b1b1b;
    background: #f7f5f1;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, .08),
        0 2.5cqw 5cqw rgba(0, 0, 0, .28),
        0 .6cqw 1.2cqw rgba(0, 0, 0, .25);
}

.tb-oeuvre--papier_encadre .tb-cadre img {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
}

/* Aluminium Dibond : sans cadre, légèrement décollé du mur */
.tb-oeuvre--alu_dibond .tb-cadre {
    box-shadow:
        0 3cqw 6cqw rgba(0, 0, 0, .3),
        0 .8cqw 1.4cqw rgba(0, 0, 0, .25);
}

/* Toile sur châssis : épaisseur et ombre plus marquées */
.tb-oeuvre--toile .tb-cadre {
    box-shadow:
        .9cqw .9cqw 0 rgba(0, 0, 0, .18),
        0 4cqw 7cqw rgba(0, 0, 0, .33);
}

.tb-oeuvre--toile .tb-cadre img {
    filter: saturate(.96) contrast(.97);
}

/* ---------- Cartes (accueil et liste) ---------- */

.tb-cartes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tb-carte {
    display: block;
    color: #b5b5b5 !important;
    text-decoration: none !important;
}

.tb-carte .tb-scene {
    margin-bottom: 14px;
}

.tb-carte .tb-oeuvre {
    transition: transform .6s ease;
}

@media (hover: hover) {
    .tb-carte:hover .tb-oeuvre {
        transform: translate(-50%, -50%) scale(1.04);
    }
}

.tb-carte-titre {
    display: block;
    color: #f3f3f3;
    font-family: "Roboto Slab", serif;
    font-size: 19px;
    font-weight: 300;
    line-height: 1.35;
}

.tb-carte-prix {
    display: block;
    margin-top: 4px;
    font-size: 14px;
}

.tb-carte:focus-visible {
    outline: 2px solid #d447a4;
    outline-offset: 4px;
}

@media (max-width: 900px) {
    .tb-cartes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .tb-cartes {
        grid-template-columns: 1fr;
        gap: 22px;
    }
}

/* ---------- Pages /tableaux ---------- */

.tb-page {
    background: #161616;
    color: #b5b5b5;
    font-size: 16px;
    line-height: 1.7;
}

.tb-page p {
    line-height: 1.7;
}

.tb-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 64px 24px 80px;
}

.tb-intro {
    max-width: 720px;
    margin: 0 0 40px;
}

.tb-intro h2,
.tb-fiche h1 {
    margin: 0 0 14px;
    color: #f3f3f3;
    font-family: "Roboto Slab", serif;
    font-weight: 300;
    text-transform: none;
    letter-spacing: 0;
}

.tb-intro h2 {
    font-size: clamp(26px, 3.2vw, 38px);
}

/* Fiche d'un tableau */
.tb-fiche {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: 48px;
    align-items: start;
}

.tb-fiche h1 {
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.2;
}

.tb-visuel {
    position: sticky;
    top: 90px;
}

.tb-decors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.tb-decors button {
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 2px;
    background: transparent;
    color: #ddd;
    font-size: 13px;
    cursor: pointer;
}

.tb-decors button[aria-pressed="true"] {
    border-color: #d447a4;
    background: rgba(212, 71, 164, .15);
    color: #fff;
}

.tb-voir-photo {
    margin-top: 12px;
    font-size: 14px;
}

.tb-choix {
    margin: 26px 0 0;
    padding: 0;
    border: 0;
}

.tb-choix legend {
    margin-bottom: 10px;
    padding: 0;
    border: 0;
    color: #f3f3f3;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.tb-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tb-options label {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.tb-options input {
    position: absolute;
    opacity: 0;
}

.tb-options span {
    display: block;
    min-width: 92px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 2px;
    color: #ddd;
    font-size: 14px;
    text-align: center;
    transition: border-color .2s, background-color .2s;
}

.tb-options input:checked + span {
    border-color: #d447a4;
    background: rgba(212, 71, 164, .15);
    color: #fff;
}

.tb-options input:focus-visible + span {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.tb-options input:disabled + span {
    opacity: .35;
    cursor: not-allowed;
    text-decoration: line-through;
}

.tb-support-texte {
    margin: 10px 0 0;
    font-size: 14px;
}

.tb-prix {
    margin: 28px 0 0;
    color: #f3f3f3;
    font-family: "Roboto Slab", serif;
    font-size: 34px;
    font-weight: 300;
}

.tb-prix small {
    color: #8f8f8f;
    font-family: inherit;
    font-size: 14px;
}

.tb-commander {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin-top: 18px;
    padding: 13px 28px;
    border: 1px solid #d447a4;
    border-radius: 2px;
    background: #d447a4;
    color: #fff;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

.tb-commander:hover,
.tb-commander:focus-visible {
    background: #b8378c;
    border-color: #b8378c;
}

.tb-infos {
    margin: 26px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: 14px;
}

.tb-infos p {
    margin: 0 0 10px;
}

.tb-message {
    padding: 14px 16px;
    border-left: 3px solid #d447a4;
    background: rgba(212, 71, 164, .1);
    color: #eee;
}

@media (max-width: 991px) {
    .tb-fiche {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .tb-visuel {
        position: static;
    }
}

@media (max-width: 767px) {
    .tb-section {
        padding: 36px 16px 56px;
    }

    .tb-visuel {
        margin: 0 -16px;
    }

    .tb-decors,
    .tb-voir-photo {
        padding: 0 16px;
    }

    .tb-options span {
        min-width: 0;
    }
}
