/* ============================================
   Hurghada Horses - Main Stylesheet
   Mobile-first responsive design
   Works alongside Tailwind CSS CDN
   ============================================ */

/* ----- CSS Custom Properties (Brand Colors) ----- */
:root {
    --color-amber-50: #fffbeb;
    --color-amber-100: #fef3c7;
    --color-amber-200: #fde68a;
    --color-amber-300: #fcd34d;
    --color-amber-400: #fbbf24;
    --color-amber-500: #f59e0b;
    --color-amber-600: #d97706;
    --color-amber-700: #b45309;
    --color-amber-800: #92400e;
    --color-amber-900: #78350f;

    --color-brown-50: #fdf8f1;
    --color-brown-100: #f5e6d3;
    --color-brown-200: #e8cba7;
    --color-brown-300: #d4a574;
    --color-brown-400: #c08552;
    --color-brown-500: #a0673d;
    --color-brown-600: #8b5a2b;
    --color-brown-700: #6d4520;
    --color-brown-800: #4e3118;
    --color-brown-900: #3a2410;

    --color-gold-50: #fefce8;
    --color-gold-100: #fef9c3;
    --color-gold-200: #fef08a;
    --color-gold-300: #fde047;
    --color-gold-400: #facc15;
    --color-gold-500: #eab308;
    --color-gold-600: #ca8a04;
    --color-gold-700: #a16207;
    --color-gold-800: #854d0e;
    --color-gold-900: #713f12;

    --color-primary: var(--color-amber-600);
    --color-primary-dark: var(--color-amber-700);
    --color-primary-light: var(--color-amber-400);
    --color-secondary: var(--color-brown-600);
    --color-accent: var(--color-gold-500);

    --navbar-height: 64px;
    --transition-speed: 0.3s;
}

/* ----- Base / Reset ----- */
html {
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #1f2937;
    overflow-x: hidden;
}

/* ----- Mobile-First Base Layout ----- */
/* Single column, stacked layouts by default */
.container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ----- Minimum 44x44px Tap Targets (Mobile) ----- */
a,
button,
[role="button"],
input[type="submit"],
input[type="button"],
input[type="reset"],
select,
.tap-target {
    min-height: 44px;
    min-width: 44px;
}

/* Inline links within text don't need the min-width */
p a,
li a,
span a {
    min-width: auto;
    min-height: auto;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    display: inline-block;
}

/* Nav links and footer links need tap targets */
nav a,
footer a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* Form controls */
input,
textarea,
select {
    min-height: 44px;
    font-size: 16px;
    /* Prevents iOS zoom on focus */
}

/* ----- Navbar Styles ----- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: transparent;
    transition: background-color var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease,
        backdrop-filter var(--transition-speed) ease;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.navbar.scrolled {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar .nav-logo {
    height: 40px;
    width: auto;
}

.navbar .nav-links {
    display: none;
}

.navbar .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1002;
}

.navbar .hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #1f2937;
    transition: transform var(--transition-speed) ease,
        opacity var(--transition-speed) ease;
    position: absolute;
}

.navbar .hamburger span:nth-child(1) {
    transform: translateY(-7px);
}

.navbar .hamburger span:nth-child(3) {
    transform: translateY(7px);
}

.navbar .hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
}

.navbar .hamburger.active span:nth-child(2) {
    opacity: 0;
}

.navbar .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Mobile menu */
.navbar .mobile-menu {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    transform: translateX(100%);
    transition: transform var(--transition-speed) ease;
    overflow-y: auto;
    padding: 1rem;
    z-index: 1001;
}

.navbar .mobile-menu.open {
    transform: translateX(0);
}

.navbar .mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.75rem 1rem;
    color: #1f2937;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #f3f4f6;
    transition: color var(--transition-speed) ease,
        background-color var(--transition-speed) ease;
}

.navbar .mobile-menu a:hover,
.navbar .mobile-menu a:focus {
    color: var(--color-primary);
    background-color: var(--color-amber-50);
}

/* Dropdown in mobile menu */
.navbar .dropdown-content {
    display: none;
    padding-left: 1rem;
}

.navbar .dropdown-content.open {
    display: block;
}

.navbar .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    color: #1f2937;
}

.navbar .dropdown-toggle:hover,
.navbar .dropdown-toggle:focus {
    color: var(--color-primary);
    background-color: var(--color-amber-50);
}

.navbar .dropdown-toggle .chevron {
    transition: transform var(--transition-speed) ease;
}

.navbar .dropdown-toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

/* ----- Animation Classes ----- */
/* Base hidden state — added by JS only (progressive enhancement) */
.animate-hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-out,
        transform 0.6s ease-out,
        visibility 0.6s ease-out;
}

/* Visible state — triggered when element enters viewport */
.animate-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Animation type: fade-up (slide up from below) */
.animate-hidden.animate-fade-up,
.animate-fade-up.animate-hidden {
    transform: translateY(30px);
}

/* Animation type: fade-in (simple opacity) */
.animate-hidden.animate-fade-in,
.animate-fade-in.animate-hidden {
    transform: none;
}

/* Animation type: fade-left (slide in from left) */
.animate-hidden.animate-fade-left,
.animate-fade-left.animate-hidden {
    transform: translateX(-30px);
}

/* Animation type: fade-right (slide in from right) */
.animate-hidden.animate-fade-right,
.animate-fade-right.animate-hidden {
    transform: translateX(30px);
}

/* ----- Lightbox Overlay Styles ----- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease,
        visibility var(--transition-speed) ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-overlay .lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
    z-index: 2001;
}

.lightbox-overlay .lightbox-close:hover,
.lightbox-overlay .lightbox-close:focus {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-overlay .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease,
        opacity var(--transition-speed) ease;
    z-index: 2001;
}

.lightbox-overlay .lightbox-nav:hover,
.lightbox-overlay .lightbox-nav:focus {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-overlay .lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-overlay .lightbox-prev {
    left: 1rem;
}

.lightbox-overlay .lightbox-next {
    right: 1rem;
}

.lightbox-overlay .lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* Body scroll lock when lightbox is open */
body.lightbox-open {
    overflow: hidden;
}

/* ----- Footer Visibility Switching ----- */
/* Mobile-first: mobile footer visible, desktop footer hidden */
.footer-desktop {
    display: none;
}

.footer-mobile {
    display: block;
}

/* ----- Mobile Footer Accordion ----- */
/* CSS fallback: sections expanded by default (JS adds collapse) */
.footer-mobile [aria-hidden="true"] {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease;
}

.footer-mobile [aria-hidden="false"] {
    max-height: 500px;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease;
}

/* No-JS fallback: all sections visible */
.footer-mobile .accordion-content {
    max-height: none;
}

/* ----- Map Section (Mobile-first) ----- */
/* Full-width on mobile */
.map-content {
    width: 100%;
}

.map-iframe-wrapper {
    width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
}

.map-iframe-wrapper iframe {
    display: block;
    width: 100%;
    border: 0;
}

.map-address {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #374151;
    font-weight: 500;
}

.map-directions-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    min-height: 44px;
    min-width: 44px;
}

.map-fallback {
    padding: 2rem;
    text-align: center;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

/* ----- Gallery Grid (Mobile-first) ----- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0.5rem;
}

/* ----- Video Gallery ----- */
.video-filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    border: 2px solid #d97706;
    background: transparent;
    color: #d97706;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-filter-btn:hover {
    background: #fffbeb;
}

.video-filter-btn.active {
    background: #d97706;
    color: #fff;
}

.video-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-card.hidden {
    display: none;
}

.video-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 2.5rem;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    min-height: auto;
    min-width: auto;
}

.video-play-btn:hover {
    background: rgba(0, 0, 0, 0.15);
}

.video-play-btn.playing {
    opacity: 0;
    pointer-events: none;
}

.video-card video.is-playing+.video-play-btn {
    opacity: 0;
    pointer-events: none;
}

/* ----- Utility Classes ----- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Ensure main content clears the fixed navbar */
main {
    padding-top: var(--navbar-height);
}

/* ============================================
   TABLET — min-width: 768px
   ============================================ */
@media (min-width: 768px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Navbar: show full nav links, hide hamburger */
    .navbar {
        padding: 0 2rem;
    }

    .navbar .nav-links {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .navbar .nav-links a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0.5rem 0.75rem;
        color: #1f2937;
        text-decoration: none;
        font-weight: 500;
        border-radius: 0.375rem;
        transition: color var(--transition-speed) ease,
            background-color var(--transition-speed) ease;
    }

    .navbar .nav-links a:hover,
    .navbar .nav-links a:focus {
        color: var(--color-primary);
        background-color: var(--color-amber-50);
    }

    .navbar .hamburger {
        display: none;
    }

    .navbar .mobile-menu {
        display: none;
    }

    /* Desktop dropdown (hover) */
    .navbar .nav-dropdown {
        position: relative;
    }

    .navbar .nav-dropdown .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 200px;
        background-color: #fff;
        border-radius: 0.5rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity var(--transition-speed) ease,
            visibility var(--transition-speed) ease,
            transform var(--transition-speed) ease;
        padding: 0.5rem 0;
        z-index: 1001;
    }

    .navbar .nav-dropdown:hover .dropdown-menu,
    .navbar .nav-dropdown:focus-within .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .navbar .nav-dropdown .dropdown-menu a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0.5rem 1rem;
        white-space: nowrap;
    }

    /* Footer switching: show desktop, hide mobile */
    .footer-desktop {
        display: block;
    }

    .footer-mobile {
        display: none;
    }

    /* Map section: add side padding on tablet */
    .map-content {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Gallery grid: 2-3 columns */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* ============================================
   DESKTOP — min-width: 1024px
   ============================================ */
@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .navbar {
        padding: 0 3rem;
    }

    /* Map section: max-width container on desktop */
    .map-content {
        max-width: 800px;
    }

    /* Gallery grid: 3 columns */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Lightbox nav buttons slightly larger on desktop */
    .lightbox-overlay .lightbox-nav {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .lightbox-overlay .lightbox-prev {
        left: 2rem;
    }

    .lightbox-overlay .lightbox-next {
        right: 2rem;
    }
}

/* ============================================
   LARGE DESKTOP — min-width: 1280px
   ============================================ */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }

    .navbar {
        padding: 0 4rem;
    }

    /* Gallery grid: 4 columns */
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}