/* ==========================================================================
   MS Plomberie — Blog « Conseils plomberie »
   Relies on design tokens defined in styles.css
   ========================================================================== */

.blog-page main {
    padding-top: 100px; /* topbar + navbar (fixed) */
}

/* ---------- Page header ---------- */
.blog-header {
    background: var(--neutral-100);
    border-bottom: 1px solid var(--neutral-300);
    padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 2rem);
}

.blog-header-inner {
    max-width: 760px;
    margin: 0 auto;
}

.blog-header h1 {
    font-size: clamp(1.75rem, 4.5vw, 2.6rem);
    line-height: 1.2;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
    margin: 0.75rem 0 0.75rem;
    overflow-wrap: break-word;
}

.blog-intro {
    font-size: 1.1rem;
    color: var(--neutral-700);
    max-width: 65ch;
}

.article-meta {
    font-size: 0.9rem;
    color: var(--neutral-600);
}

.article-meta span {
    font-weight: 600;
    color: var(--neutral-700);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--neutral-600);
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.breadcrumb li + li::before {
    content: "›";
    margin: 0 0.5rem;
    color: var(--neutral-500);
}

.breadcrumb a {
    color: var(--accent-dark);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
    color: var(--neutral-700);
}

/* ---------- Tag ---------- */
.blog-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-dark);
    background: rgba(249, 115, 22, 0.1);
    border-radius: var(--radius-pill);
    padding: 0.25rem 0.7rem;
}

.blog-header .blog-tag {
    margin-top: 1.25rem;
}

/* ---------- Blog index ---------- */
.blog-list {
    max-width: var(--container);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 2rem);
}

.blog-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.5rem;
}

.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    background: var(--white);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s;
}

.blog-card:hover,
.blog-card:focus-within {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-light);
    transform: translateY(-3px);
}

.blog-card-title {
    font-size: 1.15rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--primary);
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}

/* Whole card clickable */
.blog-card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.blog-card-title a:focus-visible {
    outline: none;
}

.blog-card:focus-within {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.blog-card-date {
    font-size: 0.85rem;
    color: var(--neutral-600);
}

.blog-card-summary {
    color: var(--neutral-700);
    font-size: 0.95rem;
    flex: 1;
}

.blog-card-more {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-dark);
}

.blog-list-cta {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2rem) clamp(3rem, 6vw, 4.5rem);
}

/* ---------- Article layout ---------- */
.article-container {
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2rem) clamp(3rem, 6vw, 4.5rem);
}

.article-body {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--neutral-800);
    overflow-wrap: break-word;
}

.article-body > * + * {
    margin-top: 1.1rem;
}

.article-body .lead {
    font-size: 1.15rem;
    color: var(--neutral-700);
}

.article-body h2 {
    font-size: clamp(1.35rem, 3vw, 1.65rem);
    line-height: 1.3;
    font-weight: 700;
    color: var(--primary);
    margin-top: 2.5rem;
    letter-spacing: -0.01em;
    scroll-margin-top: 120px;
}

.article-body h3 {
    font-size: 1.15rem;
    line-height: 1.4;
    font-weight: 700;
    color: var(--neutral-900);
    margin-top: 1.75rem;
    scroll-margin-top: 120px;
}

.article-body h2 + *,
.article-body h3 + * {
    margin-top: 0.6rem;
}

.article-body ul,
.article-body ol {
    padding-left: 1.4rem;
}

.article-body li + li {
    margin-top: 0.4rem;
}

.article-body li::marker {
    color: var(--accent);
    font-weight: 700;
}

.article-body a {
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

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

.article-body strong {
    color: var(--neutral-900);
    font-weight: 600;
}

/* ---------- Table of contents ---------- */
.article-toc {
    background: var(--neutral-100);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.article-toc-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.article-toc ol {
    padding-left: 1.25rem;
    font-size: 0.95rem;
}

.article-toc li + li {
    margin-top: 0.3rem;
}

.article-toc a {
    color: var(--accent-dark);
    text-decoration: none;
}

.article-toc a:hover {
    text-decoration: underline;
}

/* ---------- Figure ---------- */
.article-figure {
    margin: 1.75rem 0 0;
}

.article-figure img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--radius-lg);
    background: var(--neutral-200);
}

.article-figure figcaption {
    font-size: 0.875rem;
    color: var(--neutral-600);
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ---------- Tip / warning boxes & blockquote ---------- */
.tip-box,
.warning-box,
.article-body blockquote {
    border-left: 4px solid var(--accent);
    background: rgba(249, 115, 22, 0.07);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.25rem;
}

.warning-box {
    border-left-color: var(--danger);
    background: rgba(220, 38, 38, 0.06);
}

.tip-box-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.tip-box p + p,
.warning-box p + p {
    margin-top: 0.25rem;
}

/* ---------- CTA box ---------- */
.cta-box {
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-xl);
    padding: clamp(1.5rem, 4vw, 2rem);
    margin-top: 2.5rem;
    box-shadow: var(--shadow-md);
}

.cta-box-title {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.cta-box p {
    color: rgba(255, 255, 255, 0.9);
}

.cta-box-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.25rem 0 1rem;
}

.cta-box .btn-primary,
.cta-box-secondary {
    text-decoration: none;
    justify-content: center;
}

.article-body .cta-box .btn-primary {
    color: var(--white);
}

.cta-box-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-pill);
    border: 2px solid var(--white);
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
}

.article-body .cta-box .cta-box-secondary {
    color: var(--white);
}

.cta-box-secondary:hover,
.article-body .cta-box .cta-box-secondary:hover {
    background: var(--white);
    color: var(--primary);
}

.cta-box-note {
    font-size: 0.85rem;
}

.cta-box-note a,
.article-body .cta-box-note a {
    color: var(--white);
    text-decoration: underline;
}

/* ---------- FAQ ---------- */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    background: var(--white);
}

.faq-item[open] {
    border-color: var(--accent-light);
    box-shadow: var(--shadow-sm);
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.5;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    flex-shrink: 0;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--accent-dark);
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.25rem 1.1rem;
    color: var(--neutral-700);
}

/* ---------- Related articles ---------- */
.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--neutral-300);
}

.related-articles h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.related-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 1rem;
}

.related-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    background: var(--neutral-100);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.related-card:hover,
.related-card:focus-within {
    border-color: var(--accent-light);
    box-shadow: var(--shadow);
}

.related-link {
    font-weight: 600;
    line-height: 1.4;
    color: var(--primary);
    text-decoration: none;
}

.related-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.article-back {
    margin-top: 2rem;
}

.article-back a {
    color: var(--accent-dark);
    font-weight: 600;
    text-decoration: none;
}

.article-back a:hover {
    text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .blog-page main {
        padding-top: 64px; /* topbar hidden on mobile */
    }

    .article-body h2,
    .article-body h3 {
        scroll-margin-top: 80px;
    }

    .cta-box-actions {
        flex-direction: column;
    }

    .cta-box .btn-primary,
    .cta-box-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .article-body {
        font-size: 1rem;
    }

    .article-toc {
        padding: 1rem 1.1rem;
    }

    .faq-item summary {
        padding: 0.9rem 1rem;
    }

    .faq-answer {
        padding: 0 1rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .blog-card:hover,
    .faq-item summary::after {
        transition: none;
        transform: none;
    }
}

@media print {
    .blog-page main { padding-top: 0; }
    .cta-box, .article-toc, .related-articles { display: none; }
}
