@import 'variables.css';
@import 'reset.css';
@import 'global.css';
@import 'modern-layout.css';

/* Components - Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    padding: var(--spacing-sm) 0;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.site-header.hidden {
    transform: translateY(-100%);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: block;
    height: 75px;
    /* Increased by 25% as requested */
}

.logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

/* Desktop Nav */
.desktop-nav ul {
    display: flex;
    gap: var(--spacing-md);
}

.desktop-nav a {
    font-weight: 500;
    position: relative;
    color: var(--color-text);
    /* Ensure visible on header */
    transition: color var(--transition-normal);
}

.desktop-nav a:hover {
    color: var(--color-primary);
}

.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width var(--transition-normal);
}

.desktop-nav a:hover::after {
    width: 100%;
}

.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: block;
    }
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: var(--spacing-xs);
    font-size: 0.9rem;
    font-weight: 600;
}

.lang-switcher button,
.lang-switcher a {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    color: var(--color-text);
    /* Same as main menu */
    text-decoration: none;
    font-family: inherit;
    font-size: inherit;
}

.lang-switcher span {
    color: var(--color-text);
    align-self: center;
}

.lang-switcher button.active,
.lang-switcher a.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Mobile Menu Styling when open */
body.mobile-menu-open {
    overflow: hidden;
    /* Prevent background scrolling */
}

body.mobile-menu-open .desktop-nav {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--color-background);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 900;
    /* Behind header (1000) but above everything else */
    padding-top: 80px;
    /* Offset for header */
}

body.mobile-menu-open .desktop-nav ul {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

body.mobile-menu-open .desktop-nav a {
    font-size: 1.5rem;
    font-family: var(--font-heading);
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }

    /* Reset mobile styles for desktop if window is resized while open (edge case) */
    body.mobile-menu-open .desktop-nav {
        position: static;
        width: auto;
        height: auto;
        padding-top: 0;
        background-color: transparent;
        flex-direction: row;
        justify-content: flex-start;
    }
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: linear-gradient(rgba(11, 17, 32, 0.5), rgba(11, 17, 32, 0.8)), url('../img/alquitara.webp');
    background-size: cover;
    background-position: center;
    z-index: -1;
    animation: kenBurns 20s ease-in-out infinite alternate;
}

@keyframes kenBurns {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

.hero-content {
    max-width: 800px;
    padding: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
    line-height: 1.1em;
    letter-spacing: 2.5px;
    
    /* Premium Gold Gradient Text */
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 10px 30px rgba(212, 175, 55, 0.4);
}

.hero-subtitle {
    display: block;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 6px;
    color: #ffffff;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hero p {
    color: #F8FAFC;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-size: 1.35rem;
    font-weight: 400;
}

.date-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--color-primary);
    color: var(--color-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-md);
}

/* Footer */
.site-footer {
    background-color: var(--color-secondary);
    color: #ffffff;
    /* Force white text */
    padding: var(--spacing-lg) 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.footer-col h3 {
    font-size: 1.2rem;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.footer-links li {
    margin-bottom: var(--spacing-xs);
}

.footer-links a {
    color: #e0e0e0;
    /* Off-white for links */
    text-decoration: none;
    transition: color var(--transition-normal);
}

.footer-links a:hover {
    color: var(--color-primary);
}

/* Feature Card (Horizontal on desktop) */
.card-featured {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* Visit Section Background */
.section-visit-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../img/veterano-fiesta-orujo.jpg');
    background-size: cover;
    background-position: center;
    color: #ffffff;
}

.section-visit-bg h2 {
    color: #ffffff;
}

.card-featured img {
    width: 50%;
    height: 100%;
    object-fit: cover;
}
}

/* Content Blocks for Narrative */
.content-block {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: center;
}

.content-block img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    /* Circle by default as per request? Images were circles before */
    box-shadow: var(--shadow-md);
}

.content-block.rectangle img {
    border-radius: 8px;
    /* For the Marta/David one which was rectangular */
    width: 300px;
    height: auto;
}

@media (min-width: 768px) {
    .content-block {
        flex-direction: row;
        align-items: center;
        text-align: left;
    }

    .content-block.reverse {
        flex-direction: row-reverse;
    }

    .content-block img {
        flex-shrink: 0;
    }

    .content-block .text-content {
        flex: 1;
    }
}

/* Timeline Component */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-md) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    /* Adjust based on design */
    width: 2px;
    background: var(--color-primary);
    opacity: 0.3;
}

.timeline-item {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.timeline-marker {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    color: var(--color-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 1;
    box-shadow: 0 0 0 4px #fff;
    /* Gap effect */
}

/* Variant for year text outside bubble if preferred, or Keep inside */
.timeline-year {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-primary);
    min-width: 80px;
    text-align: right;
    line-height: 1;
}

.timeline-content {
    background: #fff;
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    flex: 1;
    border-left: 4px solid var(--color-primary);
    transition: transform var(--transition-normal);
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
    color: var(--color-text);
    font-size: 1.25rem;
}

.timeline-content p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin: 0;
}

/* Adjust for simple list view if timeline overly complex */
.orujero-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: #fff;
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.orujero-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.orujero-year {
    background: var(--color-secondary);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    overflow: hidden;
    height: 100%;
}

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

@media (prefers-color-scheme: dark) {
    .card {
        background: var(--color-secondary-light);
    }
}

/* Galería de Carteles */
.carteles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.gallery-img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4); /* Gold shadow */
    z-index: 2;
    position: relative;
}

/* Lightbox Modal */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--glass-bg-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border-radius: var(--radius-sm);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.lightbox-close:hover {
    color: var(--color-primary);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--glass-bg-dark);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.2);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.5s ease-in-out;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-text {
    flex: 1;
    margin-right: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-text a {
    color: var(--color-primary);
    text-decoration: underline;
}

.cookie-buttons button {
    margin-left: 1rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
    }
    .cookie-text {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    .cookie-buttons {
        display: flex;
        gap: 1rem;
        width: 100%;
        justify-content: center;
    }
    .cookie-buttons button {
        margin-left: 0;
    }
}

/* ==========================================================================
   YouTube Video Gallery (Lazy Load)
   ========================================================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.video-container {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    background: #000;
}

.video-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.video-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.video-container:hover img {
    opacity: 1;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background-color: rgba(33, 33, 33, 0.8);
    border-radius: 12px;
    transition: background-color var(--transition-fast);
}

.video-container:hover .play-button {
    background-color: #ff0000; /* YouTube Red */
}

.play-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}