/**
 * Core Web Vitals fixes — load after layout.css
 * See PERFORMANCE-SEO-PLAN.md Phase A
 */

/* A1 — Reserve hero slider height before RoyalSlider JS runs */
.royalSlider.fullSized,
.royalSlider.fullWidth.fullSized,
.fullWidth.royalSlider.fullSized,
#mainSlider.fullSized {
    min-height: calc(100vh - 154px);
    height: calc(100vh - 154px);
    visibility: visible;
    overflow: hidden;
}

@media (max-width: 991px) {
    .royalSlider.fullSized,
    .royalSlider.fullWidth.fullSized,
    .fullWidth.royalSlider.fullSized,
    #mainSlider.fullSized {
        min-height: calc(100vh - 113px);
        height: calc(100vh - 113px);
    }
}

/* Non-fullscreen sliders: fixed aspect ratio instead of autoHeight */
.royalSlider:not(.fullSized):not(.fullWidth) {
    min-height: 400px;
    aspect-ratio: 960 / 600;
    max-width: 100%;
}

/* A8 — Stop header collapse from shifting page content */
.fixed #preHeader {
    margin-top: 0;
    height: 0;
    min-height: 0;
    line-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* A9 — Parallax widget reserved height */
#parallaxHome.stellar,
.stellar#parallaxHome {
    min-height: 320px;
}

@media (min-width: 992px) {
    #parallaxHome.stellar,
    .stellar#parallaxHome {
        min-height: 420px;
    }
}

/* A10 — Dynamic widget placeholders */
#cookies-notice {
    min-height: 48px;
}

.simple-weather {
    min-height: 1.5em;
    display: inline-block;
}

/* A12 — Video embeds */
.videoWrapper {
    aspect-ratio: 16 / 9;
    width: 100%;
}

/* Loader — hide without layout shift once page is ready */
#toTop.is-visible {
    bottom: 30px;
}

body.loaded #loader-wrapper {
    display: none !important;
}

#loader-wrapper {
    pointer-events: none;
}

/* A7 — Font fallback while webfonts load */
body {
    font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3, .h1, .h2, .h3, .widget-title {
    font-family: "Montserrat", "Open Sans", system-ui, sans-serif;
}

/* A5 — Reinforce img-container dimensions for CLS */
.img-container.sm img {
    width: 90px;
    height: 90px;
}

.img-container.md img {
    width: 100%;
    height: 245px;
}
