/* =========================================================
   Fiche œuvre (top_oeuvre.php / bot_oeuvre.php)
   ========================================================= */

.oe-page {
    color: #cbd5e1;
}

/* ---------- En-tête ---------- */
.oe-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 24rem;
    margin-top: 0.5rem;
    border-radius: 14px;
    overflow: hidden;
    background: #070b16;
}

.oe-fond,
.oe-fond img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.oe-fond img {
    object-fit: cover;
    object-position: center 30%;
    opacity: 0.75;
}

.oe-hero-sans-fond .oe-fond img {
    filter: blur(16px);
    transform: scale(1.15);
    opacity: 0.45;
}

.oe-fond::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(4, 7, 16, 0.97) 0%, rgba(4, 7, 16, 0.78) 38%, rgba(4, 7, 16, 0.2) 78%, rgba(4, 7, 16, 0.1) 100%),
        linear-gradient(to right, rgba(4, 7, 16, 0.7) 0%, rgba(4, 7, 16, 0) 65%);
}

.oe-hero-contenu {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 1.75rem;
    width: 100%;
    padding: 8rem 1.75rem 1.75rem;
}

.oe-affiche {
    flex: 0 0 12.5rem;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Pas d'affiche verticale : on recadre la bannière d'Anime-Sama au format affiche */
.oe-affiche-large img {
    object-position: 50% 35%;
}

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

.oe-tete {
    flex: 1;
    min-width: 0;
}

.oe-badges {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.6rem;
}

.oe-badges .type-badge {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
    text-transform: uppercase;
}

.oe-titre {
    margin: 0;
    color: #fff;
    font-size: clamp(1.75rem, 3.1vw, 3rem);
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
    overflow-wrap: anywhere;
}

.oe-alters {
    margin-top: 0.4rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.85rem;
    font-style: italic;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
}

.oe-alters.oe-ouvert {
    -webkit-line-clamp: unset;
}

.oe-meta {
    margin-top: 0.7rem;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
}

.oe-point {
    margin: 0 0.5rem;
    color: #64748b;
}

/* Notes */
.oe-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.oe-note {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(71, 85, 105, 0.4);
    color: #fff;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.oe-note:hover {
    border-color: rgba(96, 165, 250, 0.6);
}

.oe-note-quoi {
    color: #93c5fd;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.oe-note-etoile svg {
    width: 15px;
    height: 15px;
    color: #facc15;
    fill: #facc15;
    display: block;
}

.oe-note-sur {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Boutons */
.oe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.1rem;
}

.oe-actions .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.oe-actions .action-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.oe-actions .action-btn > span {
    display: inline-flex;
}

.oe-actions .action-btn > .hidden {
    display: none;
}

/* script_oeuvre.js cache le texte quand l'œuvre est ajoutée : on le garde, la coche suffit */
.oe-actions [id^="text"].hidden {
    display: inline-flex;
}

.oe-actions .btn-watchlist { background: rgba(59, 130, 246, 0.25); }
.oe-actions .btn-favoris   { background: rgba(234, 179, 8, 0.22); }
.oe-actions .btn-vu        { background: rgba(34, 197, 94, 0.22); }
.oe-actions .btn-ba        { background: rgba(255, 255, 255, 0.1); }

.oe-actions .btn-watchlist:hover { background: rgba(59, 130, 246, 0.4); }
.oe-actions .btn-favoris:hover   { background: rgba(234, 179, 8, 0.35); }
.oe-actions .btn-vu:hover        { background: rgba(34, 197, 94, 0.35); }
.oe-actions .btn-ba:hover        { background: rgba(255, 255, 255, 0.18); }

/* Déjà dans la liste */
.oe-actions .btn-watchlist:has(#checkedWatchlist:not(.hidden)) { border-color: rgba(96, 165, 250, 0.7); }
.oe-actions .btn-favoris:has(#checkedFavoris:not(.hidden))     { border-color: rgba(250, 204, 21, 0.7); }
.oe-actions .btn-vu:has(#checkedVu:not(.hidden))               { border-color: rgba(74, 222, 128, 0.7); }

/* ---------- Corps : colonne principale + colonne d'infos ---------- */
.oe-corps {
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
}

.oe-principal {
    min-width: 0;
}

.oe-cote {
    order: 2;
    margin-top: 1.75rem;
}

.oe-suite {
    order: 3;
    min-width: 0;
}

@media (min-width: 1280px) {
    .oe-corps {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 19rem;
        column-gap: 2.25rem;
        align-items: start;
    }

    .oe-principal {
        grid-column: 1;
        grid-row: 1;
    }

    .oe-cote {
        grid-column: 2;
        grid-row: 1 / span 2;
        margin-top: 1.75rem;
    }

    .oe-suite {
        grid-column: 1;
        grid-row: 2;
    }
}

/* Titres de section : ceux du site (majuscules, soulignés) */
.oe-h2,
.oe-principal > h2 {
    margin: 1.75rem 0 0.9rem;
    padding-bottom: 0.15rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid #3b82f6;
}

.oe-h2-detail {
    margin-left: 0.4rem;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 400;
    text-transform: none;
}

/* Les textes d'explication écrits dans certaines fiches (ex. « Kai ») */
.oe-principal > p.text-gray-300 {
    margin-top: -0.4rem;
}

/* Actualité / correspondance */
.oe-actu,
.oe-correspondance {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding: 0.7rem 0.95rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.55;
}

.oe-actu {
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #cbd5e1;
}

.oe-correspondance {
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #cbd5e1;
}

.oe-actu svg,
.oe-correspondance svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 0.1rem;
    opacity: 0.8;
}

.oe-actu svg { color: #34d399; }
.oe-correspondance svg { color: #60a5fa; }

.oe-actu p {
    margin: 0;
}

.oe-actu strong,
.oe-correspondance strong {
    color: #fff;
}

/* Synopsis */
.oe-synopsis p {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.75;
}

.oe-replie {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.oe-replie.oe-ouvert {
    -webkit-line-clamp: unset;
}

.oe-voir-plus {
    margin-top: 0.35rem;
    padding: 0;
    background: none;
    border: 0;
    color: #60a5fa;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.oe-voir-plus:hover {
    color: #93c5fd;
}

/* Genres */
.oe-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1.1rem;
}

.oe-genres .genre-pill {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.35);
    color: #a5b4c8;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.2s, border-color 0.2s;
}

.oe-genres .genre-pill:hover {
    color: #fff;
    border-color: rgba(96, 165, 250, 0.6);
}

/* ---------- Cartes des saisons et des scans ---------- */
/* Le conteneur vient de l'index.php de chaque œuvre : on retire son fond */
.oe-principal > div:has(> .oe-panneau) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
    background: none !important;
    overflow: visible;
}

.oe-principal > div:has(> .oe-panneau) > .oe-panneau {
    width: auto;
    margin: 0;
}

.oe-panneau {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 12.75rem;
    aspect-ratio: 16 / 9;
    margin: 0 0.75rem 0.75rem 0;
    border: 2px solid rgba(59, 130, 246, 0.8);
    border-radius: 10px;
    overflow: hidden;
    background: #0b1220;
    transition: border-color 0.2s, transform 0.2s;
}

.oe-panneau img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    transition: opacity 0.2s;
}

.oe-panneau-nom {
    position: relative;
    padding: 0.5rem 0.7rem;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.oe-panneau-nom.oe-long {
    font-size: 0.8rem;
}

.oe-panneau:hover {
    border-color: #93c5fd;
    transform: translateY(-2px);
}

.oe-panneau:hover img {
    opacity: 0.5;
}

.oe-panneau-scan {
    border-color: rgba(156, 163, 175, 0.75);
}

.oe-panneau-scan img {
    filter: grayscale(1);
}

.oe-panneau-scan:hover {
    border-color: #e5e7eb;
}

@media (max-width: 640px) {
    .oe-principal > div:has(> .oe-panneau) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .oe-panneau {
        width: calc(50% - 0.75rem);
    }

    .oe-panneau-nom {
        font-size: 0.85rem;
    }

    .oe-panneau-nom.oe-long {
        font-size: 0.72rem;
    }
}

/* ---------- Personnages, équipe, images ---------- */
.oe-rangee {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.oe-perso {
    flex: 0 0 8.5rem;
    min-width: 0;
}

.oe-perso-img {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.25);
}

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

.oe-perso-img .oe-perso-voix {
    position: absolute;
    right: 0.4rem;
    bottom: 0.4rem;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 2px solid #0b1220;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.oe-initiale {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #475569;
    font-size: 2.5rem;
    font-weight: 800;
}

.oe-perso-nom {
    margin-top: 0.5rem;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.oe-perso-detail {
    margin-top: 0.15rem;
    color: #94a3b8;
    font-size: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.oe-staff {
    flex-basis: 7.5rem;
}

@media (max-width: 640px) {
    .oe-perso { flex-basis: 7rem; }
    .oe-staff { flex-basis: 6.5rem; }
}

/* ---------- Colonne d'infos ---------- */
.oe-bloc {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.oe-bloc-titre {
    margin: 0 0 0.75rem;
    padding-bottom: 0.4rem;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 2px solid #3b82f6;
}

.oe-sous-titre {
    margin: 0.9rem 0 0.4rem;
    color: #93c5fd;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.oe-bloc-titre + .oe-sous-titre {
    margin-top: 0;
}

.oe-infos {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.45rem 1rem;
    margin: 0;
    font-size: 0.85rem;
}

.oe-infos dt {
    color: #8994a5;
}

.oe-infos dd {
    margin: 0;
    color: #e2e8f0;
    text-align: right;
    overflow-wrap: anywhere;
}

/* Prochain épisode */
.oe-prochain {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-color: rgba(59, 130, 246, 0.45);
}

.oe-prochain-icone svg {
    width: 26px;
    height: 26px;
    color: #60a5fa;
    display: block;
}

.oe-prochain-titre {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
}

.oe-prochain-dans {
    color: #93c5fd;
    font-weight: 600;
}

.oe-prochain-date {
    color: #94a3b8;
    font-size: 0.78rem;
}

/* Liens externes */
.oe-liens {
    margin: 0;
    padding: 0;
    list-style: none;
}

.oe-liens a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.oe-liens a:hover {
    background: rgba(255, 255, 255, 0.05);
}

.oe-liens svg {
    width: 14px;
    height: 14px;
    opacity: 0.45;
    flex-shrink: 0;
}

.oe-lien-nom {
    font-weight: 600;
}

.oe-lien-quoi {
    margin-left: auto;
    color: #64748b;
    font-size: 0.75rem;
}

.oe-lien-logo {
    flex: 0 0 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.04);
}

/* ---------- Planning ---------- */
.oe-planning {
    margin-top: 1.25rem;
    padding: 0.75rem 0.95rem;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.oe-planning-titre {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.oe-planning-titre svg {
    width: 18px;
    height: 18px;
    color: #60a5fa;
}

.oe-planning ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.oe-planning a {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding: 0.45rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.oe-planning a:hover {
    background: rgba(255, 255, 255, 0.04);
}

.oe-planning-jour {
    flex: 0 0 auto;
    min-width: 5.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(51, 65, 85, 0.6);
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.oe-planning-jour.oe-auj {
    background: rgba(59, 130, 246, 0.35);
    color: #fff;
}

.oe-planning-quoi {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.oe-planning-quoi b {
    color: #fff;
    font-weight: 600;
}

.oe-planning-langue {
    color: #93c5fd;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.oe-planning-pb {
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 0.7rem;
    font-weight: 700;
}

.oe-planning-quand {
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* ---------- Œuvres similaires ---------- */
.oe-h2-similaires {
    margin-top: 2.25rem;
}

/* ---------- Bande-annonce ---------- */
.oe-modale {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.oe-modale[hidden] {
    display: none;
}

.oe-modale-fond {
    position: absolute;
    inset: 0;
    background: rgba(2, 4, 10, 0.85);
}

.oe-modale-boite {
    position: relative;
    width: min(960px, 100%);
}

.oe-modale-video {
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.oe-modale-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.oe-modale-fermer {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: none;
    border: 0;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}

.oe-modale-fermer:hover {
    opacity: 1;
}

/* ---------- Téléphone ---------- */
@media (max-width: 767px) {
    /* L'image de fond devient un bandeau en haut */
    .oe-hero {
        display: block;
        min-height: 0;
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-top: -0.5rem;
        border-radius: 0;
    }

    .oe-fond {
        bottom: auto;
        height: 13rem;
    }

    .oe-fond img {
        opacity: 0.75;
    }

    .oe-fond::after {
        background: linear-gradient(to top, #070b16 0%, rgba(7, 11, 22, 0.6) 45%, rgba(7, 11, 22, 0.1) 100%);
    }

    /* Affiche + titre côte à côte, puis notes et boutons sur toute la largeur */
    .oe-hero-contenu {
        display: grid;
        grid-template-columns: 6.5rem minmax(0, 1fr);
        align-items: end;
        gap: 0 1rem;
        padding: 7rem 1rem 1.1rem;
    }

    .oe-tete {
        display: contents;
    }

    .oe-affiche {
        grid-column: 1;
        grid-row: 1 / span 4;
        align-self: end;
        border-radius: 8px;
    }

    .oe-badges,
    .oe-titre,
    .oe-alters,
    .oe-meta {
        grid-column: 2;
    }


    .oe-badges {
        margin-bottom: 0.4rem;
    }

    .oe-titre {
        font-size: 1.45rem;
    }

    .oe-alters {
        font-size: 0.72rem;
        -webkit-line-clamp: 1;
    }

    .oe-meta {
        margin-top: 0.45rem;
        font-size: 0.78rem;
    }

    .oe-point {
        margin: 0 0.3rem;
    }

    .oe-notes,
    .oe-actions {
        grid-column: 1 / -1;
    }

    .oe-notes {
        margin-top: 1rem;
    }

    .oe-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        margin-top: 0.75rem;
    }

    .oe-actions .action-btn {
        justify-content: center;
        gap: 0.3rem;
        min-width: 0;
        padding: 0.45rem 0.3rem;
        font-size: 0.75rem;
        border-radius: 7px;
    }

    .oe-actions .action-btn svg {
        width: 15px;
        height: 15px;
    }

    .oe-note {
        padding: 0.25rem 0.55rem;
        font-size: 0.8rem;
    }

    .oe-planning-quand {
        margin-left: 0;
        flex-basis: 100%;
        padding-left: 6.25rem;
    }

    .oe-actions .btn-ba {
        grid-column: 1 / -1;
    }
}
