/* ==========================================================================
   MUSICLOGS — STYLE.CSS (Clean & Optimisé)
   ========================================================================== */

/* ─── 1. VARIABLES & BASE ──────────────────────────────────────────────── */
:root {
    --sys: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --bg-site: #F4F6FC;
    --bg-card: #FFFFFF;
    --bg-search: #EEF3FA;
    --navy: #1C3041;
    --text-main: #1C3041;
    --text-muted: #6B7A8A;
    --border-color: #D4DBE3;
    --teal: #2A7F7F;
    --sand: #C8954A;
    --player-bg-idle: rgba(244, 246, 252, 0.65);
    --player-bg: rgba(255, 255, 255, 0.85);
    --player-text: #1C3041;
}

/* ─── MODE SOMBRE (DARK THEME) ─── */
[data-theme="dark"] {
    --bg-site: #0F172A;
    /* Bleu nuit très profond */
    --bg-card: #1E293B;
    /* Bleu ardoise pour les cartes */
    --bg-search: #334155;
    --navy: #F8FAFC;
    /* Le texte principal devient presque blanc */
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    --border-color: #334155;
    --teal: #38B2AC;
    /* Un teal un peu plus lumineux pour contraster */
    --player-bg-idle: rgba(15, 23, 42, 0.85);
    --player-bg: rgba(30, 41, 59, 0.95);
    --player-text: #F8FAFC;
}

/* Ajustements esthétiques pour le mode sombre */
[data-theme="dark"] .thumbnail-container img {
    filter: brightness(0.85) grayscale(10%);
}

[data-theme="dark"] .thumbnail-container:hover img {
    filter: brightness(1.1) grayscale(0%);
}

[data-theme="dark"] .filter-popin-overlay {
    background: rgba(0, 0, 0, 0.7);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--sys);
    background-color: var(--bg-site);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-weight: 400;
}

/* ─── 2. STRUCTURE & LAYOUT ────────────────────────────────────────────── */
.site-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 105px 40px 60px 40px;
    min-height: 100vh;
}

/* Sécurité : on s'assure que l'ancien header ne s'affiche plus jamais */
.site-header {
    display: none !important;
}

/* Header spécifique au mobile (caché sur grand écran) */
.mobile-header {
    display: none;
}

/* Barre de contrôles (Recherche, Filtres) */
#homeControls {
    background-color: var(--bg-card);
    padding: 16px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(28, 48, 65, 0.04);
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

/* ─── 3. RECHERCHE & FILTRES ───────────────────────────────────────────── */
.search-container {
    position: relative;
    flex-grow: 1;
    margin-bottom: 0;
}

.search-input {
    width: 100%;
    padding: 12px 18px;
    border: 1.5px solid transparent;
    border-radius: 8px;
    outline: none;
    font-size: 0.95rem;
    font-family: var(--sys);
    font-weight: 500;
    color: var(--text-main);
    background: var(--bg-search);
    transition: all 0.2s;
}

.search-input::placeholder {
    color: #8C9CAB;
    font-weight: 400;
}

.search-input:focus {
    background: #fff;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(42, 127, 127, 0.1);
}

.suggestions-box {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    z-index: 1000;
    display: none;
    box-shadow: 0 12px 28px rgba(28, 48, 65, 0.15);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--bg-site);
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--bg-search);
    color: var(--teal);
}

.filter-bar {
    display: flex;
    gap: 12px;
}

.filter-dropdown-btn {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    padding: 12px 18px;
    border-radius: 8px;
    font-family: var(--sys);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    height: 100%;
}

.filter-dropdown-btn:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.filter-dropdown-btn.active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
    min-height: 20px;
}

.active-filters-label {
    font-family: var(--sys);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-right: 8px;
}

.filter-pill {
    background: var(--bg-card);
    color: var(--navy);
    border: 1.5px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-weight: 600;
    font-family: var(--sys);
}

.filter-pill:hover {
    background: var(--navy);
    border: 1.5px solid var(--navy);
    color: #fff;
}

.reset-filters-btn {
    margin-left: auto;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--sys);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

.reset-filters-btn:hover {
    color: #E62117;
    border-color: #E62117;
    background: rgba(230, 33, 23, 0.05);
}

/* ─── 4. CARTES & GRILLE ───────────────────────────────────────────────── */
.music-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

#noResults {
    text-align: center;
    padding: 64px 40px;
    color: var(--text-muted);
    grid-column: 1 / -1;
    font-size: 0.95rem;
    display: none;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(28, 48, 65, 0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(28, 48, 65, 0.08);
}

.card.hidden {
    display: none !important;
}

.thumbnail-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    background-color: #D8E0E8;
    display: block;
    cursor: pointer;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.4s ease;
    filter: grayscale(15%) brightness(0.97);
}

.thumbnail-container:hover img {
    transform: scale(1.04);
    filter: grayscale(0%) brightness(1);
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 48, 65, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.thumbnail-container:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    width: 54px;
    height: 54px;
    background-color: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal);
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.play-icon i {
    padding-left: 3px;
}

.equalizer {
    display: none;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 18px;
    width: 22px;
}

.eq-bar {
    width: 3px;
    background-color: var(--teal);
    border-radius: 1px;
    animation: eq-bounce 0.5s infinite alternate ease-in-out;
}

.eq-bar:nth-child(1) {
    height: 40%;
    animation-delay: 0s;
}

.eq-bar:nth-child(2) {
    height: 100%;
    animation-delay: 0.2s;
}

.eq-bar:nth-child(3) {
    height: 60%;
    animation-delay: 0.4s;
}

@keyframes eq-bounce {
    0% {
        height: 20%;
    }

    100% {
        height: 100%;
    }
}

.card.playing .play-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.32);
}

.card.playing .play-icon i {
    display: none;
}

.card.playing .equalizer {
    display: flex;
}

.card.playing .thumbnail-container img {
    filter: grayscale(0%);
}

.card-content {
    padding: 20px 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.card-date {
    font-family: var(--sys);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    font-weight: 500;
}

.card-title {
    font-family: var(--sys);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
    color: var(--text-main);
    display: inline-block;
    transition: opacity 0.2s;
}

.card-artists {
    margin-bottom: 14px;
    font-family: var(--sys);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sand);
    letter-spacing: 0.02em;
}

.card-artist {
    display: inline-block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.card-artist:hover,
.card-title:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.card-meta {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-tag {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-muted);
    background-color: var(--bg-site);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--sys);
}

.meta-tag:hover {
    background-color: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

.card-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 16px 0;
    font-weight: 400;
    flex-grow: 1;
}

.btn-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: auto;
    align-items: center;
    width: 100%;
    /* S'assure de prendre toute la largeur de la carte */
}

.add-playlist-btn,
.yt-btn {
    flex: 1;
    /* Les boutons se partagent l'espace à 50/50 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-family: var(--sys);
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    /* Arrondis cohérents avec les tags */
    background: var(--bg-site);
    /* Légèrement grisé pour se détacher du fond de la carte */
    transition: all 0.2s ease;
    cursor: pointer;
}

.add-playlist-btn:hover,
.yt-btn:hover {
    color: var(--teal);
    border-color: var(--teal);
    background: var(--bg-card);
    transform: translateY(-2px);
    /* Petit effet de soulèvement */
    box-shadow: 0 4px 12px rgba(42, 127, 127, 0.08);
    /* Halo discret aux couleurs de ton thème */
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 64px;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    background: var(--bg-card);
    font-size: 0.9rem;
    font-family: var(--sys);
    font-weight: 500;
    transition: all 0.2s;
}

.page-link:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.page-link.active {
    background-color: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

/* ─── 5. VUE ARTICLE ───────────────────────────────────────────────────── */
.single-article {
    width: 100%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-wrapper {
    background: var(--bg-card);
    padding: 35px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(28, 48, 65, 0.05);
}

.article-header {
    display: flex;
    gap: 48px;
    align-items: center;
}

.article-thumb-container {
    width: 400px;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(28, 48, 65, 0.08);
    border: 1px solid var(--border-color);
}

.article-thumb-container .article-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    filter: grayscale(10%);
    transition: filter 0.4s;
}

.article-thumb-container .play-overlay {
    opacity: 1;
    background: rgba(28, 48, 65, 0.25);
}

.article-thumb-container:hover .article-thumb {
    filter: grayscale(0%);
}

.article-thumb-container:hover .play-overlay {
    background: rgba(28, 48, 65, 0.35);
}

.article-thumb-container.playing .play-overlay {
    background: rgba(0, 0, 0, 0.32);
}

.article-thumb-container.playing .play-icon i {
    display: none;
}

.article-thumb-container.playing .equalizer {
    display: flex;
}

.article-thumb-container.playing .article-thumb {
    filter: grayscale(0%);
}

.article-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.article-meta-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--sys);
}

.article-meta-table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

.article-meta-table tr:last-child td {
    border-bottom: none;
}

.article-meta-table .meta-label {
    font-weight: 500;
    color: var(--text-muted);
    width: 120px;
    vertical-align: top;
}

.article-meta-table .meta-value {
    font-weight: 600;
    color: var(--navy);
}

.article-meta-table .meta-value span {
    cursor: pointer;
    transition: color 0.2s;
    display: inline-block;
}

.article-meta-table .meta-value span:hover {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-buttons-row {
    display: flex;
    width: 100%;
    gap: 16px;
    margin: 36px 0;
}

.article-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--sys);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background-color: var(--bg-search);
    color: var(--teal);
    border: none;
    padding: 16px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.article-action-btn:hover {
    background-color: #DCE5F2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 127, 127, 0.1);
}

.article-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--navy);
    white-space: pre-wrap;
    font-weight: 400;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.article-body a {
    color: var(--teal);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.article-body a:hover {
    color: var(--navy);
}

/* Blockquote dans l'article */
.article-body blockquote {
    position: relative;
    margin: 36px 0;
    padding: 24px 32px 24px 56px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--teal);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--navy);
    box-shadow: 0 4px 12px rgba(28, 48, 65, 0.03);
}

.article-body blockquote::before {
    content: '\f10d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 20px;
    top: 24px;
    color: var(--teal);
    opacity: 0.25;
    font-size: 1.4rem;
}

.article-body blockquote p {
    margin: 0;
}

.related-articles {
    margin-top: 60px;
}

.related-title {
    font-family: var(--sys);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

/* Navigation inter-articles */
.article-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 0px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.nav-article-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--navy);
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-site);
    transition: all 0.2s;
    max-width: 48%;
}

.nav-article-btn:hover {
    border-color: var(--teal);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 127, 127, 0.08);
}

.nav-article-btn.prev-btn {
    align-items: flex-start;
    text-align: left;
}

.nav-article-btn.next-btn {
    align-items: flex-end;
    text-align: right;
}

.nav-label {
    font-family: var(--sys);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.nav-title {
    font-family: var(--sys);
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* ─── 6. LECTEUR AUDIO GLOBAL ──────────────────────────────────────────── */
.bottom-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    transform: none;
    background-color: var(--bg-card);
    color: var(--player-text);
    display: flex;
    flex-direction: column-reverse;
    z-index: 1010;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 60px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Les 3 Zones du Lecteur */
.left-zone {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 24px;
}

.left-zone a {
    font-size: 1.15rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.left-zone a:hover {
    color: var(--navy);
}

.center-zone {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.right-zone {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-grow: 1;
    width: auto;
}

.control-btn {
    background: none;
    border: none;
    color: var(--navy);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 6px;
}

.control-btn:hover {
    color: var(--navy);
}

.play-pause-btn {
    font-size: 1.5rem;
    color: var(--navy);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-pause-btn:hover {
    color: var(--teal);
    transform: scale(1.15);
}

.shuffle-active {
    color: var(--teal) !important;
}

.player-actions {
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    position: relative;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 30%;
    min-width: 160px;
}

.right-zone .player-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-align: right;
}

.player-title {
    font-family: var(--sys);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.1;
    text-overflow: ellipsis;
    overflow: hidden;
    cursor: pointer;
    transition: color 0.2s;
}

.player-title:hover {
    color: var(--teal);
    text-decoration: underline;
}

.player-artist {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    line-height: 1.1;
    color: var(--navy)
}

.player-artist::before {
    display: none;
}

.player-artist span {
    cursor: pointer;
    transition: color 0.2s;
}

.player-artist span:hover {
    color: var(--teal);
    text-decoration: underline;
}

.player-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
}

/* Barre de progression avec Chrono intégré */
.progress-container {
    width: 100%;
    height: 0;
    opacity: 0;
    background-color: var(--border-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
}

.progress-container:hover {
    height: 15px;
}

.progress-bar {
    height: 100%;
    background-color: var(--teal);
    width: 0%;
    pointer-events: none;
    transition: width 0.1s linear;
}

.bottom-player.playing .progress-container {
    height: 20px;
    opacity: 1;
}

.bottom-player.playing .progress-container:hover {
    height: 25px;
}

.player-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    color: #ffffff;
    z-index: 2;
    pointer-events: none;
}

/* Playlist Popup */
.playlist-popup {
    position: absolute;
    top: calc(100% + 15px);
    bottom: auto;
    right: 0;
    width: 300px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
}

.playlist-popup.active {
    display: flex;
}

.playlist-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-site);
}

.clear-playlist-btn {
    background: none;
    border: none;
    font-family: var(--sys);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    text-transform: uppercase;
    transition: color 0.2s;
    padding: 0;
    letter-spacing: 0.02em;
}

.clear-playlist-btn:hover {
    color: #E62117;
}

.playlist-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.playlist-popup-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--bg-site);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playlist-popup-item:last-child {
    border-bottom: none;
}

.playlist-item-title {
    font-family: var(--sys);
    font-weight: 600;
    color: var(--navy);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-artist {
    font-family: var(--sys);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* L'iframe YT cachée */
#yt-player {
    position: absolute;
    width: 0;
    height: 0;
    top: -9999px;
    left: -9999px;
    visibility: hidden;
}

/* ─── 7. POP-INS & AUTRES ELEMENTS ─────────────────────────────────────── */
.filter-popin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 48, 65, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.filter-popin-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.filter-popin {
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(28, 48, 65, 0.25);
    width: 600px;
    max-width: 90vw;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    transform: translateY(10px) scale(0.97);
    transition: transform 0.2s ease;
}

.filter-popin-overlay.active .filter-popin {
    transform: translateY(0) scale(1);
}

.filter-popin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-color);
}

.filter-popin-title {
    font-family: var(--sys);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--navy);
}

.filter-popin-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    transition: color 0.2s;
    line-height: 1;
}

.filter-popin-close:hover {
    color: var(--navy);
}

.filter-popin-body,
.blogroll-list,
.archives-grid {
    padding: 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.filter-popin-body .filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    margin-bottom: 0;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--sys);
    color: var(--text-main);
    background: var(--bg-site);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.filter-popin-body .filter-option:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: #fff;
}

.filter-popin-body .filter-option:has(input:checked) {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.filter-popin-body .filter-option input {
    display: none;
}

.blogroll-list a,
.archives-grid .archive-btn {
    padding: 10px 14px;
    line-height: 1.4;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--sys);
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    background: var(--bg-site);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    text-align: left;
}

.blogroll-list a:hover,
.archives-grid .archive-btn:hover {
    background: #fff;
    border-color: var(--teal);
    color: var(--teal);
}

.filter-popin-overlay#overlay-archives .filter-popin {
    width: 600px;
}

/* Bannière Sync */
.sync-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-family: var(--sys);
    font-size: 0.875rem;
    color: var(--navy);
}

.sync-banner i.fa-circle-check {
    color: var(--teal);
    flex-shrink: 0;
}

.sync-banner-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.sync-banner-close:hover {
    color: var(--navy);
}

/* ─── 8. RESPONSIVE (MEDIA QUERIES) ────────────────────────────────────── */

@keyframes slideUpMobile {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .music-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 850px) {
    .article-header {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    .article-thumb-container {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {

    /* Header Mobile Spécifique */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
        padding: 0 4px;
    }

    .mobile-home-link {
        display: flex;
        align-items: center;
        gap: 8px;
        font-family: var(--sys);
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--navy);
        text-decoration: none;
        letter-spacing: -0.01em;
    }

    .mobile-home-link i {
        color: var(--teal);
        font-size: 1.1rem;
    }

    .mobile-header-links {
        display: flex;
        gap: 20px;
        align-items: center;
    }

    .mobile-header-links a {
        font-size: 1.15rem;
        color: var(--text-muted);
        transition: color 0.2s;
    }

    .mobile-header-links a:hover {
        color: var(--navy);
    }

    /* Ajustement de la page globale pour le lecteur en bas */
    .site-wrapper {
        padding: 20px 20px 90px 20px;
    }

    .article-wrapper {
        padding: 24px 20px;
    }

    /* LECTEUR MOBILE : Passe en bas */
    .bottom-player {
        top: auto;
        bottom: 0;
        border-radius: 0;
        flex-direction: column;
        /* La barre passe au-dessus */
        animation: slideUpMobile 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }

    .player-content {
        padding: 0 16px;
        gap: 8px;
        border-top: 1px solid var(--border-color);
    }

    /* On masque ce qui n'est plus utile sur mobile */
    .left-zone {
        display: none !important;
    }

    /* Icônes passées en haut */
    .player-thumb {
        display: none;
    }

    /* Image masquée */
    .player-artist::before {
        display: none;
    }

    /* Point séparateur */

    /* Réorganisation de l'espace */
    .center-zone {
        flex: 1;
        justify-content: flex-start;
        gap: 4px;
    }

    .right-zone {
        flex: 1.2;
        gap: 8px;
    }

    .player-controls {
        gap: 8px;
    }

    .player-actions {
        position: static;
    }

    .player-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    /* Playlist s'ouvre vers le HAUT */
    .playlist-popup {
        top: auto;
        bottom: calc(100% + 15px);
        right: 0;
    }
}

@media (max-width: 650px) {
    #homeControls {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }

    .filter-bar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .filter-dropdown-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .article-buttons-row {
        flex-direction: column;
    }

    .article-navigation {
        flex-direction: column;
        gap: 12px;
    }

    .nav-article-btn {
        max-width: 100%;
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }

    .nav-article-btn.next-btn {
        align-items: flex-start;
        text-align: left;
    }

    .nav-article-btn.next-btn .nav-label {
        flex-direction: row-reverse;
        justify-content: flex-end;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .music-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

.admin-card-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.card:hover .admin-card-controls {
    opacity: 1;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--navy);
}

.admin-btn.delete:hover {
    color: #E62117;
}

.admin-btn.edit:hover {
    color: var(--teal);
}

/* Conteneur des pillules dans le formulaire Admin */
.form-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.form-pills-container:not(:empty) {
    margin-bottom: 4px;
}

.form-pills-container .filter-pill {
    padding: 4px 10px;
    font-size: 0.85rem;
    background: var(--bg-site);
    border: 1px solid var(--border-color);
}

/* ─── MODALE ADMIN (Grid, Scroll & Pillules) ─── */
.admin-popin {
    width: 800px !important;
    max-width: 95vw;
}

.admin-popin-body {
    max-height: 75vh;
    overflow-y: auto;
    /* Rend la pop-in scrollable */
    padding: 24px;
    display: block !important;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Passage sur 2 colonnes sur grand écran */
@media (min-width: 768px) {
    .admin-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.admin-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    /* Important pour l'autocomplétion */
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
}

.admin-submit-btn {
    grid-column: 1 / -1;
    /* Prend toute la largeur en bas */
    padding: 14px;
    background: var(--teal);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    font-size: 1rem;
    transition: background 0.2s;
}

.admin-submit-btn:hover {
    background: #236b6b;
}

/* Conteneur des pillules dans le formulaire Admin */
.form-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.form-pills-container:not(:empty) {
    margin-bottom: 4px;
}

.form-pills-container .filter-pill {
    padding: 4px 10px;
    font-size: 0.85rem;
    background: var(--bg-site);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

/* Au survol d'une pillule du formulaire : ROUGE (Action de suppression) */
.form-pills-container .filter-pill:hover {
    background: #E62117 !important;
    border-color: #E62117 !important;
    color: #fff !important;
}

/* Correction du bug global des pillules classiques en mode sombre */
[data-theme="dark"] .filter-pill:hover {
    color: #0F172A;
    /* Texte bleu très foncé pour contraster avec le fond clair */
}