/* ═══════════════════════════════════════════════════
   SINGLE ARTICLE CSS — CMS ass-fam.org
═══════════════════════════════════════════════════ */

.single-article {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: 40px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

/* Fil d'Ariane */
.breadcrumb {
    font-size: 13px;
    color: var(--c-text-2);
    margin-bottom: 25px;
}

.breadcrumb a {
    color: var(--c-text-2);
}

.breadcrumb a:hover {
    color: var(--c-accent);
}

.breadcrumb .separator {
    margin: 0 8px;
    color: var(--c-text-3);
}

.breadcrumb .current {
    font-weight: 600;
    color: var(--c-text);
}

/* Header de l'article */
.article-header {
    margin-bottom: 30px;
}

.article-header h1 {
    font-size: 34px;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--c-accent);
}

.article-meta-data {
    font-size: 14px;
    color: var(--c-text-2);
}

.article-meta-data strong {
    color: var(--c-text);
}

.author-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.author-link:hover {
    color: var(--c-accent);
    text-decoration: underline;
}

.meta-tags {
    color: var(--c-text-3);
}

.tag-link {
    color: var(--c-text-2);
    text-decoration: none;
    background: var(--c-surface2);
    padding: 2px 8px;
    border-radius: var(--r-sm);
    transition: all 0.2s;
    font-weight: 600;
}

.tag-link:hover {
    background: var(--c-accent);
    color: white;
}


/* Image de couverture */
.article-cover {
    margin: 0 0 30px;
    display: flex;
    justify-content: center;
    background: transparent;
}

.article-cover img {
    width: 65%;
    max-height: 450px;
    object-fit: cover;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
}

/* Sommaire automatique (TOC) */
.article-toc {
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    margin: 30px 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.article-toc[open] {
    box-shadow: var(--shadow-md);
}

.article-toc .toc-title {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--c-accent);
    list-style: none;
    /* Cache la flèche par défaut sur Chrome/Firefox */
}

/* Cache la flèche par défaut sur Safari */
.article-toc .toc-title::-webkit-details-marker {
    display: none;
}

.article-toc .toc-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: var(--c-text-3);
}

.article-toc[open] .toc-icon {
    transform: rotate(180deg);
}

.article-toc ul {
    list-style: none;
    margin: 0;
    padding: 0 25px 25px;
}

.article-toc li {
    margin-bottom: 12px;
    line-height: 1.4;
    padding-left: 15px;
    position: relative;
}

.article-toc li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--c-accent);
    font-weight: bold;
}

.article-toc li a {
    text-decoration: none;
    color: var(--c-text);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.article-toc li a:hover {
    color: var(--c-accent);
    padding-left: 5px;
}

/* Corps du texte */
.article-body {
    font-size: 17px;
    line-height: 1.8;
    color: var(--c-text);
}

.article-body h2 {
    font-size: 24px;
    margin: 35px 0 15px;
    color: var(--c-accent);
}

.article-body h3 {
    font-size: 20px;
    margin: 25px 0 10px;
}

.article-body ul,
.article-body ol {
    margin: 0 0 20px 25px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body blockquote {
    border-left: 4px solid var(--c-accent);
    background: var(--c-surface2);
    padding: 15px 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--c-text-2);
}

.article-body a {
    text-decoration: underline;
}

.article-body a:hover {
    text-decoration: none;
}

/* Hiérarchie Sous-pages */
.child-pages {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--c-border);
}

.child-pages h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--c-text);
}

.child-pages ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 15px;
}

.child-pages li a {
    display: block;
    padding: 15px 20px;
    background: var(--c-surface2);
    border-radius: var(--r-md);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.child-pages li a:hover {
    border-color: var(--c-accent);
    background: var(--c-surface);
}

.child-pages li a strong {
    display: block;
    color: var(--c-accent);
    margin-bottom: 5px;
}

.child-pages li a p {
    font-size: 14px;
    color: var(--c-text-2);
    margin: 0;
}

/* Articles Similaires */
.similar-articles {
    background: var(--c-surface2);
    border-radius: var(--r-lg);
    padding: 30px;
    margin-bottom: 30px;
}

.similar-articles h3 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 22px;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.similar-card {
    background: var(--c-surface);
    border-radius: var(--r-sm);
    overflow: hidden;
    text-decoration: none;
    color: var(--c-text);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.similar-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.similar-thumb {
    height: 120px;
    background: var(--c-border);
}

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

.similar-title {
    padding: 15px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.back-link {
    text-align: center;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 800px) {
    .single-article {
        padding: 25px;
    }

    .article-cover {
        margin: 0 -25px 25px;
    }

    .article-header h1 {
        font-size: 25px;
    }

    .breadcrumb {
        margin-bottom: 12px;
    }

    .breadcrumb .current,
    .breadcrumb .separator:last-of-type {
        display: none;
    }
}

/* ── Bloc Newsletter ── */
.newsletter-sidebar-card {
    background: var(--c-surface);
    border-radius: var(--r-xl);
    padding: 30px;
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.3s ease;
}

.newsletter-sidebar-card:hover {
    transform: translateY(-5px);
}

.newsletter-sidebar-card .newsletter-icon {
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
}

.newsletter-sidebar-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--c-text);
}

.newsletter-sidebar-card p {
    font-size: 14px;
    color: var(--c-text-2);
    margin-bottom: 20px;
}

.newsletter-sidebar-card .btn-primary {
    display: block;
    text-decoration: none;
    padding: 12px;
    border-radius: var(--r-md);
    font-weight: 700;
}

/* ── Helpers Responsifs complémentaires ── */
.mobile-only {
    display: none;
}

@media (max-width: 1024px) {
    .mobile-only {
        display: block;
    }
}