/* ═══════════════════════════════════════════════════════════════
   MÉDIATHÈQUE PUMA — Galerie Photos + Docuthèque
   Charte : #07853F vert | #FAEB49 jaune | #E31B23 rouge
   ═══════════════════════════════════════════════════════════════ */

/* ── Fix alignement hero — identique navbar (max-width 1280px, margin auto, padding 32px) ── */
.puma-mediatheque-hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.puma-mediatheque-hero .puma-container,
.puma-mediatheque-hero .puma-page-hero-content,
.puma-mediatheque-hero .puma-container.puma-page-hero-content {
    position: relative;
    z-index: 2;
    width: 100% !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 40px 32px 44px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    box-sizing: border-box;
}


/* ── Barre d'onglets ──────────────────────────────────────────── */
.puma-media-tabs-bar {
    background: #fff;
    border-bottom: 2px solid #e8f5ee;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(7,133,63,.06);
}
.puma-media-tabs-nav {
    display: flex;
    gap: 0;
}
.puma-media-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color .2s, border-color .2s;
    position: relative;
    bottom: -2px;
    white-space: nowrap;
}
.puma-media-tab:hover { color: #07853F; }
.puma-media-tab.is-active {
    color: #07853F;
    border-bottom-color: #07853F;
}
.puma-media-tab svg { flex-shrink: 0; }
.puma-media-tab-count {
    background: #07853F;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}
.puma-media-tab:not(.is-active) .puma-media-tab-count {
    background: #e5e7eb;
    color: #6b7280;
}

/* ── Contenu panels ───────────────────────────────────────────── */
.puma-media-content {
    padding-top: 48px;
    padding-bottom: 80px;
}
.puma-media-panel { display: none; }
.puma-media-panel.is-active { display: block; }

/* État vide */
.puma-media-empty {
    text-align: center;
    padding: 80px 20px;
    color: #9ca3af;
}
.puma-media-empty svg { margin-bottom: 16px; opacity: .5; }
.puma-media-empty p { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.puma-media-empty small { font-size: 14px; }

/* ════════════════════════════════════════════════════════════════
   GALERIE ALBUMS
   ════════════════════════════════════════════════════════════════ */
.puma-albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.puma-album-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: transform .25s, box-shadow .25s;
    cursor: pointer;
}
.puma-album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(7,133,63,.15);
}

.puma-album-cover {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(135deg, #07853F, #045c2b);
}
.puma-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .4s;
}
.puma-album-card:hover .puma-album-cover img { transform: scale(1.06); }

.puma-album-no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.puma-album-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7,133,63,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s;
}
.puma-album-card:hover .puma-album-overlay { opacity: 1; }

.puma-album-open-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #07853F;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.puma-album-open-btn:hover { background: #FAEB49; color: #07853F; }

.puma-album-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.puma-album-info { padding: 16px 18px 20px; }
.puma-album-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a2e1f;
    margin: 0 0 6px;
    line-height: 1.3;
}
.puma-album-desc {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 10px;
    line-height: 1.5;
}
.puma-album-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.puma-album-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #07853F;
    font-weight: 500;
}

/* ════════════════════════════════════════════════════════════════
   LIGHTBOX GALERIE
   ════════════════════════════════════════════════════════════════ */
.puma-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.puma-lightbox[hidden] { display: none; }

.puma-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.92);
    cursor: pointer;
}
.puma-lightbox-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(95vw, 1200px);
    max-height: 95vh;
    background: #111;
    border-radius: 16px;
    overflow: hidden;
}
.puma-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}
.puma-lightbox-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.puma-lightbox-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}
.puma-lightbox-close:hover { color: #fff; background: #333; }

.puma-lightbox-stage {
    display: flex;
    align-items: center;
    flex: 1;
    min-height: 0;
    position: relative;
    background: #000;
}
.puma-lightbox-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    min-height: 300px;
    max-height: 65vh;
}
.puma-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}
.puma-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .15s;
    z-index: 2;
}
.puma-lightbox-nav:hover { background: #07853F; }
.puma-lightbox-prev { left: 12px; }
.puma-lightbox-next { right: 12px; }

.puma-lightbox-thumbs {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    background: #1a1a1a;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #07853F #333;
}
.puma-lightbox-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: .55;
    border: 2px solid transparent;
    transition: opacity .15s, border-color .15s;
}
.puma-lightbox-thumb.is-active { opacity: 1; border-color: #07853F; }
.puma-lightbox-thumb:hover { opacity: .85; }

.puma-lightbox-counter {
    text-align: center;
    padding: 6px;
    font-size: 12px;
    color: #6b7280;
    background: #1a1a1a;
}

/* ════════════════════════════════════════════════════════════════
   DOCUTHÈQUE
   ════════════════════════════════════════════════════════════════ */

/* Filtres */
.puma-docu-filters {
    margin-bottom: 36px;
    background: #f8faf9;
    border: 1px solid #e2eeea;
    border-radius: 12px;
    padding: 20px 24px;
}
.puma-docu-filters-inner { display: flex; flex-wrap: wrap; gap: 24px; }
.puma-docu-filter-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #07853F;
    margin-bottom: 10px;
}
.puma-docu-filter-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.puma-docu-filter-btn {
    padding: 6px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.puma-docu-filter-btn:hover { border-color: #07853F; color: #07853F; }
.puma-docu-filter-btn.is-active {
    background: #07853F;
    border-color: #07853F;
    color: #fff;
}

/* Grille documents */
.puma-docu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}
.puma-doc-card[hidden] { display: none; }

.puma-doc-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.puma-doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(7,133,63,.13);
}

/* Vignette document */
.puma-doc-thumb {
    position: relative;
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f3f4f6;
}
.puma-doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}
.puma-doc-icon-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.puma-doc-icon--pdf  { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #dc2626; }
.puma-doc-icon--word { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; }
.puma-doc-icon--excel{ background: linear-gradient(135deg, #f0fdf4, #dcfce7); color: #16a34a; }
.puma-doc-icon--ppt  { background: linear-gradient(135deg, #fff7ed, #fed7aa); color: #ea580c; }

.puma-doc-ext-badge {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,.08);
}

/* Overlay boutons */
.puma-doc-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7,133,63,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity .25s;
}
.puma-doc-card:hover .puma-doc-thumb-overlay { opacity: 1; }

.puma-doc-preview-btn,
.puma-doc-dl-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-decoration: none;
    white-space: nowrap;
}
.puma-doc-preview-btn {
    background: #fff;
    color: #07853F;
    border: none;
}
.puma-doc-preview-btn:hover { background: #FAEB49; }
.puma-doc-dl-btn {
    background: #07853F;
    color: #fff;
    border: 2px solid rgba(255,255,255,.4);
}
.puma-doc-dl-btn:hover { background: #045c2b; }

/* Infos document */
.puma-doc-info { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.puma-doc-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a2e1f;
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.puma-doc-desc {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.puma-doc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}
.puma-doc-cat-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(7,133,63,.1);
    color: #07853F;
}
.puma-doc-annee {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    padding: 3px 8px;
    background: #f3f4f6;
    border-radius: 20px;
}
.puma-doc-size {
    font-size: 11px;
    color: #9ca3af;
    margin-left: auto;
}

/* ════════════════════════════════════════════════════════════════
   MODALE APERÇU PDF
   ════════════════════════════════════════════════════════════════ */
.puma-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.puma-pdf-modal[hidden] { display: none; }
.puma-pdf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.8);
    cursor: pointer;
}
.puma-pdf-modal-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(96vw, 1000px);
    height: min(92vh, 820px);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.4);
}
.puma-pdf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #07853F;
    color: #fff;
    flex-shrink: 0;
}
.puma-pdf-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}
.puma-pdf-modal-actions { display: flex; align-items: center; gap: 10px; }
.puma-pdf-dl-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: #FAEB49;
    color: #07853F;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}
.puma-pdf-dl-btn:hover { background: #fff; }
.puma-pdf-modal-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background .15s;
}
.puma-pdf-modal-close:hover { background: rgba(255,255,255,.3); }
.puma-pdf-modal-body { flex: 1; min-height: 0; }
.puma-pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .puma-media-tab { padding: 14px 16px; font-size: 14px; }
    .puma-albums-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .puma-docu-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .puma-lightbox-nav { width: 36px; height: 36px; }
}
@media (max-width: 480px) {
    .puma-media-tab span:not(.puma-media-tab-count) { display: none; }
    .puma-albums-grid { grid-template-columns: 1fr; }
    .puma-docu-grid { grid-template-columns: 1fr; }
}
