/* =====================================================
   Base Layout
===================================================== */

html, body {
    height: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, system-ui, BlinkMacSystemFont, Ubuntu;
    max-width: 100%;
    overflow-x: auto;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.content-area {
    position: relative;
    z-index: 1;
    padding-top: var(--header-height);
    padding-bottom: 30px;
    margin: 0;
    min-height: calc(100vh - var(--header-height));
}


/* =====================================================
   Header Height
===================================================== */

:root {
    /* Default: Main nav only */
    --header-height: 110px;
}

@media (min-width: 900px) {
    .page-home {
        /* Home: Main nav (110px) + topbar (50px) */
        --header-height: 160px;
    }
}

/* No topbar, only the main nav height (specified in navbar.css) */
@media (max-width: 899px) {
    :root {
        --header-height: 75px;
    }
}


/* =====================================================
   Header Banners
===================================================== */

.page-header-banner {
    position: relative;
    width: 100%;
    height: 130px;
    overflow: hidden;

    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.page-header-banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    z-index: 1;
}

.page-header-banner-content {
    position: relative;
    z-index: 2;
    height: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    padding: 0 30px;
    box-sizing: border-box;
}

.page-header-banner-content h1 {
    margin: 0 0 6px 0;
    font-size: 40px;
    font-weight: 750;
    line-height: 1.1;
    color: #fdfdfd;
    letter-spacing: 0.5px;
}

.page-header-banner-content p {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    color: #fdfdfd;
    text-align: center;
    max-width: 750px;
}


/* =====================================================
   Primary Button
===================================================== */

.btn-primary {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 999px;
    background: #c6212e;
    color: #ffffff;
    font-weight: 650;
    min-width: 160px;
    text-decoration: none;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-align: center;
}

.btn-primary:hover {
    background: #a51b25;
}


/* =====================================================
   Scroll To Top Button
===================================================== */

.scroll-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;

    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #6b7280;
    cursor: pointer;

    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);

    transition:
            opacity 0.25s ease,
            visibility 0.25s ease,
            transform 0.2s ease,
            background 0.2s ease;
}

/* Arrow/icon image size adjust */
.scroll-to-top img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

/* Visible State */
.scroll-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}


/* =====================================================
   Mobile Adjustments
===================================================== */

@media (max-width: 899px) {
    /* Banner adjustments */
    .page-header-banner {
        height: 130px;
        background-position: center center;
    }

    .page-header-banner-content {
        padding: 0 20px;
    }

    .page-header-banner-content h1 {
        font-size: 32px;
        margin-bottom: 4px;
    }

    .page-header-banner-content p {
        font-size: 16px;
        line-height: 1.35;
        max-width: 420px;
    }

    /* Top button sizing overrides */
    .scroll-to-top {
        right: 16px;
        bottom: 16px;
        width: 46px;
        height: 46px;
    }

    .scroll-to-top img {
        width: 18px;
        height: 18px;
    }
}

/* Only apply hover effects on desktop (when hover is supported) */
@media (hover: hover) and (pointer: fine) {
    .scroll-to-top:hover {
        background: #a51b25;
    }

    .scroll-to-top.is-visible:hover {
        transform: translateY(-2px);
    }
}
