/*
 Theme Name:   Astra Child
 Theme URI:    https://www.sanavito.com
 Description:  Sanavito child theme van Astra
 Author:       Sanavito
 Template:     astra
 Version:      1.2.0
*/


/* ============================================================
   BAYMARD UX OPTIMALISATIES — v1.1
   ============================================================ */

/* --- 1. TYPOGRAFIE (Baymard: min 16px, line-height 1.6, max 70ch) --- */
body,
.entry-content p,
.entry-content li {
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
    line-height: 1.7;
    color: #2d2d2d;
}

.entry-content {
    max-width: 70ch;
    margin-left: auto;
    margin-right: auto;
}

.entry-content p {
    margin-bottom: 1.4em;
}

.entry-content h2 {
    font-size: 1.55em;
    color: #1a3c34;
    margin-top: 2em;
    margin-bottom: 0.6em;
    padding-top: 0.5em;
    border-top: 2px solid #e8f4f0;
}

.entry-content h3 {
    font-size: 1.2em;
    color: #1a3c34;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5em;
    margin-bottom: 1.3em;
}

.entry-content li {
    margin-bottom: 0.4em;
}

.entry-content strong {
    color: #1a3c34;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.93em;
}

.entry-content th,
.entry-content td {
    padding: 10px 14px;
    border: 1px solid #d0e8e0;
    text-align: left;
}

.entry-content th {
    background: #f0f7f4;
    font-weight: 600;
    color: #1a3c34;
}

.entry-content tr:nth-child(even) td {
    background: #f9fcfb;
}

/* --- 2. ARTIKEL HEADER META (leestijd, datum) --- */
.snv-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.88em;
    color: #666;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8f0ec;
}

.snv-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0f7f4;
    color: #2a7c5f;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

/* --- 3. TABLE OF CONTENTS --- */
.snv-toc {
    background: #f8fdfb;
    border: 1px solid #d0e8e0;
    border-left: 4px solid #2a7c5f;
    border-radius: 6px;
    padding: 20px 24px;
    margin: 0 0 2em 0;
    max-width: 70ch;
}

.snv-toc summary {
    font-weight: 700;
    font-size: 1em;
    color: #1a3c34;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.snv-toc summary::after {
    content: '▾';
    font-size: 0.9em;
    color: #2a7c5f;
}

details.snv-toc[open] summary::after {
    content: '▴';
}

.snv-toc ol {
    margin: 12px 0 0 0;
    padding-left: 1.4em;
}

.snv-toc li {
    margin-bottom: 6px;
    font-size: 0.93em;
}

.snv-toc a {
    color: #2a7c5f;
    text-decoration: none;
}

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

.snv-toc .snv-toc-h3 {
    margin-left: 1.2em;
    font-size: 0.88em;
    color: #555;
}

/* --- 4. MEDISCH DISCLAIMER IN ARTIKEL --- */
.snv-medical-note {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 14px 18px;
    font-size: 0.88em;
    color: #555;
    margin: 2em 0;
    line-height: 1.55;
}

.snv-medical-note strong {
    color: #92400e;
}

/* --- 5. GERELATEERDE ARTIKELEN --- */
.snv-related {
    border-top: 2px solid #e8f4f0;
    padding-top: 32px;
    margin-top: 40px;
}

.snv-related h3 {
    font-size: 1.3em;
    color: #1a3c34;
    margin-bottom: 20px;
}

.snv-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.snv-related-card {
    border: 1px solid #e0ece8;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    color: inherit;
    transition: box-shadow 0.2s;
}

.snv-related-card:hover {
    box-shadow: 0 4px 16px rgba(42,124,95,0.15);
}

.snv-related-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.snv-related-card-body {
    padding: 14px 16px;
}

.snv-related-card-body h4 {
    font-size: 0.93em;
    color: #1a3c34;
    margin: 0 0 6px;
    line-height: 1.4;
}

.snv-related-card-body span {
    font-size: 0.8em;
    color: #888;
}

/* --- 6. BRONNEN SECTIE --- */
.snv-sources {
    background: #f8fdfb;
    border: 1px solid #d0e8e0;
    border-radius: 6px;
    padding: 18px 22px;
    margin-top: 32px;
    font-size: 0.87em;
}

.snv-sources h4 {
    color: #1a3c34;
    margin: 0 0 10px;
    font-size: 1em;
}

.snv-sources ol {
    margin: 0;
    padding-left: 1.4em;
    color: #555;
}

.snv-sources li {
    margin-bottom: 4px;
}

/* --- 7. HOMEPAGE VERBETERINGEN --- */
.home .entry-header {
    display: none;
}

/* --- 8. STICKY HEADER --- */
#masthead,
.site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* --- 9. BACK TO TOP KNOP --- */
#snv-back-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #2a7c5f;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.2em;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 998;
    text-decoration: none;
}

#snv-back-top.visible {
    display: flex;
}

/* --- 10. MOBILE VERBETERINGEN (Baymard: min 44px touch targets) --- */
@media (max-width: 768px) {
    body, .entry-content p, .entry-content li {
        font-size: 16px;
    }

    .entry-content {
        max-width: 100%;
        padding: 0 4px;
    }

    .snv-toc {
        padding: 14px 16px;
    }

    .snv-related-grid {
        grid-template-columns: 1fr;
    }

    #snv-back-top {
        width: 48px;
        height: 48px;
        bottom: 20px;
        right: 16px;
    }
}

/* --- 11. FOCUS STIJLEN (Baymard: toegankelijkheid) --- */
a:focus,
button:focus {
    outline: 3px solid #2a7c5f;
    outline-offset: 2px;
}

/* --- 12. ARTIKEL FIGUUR CAPTIONS --- */
.entry-content figure {
    margin: 2em 0;
}

.entry-content figcaption {
    text-align: center;
    font-size: 0.83em;
    color: #777;
    margin-top: 8px;
    font-style: italic;
}

/* --- 13. HIGHLIGHT BOXES --- */
.entry-content blockquote {
    border-left: 4px solid #2a7c5f;
    background: #f8fdfb;
    padding: 14px 20px;
    margin: 1.5em 0;
    border-radius: 0 6px 6px 0;
    font-style: normal;
    color: #333;
}

/* --- 14. PROGRESS BAR (lees voortgang) --- */
#snv-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: #2a7c5f;
    z-index: 9999;
    transition: width 0.1s linear;
}

/* --- 15. VERBERG ASTRA STANDAARD POST META (wij tonen eigen snv-article-meta) --- */
.entry-header .entry-meta {
    display: none;
}

/* --- 16. HOMEPAGE MOBILE FIX — grid en font overflow --- */
@media (max-width: 480px) {
    .sanavito-home .home-hero h1 {
        font-size: 1.6em !important;
        word-break: break-word;
    }

    .sanavito-home .home-hero {
        padding: 40px 16px !important;
    }

    .sanavito-home .home-hero p {
        font-size: 1em !important;
    }

    .sanavito-home .home-categories > div {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .sanavito-home .home-trust > div {
        grid-template-columns: 1fr !important;
    }

    .sanavito-home .home-trust {
        padding: 28px 16px !important;
    }
}

/* Voorkom horizontale scroll op alle schermen */
html, body {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
    max-width: 100vw;
}

img, video, iframe, table {
    max-width: 100%;
    height: auto;
}

.entry-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- 17. SAFARI MOBILE FIX — voorkom text inflation en grid overflow --- */
/* Safari Mobile blaast fonts op via text-size-adjust; dit voorkomt dat */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Fix homepage grids op smalle viewports */
@media (max-width: 420px) {
    .sanavito-home .home-categories > div,
    .sanavito-home .home-trust > div {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .sanavito-home .home-hero h1 {
        font-size: 1.5em !important;
    }

    .sanavito-home .home-hero {
        padding: 30px 16px !important;
    }

    /* Voorkom dat inline font-sizes de viewport breder maken */
    .sanavito-home * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Category cards: smaller padding on very narrow screens */
    .sanavito-home .home-categories a {
        padding: 16px 14px !important;
    }
}

/* Ensure all containers respect viewport width */
.ast-container,
.site-content,
.ast-full-width-layout .site-content > .ast-container,
#page,
.site {
    max-width: 100vw;
    box-sizing: border-box;
}
