/* ==================================================
   CSS Variables (Theme Palette)
   ================================================== */
   :root {
    --color-bg-primary: #FCF9F2; /* Cream */
    --color-bg-secondary: #F5EBE0; /* Warm beige */
    --color-soft-brown: #D5B495;
    --color-orange: #E07A5F;
    --color-red: #C66A65;
    --color-text: #333333; /* Dark charcoal */
    --color-white: #FFFFFF;
    
    --font-heading: 'Lora', serif;
    --font-body: 'Open Sans', sans-serif;
    
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.12);
    --radius-lg: 16px;
    --radius-md: 12px;
    
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==================================================
   Global Resets & Base Styles
   ================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

a {
    text-decoration: none;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.section {
    padding: 5rem 0;
}

.text-center {
    text-align: center;
}

.section-header {
    margin-bottom: 3rem;
}

.bg-beige {
    background-color: var(--color-bg-secondary);
}

.bg-soft-brown {
    background-color: var(--color-soft-brown);
    color: var(--color-bg-primary);
}

/* ==================================================
   Image Fallback System
   ================================================== */
.image-wrapper {
    position: relative;
    background-color: #EFE8DD;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-wrapper::before {
    content: "Photo coming soon";
    position: absolute;
    font-family: var(--font-body);
    color: var(--color-soft-brown);
    font-weight: 600;
    font-size: 1rem;
    z-index: 1;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    transition: var(--transition-smooth);
}

/* Added by JS when an image fails to load */
.image-wrapper img.fallback-active {
    opacity: 0;
    visibility: hidden;
}

/* ==================================================
   1. Hero Section
   ================================================== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(51,51,51,0.3), rgba(51,51,51,0.7));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    color: var(--color-white);
    padding: 0 1.5rem;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 4rem;
    color: var(--color-white);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.hero-content .subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2.5rem;
}

.btn-primary {
    display: inline-block;
    background-color: var(--color-orange);
    color: var(--color-white);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--color-red);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* ==================================================
   2. About Him
   ================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.portrait-wrapper {
    border-radius: var(--radius-lg);
    aspect-ratio: 3 / 4;
    box-shadow: var(--shadow-soft);
}

.about-text-col h2 {
    font-size: 2.5rem;
    color: var(--color-orange);
}

/* ==================================================
   3. Greatest Achievement
   ================================================== */
.lead-text {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--color-red);
    margin-bottom: 1.5rem;
}

.kids-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

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

.card-image {
    aspect-ratio: 4 / 3;
}

.card-body {
    padding: 1.5rem;
    text-align: center;
}

.card-body h3 {
    margin-bottom: 0.5rem;
    color: var(--color-orange);
}

.card-body p {
    margin: 0;
    font-size: 1rem;
    color: #666;
}

/* ==================================================
   4. Family Gallery
   ================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border-radius: var(--radius-md);
    aspect-ratio: 1 / 1;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* ==================================================
   5. Timeline
   ================================================== */
.timeline-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 4px;
    background: var(--color-soft-brown);
    border-radius: 4px;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 2.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 12px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--color-orange);
    border-radius: 50%;
    border: 4px solid var(--color-bg-secondary);
    box-shadow: 0 0 0 2px var(--color-soft-brown);
}

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

.timeline-content p {
    margin: 0;
    font-size: 1rem;
}

/* ==================================================
   6. Values
   ================================================== */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.value-card {
    background: var(--color-white);
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

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

.value-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.value-card h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--color-text);
}

/* ==================================================
   7. Quote Section
   ================================================== */
.quote-box {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1.4;
    max-width: 800px;
    margin: 0 auto;
    color: var(--color-bg-primary);
}

/* ==================================================
   8. Footer
   ================================================== */
footer {
    background-color: var(--color-white);
    color: var(--color-text);
    text-align: center;
    padding: 3rem 0;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-style: italic;
}

footer p {
    margin: 0;
}

/* ==================================================
   Animations
   ================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================================================
   Responsive Design
   ================================================== */

/* Tablet */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .portrait-wrapper {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .about-text-col {
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content .subtitle {
        font-size: 1.125rem;
    }
    
    .section {
        padding: 3.5rem 0;
    }
    
    .quote-box {
        font-size: 1.5rem;
    }
}

/* ==================================================
   Language Switcher & Multi-language Display
   ================================================== */

/* Hide/Show logic based on html[lang] attribute */
html[lang="en"] .lang-vi {
    display: none !important;
}

html[lang="vi"] .lang-en {
    display: none !important;
}

/* Floating Switcher Position */
.lang-switcher-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Language Button Styling */
.btn-lang {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    color: var(--color-text);
    border: 1px solid var(--color-soft-brown);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-lang:hover {
    background-color: var(--color-orange);
    color: var(--color-white);
    border-color: var(--color-orange);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
/* Prevent right-clicking, selecting, and dragging images */
img {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
/* ==================================================
   Block Right-Click & Selection
   ================================================== */
.image-wrapper,
img {
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}
