/* Final responsive layer for public pages. Keep layout widths fluid and
   prevent legacy components from forcing horizontal scroll. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body,
main,
section,
article,
aside,
header,
footer,
.main-content {
    min-width: 0;
}

img,
svg,
video,
iframe,
canvas {
    max-width: 100%;
}

img,
video {
    height: auto;
}

.container {
    width: min(100% - 2rem, 1200px);
    max-width: 1200px;
    padding-inline: 0;
}

.header .container,
.footer > .container {
    width: min(100% - 2rem, 1200px);
}

.header-content {
    width: 100%;
    min-width: 0;
    gap: 1rem;
}

/* The landing page has its own content typography. Keep the shared header
   typography identical to every other public page. */
.landing-page .header {
    font-family: var(--font-family, "Open Sans", sans-serif);
}

.logo,
.logo a,
.logo-text,
.main-nav,
.header-actions,
.mobile-actions {
    min-width: 0;
}

.logo-image,
.footer-logo {
    max-width: 100% !important;
}

.main-nav {
    overflow: visible;
}

.nav-list {
    min-width: 0;
}

.nav-link {
    overflow-wrap: anywhere;
}

.main-content > .container,
.main-content > .container-fluid {
    min-width: 0;
}

/* The footer keeps a solid, high-contrast surface even when a page-level
   theme injects a legacy gradient. */
.footer {
    background: #170b09 !important;
    color: #fff;
}

.footer-content,
.footer-bottom-content {
    min-width: 0;
}

.footer-section,
.footer-section p,
.footer-links,
.footer-links li,
.footer-bottom-content p {
    overflow-wrap: anywhere;
}

/* Missing media should be explicit and calm, never a decorative gradient. */
.location-image-placeholder,
.hx-related-img-placeholder,
.photo-gallery-empty {
    background: #eef2f5 !important;
    color: #7b858e !important;
}

/* Home hero */
.landing-page .hero-banner {
    min-height: clamp(520px, 68vh, 720px);
    width: 100%;
}

.landing-page .hero-banner .container {
    display: flex;
    align-items: center;
    width: min(100% - 2rem, 1200px);
    min-width: 0;
}

.landing-page .hero-content {
    width: min(100%, 760px);
    max-width: 760px;
    min-width: 0;
    margin-inline: auto;
    padding-inline: 0;
}

.landing-page .hero-content h1,
.landing-page .hero-content p {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.landing-page .hero-content h1 {
    text-wrap: balance;
}

.landing-page .hero-search {
    width: min(100%, 620px);
    max-width: 100%;
    margin-inline: auto;
}

.landing-page .search-form {
    width: 100%;
    min-width: 0;
}

.landing-page .search-input {
    min-width: 0;
    width: 100%;
}

.landing-page .hero-cta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-page .hx-section-header,
.landing-page .hx-section-header .section-subtitle {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.landing-page .hx-regions-grid,
.landing-page .hx-directory-grid,
.landing-page .hx-featured-grid,
.landing-page .hx-categories-grid {
    min-width: 0;
}

.landing-page .hx-region-card,
.landing-page .hx-dir-card,
.landing-page .hx-featured-card {
    min-width: 0;
}

@media (max-width: 1024px) {
    .container,
    .header .container,
    .footer > .container,
    .landing-page .hero-banner .container {
        width: min(100% - 2rem, 960px);
    }

    .header-content {
        gap: .75rem;
    }

    .main-nav {
        margin-inline: .25rem;
    }

    .nav-list {
        gap: .15rem;
    }

    .nav-link {
        font-size: .9rem;
        padding-inline: .3rem;
    }

    .landing-page .hero-content {
        max-width: 680px;
    }
}

@media (max-width: 900px) {
    .header .main-nav,
    .header .header-actions {
        display: none !important;
    }

    .header .mobile-actions {
        display: flex !important;
        align-items: center;
        margin-left: auto;
    }

    .header .mobile-menu-toggle {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 767.98px) {
    .container,
    .header .container,
    .footer > .container,
    .landing-page .hero-banner .container {
        width: min(100% - 1.25rem, 640px);
    }

    .header-content {
        padding-block: .55rem;
    }

    .logo {
        max-width: calc(100% - 52px);
    }

    .logo-image {
        max-width: 150px !important;
        max-height: 48px !important;
        object-fit: contain;
    }

    .landing-page .hero-banner {
        min-height: 570px;
        padding-block: 3.5rem;
    }

    .landing-page .hero-content {
        padding: 0;
    }

    .landing-page .hero-content h1 {
        font-size: 2.25rem;
        line-height: 1.14;
        margin-inline: auto;
    }

    .landing-page .hero-content p {
        font-size: 1rem;
        line-height: 1.55;
        margin-inline: auto;
    }

    .landing-page .hero-search {
        padding: .45rem;
        border-radius: 10px;
    }

    .landing-page .hero-search .search-form {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: .45rem;
    }

    .landing-page .hero-search .search-input {
        min-height: 48px;
        padding-inline: 1rem;
        border-radius: 8px;
    }

    .landing-page .hero-search .search-btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        border-radius: 8px;
    }

    .landing-page .hero-cta .btn {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .category-page .results-header {
        display: block;
    }

    .category-page .results-title {
        margin-bottom: .55rem;
    }

    .category-page .results-count {
        display: block;
    }

    .landing-page .hx-regions-section,
    .landing-page .hx-directory-section,
    .landing-page .hx-featured-section,
    .landing-page .stats-section,
    .landing-page .testimonials-section {
        padding-block: 3rem;
    }

    .landing-page .hx-section-header {
        margin-bottom: 1.75rem;
    }

    .landing-page .hx-section-header .section-title {
        font-size: clamp(1.6rem, 7vw, 2.1rem);
        line-height: 1.2;
    }

    .landing-page .hx-section-header .section-subtitle {
        font-size: .98rem;
        line-height: 1.55;
    }

    .landing-page .hx-regions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .landing-page .hx-region-card {
        height: 230px;
    }

    .landing-page .hx-directory-grid,
    .landing-page .hx-featured-grid,
    .landing-page .hx-categories-grid {
        grid-template-columns: 1fr;
    }

    .footer {
        padding-top: 2.75rem;
    }

    .footer > .container {
        width: min(100% - 1.5rem, 540px);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-section:first-child {
        grid-column: auto;
    }

    .footer-section:first-child,
    .footer-section:not(:first-child) {
        text-align: center;
    }

    .footer-section h3::after,
    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-logo,
    .footer-section:first-child p {
        margin-inline: auto;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom-content p {
        font-size: .82rem;
    }
}

@media (max-width: 420px) {
    .landing-page .hero-banner {
        min-height: 590px;
    }

    .landing-page .hero-content h1 {
        font-size: 2rem;
    }

    .landing-page .hx-region-content {
        padding: 1.15rem 1rem;
    }
}
