/* ============================================================================
   PUBLIC SITE LAYOUT
   Core layout styles for public-facing pages
   ============================================================================ */

/* ============================================================================
   1. PAGE LAYOUT
   ============================================================================ */

/* Standard page padding below navbar */
.page-standard {
    padding-top: calc(var(--kai-navbar-height, 72px) + 2rem);
}

/* Pages with hero sections (no top padding) */
.page-with-hero,
.homepage-body {
    padding-top: 0;
}

/* Remove top padding when main contains hero section */
.page-with-hero main:has(.hero-section),
.homepage-body main:has(.hero-section) {
    padding-top: 0;
}

/* Alternative for browsers that don't support :has() */
main .hero-section:first-child {
    margin-top: 0;
}

/* ============================================================================
   2. CONTAINER STYLES
   ============================================================================ */

/* Ensure all containers respect viewport width */
.container,
.container-fluid,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
    max-width: 100%;
    overflow-x: hidden;
}

/* ============================================================================
   3. SECTION STYLES
   ============================================================================ */

section {
    overflow: visible !important;
}

/* Standard section spacing */
.section-padding {
    padding: 4rem 0;
}

.section-padding-sm {
    padding: 2rem 0;
}

.section-padding-lg {
    padding: 6rem 0;
}

/* ============================================================================
   4. FOOTER STYLES
   ============================================================================ */

.footer-gradient {
    background: linear-gradient(135deg, #1a365d 0%, #38b2ac 100%);
    color: white;
}

.footer-gradient * {
    color: white !important;
}

.footer-logo {
    max-width: 240px;
    width: 100%;
    height: auto;
    max-height: 60px;
    display: block;
}

.newsletter-input {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ============================================================================
   5. TEXT COLOR OVERRIDES FOR DARK BACKGROUNDS
   ============================================================================ */

.hero-section,
.hero-section *,
.navbar-dark,
.navbar-dark *,
.footer-gradient,
.footer-gradient *,
.bg-primary,
.bg-primary *,
.bg-dark,
.bg-dark *,
[class*="gradient"]:not(.text-gradient-primary):not(.text-gradient-secondary),
[class*="gradient"] * {
    color: white !important;
}

.hero-section .text-muted,
.navbar-dark .text-muted,
.footer-gradient .text-muted,
.bg-primary .text-muted,
.bg-dark .text-muted,
[class*="gradient"] .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ============================================================================
   6. LINK STYLES
   ============================================================================ */

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: none;
}

/* Links on dark backgrounds */
.hero-section a,
.navbar-dark a,
.footer-gradient a,
.bg-primary a,
.bg-dark a,
[class*="gradient"] a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.hero-section a:hover,
.navbar-dark a:hover,
.footer-gradient a:hover,
.bg-primary a:hover,
.bg-dark a:hover,
[class*="gradient"] a:hover {
    color: white !important;
}

/* ============================================================================
   7. RESPONSIVE LAYOUT
   ============================================================================ */

@media (max-width: 991.98px) {
    .page-standard {
        padding-top: calc(var(--kai-navbar-height, 72px) + 1.5rem);
    }
    
    .section-padding {
        padding: 3rem 0;
    }
    
    .section-padding-lg {
        padding: 4rem 0;
    }
}

@media (max-width: 767.98px) {
    .section-padding {
        padding: 2rem 0;
    }
    
    .section-padding-sm {
        padding: 1.5rem 0;
    }
    
    .section-padding-lg {
        padding: 3rem 0;
    }
}

@media (max-width: 575.98px) {
    .page-standard {
        padding-top: calc(var(--kai-navbar-height, 72px) + 1rem);
    }
    
    .footer-logo {
        max-width: 180px;
        max-height: 45px;
    }
}
