﻿/* =========================================
   CHAIR FEMMES THEME - BLOG PAGE
   ========================================= */

/* --- Font Definition --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&display=swap');

/* --- Unified Global Variables --- */
:root {
    /* Main Layout & Text */
    --bg-beige: #FAF6F0; 
    --text-dark: #4A332A; 
    --bg-dark: #3A261F; 

    /* Accent & Brand Colors */
    --brand-accent: #C47A65; /* Terracotta doux */
    --brand-red: #d64d2e;    /* Rouge vif pour boutons et accents */
    --brand-gold: #D4A373;   /* Or mat */
    --bg-muted: #F1EDE8;     

    /* Glass Effects */
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-bg: rgba(255, 248, 240, 0.2);
}

/* --- Base Body & Resets --- */
body, html {
    font-family: 'The Seasons', 'Playfair Display', serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-beige);
    color: var(--text-dark);
    overflow-x: clip; /* Fix: Changed from 'hidden' to 'clip' so position: sticky can work natively */
}

/* Texture sensuelle en arrière-plan */
.sensual-texture-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.05; 
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Utility Classes */
.text-dark-brown { color: var(--text-dark) !important; }
.text-accent { color: var(--brand-accent) !important; }
.text-brand-red { color: var(--brand-red) !important; }
.bg-white { background-color: #ffffff !important; } 
.object-fit-cover { object-fit: cover; }

/* Dynamic Typography scaling */
#articleTitle {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    line-height: 1.1;
}

/* --- Breadcrumb --- */
.breadcrumb-section { 
    background-color: rgba(196, 122, 101, 0.05); 
}
.breadcrumb-item a { 
    color: var(--text-dark); 
    text-decoration: none; 
    font-weight: 500; 
    opacity: 0.7;
    transition: opacity 0.3s;
    font-family: 'Manrope', sans-serif;
}
.breadcrumb-item a:hover { opacity: 1; color: var(--brand-accent); }
.breadcrumb-item.active { color: var(--brand-accent); font-family: 'Manrope', sans-serif; }
.breadcrumb-item + .breadcrumb-item::before { 
    content: ">>"; 
    font-size: 0.8rem; 
    padding-top: 4px; 
    opacity: 0.4;
}

/* --- Blog Post & Image Hover --- */
.post-thumb {
    width: 280px;
    height: 220px; 
    flex-shrink: 0;
    border-radius: 4px !important;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.thumb-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-red) 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 2;
    opacity: 0;
    box-shadow: 0 5px 15px rgba(214, 77, 46, 0.4);
    text-decoration: none;
}

.post-thumb:hover img {
    transform: scale(1.08); 
}

.post-thumb:hover .thumb-overlay {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* --- Content Styling --- */
.post-title a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.8rem;
    transition: color 0.3s;
    line-height: 1.2;
}
.post-title a:hover { color: var(--brand-red); }

.author-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.meta-text {
    line-height: 1.2;
    font-family: 'Manrope', sans-serif;
}

.post-excerpt {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #665b58; 
    font-family: 'Manrope', sans-serif;
}

/* --- Read More Pill Button --- */
.btn-read-more {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background-color: var(--brand-accent);
    color: white;
    padding: 6px 20px 6px 6px; 
    border-radius: 50px; 
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Manrope', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(196, 122, 101, 0.2);
}

.btn-read-more .icon-circle {
    background-color: white;
    color: var(--brand-accent);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
    font-size: 0.75rem;
    transition: transform 0.3s;
}

.btn-read-more:hover {
    background-color: var(--brand-red); 
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 8px 20px rgba(214, 77, 46, 0.3);
}

.btn-read-more:hover .icon-circle {
    transform: rotate(45deg); 
    color: var(--brand-red);
}

.post-divider { 
    border-top: 1px dashed rgba(74, 51, 42, 0.25) !important; 
    opacity: 1 !important;
}

/* --- Pagination --- */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.blog-pagination .page-num {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--bg-muted);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    transition: all 0.3s;
}

.blog-pagination .page-num.active,
.blog-pagination .page-num:hover {
    background-color: var(--brand-red);
    color: white;
    box-shadow: 0 5px 15px rgba(214, 77, 46, 0.3);
}

/* --- Sidebar --- */
.widget { 
    border: 1px solid rgba(74, 51, 42, 0.05); 
    border-radius: 3px !important;
}

.widget-title { 
    font-weight: 700; 
    position: relative; 
    padding-bottom: 12px; 
    color: var(--text-dark); 
    font-size: 1.4rem;
}

.widget-title::after { 
    content: ''; 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 40px; 
    height: 3px; 
    background-color: var(--brand-accent); 
    border-radius: 5px;
}

/* Sticky Sidebar Implementation */
.sidebar-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 120px; /* Accounts for navbar height and spacing */
    height: max-content; /* Critical for sticky to work without stretching */
    align-self: start; /* Ensures it doesn't stretch and sticks properly */
    z-index: 10;
}

/* --- Clean Custom Form Styling (Matching your reference) --- */
.custom-input { 
    border-radius: 50px; 
    background-color: #ffffff; 
    border: 1px solid rgba(74, 51, 42, 0.15); 
    padding: 12px 20px; 
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.custom-textarea {
    border-radius: 16px; 
}

.custom-input:focus,
.form-control:focus {
    border-color: var(--brand-accent) !important;
    background-color: white;
    outline: none !important;
    box-shadow: 0 0 0 1px var(--brand-accent) !important; 
}

.custom-checkbox:focus {
    border-color: var(--brand-accent) !important;
    box-shadow: 0 0 0 1px var(--brand-accent) !important;
}

.custom-checkbox:checked {
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
}

/* Sidebar Buttons & Tags */
.btn-accent { 
    background-color: var(--brand-red);
    color: white; 
    font-weight: 600; 
    border: none; 
    transition: transform 0.3s, box-shadow 0.3s;
    font-family: 'Manrope', sans-serif;
}
.btn-accent:hover { 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(214, 77, 46, 0.4);
    background-color: #b83e22; 
    color: white; 
}

.tags-container { display: flex; flex-wrap: wrap; gap: 10px; }

.tag-link { 
    background-color: var(--bg-muted); 
    color: var(--text-dark); 
    text-decoration: none; 
    padding: 6px 16px; 
    border-radius: 20px; 
    font-size: 0.85rem; 
    font-weight: 500; 
    font-family: 'Manrope', sans-serif;
    transition: all 0.3s ease; 
}

.tag-link:hover { 
    background-color: var(--brand-accent); 
    color: white; 
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(196, 122, 101, 0.2);
}

.tag-link.active {
    background-color: var(--brand-red);
    color: white;
    box-shadow: 0 5px 10px rgba(214, 77, 46, 0.3);
}

.tag-link.active:hover {
    background-color: var(--brand-red);
    transform: translateY(-2px);
}

/* Ad Placeholder */
.ad-placeholder { 
    height: 280px; 
    border-radius: 3px !important;
}
.ad-text-overlay { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
}

/* =========================================
   READ BLOG PAGE (SINGLE POST) STYLES
   ========================================= */

/* --- Native CSS Grid Layout for Main Page --- */
.blog-read-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px; 
    gap: 40px;
    align-items: start; /* CRITICAL for sticky sidebar */
}

/* --- Article Header & Meta --- */
.avatar-small { width: 35px; height: 35px; object-fit: cover; }
.avatar-md { width: 50px; height: 50px; object-fit: cover; }

.meta-divider {
    width: 4px; height: 4px; border-radius: 50%;
    background-color: var(--brand-gold);
}

.tag-pill-accent {
    background-color: rgba(214, 77, 46, 0.1);
    color: var(--brand-red);
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600; text-decoration: none;
    font-family: 'Manrope', sans-serif;
}

/* --- Article Body --- */
.article-hero-image { 
    height: 450px; 
    border-radius: 1px !important; 
}

.text-highlight {
    background-color: var(--brand-gold);
    color: white;
    padding: 2px 6px; border-radius: 4px;
    font-weight: 600;
}

.custom-blockquote { border-left: 4px solid var(--brand-accent); }

/* --- REFINED SHARE SECTION (Thin Transparent Icons) --- */
.share-bar {
    border-radius: 8px; /* Clean flat rectangle instead of an awkward pill */
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(74, 51, 42, 0.05); /* Very subtle border */
}

.social-share-links {
    display: flex;
    align-items: center;
}

.social-share-links a {
    color: var(--brand-accent);
    font-size: 1.25rem; /* Larger glyphs since there's no background */
    display: flex; 
    justify-content: center; 
    align-items: center;
    text-decoration: none; 
    background-color: transparent !important; /* No pill backgrounds */
    transition: all 0.3s;
}

.social-share-links a:hover {
    color: var(--brand-red);
    transform: translateY(-2px); 
}

/* --- Post Navigation --- */
.nav-post-link { text-decoration: none; transition: opacity 0.3s; max-width: 40%; }
.nav-post-link:hover { opacity: 0.7; }
.nav-icon {
    width: 40px; height: 40px; border-radius: 50%; background-color: var(--brand-gold);
    color: white; display: flex; justify-content: center; align-items: center;
}
.nav-grid-icon { transition: color 0.3s; }
.nav-grid-icon:hover { color: var(--brand-red) !important; opacity: 1 !important; }

/* --- Related Posts Grid --- */
.related-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}
.related-card {
    flex: 0 0 calc(33.333% - 16px);
    max-width: calc(33.333% - 16px);
    width: 100%;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .related-grid {
        gap: 16px;
    }
    .related-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
.related-img-container {
    background-color: white;
    padding: 6px;
    border-radius: 6px; 
    box-shadow: 0 4px 15px rgba(74, 51, 42, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.related-img { 
    height: 160px; 
    width: 100%;
    object-fit: cover;
    border-radius: 4px; 
}
.related-card:hover .related-img-container { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(74, 51, 42, 0.1); 
}

/* --- REFINED COMMENTS SECTION (Like the reference) --- */
.comments-section-wrapper {
    /* Set up master card container in HTML */
}

.comment-card {
    border: 1px solid #eaeaea; /* Crisp, clean borders */
    background: transparent;
    box-shadow: none; /* No shadow, fully matching your reference */
}

.reply-btn { 
    transition: color 0.3s; 
    font-family: 'Manrope', sans-serif;
}
.reply-btn:hover { color: var(--brand-red) !important; text-decoration: underline; }
.bg-accent { background-color: var(--brand-accent) !important; }

/* --- REFINED COMMENT FORM GRID --- */
.comment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 Even columns for Name, Email, Website */
    gap: 20px;
}
.comment-form-grid .form-full-width {
    grid-column: 1 / -1; /* Spans across all 3 columns */
}
.comment-form-grid .form-label { margin-bottom: 6px; }


/* =========================================
   CLEAN NON-DESTRUCTIVE RESPONSIVENESS (UPDATED)
   ========================================= */

@media (max-width: 991px) {
    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
    }

    .outer-frame {
        padding: 0 !important;
        margin: 0 !important;
        min-height: 100vh;
    }

    .read-article-section {
        padding-top: 60px !important;
        position: relative;
        top: 0;
    }

    /* --- Blog Read Layout (Collapse 2-columns into 1) --- */
    .blog-read-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    /* Reset sidebar spacing and layout since it drops below the article */
    .sidebar-wrapper { 
        position: relative; /* Disable sticky on tablet/mobile */
        top: auto;
        margin-top: 0px; 
        padding-top: 20px;
        border-top: 2px solid rgba(74, 51, 42, 0.1); 
        padding-left: 0 !important; 
    }

    /* Adjust thumbnail grid for tablets */
    .post-thumb { 
        width: 220px; 
        height: 180px; 
    }
    .post-title a { font-size: 1.5rem; }
}

@media (max-width: 768px) {
    /* --- Main Article Scale --- */
    .article-hero-image { height: 300px; }
    
    /* Meta info wrapping */
    .article-meta-top { flex-wrap: wrap; }
    
    /* Form inputs stack vertically on mobile */
    .comment-form-grid { grid-template-columns: 1fr; }
    
    /* Perfect Center Stack for Mobile Navigation Links */
    .post-navigation {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }
    .nav-post-link {
        max-width: 100%;
        width: 100%;
    }
    .nav-post-link.text-start,
    .nav-post-link.text-end {
        text-align: center !important;
    }
    .nav-post-link .nav-icon {
        margin: 0 auto 10px auto !important; /* Forces the circle icon to middle */
    }
    .nav-grid-icon { 
        margin: 10px 0; 
    }
    
    /* Fix comment reply margin padding */
    .comment-card.ms-md-5 { margin-left: 15px !important; }

    /* Keeps Share Bar completely horizontal & seamless */
    .share-bar {
        flex-direction: row; /* Locks it horizontally */
        flex-wrap: wrap; /* Allows wrap only if screen is absurdly tiny */
        justify-content: center;
        align-items: center;
        gap: 15px !important;
        padding: 1rem !important;
    }
    .social-share-links { gap: 15px !important; }

    /* --- General Blog Layout Fallbacks --- */
    .blog-post { 
        flex-direction: column !important; 
        align-items: center;
        text-align: center; 
    }
    
    .post-thumb { 
        width: 100%; 
        max-width: 400px; 
        height: 250px; 
        margin-right: 0 !important;
        margin-bottom: 25px !important;
    }
    
    .post-meta { justify-content: center; } 
    .post-title a { font-size: 1.6rem; }
    .btn-read-more { margin: 0 auto; }
    .tags-container { justify-content: center; }
    .widget-title { text-align: center; padding-bottom: 15px; }
    .widget-title::after { left: 50%; transform: translateX(-50%); } 
}

@media (max-width: 480px) {
    .article-hero-image { height: 200px; }

    /* Post Layout */
    .post-thumb { height: 200px; }
    .post-title a { font-size: 1.4rem; }
}