/* ============================================================
   Costapedia v0.3.6 — Mobile Polish
   
   Auto-loaded via helpers_patch.php render_seo_head() — no manual
   header.php edit needed.
   ============================================================ */

/* Voorkom horizontale scroll altijd */
html, body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* ============================================================
   Mobile: < 760px
   ============================================================ */
@media (max-width: 759px) {

    main,
    .container,
    [class*="content"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .hero-title,
    h1 {
        font-size: 32px !important;
        line-height: 1.15 !important;
        letter-spacing: -0.02em !important;
    }

    .hero-subtitle {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }

    h2 {
        font-size: 26px !important;
        line-height: 1.2 !important;
    }

    h3 {
        font-size: 19px !important;
        line-height: 1.3 !important;
        margin-top: 24px !important;
    }

    article,
    .markdown-body,
    [class*="body"] p {
        font-size: 16px !important;
        line-height: 1.65 !important;
    }

    article ul,
    article ol {
        padding-left: 22px !important;
    }

    article li {
        margin-bottom: 6px !important;
        line-height: 1.55 !important;
    }

    article code {
        font-size: 13px !important;
        word-break: break-word;
    }

    article pre {
        font-size: 12px !important;
        overflow-x: auto;
        padding: 12px !important;
    }

    /* Tables: scrollable on mobile */
    article table,
    .content table,
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 13px;
        margin: 16px -16px;
        padding: 0 16px;
        max-width: calc(100vw - 0px);
        -webkit-overflow-scrolling: touch;
    }

    article table thead,
    article table tbody {
        white-space: normal;
    }

    /* Cards/grids: stack altijd */
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns:repeat(4"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .hero-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .hero-actions .btn,
    .hero-actions a {
        width: 100%;
        text-align: center;
        padding: 14px 20px !important;
    }

    section {
        margin-top: 40px !important;
    }

    .btn,
    button,
    [class*="btn-"] {
        min-height: 44px;
        font-size: 15px !important;
    }

    /* Tool widget mobile */
    .tool-widget-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .tool-form {
        position: relative !important;
        top: auto !important;
    }

    .tool-summary-big {
        font-size: 32px !important;
    }

    .tool-highlights {
        grid-template-columns: 1fr 1fr !important;
    }

    .breadcrumbs {
        padding: 12px 16px 0 !important;
        font-size: 12px !important;
    }

    .breadcrumbs ol {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    article a,
    article code {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    footer {
        padding: 24px 16px !important;
        font-size: 13px !important;
    }

    footer [style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Form inputs: 16px voorkomt iOS zoom */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px !important;
    }

    .tool-result-hero .tool-summary-big {
        font-size: 36px !important;
    }

    article h2,
    article h3,
    article h4 {
        margin-top: 24px !important;
        margin-bottom: 10px !important;
    }

    article p {
        margin-bottom: 14px !important;
    }
}

/* ============================================================
   Tablet: 760-1023px
   ============================================================ */
@media (min-width: 760px) and (max-width: 1023px) {
    h1 { font-size: 38px !important; }
    h2 { font-size: 30px !important; }
    
    [style*="grid-template-columns:repeat(4"],
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================================
   Accessibility (alle breakpoints)
   ============================================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary, #E54B4B);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .admin-sidebar,
    nav,
    footer,
    .tool-form,
    .tool-share,
    .hero-actions,
    button {
        display: none !important;
    }

    body {
        font-size: 11pt;
        line-height: 1.4;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    article {
        max-width: 100% !important;
    }
}

/* === v2.5.4 Mobile header fix — breakpoint sync met header.php v2.5.x === */
@media (max-width: 900px) {
    .mobile-action, #mobile-menu-btn {
        display: flex !important;
        align-items: center; justify-content: center;
        width: 40px; height: 40px;
        background: var(--primary, #E54B4B);
        border: none;
        border-radius: 9999px;
        font-size: 18px; line-height: 1;
        color: white;
        cursor: pointer; padding: 0;
    }
    .header-profile { display: none !important; }
    .header-nav, .header-link { display: none !important; }
    .header-actions { display: flex !important; margin-left: auto; gap: 8px !important; }
}
@media (min-width: 901px) {
    .mobile-action, #mobile-menu-btn { display: none !important; }
}
