/* ═══════════════════════════════════════════
   DragonsMag — wiki_serie.css
   Page de présentation d'une série
   Dépend de base.css
═══════════════════════════════════════════ */

/* ════════════════════════════════════════════
   LAYOUT
════════════════════════════════════════════ */
.page-serie {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.serie-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    align-items: start;
}

/* ════════════════════════════════════════════
   EN-TÊTE
════════════════════════════════════════════ */
.wiki-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.serie-title-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Bouton favori */
.serie-fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border2);
    background: var(--bg3);
    cursor: pointer;
    font-size: 16px;
    transition: all .18s;
    text-decoration: none;
    flex-shrink: 0;
}
.serie-fav-btn:hover {
    border-color: var(--accent2);
    background: var(--accent-bg);
    transform: scale(1.1);
}
.serie-fav-btn.active {
    border-color: #f43f5e;
    background: rgba(244,63,94,.1);
}

/* Bouton édition admin */
.serie-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: var(--r);
    border: 1px solid var(--border2);
    background: var(--bg3);
    color: var(--text3);
    font-family: var(--fb);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
    flex-shrink: 0;
}
.serie-edit-btn:hover {
    border-color: var(--accent2);
    color: var(--accent3);
    background: var(--accent-bg);
}
.serie-edit-btn svg { width: 12px; height: 12px; }

/* ════════════════════════════════════════════
   BLOC INFOS DE BASE
════════════════════════════════════════════ */
.serie-infos {
    display: flex;
    gap: 20px;
}

/* Image de couverture */
.serie-cover {
    width: 250px;
    flex-shrink: 0;
    background: var(--bg4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.serie-cover img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
/* Photo en niveaux de gris — profil décédé (DateOut renseigné sur une personne) ou groupe séparé,
   cf. profils/view.tpl */
.serie-cover.photo-gris img {
    filter: grayscale(1);
    opacity: .75;
}
.serie-cover-ph {
    width: 100%;
    height: 100%;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    font-size: 12px;
}

/* Tableau d'infos */
.serie-infos-table {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.serie-info-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.serie-info-row:last-child { border-bottom: none; }

.serie-info-label {
    font-family: var(--fb);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent3);
}

.serie-info-value {
    font-family: var(--fb);
    font-size: 13px;
    color: var(--text2);
    line-height: 1.5;
}

.serie-info-value a {
    color: var(--text2);
    text-decoration: none;
    transition: color .15s;
}
.serie-info-value a:hover { color: var(--accent3); }

/* Badge statut */
.serie-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}
.serie-status.ongoing {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(74,222,128,.3);
}
.serie-status.finished {
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid rgba(96,165,250,.3);
}
.serie-status.paused {
    background: var(--amber-bg);
    color: var(--amber);
    border: 1px solid rgba(251,191,36,.3);
}

/* Drapeau nationalité */
.serie-flag { font-size: 20px; line-height: 1; }

/* ════════════════════════════════════════════
   DESCRIPTION
════════════════════════════════════════════ */
.serie-description {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 18px 20px;
    font-family: var(--fb);
    font-size: 13px;
    color: var(--text2);
    line-height: 1.8;
}
.serie-description p { margin-bottom: 10px; }
.serie-description p:last-child { margin-bottom: 0; }

.profil-description {
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 18px 20px;
    font-family: var(--fb);
    font-size: 13px;
    color: var(--text2);
    line-height: 1.8;
}
.profil-description p { margin-bottom: 10px; }
.profil-description p:last-child { margin-bottom: 0; }

/* ════════════════════════════════════════════
   SECTIONS LIÉES (accordéon)
════════════════════════════════════════════ */
.serie-sections { display: flex; flex-direction: column; gap: 3px; margin-top: 16px; }

/* Onglets de navigation */
.serie-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 3px;
}

.serie-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--r);
    border: 1px solid var(--border2);
    background: var(--bg2);
    color: var(--text2);
    font-family: var(--fb);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    user-select: none;
}
.serie-tab:hover {
    border-color: var(--accent2);
    color: var(--text);
    background: var(--bg3);
}
.serie-tab.active {
    background: var(--accent-bg);
    border-color: var(--accent2);
    color: var(--accent3);
}
.serie-tab-count {
    font-size: 10px;
    background: var(--bg4);
    color: var(--text3);
    padding: 1px 6px;
    border-radius: 99px;
    font-weight: 700;
}
.serie-tab.active .serie-tab-count {
    background: var(--accent-bg);
    color: var(--accent3);
}

/* Panneaux de contenu */
.serie-panel {
    display: none;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    overflow: hidden;
    animation: panelIn .18s ease;
}
.serie-panel.active { display: block; }

@keyframes panelIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.serie-panel-head {
    padding: 10px 16px;
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    font-family: var(--fh);
    font-size: 12px;
    font-weight: 700;
    color: var(--text3);
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* Liste générique dans un panneau */
.serie-panel-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Carte OpenStreetMap embarquée à droite des infos (ex : view_stadium.tpl), 3e colonne de
   .serie-infos (flex) — s'étire à la hauteur du bloc infos grâce au stretch flex par défaut. */
.serie-map-side {
    flex: 1;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px 16px 0;
}
.serie-map-side-title {
    font-family: var(--fh);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--text3);
}
.serie-map-side iframe {
    width: 100%;
    flex: 1;
    min-height: 340px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    display: block;
}
.serie-map-link {
    align-self: flex-start;
    font-family: var(--fb);
    font-size: 12px;
    color: var(--text3);
    text-decoration: none;
}
.serie-map-link:hover { color: var(--accent3); }

@media (max-width: 900px) {
    .serie-map-side { padding: 16px 20px; min-width: 0; }
    .serie-map-side iframe { min-height: 260px; }
}

.serie-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: background .1s;
}
.serie-panel-item:last-child { border-bottom: none; }
.serie-panel-item:hover { background: var(--bg3); }

.serie-panel-item-img {
    width: 36px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg4);
    flex-shrink: 0;
}
.serie-panel-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.serie-panel-item-info { flex: 1; min-width: 0; }
.serie-panel-item-name {
    font-family: var(--fb);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .15s;
}
.serie-panel-item:hover .serie-panel-item-name { color: var(--accent3); }
.serie-panel-item-meta {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
}

.serie-panel-item-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--bg4);
    color: var(--text3);
    border: 1px solid var(--border2);
    flex-shrink: 0;
}

/* Grille produits */
.serie-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 14px;
}

.serie-panel-grid-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
}

.serie-panel-grid-img {
    aspect-ratio: 3/4;
    border-radius: var(--r);
    overflow: hidden;
    background: var(--bg4);
    border: 1px solid var(--border);
    transition: border-color .15s, transform .15s;
}
.serie-panel-grid-item:hover .serie-panel-grid-img {
    border-color: var(--accent2);
    transform: translateY(-2px);
}
.serie-panel-grid-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.serie-panel-grid-name {
    font-family: var(--fb);
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
    text-align: center;
    line-height: 1.3;
    transition: color .15s;
}
.serie-panel-grid-item:hover .serie-panel-grid-name { color: var(--accent3); }


/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .serie-layout { grid-template-columns: 1fr 260px; }
}

@media (max-width: 900px) {
    .serie-layout { grid-template-columns: 1fr; }
    .serie-sidebar { order: -1; }
}

@media (max-width: 640px) {
    .serie-infos { flex-direction: column; }
    .serie-cover { width: 100%; max-height: 260px; }
    .serie-info-row { grid-template-columns: 120px 1fr; }
    .serie-tabs { gap: 5px; }
    .serie-tab { padding: 6px 12px; font-size: 12px; }
    .serie-panel-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}
