/* ==========================================
   FICHIER : /css/pages/blog.css
   PROJET  : Divine Hair Secrets by Lionne
   Dépend de : main.css
========================================== */


/* ─────────────────────────────────────
   1. HERO
───────────────────────────────────── */
.blog-hero {
    background: linear-gradient(135deg,
        var(--green-900) 0%, var(--green-800) 55%, var(--brown-900) 100%);
    padding: 72px 0 56px;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 75% 50%,
        rgba(197,160,89,.14) 0%, transparent 60%);
    pointer-events: none;
}

.blog-hero-content { position: relative; max-width: 620px; }

.blog-hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-heading); font-size: .72rem;
    font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
    color: var(--gold-500);
    background: rgba(197,160,89,.12); border: 1px solid rgba(197,160,89,.25);
    padding: 6px 16px; border-radius: var(--radius-lg); margin-bottom: 20px;
}
.blog-hero-badge .material-icons-round { font-size: .9rem; }

.blog-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800; color: #fff;
    line-height: 1.15; letter-spacing: -.02em; margin-bottom: 16px;
}
.blog-hero-title .text-gold { color: var(--gold-500); }

.blog-hero-desc {
    font-family: var(--font-body); font-size: 1rem;
    font-weight: 300; font-style: italic;
    color: rgba(255,255,255,.72); line-height: 1.75; max-width: 480px;
}


/* ─────────────────────────────────────
   2. BARRE FILTRES
───────────────────────────────────── */
.blog-filters-bar {
    background: #fff;
    border-bottom: 1px solid rgba(22,53,40,.07);
    position: sticky; top: 72px; z-index: 50;
    box-shadow: 0 2px 12px rgba(22,53,40,.05);
}

.blog-filters-inner {
    display: flex; align-items: center;
    justify-content: space-between; gap: 16px;
    padding: 14px 0; flex-wrap: wrap;
}

.blog-filter-group { display: flex; gap: 8px; flex-wrap: wrap; }

.blog-filter-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px;
    font-family: var(--font-heading); font-size: .76rem; font-weight: 600;
    color: var(--brown-500); background: var(--beige-100);
    border: 1.5px solid rgba(22,53,40,.1); border-radius: var(--radius-lg);
    cursor: pointer; transition: var(--transition-fast);
}

.blog-filter-btn:hover { border-color: var(--green-900); color: var(--green-900); }

.blog-filter-btn.active {
    background: var(--green-900); color: #fff; border-color: var(--green-900);
}

.blog-results-count {
    font-family: var(--font-body); font-size: .82rem;
    color: #aaa; white-space: nowrap; flex-shrink: 0;
}


/* ─────────────────────────────────────
   3. MAIN
───────────────────────────────────── */
.blog-main { padding: 40px 0 80px; min-height: 60vh; }


/* ─────────────────────────────────────
   4. LOADER / VIDE
───────────────────────────────────── */
.blog-loader {
    display: flex; flex-direction: column; align-items: center;
    gap: 14px; padding: 80px 0;
    color: #aaa; font-family: var(--font-body); font-size: .9rem; font-style: italic;
}

.blog-dots { display: flex; gap: 6px; }
.blog-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--green-900);
    animation: blogDot .8s ease-in-out infinite; opacity: .3;
}
.blog-dot:nth-child(2) { animation-delay: .15s; }
.blog-dot:nth-child(3) { animation-delay: .30s; }
@keyframes blogDot {
    0%,100%{transform:translateY(0);opacity:.3}
    50%{transform:translateY(-9px);opacity:1}
}

.blog-empty {
    text-align: center; padding: 80px 24px;
    color: #bbb; font-family: var(--font-body); font-size: .9rem;
}
.blog-empty .material-icons-round {
    font-size: 3rem; display: block; margin: 0 auto 12px;
    opacity: .2; color: var(--green-900);
}


/* ─────────────────────────────────────
   5. GRILLE ARTICLES
───────────────────────────────────── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 36px;
}


/* ─────────────────────────────────────
   6. CARTE ARTICLE
───────────────────────────────────── */
.blog-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(22,53,40,.06);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column;
    cursor: pointer;
    transition: var(--transition-smooth);
    animation: cardFadeIn .4s ease;
}

@keyframes cardFadeIn {
    from { opacity:0; transform:translateY(12px); }
    to   { opacity:1; transform:none; }
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: rgba(22,53,40,.12);
}

/* Image */
.blog-card-img {
    height: 210px; overflow: hidden;
    position: relative; background: var(--beige-100); flex-shrink: 0;
}

.blog-card-img img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .5s ease;
}

.blog-card:hover .blog-card-img img { transform: scale(1.05); }

.blog-card-img-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--beige-100), #e8e4de);
    color: rgba(22,53,40,.15);
}
.blog-card-img-ph .material-icons-round { font-size: 3.5rem; }

/* Badge catégorie */
.blog-cat-pill {
    position: absolute; top: 12px; left: 12px;
    background: var(--green-900); color: #fff;
    font-family: var(--font-heading); font-size: .62rem;
    font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    padding: 4px 10px; border-radius: var(--radius-lg); z-index: 2;
}

/* Corps */
.blog-card-body {
    padding: 18px 20px 20px;
    flex: 1; display: flex; flex-direction: column; gap: 8px;
}

.blog-card-meta {
    display: flex; align-items: center; gap: 14px;
    font-family: var(--font-body); font-size: .74rem; color: #aaa;
}

.blog-card-meta span {
    display: flex; align-items: center; gap: 4px;
}
.blog-card-meta .material-icons-round { font-size: .82rem; }

.blog-card-title {
    font-family: var(--font-heading); font-size: 1rem; font-weight: 700;
    color: var(--brown-900); line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}

.blog-card-excerpt {
    font-family: var(--font-body); font-size: .84rem; color: #999;
    line-height: 1.55; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}

.blog-card-read {
    font-family: var(--font-heading); font-size: .78rem; font-weight: 700;
    color: var(--green-900); display: inline-flex; align-items: center;
    gap: 4px; margin-top: 4px; transition: gap .2s;
}
.blog-card:hover .blog-card-read { gap: 8px; }
.blog-card-read .material-icons-round { font-size: .9rem; }

/* Bouton charger plus */
.blog-load-more { text-align: center; padding: 12px 0; }

.blog-btn-outline {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 28px; font-family: var(--font-heading);
    font-size: .84rem; font-weight: 700;
    color: var(--green-900); background: transparent;
    border: 2px solid var(--green-900); border-radius: var(--radius-lg);
    cursor: pointer; transition: var(--transition-fast);
}
.blog-btn-outline:hover { background: var(--green-900); color: #fff; }
.blog-btn-outline .material-icons-round { font-size: .95rem; }


/* ─────────────────────────────────────
   7. MODAL ARTICLE
───────────────────────────────────── */
.blog-modal-backdrop {
    padding-top: calc(env(safe-area-inset-top) + 20px);
    padding-top: env(safe-area-inset-top);
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.52);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
}

.blog-modal-backdrop.open {
    display: flex;
    animation: bmBdIn .22s ease;
}
@keyframes bmBdIn { from{opacity:0} to{opacity:1} }

.blog-modal-box {
    background: #fff;
    border-radius: var(--radius-md);
    width: 100%; max-width: 780px;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,.22);
    animation: bmIn .3s ease;
    margin: auto;
}
@keyframes bmIn {
    from { opacity:0; transform:translateY(20px) scale(.97); }
    to   { opacity:1; transform:none; }
}

/* Bouton fermer */
.blog-modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
    border: none; color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10; transition: var(--transition-fast);
}
.blog-modal-close:hover { background: rgba(0,0,0,.7); }
.blog-modal-close .material-icons-round { font-size: 1.1rem; }

/* Couverture */
.bm-cover {
    height: 320px; position: relative;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden; background: var(--beige-100);
}
.bm-cover img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.bm-cover-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top,
        rgba(0,0,0,.5) 0%, transparent 50%);
}
.bm-cat-badge {
    position: absolute; bottom: 18px; left: 24px;
    background: var(--gold-500); color: var(--green-950);
    font-family: var(--font-heading); font-size: .68rem;
    font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    padding: 5px 14px; border-radius: var(--radius-lg);
}

/* Contenu */
.bm-content { padding: 32px 36px 40px; }

.bm-meta {
    display: flex; align-items: center; gap: 18px;
    font-family: var(--font-body); font-size: .8rem; color: #aaa;
    margin-bottom: 14px; flex-wrap: wrap;
}
.bm-meta span { display: flex; align-items: center; gap: 5px; }
.bm-meta .material-icons-round { font-size: .9rem; color: var(--green-900); }

.bm-title {
    font-family: var(--font-heading); font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800; color: var(--green-950);
    line-height: 1.25; letter-spacing: -.02em; margin-bottom: 24px;
}

/* Corps de l'article — supporte le HTML riche */
.bm-body {
    font-family: var(--font-body);
    font-size: .96rem;
    color: var(--brown-900);
    line-height: 1.85;
    margin-bottom: 36px;
}

.bm-body p    { margin-bottom: 16px; }
.bm-body h3   { font-family: var(--font-heading); font-size: 1.15rem; color: var(--green-900); margin: 24px 0 10px; }
.bm-body h4   { font-family: var(--font-heading); font-size: 1rem; color: var(--brown-900); margin: 18px 0 8px; }
.bm-body ul   { padding-left: 20px; margin-bottom: 16px; }
.bm-body ul li { margin-bottom: 6px; }
.bm-body strong { color: var(--green-900); }
.bm-body em   { color: var(--brown-500); font-style: italic; }


/* ─────────────────────────────────────
   8. COMMENTAIRES
───────────────────────────────────── */
.bm-comments-section {
    border-top: 1px solid rgba(22,53,40,.08);
    padding-top: 28px;
}

.bm-comments-title {
    font-family: var(--font-heading); font-size: 1rem; font-weight: 800;
    color: var(--brown-900); display: flex; align-items: center; gap: 8px;
    margin-bottom: 22px;
}
.bm-comments-title .material-icons-round { font-size: 1.1rem; color: var(--green-900); }

.bm-comments-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px;
    background: var(--green-900); color: #fff;
    font-size: .72rem; font-weight: 800;
    border-radius: 11px; padding: 0 6px;
}

/* Formulaire commentaire */
.bm-comment-form {
    background: var(--beige-100);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.bm-comment-form-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}

.bm-comment-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--green-900); color: #fff;
    font-family: var(--font-heading); font-size: .82rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.bm-comment-user {
    font-family: var(--font-heading); font-size: .88rem;
    font-weight: 700; color: var(--brown-900); display: block;
}

.bm-comment-sub {
    font-family: var(--font-body); font-size: .72rem; color: #aaa;
}

.bm-comment-textarea {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid rgba(22,53,40,.12); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: .9rem; color: var(--brown-900);
    background: #fff; outline: none; resize: vertical; min-height: 80px;
    line-height: 1.55; transition: var(--transition-fast);
}
.bm-comment-textarea:focus {
    border-color: var(--green-900);
    box-shadow: 0 0 0 3px rgba(22,53,40,.06);
}
.bm-comment-textarea::placeholder { color: #ccc; }

.bm-comment-form-foot {
    display: flex; justify-content: flex-end; margin-top: 10px;
}

.bm-btn-comment {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 20px;
    font-family: var(--font-heading); font-size: .82rem; font-weight: 700;
    color: #fff; background: var(--green-900);
    border: none; border-radius: var(--radius-lg);
    cursor: pointer; transition: var(--transition-fast);
}
.bm-btn-comment:hover { background: var(--gold-500); }
.bm-btn-comment:disabled { opacity: .6; cursor: not-allowed; }
.bm-btn-comment .material-icons-round { font-size: .9rem; }

/* Prompt connexion dans commentaires */
.bm-login-prompt {
    background: var(--beige-100); border-radius: var(--radius-md);
    padding: 18px 20px; text-align: center; margin-bottom: 24px;
    border: 1.5px dashed rgba(22,53,40,.1);
}
.bm-login-prompt p {
    font-family: var(--font-body); font-size: .88rem; color: #aaa;
    margin-bottom: 12px;
}
.bm-login-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; font-family: var(--font-heading);
    font-size: .8rem; font-weight: 700;
    color: #fff; background: var(--green-900);
    border-radius: var(--radius-lg); text-decoration: none;
    transition: var(--transition-fast);
}
.bm-login-link:hover { background: var(--gold-500); }
.bm-login-link .material-icons-round { font-size: .9rem; }

/* Liste commentaires */
.bm-comments-loader { text-align: center; padding: 20px 0; color: #bbb; font-family: var(--font-body); font-size: .84rem; }

.bm-comment-item {
    display: flex; gap: 12px; padding: 14px 0;
    border-bottom: 1px solid rgba(22,53,40,.05);
    animation: cmtIn .3s ease;
}
@keyframes cmtIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

.bm-comment-item:last-child { border-bottom: none; }

.bm-cmt-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--green-900); color: #fff;
    font-family: var(--font-heading); font-size: .76rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.bm-cmt-body { flex: 1; min-width: 0; }

.bm-cmt-head {
    display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; flex-wrap: wrap;
}
.bm-cmt-name {
    font-family: var(--font-heading); font-size: .84rem;
    font-weight: 700; color: var(--brown-900);
}
.bm-cmt-date {
    font-family: var(--font-body); font-size: .72rem; color: #bbb;
}
.bm-cmt-text {
    font-family: var(--font-body); font-size: .88rem;
    color: var(--brown-500); line-height: 1.6;
}

/* Bouton supprimer son propre commentaire */
.bm-cmt-delete {
    background: none; border: none; color: #ddd;
    cursor: pointer; font-size: .72rem; font-family: var(--font-body);
    display: flex; align-items: center; gap: 3px;
    transition: color .15s; padding: 3px 0; margin-top: 4px;
}
.bm-cmt-delete:hover { color: #c0392b; }
.bm-cmt-delete .material-icons-round { font-size: .82rem; }

/* Aucun commentaire */
.bm-no-comments {
    text-align: center; padding: 28px 0;
    color: #ccc; font-family: var(--font-body); font-size: .84rem; font-style: italic;
}


/* ─────────────────────────────────────
   9. TOASTS
───────────────────────────────────── */
#toast-root {
    position: fixed; bottom: 22px; right: 22px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 9999; pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 11px; padding: 13px 16px;
    background: #fff; border-left: 4px solid var(--green-900);
    border-radius: var(--radius-md); box-shadow: 0 6px 22px rgba(0,0,0,.12);
    min-width: 240px; max-width: 320px; pointer-events: all; animation: tIn .3s ease;
}
.toast.error   { border-left-color: #c0392b; }
.toast.removing { animation: tOut .22s ease forwards; }
@keyframes tIn  { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
@keyframes tOut { to{opacity:0;transform:translateY(8px)} }
.toast .material-icons-round { font-size: 1.1rem; flex-shrink: 0; }
.toast.success .material-icons-round { color: var(--green-900); }
.toast.error   .material-icons-round { color: #c0392b; }
.toast-body { flex: 1; }
.toast-title { font-family:var(--font-heading); font-size:.82rem; font-weight:700; color:var(--brown-900); display:block; margin-bottom:2px; }
.toast-desc  { font-family:var(--font-body); font-size:.74rem; color:#aaa; }
.toast-x { background:none; border:none; color:#ccc; cursor:pointer; flex-shrink:0; transition:color .15s; }
.toast-x:hover { color:var(--brown-900); }
.toast-x .material-icons-round { font-size:.88rem; }


/* ─────────────────────────────────────
   10. RESPONSIVE
───────────────────────────────────── */
@media (max-width: 768px) {
    .blog-hero { padding: 52px 0 40px; }
    .blog-hero-title { font-size: 2rem; }
    .blog-filters-bar { top: 62px; }
    .blog-grid { grid-template-columns: 1fr; }

    .bm-cover { height: 220px; }
    .bm-content { padding: 22px 20px 30px; }
    .bm-title { font-size: 1.3rem; }
    .bm-body { font-size: .9rem; }
}

@media (max-width: 640px) {
    .blog-hero { padding: 40px 0 32px; }
    .blog-filters-bar { top: 56px; }
    .blog-filters-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .blog-grid { gap: 16px; }

    /* Modal plein écran mobile */
    .blog-modal-backdrop { padding: 0; align-items: flex-end; }
    .blog-modal-box {
        border-radius: 20px 20px 0 0;
        max-height: 95vh; overflow-y: auto;
        animation: bmSheetUp .3s ease;
    }
    @keyframes bmSheetUp {
        from { transform:translateY(100%); opacity:0; }
        to   { transform:none; opacity:1; }
    }
    .bm-cover { height: 200px; border-radius: 20px 20px 0 0; }
    .bm-content { padding: 18px 16px 28px; }
}

@media (max-width: 400px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-filter-btn { padding: 6px 12px; font-size: .7rem; }
}