/* Shared page chrome: header, navigation, hero, listings, footer, and slideshow. */
/* --- Sticky Header & Responsive Navigation --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
        ". logo ."
        "nav nav nav";
    align-items: center;
    padding: 16px 24px 14px;
    background: #ffffff;
    border-bottom: 2px solid #23346d;
    box-shadow: 0 2px 12px rgba(21, 32, 68, 0.06);
    transition: padding 180ms ease, box-shadow 180ms ease;
}

.logo-container {
    grid-area: logo;
    justify-self: center;
}

.logo-container a {
    display: flex;
}

.logo-container img {
    display: block;
    height: 112px;
    margin-bottom: 12px;
    transition: height 180ms ease, margin 180ms ease;
}

.nav-container {
    grid-area: nav;
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
}

.menu-link,
.dropbtn {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    color: #333333;
    background: none;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}

.menu-link:hover,
.menu-link:focus-visible,
.dropbtn:hover,
.dropbtn:focus-visible {
    background-color: #23346d;
    color: #ffffff;
    outline: none;
}

/* Client Access submenu in the full desktop navigation. */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    min-width: 270px;
    overflow: hidden;
    background-color: #ffffff;
    border: 1px solid #e0dcd3;
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(21, 32, 68, 0.16);
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    color: #333333;
    text-decoration: none;
}

/* Audience labels separate prospective information from secure portals. */
.dropdown-section-label {
    display: block;
    padding: 10px 16px 6px;
    color: #23346d;
    background: #F8F6F0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dropdown-section-label:not(:first-child) {
    margin-top: 4px;
    border-top: 1px solid #e0dcd3;
}

.dropdown-content a:hover,
.dropdown-content a:focus-visible {
    background-color: #23346d;
    color: #ffffff;
    outline: none;
}

.site-header:not(.is-compact) .dropdown:hover .dropdown-content,
.site-header:not(.is-compact) .dropdown:focus-within .dropdown-content {
    display: block;
}

/* Hamburger is hidden in the full desktop header. */
.nav-toggle {
    grid-area: toggle;
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #23346d;
    border: 0;
    border-radius: 7px;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    background: #152044;
    outline: 3px solid rgba(35, 52, 109, 0.22);
    outline-offset: 2px;
}

.nav-toggle-line {
    display: block;
    width: 22px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 180ms ease, opacity 180ms ease;
}

.site-header.nav-open .nav-toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header.nav-open .nav-toggle-line:nth-child(2) {
    opacity: 0;
}

.site-header.nav-open .nav-toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Once scrolling begins, shrink the logo and replace tabs with a menu. */
.site-header.is-compact {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo . toggle";
    min-height: 64px;
    padding: 4px 20px;
    box-shadow: 0 8px 24px rgba(21, 32, 68, 0.16);
}

.site-header.is-compact .logo-container {
    justify-self: start;
}

.site-header.is-compact .logo-container img {
    height: 112px;
    margin: 0;
}

.site-header.is-compact .nav-toggle {
    display: flex;
}

/* Shared dropdown-panel treatment for compact desktop and mobile. */
.site-header.is-compact .nav-container {
    position: absolute;
    top: calc(100% + 8px);
    right: 20px;
    display: flex;
    width: min(320px, calc(100vw - 32px));
    padding: 10px;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #d9ddeb;
    border-radius: 10px;
    box-shadow: 0 16px 38px rgba(21, 32, 68, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
}

.site-header.is-compact.nav-open .nav-container {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.site-header.is-compact .menu-link,
.site-header.is-compact .dropbtn {
    width: 100%;
    justify-content: flex-start;
    padding: 13px 14px;
    text-align: left;
}

.site-header.is-compact .dropdown {
    width: 100%;
}

.site-header.is-compact .dropdown-content {
    position: static;
    display: none;
    min-width: 0;
    margin: 2px 0 6px;
    background: #F8F6F0;
    border-radius: 6px;
    box-shadow: none;
}

.site-header.is-compact .dropdown.submenu-open .dropdown-content {
    display: block;
}

/* Phones and small tablets use the compact menu even before scrolling. */
@media (max-width: 768px) {
    .site-header {
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "logo . toggle";
        min-height: 64px;
        padding: 7px 16px;
        box-shadow: 0 6px 20px rgba(21, 32, 68, 0.14);
    }

    .site-header .logo-container {
        justify-self: start;
    }

    .site-header .logo-container img {
        height: 52px;
        margin: 0;
    }

    .site-header .nav-toggle {
        display: flex;
    }

    .site-header .nav-container {
        position: absolute;
        top: calc(100% + 8px);
        right: 16px;
        display: flex;
        width: min(320px, calc(100vw - 32px));
        padding: 10px;
        flex-direction: column;
        gap: 4px;
        align-items: stretch;
        background: #ffffff;
        border: 1px solid #d9ddeb;
        border-radius: 10px;
        box-shadow: 0 16px 38px rgba(21, 32, 68, 0.22);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
    }

    .site-header.nav-open .nav-container {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .site-header .menu-link,
    .site-header .dropbtn {
        width: 100%;
        justify-content: flex-start;
        padding: 13px 14px;
        text-align: left;
    }

    .site-header .dropdown {
        width: 100%;
    }

    .site-header .dropdown-content,
    .site-header .dropdown:hover .dropdown-content,
    .site-header .dropdown:focus-within .dropdown-content {
        position: static;
        display: none;
        min-width: 0;
        margin: 2px 0 6px;
        background: #F8F6F0;
        border-radius: 6px;
        box-shadow: none;
    }

    .site-header .dropdown.submenu-open .dropdown-content {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .logo-container img,
    .nav-container,
    .nav-toggle-line {
        transition: none;
    }
}

/* --- Hero Section --- */
.hero {
    color: #fff;
    height: 60vh;
    background: url('dillon-kydd-pvdx8c6Y5BY-unsplash.png') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* --- Content & MLS Listings --- */
.content-area {
    padding: 40px 20px;
    min-height: 60vh;
    text-align: center;
}

.listing-section {
    padding: 40px 20px;
    text-align: center;
}

.mls-container {
    max-width: 1200px;
    margin: 30px auto;
    background: #fff;
    border: 3px solid #23346d;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.mls-iframe {
    width: 100%;
    height: 800px;
    border: none;
    display: block;
}


/* --- Footer --- */
footer {
    padding: 40px;
    background: #F8F6F0;
    color: #333333;
    text-align: center;
    border-top: 2px solid #23346d;
}

/* --- Houston Slideshow Styles --- */
.slideshow-section {
    width: 100%;
    margin: 0;
    /* Removed top/bottom margin to sit flush with the header */
    padding: 0;
    /* Removed side padding for full width */
    position: relative;
    box-sizing: border-box;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 30vh;
    overflow: hidden;
    /* Removed border, box-shadow, and border-radius for an edge-to-edge hero look */
}

/* Static Overlay Styles */
.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    /* Ensures the text stays above the active slides (z-index: 1) */
    pointer-events: none;
    /* Prevents the text block from interfering with user clicks */
    background: rgba(0, 0, 0, 0.3);
    /* Optional: Adds a slight dark overlay to make white text pop */
}

.carousel-overlay h1 {
    color: #ffffff;
    font-size: 4rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    /* Improves readability over varied photos */
    margin: 0;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 0;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .carousel-container {
        height: 40vh;
        /* Adjusted for better mobile scaling */
    }

    .carousel-overlay h1 {
        font-size: 2.5rem;
        /* Scales text down for smaller screens */
    }
}
