/* ========================================
   GLOBAL RESETS & BASE STYLES
   ======================================== */

* {
    box-sizing: border-box;
    scroll-behavior: smooth !important;
}

html {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    background: #f7f7f4;
}

/* ========================================
   BUDDYPRESS & THEME OVERRIDES
   ======================================== */

#page,
#content,
.site,
.site-content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
}

#content .bb-grid.site-content-grid,
#content .container,
.bb-grid {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* ========================================
   PAGE HEADER
   ======================================== */

/* ========================================
   TABLE OF CONTENTS
   ======================================== */

.table-of-contents-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
    padding: 5rem 0;
    margin-bottom: 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 25;
}

.toc-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
}

.toc-subtitle {
    font-size: 1.2rem;
    color: #4a5568;
}

.toc-state-link {
    transition: transform 0.3s ease;
}

.toc-state-link:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.toc-state-card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.toc-state-card:hover {
    box-shadow: 0 4px 20px rgba(0, 117, 74, 0.2);
    border: 2px solid #00754a83 !important;
}

.toc-state-card.active {
    border-color: #00754a;
    background: linear-gradient(135deg, #f0fff4 0%, #f7fafc 100%);
}

.toc-state-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
}

.toc-state-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.toc-state-card:hover .toc-state-icon {
    transform: scale(1.1);
}

/* ========================================
   STATE DESCRIPTION SECTIONS
   ======================================== */

.description-section {
    min-height: 150vh;
    position: relative;
    z-index: 20;
    background-color: #f7f7f4;
}

.stateDescription {
    position: sticky !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    max-width: 700px;
    padding: 4rem 2rem;
    margin: 0 auto;
    z-index: 25;
    left: 0;
    right: 0;
}

.stateDescription h2 {
    font-size: 3.5rem;
    text-align: left;
    color: #2d3748;
    border-bottom: 3px solid #00754a;
    padding-bottom: 1rem;
}

.stateDescription p {
    color: #4a5568;
}

.stateDescription a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.stateDescription .row {
    margin-bottom: 2rem;
}

.stateDescription table {
    background: rgba(248, 250, 252, 0.95);
}

.stateDescription table td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 1.1rem;
}

.stateDescription table td:first-child {
    font-weight: 700;
    color: #2d3748;
    width: 35%;
}

.stateDescription table td:last-child {
    color: #4a5568;
}

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

.state-outline-image {
    background-color: white;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
}

/* ========================================
   FLYOVER SECTIONS
   ======================================== */

.flyovers-bg-section {
    min-height: 250vh;
    position: relative;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    z-index: 30;
}

.section-content {
    position: relative;
    z-index: 10;
    padding: 20vh 0;
}

.flyoversContainer {
    position: relative;
    z-index: 10;
}

/* ========================================
   FLYOVER CARDS
   ======================================== */

.card {
    max-width: 700px;
    border: 2px solid #333;
    margin: 80vh auto;
    box-sizing: border-box;
    position: relative;
    z-index: 15;
}

.flyoversContainer .card:first-child {
    margin-top: 50vh;
}

.flyoversContainer .card:last-child {
    margin-bottom: 100vh;
}

.card h2,
.card h3 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

.card img:first-of-type {
    height: 350px;
    object-fit: cover;
}

.card iframe {
    height: auto;
    aspect-ratio: 16/9;
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */

.back-to-top-btn {
    bottom: 2rem;
    right: 2rem;
    background: rgba(0, 117, 74, 0.9);
    border-radius: 50px;
    padding: 16px 20px;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999999;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    isolation: isolate;
    transform: translateZ(0);
    will-change: transform;
}

.back-to-top-btn:hover {
    background: rgba(0, 117, 74, 1);
    transform: translateY(-2px);
}

.back-to-top-btn svg {
    transition: transform 0.3s ease;
}

.back-to-top-btn:hover svg {
    transform: translateY(-2px);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@supports not (scroll-snap-type: y proximity) {
    .description-section {
        min-height: 200vh;
    }
}

@media (max-width: 991px) {
    .back-to-top-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        padding: 10px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .description-section {
        min-height: 200vh;
    }

    .flyovers-bg-section {
        min-height: 200vh;
    }

    .stateDescription h2 {
        font-size: 2.8rem;
    }

    .card {
        margin: 60vh auto;
    }

    .flyoversContainer .card:first-child {
        margin-top: 40vh;
    }

    .flyoversContainer .card:last-child {
        margin-bottom: 80vh;
    }

    .table-of-contents-wrapper {
        padding: 3rem 0;
    }

    .toc-title {
        font-size: 2rem;
    }

    .toc-state-card {
        padding: 1rem;
    }

    .toc-state-name {
        font-size: 0.9rem;
    }

    .back-to-top-btn {
        bottom: 1rem;
        right: 1rem;
        padding: 8px 12px;
    }
}
