/* Responsive Styles */

/* Large screens */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
        padding: 0 var(--spacing-md);
    }
    
    .hero-title {
        font-size: 6rem;
    }
    
    .team-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet styles */
@media (max-width: 992px) {

    .hero-background {
        width: 100%;
        height: 100%;
        background-size: 200% auto;
        background-position: 15% center;        
    }

    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1002;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Dropdown adjustments */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: var(--color-accent);
        margin-top: var(--spacing-sm);
        margin-left: var(--spacing-md);
    }
    
    /* Sections */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
      
    .team-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    /* Typography */
    :root {
        --spacing-xs: 0.25rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1.5rem;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
        --spacing-xxl: 4rem;
    }
    
    body {
        font-size: 14px;
    }

    
    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
        top: 20px;
        left: 20px;
    }
    
    .hamburger-line {
        width: 18px;
    }
    
    /* Hero */
    .hero-section {
        min-height: 620px;
        height: auto;
        padding: var(--spacing-lg) 0 var(--spacing-xxl);
    }
    
    .hero-layout {
        flex-direction: column;
        min-height: auto;
    }
    
    .hero-background {
        width: 100%;
        height: 100%;
        background-size: 200% auto;
        background-position: 15% center;        
    }

    
    .hero-image-area {
        flex: 0 0 auto;
        min-height: 320px;
        width: 100%;
    }
    
    .hero-content-area {
        flex: 0 0 auto;
        background-color: transparent;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 var(--spacing-md);
        margin-top: -80px;
    }
    
    .hero-content {
        width: clamp(280px, 90%, 420px);
        padding: 32px 26px 36px;
        text-align: center;
        margin: 0 auto;
        border-radius: 20px;
        background-color: rgba(255, 255, 255, 0.95);
        box-shadow: 0 25px 45px rgba(0, 0, 0, 0.15);
    }
    
    .hero-title {
        font-size: 2rem;
        letter-spacing: -1px;
        margin-bottom: var(--spacing-md);
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 18px;
    }
    
    .hero-section .btn {
        margin-top: 12px;
    }
    
    /* Buttons */
    .btn {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: auto;
        max-width: 80%;
        padding: 14px 24px;
        font-size: 11px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        gap: 8px;
    }

    /* Event tabs (mobile): make tabs horizontal, compact and scrollable */
    .event-tabs {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.5rem 0.5rem 0.25rem 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        align-items: center;
        scrollbar-width: thin;
    }

    .event-tabs .tab-button {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 6px 10px;
        font-size: 13px;
        border-radius: 20px;
        border: 1px solid rgba(0,0,0,0.06);
        background: transparent;
        color: inherit;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        min-width: 0;
    }

    .event-tabs .tab-button.active {
        background: var(--color-highlight);
        color: #fff;
        border-color: var(--color-highlight);
    }

    /* Reduce icon size inside tab buttons to save space */
    .event-tabs .tab-button i {
        font-size: 0.9em;
        line-height: 1;
    }

    /* Make embedded Google Maps and iframes responsive and centered on mobile */
    .event-content iframe,
    .details-column iframe,
    .event-content .details-column iframe {
        width: 100% !important;
        max-width: 600px;
        height: auto !important;
        aspect-ratio: 3 / 2;
        display: block;
        margin: 1rem auto;
        border-radius: 8px;
    }

    /* About gallery */

    .gallery-grid[data-items="4"] {
        grid-template-columns: 100px 100px;
        max-width: 300px; /* Reduced from 400px */
    }
    
    .gallery-grid[data-items="6"] {
        grid-template-columns: repeat(2, 1fr);
        max-width: 450px; /* Reduced from 600px */
    }
    
    .gallery-grid[data-items="8"] {
        grid-template-columns: repeat(2, 1fr);
        max-width: 450px; /* Reduced from 600px */
    }

    .gallery-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    max-width: 75% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0;
    gap: 0 !important;
   }

    .gallery-item {
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast);
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 50% !important;  /* Each item takes exactly 50% width */
    width: 50% !important;
    box-sizing: border-box !important;
    border: 0 !important;
    }

    .about-items .about-item:last-child {
        display: flex !important;
        justify-content: center !important;
        align-self: center !important;
        width: 100%;
        padding-top: var(--spacing-lg) !important;
    }
    
    /* Sections */
    section {
        scroll-margin-top: 70px;
    }

    .about-section,
    .team-section,
    .blog-section {
        padding: var(--spacing-xl) 0;
    }
    
    /* Team grid */
    .team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: var(--spacing-md);
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .team-member {
        width: 100%;
    }
    
    .member-photo {
        aspect-ratio: 1 / 1;
        margin-bottom: var(--spacing-sm);
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .post-content {
        padding: var(--spacing-md);
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Navigation */
    .nav-menu {
        width: 100vw;
        right: -100vw;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    /* Hero */
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1.8rem;     /* increase as needed */
        font-weight: 400;    /* optional: make it stronger */
        letter-spacing: 1px; /* optional: elegant spacing */
    }    

    /* Stop absolute overlay behavior */
    .hero-background {
        position: relative;       /* becomes a normal block */
        width: 100%;
        height: 60vh;             /* visible hero height */
        padding: 0;
        margin: 0;

        /* your mobile crop */
        background-size: 200% auto;
        background-position: 15% center;
    }

    /* Reset hero-layout to normal vertical stacking */
    .hero-layout {
        position: relative;
        height: auto;
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* The .hero-image-area becomes *empty*, so give it zero height */
    .hero-image-area {
        display: none;   /* invisible on mobile */
    }

    /* Now hero content comes BELOW the hero image naturally */
    .hero-content-area {
        position: relative; 
        width: 100%;
        height: auto;
        background: none;
        margin: 0;
        padding: 0 0;
    }

    .hero-content {
        max-width: 100%;
        margin: 0(auto);
        padding: 10px;
        background-color: #fff;
        text-align: center;
        box-shadow: none;
        min-width: 0;
        border-radius: 3px;

    } 
    
    /* Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 10px;
        max-width: 90%;
    }
    
    .about-content-right .gallery-grid,
    .gallery-grid.mobile-two-column {
        max-width: 280px;
    }

    /* Team */
    .team-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }
    
    .member-photo {
        margin-bottom: var(--spacing-sm);
    }
    
    .member-name {
        font-size: 12px;
    }
    
    .member-role {
        font-size: 10px;
    }
    
    /* Footer */
    .footer-content {
        gap: var(--spacing-md);
    }
    
    .footer-text {
        font-size: 12px;
        text-align: center;
    }
    
    .footer-label {
        font-size: 10px;
    }
}

/* Force team grid to center members when fewer items are present */
.team-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: var(--spacing-md) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.team-member {
    width: auto !important;
    flex: 0 1 220px !important;
    max-width: 260px !important;
    margin: 0.5rem !important;
}


/* Extra small screens */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1.8rem;     /* increase as needed */
        font-weight: 400;    /* optional: make it stronger */
        letter-spacing: 1px; /* optional: elegant spacing */
    }    

    /* Stop absolute overlay behavior */
    .hero-background {
        position: relative;       /* becomes a normal block */
        width: 100%;
        height: 60vh;             /* visible hero height */
        padding: 0;
        margin: 0;

        /* your mobile crop */
        background-size: 200% auto;
        background-position: 15% center;
    }

    /* Reset hero-layout to normal vertical stacking */
    .hero-layout {
        position: relative;
        height: auto;
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* The .hero-image-area becomes *empty*, so give it zero height */
    .hero-image-area {
        display: none;   /* invisible on mobile */
    }

    /* Now hero content comes BELOW the hero image naturally */
    .hero-content-area {
        position: relative; 
        width: 100%;
        height: auto;
        background: none;
        margin: 0;
        padding: 0 0;
    }

    .hero-content {
        max-width: 100%;
        margin: 0(auto);
        padding: 10px;
        background-color: #fff;
        text-align: center;
        box-shadow: none;
        min-width: 0;
        border-radius: 3px;

    } 
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .service-item {
        padding: var(--spacing-sm);
    }
    
    .post-content {
        padding: var(--spacing-sm);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark mode support (if desired) */
@media (prefers-color-scheme: dark) {
    /* 
    Uncomment and customize if you want automatic dark mode
    :root {
        --color-primary: #ffffff;
        --color-secondary: #1a1a1a;
        --color-accent: #2a2a2a;
        --color-text-primary: #ffffff;
        --color-text-secondary: #cccccc;
        --color-text-light: #999999;
        --color-border: #333333;
        --color-overlay: rgba(255, 255, 255, 0.1);
    }
    */
}

/* Focus styles for accessibility */
@media (prefers-reduced-motion: no-preference) {
    :focus-visible {
        outline: 2px solid var(--color-primary);
        outline-offset: 2px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .nav-toggle,
    .hero-section,
    .scroll-indicator,
    .footer-social {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    section {
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: #000;
    }
    
    .btn {
        border: 1px solid #000;
        color: #000;
        background: transparent;
    }
}
