/* Travel Royalty - Hero Section
   Fullscreen card-based navigation system
   Features 5 service cards with flex expansion on hover
*/

/* CSS Custom Properties for responsive calculations */
:root {
    --mobile-navbar-height: 64px;
    --service-cards-count: 5;
}

/* Hero Container - Fullscreen Layout */
.hero-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    margin-bottom: 0; /* Ensure no gap to next section */
    position: relative;
    /* Ensure the container takes full viewport height and touches next section */
    min-height: 100vh;
}

/* Service Cards - Equal Space by Default */
.service-card {
    flex: 1;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: var(--transition-medium);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

/* Individual Service Card Backgrounds */
.service-card[data-service="bespoke"] {
    background-image: url('../assets/luxury holidays.webp');
}
.service-card[data-service="safari"] {
    background-image: url('../assets/african safari.webp');
}
.service-card[data-service="cruise"] {
    background-image: url('../assets/luxury cruise.webp');
}
.service-card[data-service="helicopter-services"] {
    background-image: url('../assets/helicopter tours.webp');
}
.service-card[data-service="private-jet"] {
    background-image: url('../assets/Private jets air.webp');
}

/* Gradient overlay for text readability */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
    z-index: 1;
    transition: var(--transition-medium);
}

/* Enhance gradient on hover for more focus */
.service-card:hover::before,
.service-card.active::before {
    background: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.8) 60%, transparent 100%);
}

/* Card Expansion on Hover */
.service-card:hover,
.service-card.active {
    flex: 2.5;
}

/* Dim non-hovered cards */
.service-card.inactive {
    flex: 0.7;
    filter: brightness(0.6) saturate(0.8);
}

/* Vertical Labels - Always Visible */
.service-card__label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-family-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--modern-text-primary);
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.6);
    white-space: normal;
    text-align: center;
    width: 150px; /* Controls the stacking */
    z-index: 2;
    transition: var(--transition-medium);
    pointer-events: none;
}

/* Hide label on hover */
.service-card:hover .service-card__label,
.service-card.active .service-card__label {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
}

/* Card Content - Hidden by Default */
.service-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-medium);
    z-index: 3;
    
    /* Enhanced gradient background for better text readability */
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        transparent 100%
    );
}

/* Show content on hover */
.service-card:hover .service-card__content,
.service-card.active .service-card__content {
    opacity: 1;
    transform: translateY(0);
}

/* Content Typography */
.service-card__content h2 {
    font-family: var(--font-family-serif);
    font-size: 2rem;
    font-weight: 600;
    color: var(--modern-text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.service-card__content p {
    color: var(--modern-text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 400px;
}

/* Discover Button */
.discover-button {
    background-color: var(--modern-accent);
    color: var(--modern-text-primary);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    
    /* Modern glow effect */
    box-shadow: var(--shadow-glow-sm);
}

.discover-button:hover {
    background-color: var(--modern-accent-hover);
    box-shadow: var(--shadow-glow-md);
    transform: translateY(-2px);
}

.discover-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-glow-sm);
}

/* Focus Styles for Accessibility */
.service-card:focus {
    outline: 2px solid var(--modern-accent);
    outline-offset: -2px;
}

.service-card:focus .service-card__label {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
}

.service-card:focus .service-card__content {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design - Mobile Stack */
@media (max-width: 768px) {
    .hero-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        /* Account for mobile navbar height using CSS custom property */
        padding-top: var(--mobile-navbar-height);
        margin-top: 0;
        /* Calculate total height to eliminate gaps */
        /* 100vh total space for full coverage */
        height: 100vh;
        box-sizing: border-box;
    }
    
    .service-card {
        /* Calculate card height: (100vh - navbar height) / number of cards */
        min-height: calc((100vh - var(--mobile-navbar-height)) / var(--service-cards-count));
        flex: 1;
        flex-shrink: 0;
        /* Ensure cards fill available space properly */
        box-sizing: border-box;
    }
    
    /* First card specific styling to ensure it's not hidden */
    .service-card:first-child {
        /* Ensure first card is fully visible below navbar */
        position: relative;
        z-index: 5;
        /* Add subtle top margin to ensure complete visibility */
        margin-top: 1px;
    }
    
    /* Ensure last card touches the bottom edge */
    .service-card:last-child {
        /* Ensure last card reaches the bottom */
        margin-bottom: 0;
        border-bottom: none;
    }
    
    .service-card:hover,
    .service-card.active {
        flex: 1.8;
        min-height: calc(((100vh - var(--mobile-navbar-height)) / var(--service-cards-count)) * 1.6);
    }
    
    .service-card.inactive {
        flex: 0.8;
        min-height: calc(((100vh - var(--mobile-navbar-height)) / var(--service-cards-count)) * 0.7);
        filter: brightness(0.7);
    }
    
    .service-card__label {
        transform: translate(-50%, -50%) rotate(0deg);
        font-size: 1.2rem;
    }
    
    .service-card:hover .service-card__label,
    .service-card.active .service-card__label,
    .service-card:focus .service-card__label {
        transform: translate(-50%, -50%) rotate(0deg) scale(0.9);
    }
    
    .service-card__content h2 {
        font-size: 1.5rem;
    }
    
    .service-card__content {
        padding: 1.5rem;
    }
}

/* Small Mobile Devices - Extra optimization */
@media (max-width: 480px) {
    .hero-container {
        /* Ensure proper height calculation on very small screens */
        height: 100vh;
        max-height: 100vh;
    }
    
    .service-card {
        /* Slightly adjust for smaller screens */
        min-height: calc((100vh - var(--mobile-navbar-height)) / var(--service-cards-count));
    }
    
    .service-card__content {
        padding: 1rem;
    }
    
    .service-card__content h2 {
        font-size: 1.3rem;
    }
    
    .service-card__label {
        font-size: 1rem;
    }
}

/* Tablet Adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .service-card__content h2 {
        font-size: 1.8rem;
    }
    
    .service-card__label {
        font-size: 1.3rem;
    }
}

/* Large Screen Enhancements */
@media (min-width: 1400px) {
    .service-card__content h2 {
        font-size: 2.2rem;
    }
    
    .service-card__label {
        font-size: 1.7rem;
    }
    
    .service-card__content {
        padding: 2.5rem;
    }
}

/* Animation Presets */
@media (prefers-reduced-motion: reduce) {
    .service-card,
    .service-card__label,
    .service-card__content,
    .discover-button {
        transition: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .service-card__label {
        text-shadow: 
            0 0 0 #000,
            0 0 4px #000,
            0 0 8px #000;
    }
    
    .service-card__content {
        background: rgba(0, 0, 0, 0.95);
    }
}
