/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

.header__logo img {
    height: 50px;
    width: auto;
}

.nav {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.nav__link {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text);
    text-transform: uppercase;
}

.nav__link:hover,
.nav__link.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* Hero Section */
.hero {
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    position: relative;
    color: var(--color-white);
    text-align: center;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero__title {
    font-size: 4rem;
    margin-bottom: var(--space-sm);
}

.hero__subtitle {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

/* Feature Cards */
.card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card__image {
    height: 250px;
    overflow: hidden;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card:hover .card__image img {
    transform: scale(1.1);
}

.card__content {
    padding: var(--space-md);
}

.card__title {
    margin-bottom: var(--space-xs);
    color: var(--color-primary);
}

/* Footer */
.footer {
    background-color: var(--color-text);
    color: var(--color-white);
    padding: var(--space-lg) 0 var(--space-md);
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer__title {
    margin-bottom: var(--space-md);
    font-size: 1.2rem;
}

.footer__links li {
    margin-bottom: var(--space-xs);
}

.footer__links a {
    opacity: 0.8;
}

.footer__links a:hover {
    opacity: 1;
    color: var(--color-primary);
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-md);
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}


/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: var(--transition);
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger Animation when Active */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu__nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
    padding: var(--space-lg);
}

.mobile-menu__link {
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.mobile-menu.active .mobile-menu__link {
    animation: slideInUp 0.4s ease forwards;
}

.mobile-menu__link:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu__link:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu__link:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu__link:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu__link:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu__link:nth-child(6) { animation-delay: 0.35s; }

.mobile-menu__link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
}

.mobile-menu__link--cta {
    background-color: var(--color-white);
    color: var(--color-primary);
    margin-top: var(--space-sm);
}

.mobile-menu__link--cta:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

@media (max-width: 992px) {
    .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    /* Hide desktop nav, show mobile toggle */
    .nav { display: none; }
    .mobile-menu-toggle { display: flex; }
    
    /* Adjust header for mobile */
    .header__inner {
        width: 100%;
    }
    
    .hero__title { font-size: 2.5rem; }
}

@media (max-width: 576px) {
    .footer__grid { grid-template-columns: 1fr; }
    
    .mobile-menu__link {
        font-size: 1.2rem;
    }
}


/* Global Components */
.footer-logo {
    height: 60px;
    width: auto;
    margin-bottom: var(--space-sm);
}

.footer-info-details {
    font-size: 0.8rem;
    opacity: 0.8;
    display: block;
    margin-top: 0.5rem;
}

.hero--small {
    height: 40vh !important;
    min-height: 0 !important;
}

.hero--half {
    height: 50vh !important;
    min-height: 0 !important;
}


.card-image--auto {
    height: auto !important;
    border-radius: var(--radius-lg);
}

.small-gray-text {
    font-size: 0.9rem;
    color: #718096;
}

.error-details-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fff5f5;
    border-radius: 6px;
    border: 1px solid #feb2b2;
}

.error-details-text {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.btn--gray {
    background-color: #4a5568 !important;
    color: white !important;
}

.btn--gray:hover {
    background-color: #2d3748 !important;
}


.gallery-4-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 768px) {
    .gallery-4-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gallery-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

/* Accessibility: Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 10px;
}



/* 
   GALLERY & LAYOUT ROBUSTNESS FIX 
   - Enforces 4-col desktop / 2-col mobile grid
   - Prevents layout overlaps using flow-root
*/

.gallery-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 4rem; /* Safe spacing */
    width: 100%;
}

.gallery-container img,
.gallery-container picture img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
}

/* 
   CRITICAL: flow-root creates a strict Block Formatting Context.
   This forces the section to expand to contain ALL children,
   preventing any content from spilling out or overlapping.
*/
.section {
    display: flow-root; 
    position: relative;
    width: 100%;
}

.gallery-container > *:hover img,
.gallery-container > img:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem; /* Slightly larger gap for clarity */
        margin-bottom: 3rem;
    }
    
    .gallery-container img,
    .gallery-container picture img {
        height: 150px;
    }
    
    /* Ensure sections have clear boundaries on mobile */
    .section {
        padding-bottom: 3rem;
        border-bottom: 1px solid transparent; /* Force containment */
    }

    /* 
       FIX ORDER INCONSISTENCY 
       Force Image (which is usually first in HTML) to stay first.
       Disable desktop reordering classes.
    */
    .card__order-first,
    .card__order-last {
        order: unset !important;
    }
    
    /* Extra safety: if using flex/grid, prevent reordering */
    .grid > div {
        order: unset !important;
    }
}

