/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent horizontal scroll globally but allow vertical overflow for floral continuity */
html { 
    overflow-x: hidden; 
    width: 100%; 
}

/* Media elements scale with layout width */
img, svg, video, canvas { max-width: 100%; height: auto; }

:root {
    /* Paper tones (backgrounds) */
    --paper-bg: #f8f7f3;
    --paper-bg-2: #faf2e5;
    /* Accents */
    --accent-blue: #b6d5e6;
    --accent-blue-light: #dbebf3;
    --accent-gold: #c29534;
    /* Text */
    --text-main: #0F172A;
    /* Paper grain (soft noise) */
    --paper-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 100 100'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='5' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0.15'/><feComponentTransfer><feFuncA type='table' tableValues='0 0.06'/></feComponentTransfer></filter><rect width='100' height='100' filter='url(%23g)'/></svg>");
    /* Paper speckles (tiny dots) */
    --paper-speckle: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 100 100'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='1' stitchTiles='stitch'/><feThreshold threshold='0.92'/><feComponentTransfer><feFuncA type='table' tableValues='0 0.07'/></feComponentTransfer></filter><rect width='100' height='100' filter='url(%23s)'/></svg>");
    /* Paper fibers (elongated soft streaks) */
    --paper-fibers: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 100 100'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3' seed='7' stitchTiles='stitch'/><feGaussianBlur stdDeviation='0.5'/><feColorMatrix type='saturate' values='0.05'/><feComponentTransfer><feFuncA type='table' tableValues='0 0.025'/></feComponentTransfer></filter><rect width='100' height='100' filter='url(%23f)' transform='skewX(-12)' opacity='0.8'/></svg>");
    /* Floral assets */
    /* Allowed floral assets (no 1, 2, or 5) */
    --floral-3: url('svg/floral3.svg');
    --floral-4: url('svg/floral4.svg');
    --floral-6: url('svg/floral6.svg');
    --floral-7: url('svg/floral7.svg');
    --floral-8: url('svg/floral8.svg');
    /* Large pattern tiling controls */
    --floral-opacity: 0.12;
}

/* Custom font: Amsterdam Four (local). */
@font-face {
    font-family: 'Amsterdam Four';
    src: local('Amsterdam Four'),
         url('fonts/AmsterdamFour.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Caslon 540 Regular (local) for ampersands */
@font-face {
    font-family: 'Caslon 540';
    src: local('Caslon 540 Regular'), url('fonts/Caslon 540 Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Alegreya local family (essential weights + italic) */
@font-face {
    font-family: 'Alegreya';
    src: local('Alegreya Regular'), url('fonts/Alegreya-Regular.ttf') format('truetype');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Alegreya';
    src: local('Alegreya Italic'), url('fonts/Alegreya-Italic.ttf') format('truetype');
    font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
    font-family: 'Alegreya';
    src: local('Alegreya Medium'), url('fonts/Alegreya-Medium.ttf') format('truetype');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Alegreya';
    src: local('Alegreya SemiBold'), url('fonts/Alegreya-SemiBold.ttf') format('truetype');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Alegreya';
    src: local('Alegreya Bold'), url('fonts/Alegreya-Bold.ttf') format('truetype');
    font-weight: 700; font-style: normal; font-display: swap;
}

/* Karla local family (UI weights) */
@font-face {
    font-family: 'Karla';
    src: local('Karla Bold'), url('fonts/Karla-Bold.ttf') format('truetype');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Karla';
    src: local('Karla ExtraBold'), url('fonts/Karla-ExtraBold.ttf') format('truetype');
    font-weight: 800; font-style: normal; font-display: swap;
}

body {
    font-family: 'Alegreya', serif;
    line-height: 1.6;
    color: var(--text-main); /* neutral dark */
    overflow-x: hidden; /* only restrict horizontal scroll */
    /* Paper background base */
    background-color: var(--paper-bg);
    background-attachment: scroll; /* avoid mobile white gaps from fixed backgrounds */
    position: relative;
    margin: 0;
    padding: 0;
    min-height: 100vh; /* ensure no bottom blank on short content */
}
/* Overlay texture so it is visible over section backgrounds */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0; /* behind content; sections/cards get their own textures too */
    background-image:
        var(--paper-grain),
        var(--paper-speckle),
        var(--paper-fibers);
    background-repeat: repeat, repeat, repeat;
    background-size: 200px 200px, 280px 280px, 320px 320px;
    opacity: 0.35;
}

/* Simple vignette without complex florals to avoid white gaps */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 62%, rgba(0,0,0,0.06) 100%);
    mix-blend-mode: multiply;
}
.with-florals {
    position: relative;
    /* No overflow restrictions to allow continuous floral flow */
}

/* Seamless joins: nudge stacked sections by 2px so no line appears */
.with-florals + .with-florals { margin-top: -2px; }

.with-florals::before,
.with-florals::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: 1; /* above body vignette, below content */
    opacity: 0.16; /* subtle by default */
    background-image: var(--floral-7); /* default now uses floral7 */
    background-repeat: no-repeat;
    background-size: contain;
    filter: saturate(0.85) contrast(0.95);
    mix-blend-mode: multiply; /* avoid white blocks on colored backgrounds */
}

/* Ensure section content stays above florals */
.with-florals .container { position: relative; z-index: 2; }

/* Top-left flourish */
.with-florals::before {
    top: -10%;
    left: -8%;
    width: min(46vw, 580px);
    height: min(46vw, 580px);
    transform: rotate(-5deg);
}

/* Bottom-right flourish (mirrored) */
.with-florals::after {
    bottom: -10%;
    right: -8%;
    width: min(48vw, 600px);
    height: min(48vw, 600px);
    transform: scaleX(-1) rotate(6deg);
}

/* Per-section: choose which floral design and opacity */
/* Wedding Details: use floral7 (TL) and floral8 (BR) - NO extender hacia arriba para no interferir con hero */
.wedding-details.with-florals::before { 
    background-image: var(--floral-7); 
    opacity: 0.22; 
    left: -14%;
    width: min(60vw, 800px);
    height: min(60vw, 800px);
    transform: rotate(-4deg);
}
.wedding-details.with-florals::after  { 
    background-image: var(--floral-8); 
    opacity: 0.14; 
    bottom: -20%;
    right: -16%;
    width: min(44vw, 560px);
    height: min(44vw, 560px);
    transform: scaleX(-1) rotate(6deg);
}

/* Countdown: floral4 + floral6 - extender para conectar con Timeline */
.countdown-section.with-florals::before { 
    background-image: var(--floral-4); 
    opacity: 0.08; /* Reducir opacidad de flor izquierda para equilibrar */
    top: 15%; /* Mover más abajo para alinearse con la zona del reloj */
    left: -16%; 
    width: min(56vw, 720px);
    height: min(56vw, 720px);
}
.countdown-section.with-florals::after  { 
    background-image: var(--floral-6); 
    opacity: 0.14; 
    bottom: -15%; 
    right: -12%; 
    width: min(52vw, 680px);
    height: min(52vw, 680px);
}

/* Timeline: continuar desde Countdown con mejor conexión */
.timeline-section.with-florals::before { 
    background-image: var(--floral-6); 
    opacity: 0.22; 
    top: 10%; /* Ajustar para que esté en la zona del título "Minuto a minuto" */
    left: -12%; 
    width: min(58vw, 760px); 
    height: min(58vw, 760px); 
}
.timeline-section.with-florals::after  { 
    background-image: var(--floral-7); 
    opacity: 0.16; 
    bottom: -18%;
    right: -14%;
    width: min(54vw, 700px);
    height: min(54vw, 700px);
}

.simple-gallery.with-florals::before { 
    background-image: var(--floral-7); 
    opacity: 0.10; 
    top: -20%; 
    left: -16%; 
    width: min(58vw, 750px);
    height: min(58vw, 750px);
}
.simple-gallery.with-florals::after  { 
    background-image: var(--floral-6); 
    opacity: 0.08; 
    bottom: -25%; 
    right: -22%; 
    width: min(60vw, 780px);
    height: min(60vw, 780px);
}

/* Footer: hacer que las flores salgan de las orillas pero sean más visibles */
.footer.with-florals::before {
    background-image: var(--floral-4);
    opacity: 0.35; /* Aumentar opacidad significativamente */
    top: -15%; /* Menos extensión hacia arriba para mantener visibilidad */
    left: -20%; /* Menos extensión hacia la izquierda */
}
.footer.with-florals::after  {
    background-image: var(--floral-6);
    opacity: 0.32; /* Aumentar opacidad significativamente */
    bottom: -15%; /* Menos extensión hacia abajo */
    right: -20%; /* Menos extensión hacia la derecha */
    transform: scaleX(-1) rotate(6deg);
}

/* Footer: completely separate and adjustable florals */
.footer.with-florals::before,
.footer.with-florals::after {
    mix-blend-mode: overlay; /* Mejor modo de mezcla para contraste sobre azul */
    filter: contrast(1.3) saturate(1.2) brightness(1.1); /* Más contraste y brillo */
}
.footer.with-florals::before {
    width: min(45vw, 550px); /* Flor izquierda tamaño original escritorio */
    height: min(45vw, 550px);
    top: -3%; /* Bajar aún más la flor izquierda */
    left: -5%; /* Mover más hacia la derecha */
    opacity: 0.35;
    transform: rotate(8deg); /* Mantener rotación dinámica */
}
.footer.with-florals::after {
    width: min(60vw, 700px); /* Flor derecha tamaño original escritorio */
    height: min(60vw, 700px);
    bottom: -75%; /* Bajar directamente mucho más la flor derecha */
    right: -20%;
    opacity: 0.32;
}

/* TABLET INTERMEDIO (900px) - Transición suave hacia móvil */
@media (max-width: 900px) {
    .with-florals {
        overflow: hidden !important;
        position: relative !important;
    }
    
    .with-florals::before {
        width: min(55vw, 480px) !important;
        height: min(55vw, 480px) !important;
        opacity: 0.20 !important;
        left: -25% !important;
        top: -18% !important;
        max-height: 65vh !important;
        z-index: 0 !important;
    }
    
    .with-florals::after {
        width: min(60vw, 520px) !important;
        height: min(60vw, 520px) !important;
        opacity: 0.18 !important;
        right: -30% !important;
        bottom: 22% !important;
        max-height: 65vh !important;
        clip-path: inset(0 0 6% 0) !important;
        z-index: 0 !important;
    }
    
    /* Footer específico para tablets */
    .footer.with-florals::before {
        width: min(45vw, 380px); /* Flor izquierda reducida en tablets */
        height: min(45vw, 380px);
        top: 0%; /* Bajar más en tablets */
        left: -3%; /* Más hacia la derecha en tablets */
        opacity: 0.32; /* Opacidad visible en tablets */
    }
    .footer.with-florals::after {
        width: min(58vw, 500px); /* Flor derecha reducida en tablets */
        height: min(58vw, 500px);
        bottom: -70%; /* Bajar directamente más en tablets */
        right: -18%; 
        opacity: 0.28; 
    }
}



/* 
 * SISTEMA DE OPTIMIZACIÓN DE FLORES PARA MÓVIL - VERSIÓN COMPLETA
 * ================================================================
 * 
 * REGLAS FUNDAMENTALES IMPLEMENTADAS:
 * 
 * 1. CONTENCIÓN ESTRICTA ABSOLUTA
 *    - overflow: hidden !important en todas las secciones .with-florals
 *    - position: relative !important en contenedores padre
 *    - z-index jerarquía: flores (0), contenido (2-3)
 * 
 * 2. ELIMINACIÓN DE EXTENSIONES PROBLEMÁTICAS
 *    - NO valores bottom negativos excesivos (máximo -5%)
 *    - Preferencia por valores positivos: bottom: 8% a 25%
 *    - Flores contenidas dentro del viewport
 * 
 * 3. LÍMITES DE ALTURA PROGRESIVOS - EXPANDIDOS PARA VISIBILIDAD WEB
 *    - Tablet (768px): max-height: 75vh (expandido)
 *    - Móvil (520px): max-height: 80vh (expandido) 
 *    - Pequeño (360px): max-height: 70vh (expandido)
 *    - Landscape: max-height: 35vh
 * 
 * 4. SISTEMA DE RECORTE INTELIGENTE
 *    - Corte mínimo: clip-path: inset(0 0 8% 0) tablets
 *    - Corte moderado: clip-path: inset(0 0 10-12% 0) móviles
 *    - Corte controlado: clip-path: inset(0 0 20% 0) landscape
 * 
 * 5. PERSONALIZACIÓN POR SECCIÓN - PROMINENTE COMO EN VERSIÓN WEB
 *    - Wedding Details: Opacidad 0.32-0.40, EXTRA VISIBLE
 *    - Countdown: Opacidad 0.25-0.32, PROMINENTE sin interferir
 *    - Timeline: Opacidad 0.35-0.45, MÁXIMA VISIBILIDAD 
 *    - Gallery: Opacidad 0.20-0.28, VISIBLE como en web
 *    - Tamaños: 100vw a 130vw para igualar experiencia web
 * 
 * BREAKPOINTS DE IMPLEMENTACIÓN:
 * - 900px: Transición suave tablet → móvil
 * - 768px: Tablet/móvil grande - contención inicial
 * - 520px: Móvil estándar - optimización principal
 * - 360px: Móvil pequeño - máxima contención
 * - landscape + altura <480px: Contención extrema
 */

/* OPTIMIZACIÓN COMPLETA DE FLORES PARA MÓVIL */
/* CONTENCIÓN ESTRICTA ABSOLUTA - TABLET/MÓVIL GRANDE */
@media (max-width: 768px) {
    .with-florals {
        overflow: hidden !important;
        position: relative !important;
    }
    
    /* Flor izquierda - Más centrada */
    .with-florals::before {
        width: 100vw !important; /* Mucho más grande */
        height: 100vw !important;
        opacity: 0.30 !important; /* Mucho más visible */
        left: -45% !important;
        top: -15% !important; /* Movida hacia abajo */
        max-height: 75vh !important;
        z-index: 0 !important;
    }
    
    /* Flor derecha - Más centrada */
    .with-florals::after {
        width: 105vw !important; /* Mucho más grande */
        height: 105vw !important;
        opacity: 0.25 !important; /* Mucho más visible */
        right: -50% !important;
        bottom: 35% !important; /* Movida hacia arriba para centrar */
        max-height: 75vh !important;
        clip-path: inset(0 0 5% 0) !important; /* Menos corte */
        z-index: 0 !important;
    }
}

/* MÓVIL ESTÁNDAR - Flores EQUILIBRADAS y DISTRIBUIDAS */
@media (max-width: 520px) {
    .with-florals {
        overflow: hidden !important;
        position: relative !important;
    }
    
    .with-florals::before {
        width: 95vw !important; /* Reducido para mejor distribución */
        height: 95vw !important;
        opacity: 0.35 !important; /* Muy visible como en web */
        left: -40% !important; /* Menos extensión */
        top: -15% !important; /* Posición balanceada */
        max-height: 80vh !important;
        z-index: 0 !important;
    }
    
    .with-florals::after {
        width: 100vw !important; /* Reducido para mejor distribución */
        height: 100vw !important;
        opacity: 0.28 !important; /* Muy visible como en web */
        right: -45% !important; /* Menos extensión */
        bottom: 30% !important; /* Mejor separación */
        max-height: 80vh !important;
        clip-path: inset(0 0 3% 0) !important; /* Mínimo corte */
        z-index: 0 !important;
    }
    
    /* Contenido siempre visible */
    .with-florals .container {
        position: relative !important;
        z-index: 2 !important;
    }
}

/* MÓVIL PEQUEÑO - Flores VISIBLES como en web */
@media (max-width: 360px) {
    .with-florals::before {
        width: 100vw !important; /* Tamaño generoso */
        height: 100vw !important;
        opacity: 0.30 !important; /* Muy visible */
        left: -45% !important;
        top: -18% !important; /* Movida hacia abajo */
        max-height: 70vh !important;
    }
    
    .with-florals::after {
        width: 105vw !important; /* Tamaño generoso */
        height: 105vw !important;
        opacity: 0.25 !important; /* Muy visible */
        right: -50% !important;
        bottom: 35% !important; /* Movida hacia arriba para centrar */
        max-height: 70vh !important;
        clip-path: inset(0 0 5% 0) !important; /* Mínimo corte */
    }
}

/* LANDSCAPE EXTREMO - Contención ultra-estricta para altura limitada */
@media (orientation: landscape) and (max-height: 480px) {
    .with-florals::before,
    .with-florals::after {
        width: 40vw !important;
        height: 40vw !important;
        opacity: 0.10 !important;
        max-height: 35vh !important;
    }
    
    /* Posiciones seguras para landscape */
    .with-florals::before { 
        top: -15% !important; 
        left: -15% !important; 
    }
    
    .with-florals::after { 
        bottom: 12% !important; 
        right: -15% !important; 
        clip-path: inset(0 0 20% 0) !important;
    }
}

/* PERSONALIZACIÓN POR SECCIÓN - WEDDING DETAILS - DISTRIBUIDAS */
@media (max-width: 768px) {
    .wedding-details.with-florals::before {
        opacity: 0.35 !important; /* Como en web */
        left: -35% !important; /* Mejor distribución */
        top: -18% !important; /* Balanceada */
        width: 95vw !important; /* Reducido para menos amontonamiento */
        height: 95vw !important;
    }
    
    .wedding-details.with-florals::after {
        opacity: 0.28 !important; /* Como en web */
        right: -40% !important; /* Mejor distribución */
        bottom: 28% !important; /* Más separación */
        width: 100vw !important; /* Reducido para menos amontonamiento */
        height: 100vw !important;
    }
}

@media (max-width: 520px) {
    .wedding-details.with-florals::before {
        opacity: 0.40 !important; /* Muy visible */
        width: 105vw !important; /* Reducido */
        height: 105vw !important;
        left: -45% !important; /* Mejor posicionamiento */
        top: -22% !important; /* Balanceada */
    }
    
    .wedding-details.with-florals::after {
        opacity: 0.32 !important; /* Muy visible */
        width: 110vw !important; /* Reducido */
        height: 110vw !important;
        right: -50% !important; /* Mejor posicionamiento */
        bottom: 32% !important; /* Más separación */
    }
}

/* PERSONALIZACIÓN POR SECCIÓN - COUNTDOWN - AÚN MÁS ABAJO */
@media (max-width: 768px) {
    .countdown-section.with-florals::before {
        opacity: 0.30 !important; /* Visible como en web */
        width: 90vw !important; /* Reducido ligeramente */
        height: 90vw !important;
        left: -50% !important;
        top: 5% !important; /* Aún más abajo */
    }
    
    .countdown-section.with-florals::after {
        opacity: 0.25 !important; /* Visible como en web */
        width: 95vw !important; /* Reducido ligeramente */
        height: 95vw !important;
        right: -55% !important;
        bottom: 60% !important; /* Aún más arriba */
    }
}

@media (max-width: 520px) {
    .countdown-section.with-florals::before {
        opacity: 0.32 !important; /* Prominente como en web */
        width: 100vw !important; /* Reducido ligeramente */
        height: 100vw !important;
        left: -55% !important;
        top: 2% !important; /* Aún más abajo */
    }
    
    .countdown-section.with-florals::after {
        opacity: 0.28 !important; /* Prominente como en web */
        width: 105vw !important; /* Reducido ligeramente */
        height: 105vw !important;
        right: -60% !important;
        bottom: 65% !important; /* Aún más arriba */
    }
}

/* PERSONALIZACIÓN POR SECCIÓN - TIMELINE - DISEÑO EQUILIBRADO */
@media (max-width: 768px) {
    .timeline-section.with-florals::before {
        opacity: 0.40 !important; /* Muy prominente como en web */
        width: 85vw !important; /* Reducido ligeramente */
        height: 85vw !important;
        left: -40% !important; /* Menos extensión hacia la izquierda */
        top: 8% !important; /* Posición balanceada */
    }
    
    .timeline-section.with-florals::after {
        opacity: 0.32 !important; /* Muy prominente como en web */
        width: 90vw !important; /* Reducido ligeramente */
        height: 90vw !important;
        right: -45% !important; /* Menos extensión hacia la derecha */
        bottom: 15% !important; /* Más abajo */
    }
}

@media (max-width: 520px) {
    .timeline-section.with-florals::before {
        opacity: 0.45 !important; /* Máxima visibilidad como en web */
        width: 95vw !important; /* Reducido ligeramente */
        height: 95vw !important;
        left: -45% !important; /* Mejor posicionamiento */
        top: 12% !important; /* Posición balanceada */
    }
    
    .timeline-section.with-florals::after {
        opacity: 0.35 !important; /* Máxima visibilidad como en web */
        width: 100vw !important; /* Reducido ligeramente */
        height: 100vw !important;
        right: -50% !important; /* Mejor posicionamiento */
        bottom: 10% !important; /* Más abajo */
    }
}

/* PERSONALIZACIÓN POR SECCIÓN - GALLERY - CENTRADAS */
@media (max-width: 768px) {
    .simple-gallery.with-florals::before {
        opacity: 0.25 !important; /* Visible como en web */
        width: 100vw !important;
        height: 100vw !important;
        left: -45% !important;
        top: -20% !important; /* Más centrada */
    }
    
    .simple-gallery.with-florals::after {
        opacity: 0.20 !important; /* Visible como en web */
        width: 105vw !important;
        height: 105vw !important;
        right: -50% !important;
        bottom: 30% !important; /* Más centrada */
    }
}

@media (max-width: 520px) {
    .simple-gallery.with-florals::before {
        opacity: 0.28 !important; /* Prominente como en web */
        width: 110vw !important;
        height: 110vw !important;
        left: -50% !important;
        top: -22% !important; /* Más centrada */
    }
    
    .simple-gallery.with-florals::after {
        opacity: 0.22 !important; /* Prominente como en web */
        width: 115vw !important;
        height: 115vw !important;
        right: -55% !important;
        bottom: 32% !important; /* Más centrada */
    }
}

/* FOOTER OPTIMIZADO PARA MÓVIL */
@media (max-width: 520px) {
    .footer.with-florals::before {
        width: 45vw !important; /* Flor izquierda mucho más pequeña en móviles */
        height: 45vw !important;
        opacity: 0.40 !important; /* Opacidad alta en móviles */
        mix-blend-mode: multiply !important; /* Modo más suave en móviles */
        top: 3% !important; /* Bajar más en móviles */
        left: -2% !important; /* Más hacia la derecha en móviles */
        filter: contrast(1.4) saturate(1.3) brightness(1.2) !important; /* Más definición */
        max-height: 50vh !important;
    }
    
    .footer.with-florals::after {
        width: 65vw !important; /* Flor derecha visible pero moderada en móviles */
        height: 65vw !important;
        opacity: 0.40 !important;
        mix-blend-mode: multiply !important;
        bottom: -50% !important; /* Subida para mejor visibilidad */
        right: -15% !important; 
        filter: contrast(1.4) saturate(1.3) brightness(1.2) !important;
        max-height: 50vh !important;
    }
}

@media (max-width: 360px) {
    .footer.with-florals::before {
        width: 40vw !important; /* Flor izquierda muy pequeña */
        height: 40vw !important;
        opacity: 0.35 !important; /* Mantener buena visibilidad */
        top: 5% !important; /* Bajar más en pantallas pequeñas */
        left: 0% !important; /* Más hacia la derecha */
        max-height: 40vh !important;
    }
    
    .footer.with-florals::after {
        width: 60vw !important; /* Flor derecha visible en pantallas pequeñas */
        height: 60vw !important;
        opacity: 0.35 !important;
        bottom: -45% !important; /* Subida para mejor visibilidad */
        right: -12% !important; 
        max-height: 40vh !important;
    }
}

/* VALIDACIONES FINALES Y RENDIMIENTO OPTIMIZADO */
/* Prevenir scroll horizontal absoluto en todos los dispositivos móviles */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    /* Asegurar que todas las flores están contenidas */
    .with-florals {
        contain: layout style paint !important;
        will-change: auto !important;
    }
    
    /* Performance: reducir repaint en flores */
    .with-florals::before,
    .with-florals::after {
        will-change: transform, opacity !important;
        transform-style: flat !important;
        backface-visibility: hidden !important;
    }
}

/* Transiciones suaves entre breakpoints */
@media (max-width: 900px) and (min-width: 769px) {
    .with-florals::before,
    .with-florals::after {
        transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease !important;
    }
}

@media (max-width: 768px) and (min-width: 521px) {
    .with-florals::before,
    .with-florals::after {
        transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease !important;
    }
}

/* Asegurar contenido siempre visible sobre flores */
@media (max-width: 768px) {
    .section-title,
    .countdown,
    .timeline-events,
    .gallery-grid,
    .details-grid {
        position: relative !important;
        z-index: 3 !important;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero {
    height: 100vh;
    background-image: url('img/principal.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 50% 42%; /* center the subjects a bit higher */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    text-align: center;
    padding-top: 2vh;
    isolation: isolate; /* create stacking context to keep hero above external overlays */
    z-index: 10; /* Aumentar z-index para estar por encima de flores */
}

/* Prefer new small viewport units when supported to avoid jumps on rotate */
@supports (height: 100svh) {
    .hero { height: 100svh; min-height: 100svh; }
}

@media (max-width: 768px) {
    .hero {
        background-position: 45% 38%;
        padding-top: 8vh;
    }
    .hero-content {
        margin-top: 8vh; /* Reduced from 12vh to move content slightly up */
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));
    opacity: 0.6;
}

/* Footer-specific spacing to avoid crowding (placed last to override generic rules) */
@media (max-width: 900px) {
    /* Las reglas específicas ya están definidas arriba */
}

@media (max-width: 600px) {
    /* Mantener ambas flores en móviles para mayor efecto visual */
    .footer.with-florals::before,
    .footer.with-florals::after {
        display: block !important; /* Asegurar que ambas flores se muestren */
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.ornament {
    font-size: 2rem;
    color: #64748B;
    margin: 20px 0;
}

.couple-names {
    font-family: 'Amsterdam Four', 'Alegreya', serif;
    font-size: 4rem;
    font-weight: 700;
    margin: 20px 0;
    color: #ffffff; /* hero default */
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
}

.bride-name, .groom-name {
    display: inline-block;
    animation: slideInFromSides 1.2s ease-out;
}

.bride-name {
    animation-delay: 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.groom-name {
    animation-delay: 0.6s;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Only HERO title: larger and thinner look */
.hero .couple-names {
    font-size: 4.2rem;      /* un poco más pequeño */
    font-weight: 400;       /* más delgadito (no bold) */
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.35); /* sombra más sutil */
}

.ampersand {
    font-family: 'Caslon 540', 'Amsterdam Four', 'Alegreya', serif;
    font-size: 3rem;
    color: var(--accent-blue);
    margin: 0 20px;
    display: inline-block;
    animation: pulse 2s infinite;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Hero title spacing remains default; color handled above */

/* Footer ampersand: Caslon, no pulse, inherit color */
.couple-initials .ampersand {
    font-family: 'Caslon 540', 'Amsterdam Four', 'Alegreya', serif;
    animation: none;
    color: inherit;
    text-shadow: none;
    margin: 0 8px;
    font-size: 1em;
}

/* Footer-specific override for current markup */
.footer .couple-names .ampersand {
    font-family: 'Caslon 540', 'Amsterdam Four', 'Alegreya', serif;
    animation: none;
    /* Metallic gold effect */
    background-image: linear-gradient(
        180deg,
        #fff3c4 0%,
        #f6e27a 12%,
        #e9c24c 28%,
        #d4af37 45%,
        #a67c00 60%,
        #d4af37 78%,
        #f6e27a 90%,
        #fff3c4 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: 0 1px 0 rgba(255,255,255,0.35), 0 2px 6px rgba(0,0,0,0.25);
    margin: 0 8px;
    font-size: 1em;
}

.wedding-date {
    font-family: 'Alegreya', serif;
    font-size: 1.8rem;
    color: #ffffff;
    margin: 20px 0;
    font-weight: 300;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

.invitation-text {
    font-size: 1.2rem;
    color: #ffffff;
    margin: 30px 0;
    font-style: italic;
    font-family: 'Alegreya', serif;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: #ffffff;
    animation: bounce 2s infinite;
    cursor: pointer;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Wedding Details Section */
.wedding-details {
    padding: 80px 0;
    background: var(--paper-bg);
    background-image: var(--paper-grain), var(--paper-grain), var(--paper-speckle), var(--paper-speckle), var(--paper-fibers);
    background-blend-mode: multiply, multiply, normal, normal, multiply;
    background-size: 180px 180px, 140px 140px, 260px 260px, 220px 220px, 320px 320px;
    background-attachment: scroll, scroll, scroll, scroll, scroll;
    position: relative;
}

.section-title {
    font-family: 'Amsterdam Four', 'Alegreya', serif;
    font-size: 2.5rem;
    text-align: center;
    color: #0C4A6E; /* secondary heading */
    margin-bottom: 50px;
    font-weight: 400; /* align with timeline-title */
    position: relative;
    z-index: 2;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: var(--accent-gold); /* match timeline underline */
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    column-gap: 16px;
    row-gap: 8px; /* less space above items */
    padding: 8px 12px 22px; /* more bottom padding to separate the button from the card edge */
    box-sizing: border-box;
}

/* Mobile fixes: ensure grid uses full width without horizontal scroll */
@media (max-width: 600px) {
    .wedding-details .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .details-grid {
        grid-template-columns: 1fr; /* single column to avoid clipping */
        column-gap: 12px;
        padding-left: 0;
        padding-right: 0;
    }
    .detail-card {
        margin-left: auto;
        margin-right: auto;
    }
}

.detail-card {
    background: var(--paper-bg-2);
    background-image: var(--paper-grain), var(--paper-grain), var(--paper-speckle), var(--paper-speckle), var(--paper-fibers);
    background-blend-mode: multiply, multiply, normal, normal, multiply;
    background-size: 160px 160px, 120px 120px, 240px 240px, 200px 200px, 300px 300px;
    padding: 2px 12px 12px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.06);
    position: relative;
    z-index: 2;
    /* more space below each card without affecting top */
    margin-bottom: 14px;
    max-width: 100%;
}

.detail-card:hover,
.detail-card.in-view {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}


.card-icon {
    font-size: 2.5rem;
    color: var(--accent-blue);
    margin-bottom: 8px;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-icon i {
    font-weight: 300;
}

.card-icon svg {
    width: 42px;
    height: 42px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* PNG icon sizing for ceremony/reception (responsive) */
.card-icon img {
    width: min(70vw, 320px);
    height: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.03));
}

@media (max-width: 480px) {
    .card-icon img {
        width: min(82vw, 260px);
    }
}

/* Medium screens: soften florals to avoid stacking while maintaining continuity */
@media (max-width: 820px) and (min-width: 521px) {
    .wedding-details.with-florals::after { opacity: 0.12; }
    .countdown-section.with-florals::before { opacity: 0.06; } /* Mantener proporción reducida */
    .timeline-section.with-florals::after { opacity: 0.12; }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 0 20px;
        margin-top: 10vh; /* Reduced from 15vh to move text slightly up */
    }
    /* Hero title adjustments */
    .hero .couple-names { font-size: 2.5rem; line-height: 1.15; }
    
    .couple-names {
        font-size: 2rem;
    }
    
    .wedding-date {
        font-size: 1.2rem;
    }
    
    .invitation-text {
        font-size: 1rem;
    }
    
    .detail-card {
        padding: 30px 20px;
    }
    
    .countdown-item {
        min-width: 80px;
    }
    
    .countdown-number {
        font-size: 1.5rem;
        padding: 10px;
    }
}

/* Small-height landscape phones: tighten layout and florals to avoid overflow */
@media (orientation: landscape) and (max-height: 480px) {
    body { overflow-x: hidden; }
    .hero { padding-top: 4vh; align-items: center; }
    .hero .couple-names { font-size: 2.2rem; }
    .wedding-date { font-size: 1rem; }
    .invitation-text { font-size: 0.95rem; }

    .countdown { gap: 20px; }
    .countdown-item { min-width: 100px; }
    .countdown-number { font-size: 2.2rem; padding: 14px; }

    /* Shrink decorative florals further in this tight height mode */
    .with-florals::before,
    .with-florals::after {
    width: 30vw !important;
    height: 30vw !important;
    opacity: 0.10 !important;
    }
    .wedding-details.with-florals::before { top: -16% !important; left: -16% !important; }
    .wedding-details.with-florals::after  { bottom: -16% !important; right: -16% !important; }
}

.detail-card:hover .card-icon,
.detail-card.in-view .card-icon {
    opacity: 1;
    transform: translateY(-2px);
    color: var(--accent-gold);
}

.detail-card h3 {
    font-family: 'Karla', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 0.2px;
    font-size: 1.7rem;
    color: var(--text-main);
    margin-bottom: 6px;
}

.time {
    font-family: 'Karla', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 1.1rem;
    color: var(--accent-blue); /* primary for time */
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.location {
    font-family: 'Alegreya', serif;
    font-size: 1.15rem;
    color: #0C4A6E; /* secondary */
    font-weight: 500;
    letter-spacing: 0.2px;
    margin-bottom: 3px;
}

.address {
    font-family: 'Alegreya', serif;
    color: #94a3b8;
    font-size: 0.95rem;
    font-style: italic;
    margin-bottom: 8px;
}

.map-btn {
    background: var(--accent-blue); /* primary */
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Extra space below the button inside cards */
.detail-card .map-btn {
    margin-bottom: 16px;
}

.map-btn:hover {
    background: var(--accent-gold); /* elegant hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Countdown Section */
.countdown-section {
    padding: 80px 0;
    background: var(--paper-bg-2);
    background-image: var(--paper-grain), var(--paper-grain), var(--paper-speckle), var(--paper-speckle), var(--paper-fibers);
    background-blend-mode: multiply, multiply, normal, normal, multiply;
    background-size: 180px 180px, 140px 140px, 260px 260px, 220px 220px, 320px 320px;
    background-attachment: scroll, scroll, scroll, scroll, scroll;
    color: #0C4A6E;
    text-align: center;
    position: relative;
}

.countdown-section .section-title {
    color: #0C4A6E; /* match timeline title color */
    position: relative;
    z-index: 2;
}

.countdown-section .event-date {
    margin-top: 6px;
    color: #0C4A6E;
    font-family: 'Alegreya', serif;
    font-size: 1.1rem;
    opacity: 0.9;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.countdown-actions {
    margin-top: 24px;
}

.calendar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.countdown-item {
    text-align: center;
    min-width: 120px;
}

.countdown-number {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    background: var(--paper-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.06);
}

.countdown-label {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Timeline Section */
.timeline-section {
    padding: 80px 0;
    background: var(--paper-bg);
    background-image: var(--paper-grain), var(--paper-grain), var(--paper-speckle), var(--paper-speckle), var(--paper-fibers);
    background-blend-mode: multiply, multiply, normal, normal, multiply;
    background-size: 180px 180px, 140px 140px, 260px 260px, 220px 220px, 320px 320px;
    background-attachment: scroll, scroll, scroll, scroll, scroll;
    position: relative;
}

.timeline-header {
    text-align: center;
    margin-bottom: 60px;
}

.timeline-clock {
    width: 80px;
    height: 80px;
    background: var(--accent-blue);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 20px;
    position: relative;
}

.timeline-clock::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 30px;
    background: var(--accent-blue);
}

.timeline-title {
    font-family: 'Amsterdam Four', 'Alegreya', serif;
    font-size: 2.5rem;
        color: #0C4A6E; /* secondary deep blue for titles */
    margin: 0;
    font-weight: 400;
    position: relative;
}

.timeline-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
        height: 1px;
    background: var(--accent-gold);
}

.timeline-events {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.timeline-event {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    padding: 0 20px;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    position: relative; /* anchor dot separator */
}

.timeline-event:nth-child(1) { animation-delay: 0.2s; }
.timeline-event:nth-child(2) { animation-delay: 0.4s; }
.timeline-event:nth-child(3) { animation-delay: 0.6s; }
.timeline-event:nth-child(4) { animation-delay: 0.8s; }

.event-icon {
    width: 56px;
    height: 56px;
    background: transparent; /* minimalist */
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.25s ease, color 0.25s ease;
}

.event-icon svg {
    width: 48px;
    height: 48px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.event-icon:hover { transform: scale(1.05); color: var(--accent-gold); }

.event-content {
    flex: 1;
    text-align: left;
}

.event-content h3 {
    font-family: 'Karla', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 1.2rem;
    color: #0C4A6E; /* secondary for headings */
    margin: 0 0 8px 0;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.event-time {
    font-family: 'Karla', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 1.05rem;
    color: var(--accent-blue); /* primary for times */
    margin: 0 0 8px 0;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.event-description {
    color: #64748B;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
    font-style: italic;
}

/* Decorative separators removed per request */
.timeline-event:not(:last-child)::after {
    content: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline-clock {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    /* Reduce only the HERO title on tablets */
    .hero .couple-names { font-size: 3rem; line-height: 1.15; }
    
    .timeline-title {
        font-size: 2rem;
    }
    
    .timeline-events {
        gap: 40px;
        padding: 0 10px;
    }
    
    .timeline-event {
        gap: 20px;
        padding: 0 10px;
    }
    
    .event-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .event-content h3 {
        font-size: 1.2rem;
    }
    
    .event-time {
        font-size: 1rem;
    }
    
    .event-description {
        font-size: 0.9rem;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Photo Gallery Section */
.gallery-section {
    padding: 80px 0;
        margin: 0;
        padding: 0;
    background: #f8f9fa;

    /* Root safeguard: prevent any horizontal scroll on mobile */
    html { overflow-x: hidden; width: 100%; }
    position: relative;
}



.gallery-subtitle {
    text-align: center;
    color: #E0E0E0;
    font-size: 1.1rem;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.photo-carousel {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(139,69,19,0.3);
    background: #fff;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(212, 175, 55, 0.9);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 3;
}

.carousel-btn:hover {
    background: rgba(212, 175, 55, 1);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn-prev {
    left: 20px;
}

.carousel-btn-next {
    right: 20px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: #D4AF37;
    transform: scale(1.2);
}

/* Responsive design for carousel */
@media (max-width: 768px) {
    .carousel-slide img {
        height: 300px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .carousel-btn-prev {
        left: 10px;
    }
    
    .carousel-btn-next {
        right: 10px;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
    }
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0C4A6E; /* secondary */
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0284C7;
    box-shadow: 0 0 0 3px rgba(2,132,199,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Simple Gallery */
.simple-gallery {
    padding: 60px 0 40px;
    /* Use the lighter paper tone like the countdown (Faltan) section for clear separation */
    background: var(--paper-bg-2);
    background-image: var(--paper-grain), var(--paper-grain), var(--paper-speckle), var(--paper-speckle), var(--paper-fibers);
    background-blend-mode: multiply, multiply, normal, normal, multiply;
    background-size: 180px 180px, 140px 140px, 260px 260px, 220px 220px, 320px 320px;
    background-attachment: scroll, scroll, scroll, scroll, scroll;
}


/* Info Section now uses paper texture */
.info-section {
    padding: 80px 0;
    background: var(--paper-bg);
    background-image: var(--paper-grain), var(--paper-grain), var(--paper-speckle), var(--paper-speckle), var(--paper-fibers);
    background-blend-mode: multiply, multiply, normal, normal, multiply;
    background-size: 180px 180px, 140px 140px, 260px 260px, 220px 220px, 320px 320px;
    background-attachment: scroll, scroll, scroll, scroll, scroll;
}

.info-card {
    background: var(--paper-bg-2);
    background-image: var(--paper-grain), var(--paper-grain), var(--paper-speckle), var(--paper-speckle), var(--paper-fibers);
    background-blend-mode: multiply, multiply, normal, normal, multiply;
    background-size: 160px 160px, 120px 120px, 240px 240px, 200px 200px, 300px 300px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 28px;
}

.gallery-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-blue); /* primary */
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.gallery-title {
    font-family: 'Amsterdam Four', 'Alegreya', serif;
    font-size: 2.5rem; /* match timeline size */
    color: #0C4A6E; /* secondary */
    position: relative;
    display: inline-block;
    padding: 10px 20px;
    font-weight: 400; /* align with timeline-title */
}

.gallery-title::after {
    content: '';
    display: block;
    height: 1px;
    width: 120px; /* match timeline underline width */
    background: var(--accent-gold); /* accent */
    margin: 10px auto 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-flow: dense;
    gap: 12px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    cursor: zoom-in;
}

/* Creative sizes */
.gallery-item.small { grid-column: span 2; aspect-ratio: 1 / 1; }
.gallery-item.wide { grid-column: span 3; aspect-ratio: 3 / 2; }
.gallery-item.tall { grid-column: span 2; aspect-ratio: 2 / 3; }
.gallery-item.hero { grid-column: span 4; aspect-ratio: 16 / 9; }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease, filter 0.35s ease;
    filter: grayscale(10%) saturate(75%) brightness(0.9) contrast(0.98);
}

.gallery-item.in-view img,
.gallery-item:hover img {
    transform: scale(1.04);
    filter: none; /* color original */
}

@media (max-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(4, 1fr); }
    .gallery-item.small { grid-column: span 2; }
    .gallery-item.wide { grid-column: span 2; }
    .gallery-item.tall { grid-column: span 2; }
    .gallery-item.hero { grid-column: span 4; }
}

@media (max-width: 600px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-item.small,
    .gallery-item.wide,
    .gallery-item.tall,
    .gallery-item.hero { grid-column: span 2; aspect-ratio: 4 / 3; }
    /* Tighten space before footer on phones */
    .simple-gallery { padding-bottom: 12px; }
}

/* Structured gallery layout similar to the reference (ordered) */
.gallery-grid.structured {
    grid-template-columns: 1.2fr 1.6fr 1.2fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "left top right"
        "left bottom right";
    gap: 24px;
}

.gallery-grid.structured .gallery-item { border-radius: 12px; }
.gallery-grid.structured .gallery-item.left { grid-area: left; aspect-ratio: 3 / 4; }
.gallery-grid.structured .gallery-item.right { grid-area: right; aspect-ratio: 3 / 4; }
.gallery-grid.structured .gallery-item.top { grid-area: top; aspect-ratio: 16 / 9; }
.gallery-grid.structured .gallery-item.bottom { grid-area: bottom; aspect-ratio: 16 / 9; }

@media (max-width: 900px) {
    .gallery-grid.structured {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "left top"
            "right bottom";
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .gallery-grid.structured {
        grid-template-columns: 1fr;
        grid-template-areas:
            "left"
            "top"
            "right"
            "bottom";
        gap: 12px;
    }
    .gallery-grid.structured .gallery-item.left,
    .gallery-grid.structured .gallery-item.right,
    .gallery-grid.structured .gallery-item.top,
    .gallery-grid.structured .gallery-item.bottom { aspect-ratio: 3 / 4; }
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox.open { display: flex; }

.lightbox-figure {
    margin: 0;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-figure img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.lightbox-figure figcaption {
    margin-top: 10px;
    color: #fff;
    font-size: 0.95rem;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(182,213,230,0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

.lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffffcc;
    font-size: 0.9rem;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #0284C7;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    background: #0284C7;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.submit-btn {
    width: 100%;
    background: #00B7EB; /* primary */
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,183,235,0.2);
}

.submit-btn:hover {
    transform: translateY(-1px);
    background: #0284C7; /* secondary hover */
    box-shadow: 0 4px 12px rgba(2,132,199,0.3);
}

.submit-btn i {
    margin-right: 10px;
}

/* Info Section */
.info-section {
    padding: 80px 0;
    background: #ffffff;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.info-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 8px;
    background: #f8f9fa;
    transition: transform 0.3s ease;
    border: 1px solid #ecf0f1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-icon {
    font-size: 2.2rem;
    color: #D4AF37;
    margin-bottom: 20px;
    opacity: 0.8;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-icon i {
    font-weight: 300;
}

.info-card:hover .info-icon {
    opacity: 1;
    transform: scale(1.1);
    color: #7DD3FC;
}

.info-card h3 {
    font-family: 'Karla', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.3px;
    color: #0284C7;
    margin-bottom: 10px;
}

.info-detail {
    font-family: 'Alegreya', serif;
    font-size: 0.9rem;
    color: #E0E0E0;
}

.gift-btn {
    background: #00B7EB;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(153,214,234,0.2);
}

.gift-btn:hover {
    background: #0284C7; /* secondary hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2,132,199,0.3);
}

/* Footer */
.footer {
    background: var(--accent-blue); /* primary */
    color: white;
    padding: 80px 0 60px; /* desktop default */
    text-align: center;
    position: relative;
    overflow: hidden; /* clip pseudo floral overlays to footer box to avoid white bands */
}

@media (max-width: 520px) {
    .footer { padding-top: 56px; }
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.footer .couple-names {
    color: #fff; /* footer names in white */
    margin-bottom: 42px; /* balance with footer florals */
    font-weight: 300; /* thinner specifically in footer */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.25); /* lighter shadow so it se vea más delgadita */
}

.couple-initials {
    font-family: 'Amsterdam Four', 'Alegreya', serif;
    font-size: 4rem;
    color: #64748B;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.footer-date {
    font-family: 'Alegreya', serif;
    font-size: 1.2rem;
    margin: 20px 0;
    color: #ecf0f1;
}

.social-links {
    margin-top: 30px;
}

.social-link {
    display: inline-block;
    margin: 0 15px;
    font-size: 1.5rem;
    color: #ecf0f1;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #64748B;
}

/* “Con amor, Rosa y Honorato” formatting */
.with-love { margin-top: 0; }

/* Footer &: keep white, no animation */
.footer .couple-names .ampersand {
    color: var(--accent-gold);
    animation: none;
    text-shadow: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-icon {
    font-size: 4rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
}

.modal-content h3 {
    font-family: 'Alegreya', serif;
    font-size: 1.8rem;
    color: #0C4A6E; /* secondary title */
    margin-bottom: 15px;
}

/* Buttons, labels and small UI using Karla bold for clarity */
.map-btn,
.submit-btn,
.gift-btn,
.lightbox-close,
.lightbox-nav,
.countdown-label,
.form-group label {
    font-family: 'Karla', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 700;
}

.countdown-number {
    font-family: 'Karla', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 800;
}

.modal-btn {
    background: var(--accent-blue); /* primary */
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.modal-btn:hover {
    background: var(--accent-gold); /* secondary hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromSides {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .couple-names {
        font-size: 2.5rem;
    }
    
    .ampersand {
        font-size: 2rem;
        margin: 0 10px;
    }
    
    .wedding-date {
        font-size: 1.4rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .countdown {
        gap: 20px;
    }
    
    .countdown-number {
        font-size: 2rem;
        padding: 15px;
    }
    
    .rsvp-form {
        padding: 30px 20px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .couple-initials {
        font-size: 3rem;
    }
}

@media (max-width: 520px) {
    /* Prevent any horizontal scroll and tighten seams between sections */
    html, body { overflow-x: hidden; }

    /* Keep hero full height without extra padding to avoid overflow */
    .hero { height: 100vh; min-height: 100vh; padding-top: 0; }

    /* Eliminate small white seams between stacked sections */
    .wedding-details,
    .countdown-section,
    .timeline-section,
    .simple-gallery,
    .info-section { margin-top: 0; margin-bottom: 0; }

    /* Slight negative overlap for first section to hide any 1px gap */
    .wedding-details { margin-top: -1px; }
    /* Slight negative overlap at footer bottom to hide tiny white strip */
    .footer { margin-bottom: -1px; }
}