/**
 * Site audit layer — final fixes for layout, responsive, a11y, forms.
 * Loads after site-clean.css.
 */

/* ── Prevent horizontal scroll ── */
html {
    overflow-x: clip;
    scroll-behavior: smooth;
}

body {
    overflow-x: clip;
    min-width: 320px;
}

.site-premium main,
.vk-home,
.page-inner {
    overflow-x: clip;
}

/* ── Skip link ── */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: 0.75rem 1.25rem;
    background: #0a2803;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    left: 0;
    outline: 3px solid #eddd5e;
    outline-offset: 2px;
}

/* ── Focus visibility ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(91, 140, 81, 0.55);
    outline-offset: 2px;
}

/* ── Media ── */
img,
video,
svg,
iframe {
    max-width: 100%;
}

img {
    height: auto;
}

img[width][height] {
    aspect-ratio: attr(width) / attr(height);
}

/* ── Unified container ── */
.container {
    width: min(1200px, 92vw);
    margin-inline: auto;
}

/* ── Form validation ── */
.field-error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #b42318;
}

.contact-input.is-invalid,
.vf-field input.is-invalid,
.vf-field textarea.is-invalid {
    border-color: #b42318 !important;
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.contact-alert {
    margin-bottom: 1rem;
}

/* ── Buttons — touch-friendly ── */
.btn,
.vk-hero__btn,
.vk-cta-band__btn,
.nav__toggle,
.hero__arrow,
.vk-carousel__arrow {
    min-height: 44px;
}

/* ── Sticky header spacing ── */
.site-header-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ── Mobile nav drawer ── */
@media (max-width: 960px) {
    body.is-nav-open {
        overflow: hidden;
    }

    .nav-drawer-scroll {
        max-height: calc(100dvh - 4rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .vk-social-float {
        bottom: max(0.75rem, env(safe-area-inset-bottom));
        right: max(0.5rem, env(safe-area-inset-right));
    }

    .vk-social-float__icon {
        width: 44px;
        height: 44px;
    }

    .vk-premium-certs__grid {
        gap: 1.5rem;
    }

    .vk-premium-certs__cards {
        grid-template-columns: 1fr 1fr;
    }

    .contact-layout {
        gap: 1.5rem;
    }

    .contact-newsletter__form {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .vk-premium-certs__cards {
        grid-template-columns: 1fr;
    }

    .form-grid--2 {
        grid-template-columns: 1fr !important;
    }
}

/* ── Tablet ── */
@media (min-width: 768px) and (max-width: 1023px) {
    .vk-trust__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Wide screens ── */
@media (min-width: 1440px) {
    .container {
        width: min(1240px, 90vw);
    }
}

@media (min-width: 1920px) {
    .container {
        width: min(1280px, 88vw);
    }
}

/* ── Tables / wide content ── */
.product-detail__table-wrap,
.page-content table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Map embed ── */
.contact-map iframe,
.site-footer iframe {
    display: block;
    width: 100%;
    min-height: 220px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── High contrast text on photo sections ── */
.vk-harvest__quote p,
.hero .pill,
.vk-cta-band__title,
.vk-premium-certs__title,
.vk-premium-cert__name {
    text-wrap: balance;
}
