/* About Page Improvements - Load Performance and Mobile Responsive Fixes */

/* Loading States */
:root {
    --content-opacity: 0;
    --transition-duration: 0.4s;
}

.content-loading {
    opacity: var(--content-opacity);
    transition: opacity var(--transition-duration) ease;
}

/* Enhanced Grid System for Better Layouts */
.w-layout-grid.grid-layout {
    display: grid;
    grid-auto-columns: 1fr;
    grid-column-gap: 16px;
    grid-row-gap: 16px;
}

/* Team member cards should maintain aspect ratio */
.team-member-card {
    min-width: 0; /* Prevent grid overflow issues */
}

.w-layout-grid.desktop-4-column {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    align-items: center;
}

.w-layout-grid.tablet-1-column {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
}

.w-layout-grid.grid-gap-sm {
    grid-column-gap: 1rem;
    grid-row-gap: 1rem;
}

.w-layout-grid.y-center {
    align-items: center;
}

/* Responsive Grid Behavior */
@media screen and (max-width: 991px) {
    .w-layout-grid.desktop-4-column {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media screen and (max-width: 767px) {
    .w-layout-grid.desktop-4-column,
    .w-layout-grid.tablet-1-column {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        text-align: center;
        justify-items: center;
    }
    
    .w-layout-grid.y-center {
        justify-items: center;
    }
}

/* Container Improvements */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

@media screen and (max-width: 991px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media screen and (max-width: 767px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Full Width Container for Journeys Crafted Section */
.full-width-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.journeys-crafted-section {
    background: linear-gradient(135deg, #f6f1ea 0%, #ede7e2 100%);
    padding: 4rem 0;
    width: 100%;
    position: relative;
    z-index: 1;
}

.journeys-crafted-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
}

.journeys-crafted-text {
    flex: 1;
    max-width: 600px;
}

.journeys-crafted-heading {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3a2d1a;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-family: 'Eczar', serif;
}

.journeys-crafted-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
}

.journeys-crafted-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 200px;
}

.journeys-crafted-buttons .button {
    padding: 0.875rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    display: block;
}

.journeys-crafted-buttons .primary-button {
    background: #a64940;
    color: white;
    border: 2px solid #a64940;
}

.journeys-crafted-buttons .primary-button:hover {
    background: #8e3d36;
    border-color: #8e3d36;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(166, 73, 64, 0.3);
}

.journeys-crafted-buttons .secondary-button {
    background: transparent;
    color: #a64940;
    border: 2px solid #a64940;
}

.journeys-crafted-buttons .secondary-button:hover {
    background: #a64940;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(166, 73, 64, 0.3);
}

/* Gallery Improvements - Full Width and Better Grid */
.section.secondary-section {
    padding: 4rem 0;
}

.desktop-6-column {
    grid-template-columns: repeat(6, 1fr);
}

.tablet-3-column {
    grid-template-columns: repeat(3, 1fr);
}

.mobile-1-column {
    grid-template-columns: 1fr;
}

#about-gallery-images,
#about-experiences-gallery,
#about-travel-gallery {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.utility-aspect-3x2 {
    position: relative;
    aspect-ratio: 3/2;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.utility-aspect-3x2:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.utility-aspect-3x2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.utility-aspect-3x2:hover img {
    transform: scale(1.05);
}

/* Tab Improvements */
.w-tab-menu {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.tab-menu-link {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #666;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-menu-link:hover,
.tab-menu-link.w--current {
    background: #a64940;
    color: white;
    border-color: #a64940;
}

/* Team Section Improvements */
.team-section-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.team-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

#about-team-members {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 300px));
    gap: 1.5rem;
    margin-top: 2rem;
    justify-content: center;
}

.team-member-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: none;
    transition: transform 0.3s ease;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
    /* Removed box-shadow for clean look */
}

.team-member-card:hover {
    transform: translateY(-8px);
    /* Removed box-shadow from hover */
}

.team-member-image-wrapper {
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Creates perfect square aspect ratio */
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    border: none;
    position: relative;
    background: #f0f0f0; /* Add background for loading state */
}

.team-member-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.3s ease;
    display: block;
}

.team-member-card:hover .team-member-image {
    transform: scale(1.05);
}

.team-member-info {
    padding: 1.25rem;
}

.team-member-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.team-member-role {
    font-size: 1rem;
    color: #a64940;
    font-weight: 500;
    margin: 0 0 1rem 0;
}

.team-member-bio {
    font-size: 0.9rem;
    color: #5a6c7d;
    line-height: 1.5;
    margin: 0;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 1024px) {
    .journeys-crafted-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        padding: 0 1.5rem;
    }
    
    .journeys-crafted-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
    
    #about-gallery-images {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.25rem;
    }
    
    #about-team-members {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .team-section-wrapper {
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .journeys-crafted-section {
        padding: 3rem 0;
    }
    
    .journeys-crafted-content {
        padding: 0 1rem;
        gap: 1.5rem;
    }
    
    .journeys-crafted-heading {
        font-size: 2rem;
    }
    
    .journeys-crafted-description {
        font-size: 1rem;
    }
    
    .journeys-crafted-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .w-tab-menu {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-menu-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    #about-gallery-images {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    #about-team-members {
        grid-template-columns: repeat(auto-fit, minmax(250px, 350px));
        gap: 1.25rem;
        justify-content: center;
    }
    
    .team-member-image-wrapper {
        /* Square aspect ratio maintained on mobile using padding technique */
        height: 0;
        padding-bottom: 100%;
        position: relative;
    }
    
    .team-member-info {
        padding: 1.25rem;
    }
    
    .team-member-name {
        font-size: 1.2rem;
    }
    
    .team-member-role {
        font-size: 1rem;
    }
    
    .team-member-card {
        padding: 1.25rem;
        margin: 0 auto;
        max-width: 400px;
    }
    
    .team-member-image-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .team-member-name {
        font-size: 1.1rem;
    }
    
    .team-member-role {
        font-size: 0.95rem;
    }
    
    .team-section-wrapper {
        gap: 2rem;
    }
    
    .team-header {
        padding: 0 1rem;
    }
    
    /* Story section mobile improvements */
    .about-story-flex {
        padding: 1rem;
    }
    
    #about-story-section {
        padding: 2.5rem 0;
    }
    
    .section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .journeys-crafted-section {
        padding: 2rem 0;
    }
    
    .journeys-crafted-content {
        padding: 0 0.75rem;
    }
    
    .journeys-crafted-heading {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .journeys-crafted-description {
        font-size: 0.95rem;
    }
    
    .journeys-crafted-buttons .button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    #about-gallery-images {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .team-member-card {
        padding: 1rem;
        max-width: 350px;
    }
    
    .team-member-image-wrapper {
        width: 20rem;
        height: 80px;
    }
    
    .team-member-name {
        font-size: 1rem;
    }
    
    .team-member-role {
        font-size: 0.9rem;
    }
    
    .team-member-bio {
        font-size: 0.85rem;
    }
    
    .team-section-wrapper {
        gap: 1.5rem;
    }
    
    /* About story mobile fixes */
    .about-story-flex {
        padding: 0.5rem;
        gap: 1rem;
    }
    
    #about-story-section {
        padding: 2rem 0;
    }
    
    .section {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .button {
        width: 100%;
        max-width: 300px;
        text-align: center;
        padding: 0.75rem 1rem;
        margin: 0 auto;
        display: block;
    }
}

/* Performance Optimizations */
.team-member-image,
.utility-aspect-3x2 img {
    will-change: transform;
}

.team-member-card,
.utility-aspect-3x2 {
    will-change: transform, box-shadow;
}

/* Accessibility Improvements */
.team-member-card:focus-within,
.utility-aspect-3x2:focus-within {
    outline: 2px solid #a64940;
    outline-offset: 2px;
}

.team-member-card:focus-within .team-member-image,
.utility-aspect-3x2:focus-within img {
    transform: scale(1.05);
}

/* Prevent layout shift */
.team-member-image-wrapper::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

.team-member-image-wrapper {
    position: relative;
}

/* Loading animation for images */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.team-member-image,
.utility-aspect-3x2 img {
    animation: fadeIn 0.3s ease-in-out;
}

/* Gallery hover overlay effect */
.utility-aspect-3x2::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(166, 73, 64, 0.1), rgba(166, 73, 64, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.utility-aspect-3x2:hover::after {
    opacity: 1;
}
