/* Style CSS V10 pour poemetri.php - Charte Ivoire et Bordeaux */

.breadcrumb-poem {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans) !important;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.breadcrumb-poem a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}
.breadcrumb-poem a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}
.breadcrumb-poem span {
    font-weight: normal;
    color: var(--text-main);
}
.breadcrumb-poem span.separator {
    color: var(--text-muted);
    opacity: 0.7;
    margin: 0 2px;
}

.poemetri-container {
    max-width: 1400px;
    margin: 0 auto;
    font-family: var(--font-sans), sans-serif;
}

.description-encadre {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.description-encadre p {
    margin: 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.description-encadre a.dashboard-button {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 6px;
    transition: background-color 0.2s;
}

.description-encadre a.dashboard-button:hover {
    background-color: var(--accent-hover);
}

/* Zone Filtres & Recherche */
.filtres-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filtre-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.filtre-form label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
}

.filtre-form select,
.search-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-page);
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    font-family: var(--font-sans) !important;
}

.filtre-form select:focus,
.search-input:focus {
    border-color: var(--accent);
}

.search-forum-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

@media (max-width: 1024px) {
    .search-forum-container {
        margin-left: 0;
        width: 100%;
    }
    .search-forum-container form {
        width: 100%;
        display: flex;
    }
    .search-input {
        flex-grow: 1;
    }
}

.search-forum-container form {
    display: flex;
    gap: 6px;
}

.search-button {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.search-button:hover {
    background-color: var(--accent-hover);
}

/* Filtres Actifs */
.active-filters {
    padding: 10px 12px;
    margin-top: 12px;
    background-color: var(--bg-page);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
}

.active-filters span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-pill {
    background-color: #fff;
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.filter-pill.default {
    background-color: #eee;
    color: var(--text-muted);
    border-color: #e0e0e0;
    cursor: default;
}

.filter-pill i {
    font-size: 0.85em;
    color: var(--text-muted);
}

.filter-pill:not(.default):hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-pill:not(.default):hover i {
    color: var(--accent);
}

.clear-all-filters {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    margin-left: auto;
    padding: 4px 10px;
}

.clear-all-filters:hover {
    text-decoration: underline;
}

/* Contrôles de vue */
.view-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.view-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover,
.view-toggle-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Grille de Cartes de Poèmes */
.conteneur-cartes-poeme {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 10px 0 20px 0;
}

.carte-poeme {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    position: relative;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.carte-poeme:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(41, 18, 24, 0.08);
}

.poem-source-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--bg-page);
    color: var(--accent);
    border: 1px solid var(--border-color);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 20px;
    z-index: 2;
    max-width: calc(100% - 82px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Spans internes du tag source */
.tag-theme {
    font-weight: 700;
}

.poem-media-icons {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.poem-media-icons i {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.poem-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.carte-poeme-content-wrapper {
    padding: 40px 12px 12px 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.carte-poeme h3.titre-poeme {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.carte-poeme:hover h3.titre-poeme {
    color: var(--accent);
}

.auteur-poeme {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 8px 0;
}

.author-photo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.extrait-poeme {
    font-family: var(--font-serif);
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0 0 8px 0;
    flex-grow: 1;
    font-style: italic;
}

.infos-poeme {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.70rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
    padding-top: 7px;
    margin-top: auto;
}

.stats-poeme {
    display: flex;
    gap: 8px;
}

.stats-poeme span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =============================================
   VUE LISTE (mode alternatif au toggle)
   ============================================= */
.conteneur-cartes-poeme.vue-liste {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.conteneur-cartes-poeme.vue-liste .carte-poeme {
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease, border-color 0.15s ease;
    flex-direction: row;
    align-items: stretch;
    min-height: 48px;
}

.conteneur-cartes-poeme.vue-liste .carte-poeme:hover {
    transform: none;
    background-color: var(--bg-page);
}

/* Tag source : sort du flux absolu, devient flex-item à gauche */
.conteneur-cartes-poeme.vue-liste .poem-source-tag {
    position: static;
    flex-shrink: 0;
    align-self: center;
    font-size: 0.6rem;
    padding: 4px 8px;
    margin: 0 0 0 10px;
    border-radius: 8px;
    width: 110px;
    text-align: center;
    line-height: 1.4;
    white-space: normal;
}

/* Type sur la 1re ligne : plus petit, atténué */
.conteneur-cartes-poeme.vue-liste .poem-source-tag .tag-type {
    display: block;
    font-size: 0.55rem;
    font-weight: 500;
    opacity: 0.8;
    white-space: normal;
    overflow: visible;
}

/* Thème / catégorie sur la 2e ligne : gras, accent */
.conteneur-cartes-poeme.vue-liste .poem-source-tag.has-theme .tag-theme {
    display: block;
    font-weight: 700;
    font-size: 0.62rem;
    margin-left: 0;
    white-space: normal;
    overflow: visible;
}

/* Icônes média : déplacées en fin de ligne (après le contenu) */
.conteneur-cartes-poeme.vue-liste .poem-media-icons {
    position: static;
    order: 10;
    flex-shrink: 0;
    align-self: center;
    margin: 0 10px 0 4px;
    gap: 4px;
}

/* Le lien prend tout l'espace restant */
.conteneur-cartes-poeme.vue-liste .poem-card-link {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: row;
    align-items: center;
}

.conteneur-cartes-poeme.vue-liste .carte-poeme-content-wrapper {
    padding: 6px 12px 6px 10px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    height: auto;
    width: 100%;
}

.conteneur-cartes-poeme.vue-liste h3.titre-poeme {
    font-size: 0.9rem;
    margin: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.conteneur-cartes-poeme.vue-liste .auteur-poeme {
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.75rem;
    min-width: 90px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conteneur-cartes-poeme.vue-liste .extrait-poeme {
    display: none;
}

.conteneur-cartes-poeme.vue-liste .infos-poeme {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    flex-shrink: 0;
    gap: 8px;
    flex-wrap: nowrap;
}

@media (max-width: 768px) {
    /* Sur petit écran : la ligne passe en 2 blocs empilés */
    .conteneur-cartes-poeme.vue-liste .carte-poeme {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    /* Tag : 1re ligne, prend tout l'espace sauf les icônes */
    .conteneur-cartes-poeme.vue-liste .poem-source-tag {
        order: -1;
        flex: 1 1 auto;
        max-width: none;
        width: auto;
        text-align: left;
        margin: 8px 0 0 10px;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: baseline;
        gap: 4px;
        padding: 3px 8px;
    }

    /* Type et thème sur la même ligne en mobile */
    .conteneur-cartes-poeme.vue-liste .poem-source-tag .tag-type {
        display: inline;
        white-space: nowrap;
    }
    .conteneur-cartes-poeme.vue-liste .poem-source-tag.has-theme .tag-theme {
        display: inline;
        white-space: nowrap;
    }
    /* Séparateur entre type et thème */
    .conteneur-cartes-poeme.vue-liste .poem-source-tag.has-theme .tag-type::after {
        content: " :";
    }

    /* Icônes : sur la MÊME 1re ligne que le tag, à droite */
    .conteneur-cartes-poeme.vue-liste .poem-media-icons {
        order: -1;
        align-self: center;
        margin: 8px 10px 0 4px;
        flex-shrink: 0;
    }

    /* Le lien prend toute la largeur sur la 2e ligne */
    .conteneur-cartes-poeme.vue-liste .poem-card-link {
        flex: 1 0 100%;
    }

    /* Cacher la photo auteur pour gagner de la place */
    .conteneur-cartes-poeme.vue-liste .auteur-poeme .author-photo {
        display: none;
    }
}

/* Floutage pour averti */
.blurred-excerpt {
    filter: blur(4px);
    user-select: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 25px 0;
    font-family: var(--font-sans);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-main);
    text-decoration: none;
    background-color: var(--bg-card);
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination span.current {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: 600;
}
