/**
 * Wedding Page Styles
 * Main stylesheet for wedding invitation page sections
 * Depends on: variables.css
 */

/* Typography Utilities */
.script-font { 
    font-family: var(--font-script);
    font-feature-settings: "liga" 1, "kern" 1;
}

.elegant-font { 
    font-family: var(--font-elegant);
    font-feature-settings: "liga" 1, "kern" 1;
}

.bilingual-text {
    font-family: var(--font-body);
}

/* Hero Section Styles - Matching wireframe design */
.hero-section {
    position: relative;
    min-height: 100vh; /* Full viewport height */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Match wireframe gradient exactly */
    background: linear-gradient(135deg, 
        rgba(255, 245, 250, 0.8) 0%, 
        rgba(250, 240, 255, 0.6) 50%, 
        rgba(255, 250, 240, 0.8) 100%);
}

.hero-section.has-background {
    background: none;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Maintain aspect ratio, cover entire area */
    object-position: center; /* Center the image */
    z-index: 0;
    /* Prevent image from breaking layout */
    max-width: 100%;
    max-height: 100%;
    /* Ensure smooth loading */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-script);
    font-size: 2.5rem; /* text-4xl equivalent */
    font-weight: 700;
    color: var(--warm-brown);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem; /* text-6xl equivalent */
    }
}

.hero-couple-names {
    font-family: 'Dancing Script', 'Be Vietnam Pro', cursive;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--warm-brown);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .hero-couple-names {
        font-size: 4rem;
    }
}

.hero-date {
    font-family: 'Be Vietnam Pro', 'Noto Serif', serif;
    font-size: 1.25rem;
    color: var(--warm-brown-light);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .hero-date {
        font-size: 1.5rem;
    }
}

.hero-quote {
    font-family: 'Be Vietnam Pro', 'Cormorant Garamond', serif;
    font-size: 1.125rem;
    font-style: italic;
    color: var(--warm-brown-lighter);
    margin-top: 1.5rem;
}

/* Decorative elements for hero */
.hero-decorative-star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--soft-gold);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    pointer-events: none;
    animation: gentle-float 4s ease-in-out infinite;
    opacity: 0.7;
    z-index: 1;
}

.hero-decorative-star:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.hero-decorative-star:nth-child(2) { top: 20%; left: 90%; animation-delay: 1.5s; }
.hero-decorative-star:nth-child(3) { top: 80%; left: 10%; animation-delay: 3s; }
.hero-decorative-star:nth-child(4) { top: 60%; left: 95%; animation-delay: 0.5s; }

.hero-decorative-heart {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--blush-pink);
    clip-path: path('M12,21.35l-1.45-1.32C5.4,15.36,2,12.28,2,8.5 C2,5.42,4.42,3,7.5,3c1.74,0,3.41,0.81,4.5,2.09C13.09,3.81,14.76,3,16.5,3 C19.58,3,22,5.42,22,8.5c0,3.78-3.4,6.86-8.55,11.54L12,21.35z');
    pointer-events: none;
    animation: gentle-float 5s ease-in-out infinite;
    opacity: 0.6;
    z-index: 1;
}

.hero-decorative-heart:nth-child(5) { top: 15%; left: 50%; animation-delay: 2s; }
.hero-decorative-heart:nth-child(6) { top: 85%; left: 55%; animation-delay: 1s; }

@keyframes gentle-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-8px) rotate(5deg);
        opacity: 1;
    }
}

/* Countdown Timer Section */
.countdown-section {
    position: relative;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-primary);
    overflow: hidden;
}

/* Pulse animation for countdown section - More visible */
.countdown-pulse {
    animation: countdown-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes countdown-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.98;
    }
}

/* Decorative sparkle elements for countdown - More visible */
.countdown-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--soft-gold);
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle-twinkle 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--soft-gold), 0 0 12px var(--light-gold);
    z-index: 1;
}

.countdown-sparkle:nth-child(1) { 
    top: 15%; 
    left: 10%; 
    animation-delay: 0s; 
}

.countdown-sparkle:nth-child(2) { 
    top: 20%; 
    right: 15%; 
    animation-delay: 0.5s; 
}

.countdown-sparkle:nth-child(3) { 
    bottom: 25%; 
    left: 20%; 
    animation-delay: 1s; 
}

.countdown-sparkle:nth-child(4) { 
    bottom: 15%; 
    right: 10%; 
    animation-delay: 1.5s; 
}

@keyframes sparkle-twinkle {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(2) rotate(180deg);
    }
}

.countdown-container {
    max-width: 1200px;
    margin: 0 auto;
}

.countdown-title {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--warm-brown);
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .countdown-title {
        font-size: 2.5rem;
    }
}

.countdown-display {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top to match numbers */
    gap: 0.5rem;
    flex-wrap: wrap;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.countdown-number {
    font-family: var(--font-elegant);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--warm-brown);
    line-height: 1;
    margin-bottom: 0.5rem;
    height: 2.5rem; /* Fixed height to align separators */
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .countdown-number {
        font-size: 3.5rem;
        height: 3.5rem;
    }
}

.countdown-label {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--warm-brown-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.countdown-separator {
    font-family: var(--font-elegant);
    font-size: 2.5rem;
    color: var(--warm-brown);
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 2.5rem; /* Match number height */
    margin-top: 0; /* Align with numbers */
    padding-top: 0;
}

@media (min-width: 768px) {
    .countdown-separator {
        font-size: 3.5rem;
        height: 3.5rem;
    }
}

/* Story Section */
.story-section {
    position: relative;
    padding: 4rem 2rem;
    background: var(--bg-primary);
    overflow: hidden;
}

/* Decorative sparkle elements for story */
.story-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--soft-gold);
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle-twinkle 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--soft-gold), 0 0 12px var(--light-gold);
    z-index: 1;
}

.story-sparkle:nth-child(1) { 
    top: 10%; 
    left: 5%; 
    animation-delay: 0s; 
}

.story-sparkle:nth-child(2) { 
    top: 15%; 
    right: 8%; 
    animation-delay: 0.5s; 
}

.story-sparkle:nth-child(3) { 
    bottom: 20%; 
    left: 10%; 
    animation-delay: 1s; 
}

.story-sparkle:nth-child(4) { 
    bottom: 10%; 
    right: 5%; 
    animation-delay: 1.5s; 
}

.story-container {
    max-width: 1200px;
    margin: 0 auto;
}

.story-title {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--warm-brown);
    text-align: center;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .story-title {
        font-size: 3.5rem;
    }
}

.story-items {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.story-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 768px) {
    .story-item {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    /* Alternate layout: image left/right */
    .story-item:nth-child(even) {
        direction: rtl;
    }
    
    .story-item:nth-child(even) > * {
        direction: ltr;
    }
}

.story-item-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-soft);
}

.story-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.story-item:hover .story-image {
    transform: scale(1.05);
}

.story-item-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.story-date {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--warm-brown-lighter);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 500;
}

.story-text {
    font-family: var(--font-elegant);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--warm-brown-light);
}

.story-text p {
    margin-bottom: 1rem;
}

.story-text p:last-child {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .story-text {
        font-size: 1.125rem;
    }
}

/**
 * Language Visibility System
 * Uses CSS classes on body element to toggle between Vietnamese and English content
 * High specificity to override Tailwind CSS if needed
 */

/* Default state: Show Vietnamese, hide English */
body.template-wedding .lang-vi { 
    display: block !important; 
}

body.template-wedding .lang-en { 
    display: none !important; 
}

/* Inline elements (spans in navigation, links) */
body.template-wedding span.lang-vi,
body.template-wedding a .lang-vi {
    display: inline !important;
}

body.template-wedding span.lang-en,
body.template-wedding a .lang-en {
    display: none !important;
}

/* English state: Show English, hide Vietnamese */
body.template-wedding.lang-en .lang-vi { 
    display: none !important; 
}

body.template-wedding.lang-en .lang-en { 
    display: block !important; 
}

body.template-wedding.lang-en span.lang-en,
body.template-wedding.lang-en a .lang-en {
    display: inline !important;
}

