/* ============================================================
   components.css - Surfaces, cartes, badges, avatar, profil,
                    HTMX, icônes sociales, définitions
   ============================================================ */

/* ── Surface éditoriale (carte carrée avec ombre décalée) ── */
.surface-editoriale {
    background-color: white;
    border: 2px solid var(--encre-900);
    box-shadow: 4px 4px 0 0 rgba(15, 30, 46, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.surface-editoriale:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 0 0 rgba(15, 30, 46, 0.12);
}

/* ── Section « Temps fort » (fait marquant mis en avant) ── */
.section-temps-fort {
    background-color: var(--encre-900);
    color: var(--papier-100);
}

.kicker-clair {
    color: var(--pourpre-300);
}

.badge-editorial--clair {
    color: var(--pourpre-200);
    border-color: var(--pourpre-200);
}

.highlight-article {
    background-color: rgba(250, 247, 242, 0.04);
    border: 1px solid rgba(250, 247, 242, 0.18);
    overflow: hidden;
}

.highlight-media {
    min-width: 0;
}

.highlight-image {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

@media (min-width: 992px) {
    .highlight-media {
        height: 100%;
    }

    .highlight-image {
        height: 100%;
        aspect-ratio: auto;
        min-height: 320px;
    }
}

.highlight-body {
    padding: clamp(1.5rem, 4vw, 3rem);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.highlight-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    line-height: 1.1;
    color: var(--papier-50);
}

.highlight-organisme {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--pourpre-200);
}

.highlight-description {
    font-family: var(--font-editorial);
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--papier-200);
    max-width: 60ch;
}

.highlight-date {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--papier-300);
}

.highlight-gallery {
    border-top: 1px solid rgba(250, 247, 242, 0.18);
    padding: 1.5rem;
}

.highlight-gallery-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid rgba(250, 247, 242, 0.18);
    transition: transform 0.3s ease;
}

.highlight-gallery-item:hover .highlight-gallery-image {
    transform: scale(1.02);
}

.highlight-gallery-caption {
    margin-top: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--papier-300);
}

/* ── Section avec fond légèrement teinté ── */
.section-tint {
    background-color: var(--papier-100);
    border-top: 1px solid var(--papier-300);
    border-bottom: 1px solid var(--papier-300);
}

/* ── Cartes d'articles ── */
.carte-article {
    border: 1px solid var(--encre-200);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.carte-article:hover {
    border-color: var(--pourpre-400);
    box-shadow: 2px 2px 0 0 rgba(123, 37, 68, 0.08);
}

/* ── Titres dans les cartes ── */
.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--pourpre-700);
}

.card-heading {
    font-family: var(--font-display);
    font-weight: 700;
}

.subheading-pourpre {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--pourpre-700);
}

.subtitle-editorial {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--encre-700);
}

.block-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--encre-900);
}

/* ── Images de livres ── */
.book-cover {
    max-height: 400px;
    object-fit: contain;
}

/* Ne pas renommer en "pub-*" : les bloqueurs de publicité masquent ces classes. */
.vignette-ouvrage {
    max-height: 200px;
    object-fit: contain;
}

/* ── Badge éditorial ── */
.badge-editorial {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    padding: 0.15em 0.5em;
    background: transparent;
}

.badge-editorial--pourpre {
    color: var(--pourpre-700);
    border-color: var(--pourpre-700);
}

.badge-editorial--encre {
    color: var(--encre-500);
    border-color: var(--encre-500);
}

.badge-editorial-cuivre {
    color: var(--cuivre-700);
    border-color: var(--cuivre-700);
    font-size: 0.5rem;
}

/* ── Encadré « dernière actualité » (signal sobre, rouge) ── */
.encadre-derniere-actu {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b3261e;
    background: var(--papier-50, #faf7f2);
    border: 1px solid currentColor;
    border-radius: 3px;
    padding: 0.2em 0.55em;
    z-index: 3;
    pointer-events: none;
}

.encadre-derniere-actu i {
    font-size: 0.5rem;
}

/* ── Icônes réseaux sociaux ── */
.social-icon-lg {
    font-size: 2rem;
    color: var(--pourpre-600);
    display: block;
}

.social-icon-md {
    font-size: 1.5rem;
}

/* ── Avatar utilisateur (page profil) ── */
.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--pourpre-400);
    background: linear-gradient(135deg, var(--pourpre-600), var(--pourpre-700));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    color: white;
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
}

/* ── Listes de définitions (profil) ── */
.dl-label {
    min-width: 8rem;
}

.dl-value {
    font-family: var(--font-editorial);
    color: var(--encre-800);
}

.stat-value {
    font-size: 0.875rem;
    color: var(--encre-800);
}

/* ── Utilitaires de bordure ── */
.border-top-editorial {
    border-top: 1px solid var(--encre-200) !important;
}

.border-bottom-editorial {
    border-bottom: 1px solid var(--encre-200);
}

/* ── Succès contact ── */
.success-icon-box {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background-color: var(--pourpre-100);
    border: 3px solid var(--pourpre-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--pourpre-700);
}

/* ── Liste d'emails (gestion compte) ── */
.email-item {
    border: 1px solid var(--encre-200);
    background: var(--papier-50);
}

.email-address {
    font-size: 0.875rem;
    color: var(--encre-900);
}

/* ── Toasts / messages ── */
.toast-wrapper {
    z-index: 9998;
    width: 100%;
    max-width: 24rem;
}

.toast-editorial {
    box-shadow: 4px 4px 0 0 rgba(15, 30, 46, 0.12);
    border-radius: 0;
    pointer-events: auto;
}

.toast-close {
    margin-top: 1px;
}

/* ── Zone dangereuse (profil) ── */
.danger-panel {
    border: 1px solid var(--pourpre-300);
    background: var(--pourpre-50);
    padding: 1rem;
}

/* ── HTMX : indicateur de chargement ── */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* ── Skeleton loading ── */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--papier-200) 25%,
        var(--papier-100) 50%,
        var(--papier-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
