/* =========================================
   VARIABLES & DESIGN SYSTEM
   ========================================= */
:root {
    /* Colors */
    --primary-color: #2c3e50; /* Deep Charcoal */
    --accent-color: #bfa37e; /* Soft Gold / Beige */
    --accent-hover: #a68962;
    --bg-color: #faf9f7; /* Off-white warm */
    --surface-color: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    
    /* Dark Mode specific variables for QR section */
    --dark-bg: #1c1c1c;
    --dark-surface: #2b2b2b;
    --dark-text: #f0f0f0;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --font-thai: 'Prompt', sans-serif;
    
    /* Layout */
    --container-width: 1200px;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* Radius & Effects */
    --border-radius: 8px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    /* For Thai text mixture, fallback */
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

/* Support for Thai headings using Prompt */
h1:lang(th), h2:lang(th), h3:lang(th),
.hero-title, .section-heading, .cta-title {
    font-family: var(--font-thai);
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

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

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 40px;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    border: 2px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-outline-white {
    background-color: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-outline-white:hover {
    background-color: #fff;
    color: var(--primary-color);
}

.btn-large {
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
}

.btn-link {
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.btn-link:hover {
    border-bottom: 1px solid var(--accent-color);
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
.section-heading {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.section-subheading {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* =========================================
   ANIMATIONS
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.navbar.scrolled .logo,
.navbar.scrolled .nav-links a {
    color: var(--primary-color);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    display: flex;
    align-items: center;
}

.logo-icon {
    display: inline-block;
    height: 1.3em; 
    width: auto;
    margin-right: 0.1em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: block;
    position: absolute;
    top: 150%;
    left: -20px;
    background-color: var(--surface-color);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    box-shadow: var(--shadow-hover);
    border-radius: var(--border-radius);
    padding: 0.5rem 0;
    transition: var(--transition);
    z-index: 1001;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    color: var(--text-primary) !important;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background-color: var(--bg-color);
    color: var(--accent-color) !important;
}

.mobile-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.mobile-dropdown-content a {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 30px;
    height: 2px;
    background-color: #fff;
    transition: var(--transition);
}

.navbar.scrolled .mobile-menu-btn span {
    background-color: var(--primary-color);
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--surface-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1);
    z-index: 999;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-menu a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* =========================================
   1. HERO SECTION
   ========================================= */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.hero-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 10s linear;
    transform: scale(1.05); /* Slight zoom effect start */
}

.hero-slider .slide.active {
    opacity: 1;
    transform: scale(1);
}

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

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: #fff;
    padding: 0 1rem;
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.9;
}

/* =========================================
   2. GALLERY GRID
   ========================================= */
.gallery-section {
    padding: var(--spacing-sm) 0;
    background-color: var(--bg-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 400px;
    gap: 0; /* Seamless grid */
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover img {
    transform: scale(1.08); /* Zoom effect on hover */
}

/* =========================================
   PERFECT JUSTIFIED PORTFOLIO GRID (Math-based Flexbox)
   ========================================= */
.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px; /* tight modern gap as requested */
    padding: 10px;
}

.portfolio-grid .gallery-item {
    margin: 0;
    position: relative;
    /* Flex properties will be applied dynamically via JS */
    overflow: hidden;
    border-radius: 6px;
}

.portfolio-grid .gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover handles 1px sub-pixel rounding */
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-grid::after {
    content: '';
    flex-grow: 999999999; /* Prevents the last row from stretching wide */
    min-width: 20%;
}

@media (max-width: 600px) {
    .portfolio-grid {
        gap: 4px;
        padding: 4px;
    }
    .portfolio-grid .gallery-item {
        border-radius: 4px;
    }
}

/* =========================================
   ALBUM COVER OVERLAYS
   ========================================= */
.cover-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cover-item:hover::before {
    opacity: 1;
}

.cover-overlay {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    z-index: 2;
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.cover-item:hover .cover-overlay {
    opacity: 1;
    transform: translateY(0);
}

.cover-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
    font-family: var(--font-thai);
}

.cover-overlay p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

/* Alternate row heights for masonry-like feel */
.gallery-grid .gallery-item:nth-child(2),
.gallery-grid .gallery-item:nth-child(4),
.gallery-grid .gallery-item:nth-child(5),
.gallery-grid .gallery-item:nth-child(7) {
    grid-row: span 1;
}

/* Responsive Gallery */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 350px;
    }
}
@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
}


/* =========================================
   3. FEATURED STORY
   ========================================= */
.featured-story {
    padding: var(--spacing-xl) 0;
    background-color: var(--surface-color);
}

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.story-stats h3 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0;
    font-weight: 600;
}

.story-stats p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.story-quote blockquote {
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1.4;
    color: var(--primary-color);
    position: relative;
    padding-left: 2rem;
    border-left: 4px solid var(--accent-color);
    font-style: italic;
}


/* =========================================
   4. ICONIC SECTION
   ========================================= */
.iconic-section {
    padding: 10rem 2rem;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Parallax effect */
    position: relative;
    text-align: center;
    color: #fff;
}

.overlay.dark {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 26, 26, 0.6);
}

.iconic-content {
    position: relative;
    z-index: 2;
}

.iconic-content h2 {
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 5px;
    margin-bottom: 1rem;
}

.iconic-content p {
    font-size: 1.5rem;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
}

/* =========================================
   5. PROBLEMS SECTION
   ========================================= */
.problems-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-color);
}

.problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.problem-card {
    background: var(--surface-color);
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    position: relative;
    transition: var(--transition);
}

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

.problem-num {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-style: italic;
    color: rgba(191, 163, 126, 0.2); /* Faded accent */
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    line-height: 1;
}

.problem-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.problem-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}


/* =========================================
   6. WHY US SECTION
   ========================================= */
.why-us-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--surface-color);
}

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

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px; height: 80px;
    background: rgba(191, 163, 126, 0.1);
    border-radius: 50%;
}

.feature-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* =========================================
   7. PACKAGES SECTION
   ========================================= */
.packages-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-color);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    align-items: center; /* Center to allow popular to pop out */
}

.pricing-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pricing-card.popular {
    transform: scale(1.05);
    border-color: var(--accent-color);
    box-shadow: 0 20px 50px rgba(191, 163, 126, 0.15);
    z-index: 2;
}

.badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.premium-badge { background: var(--primary-color); }

.package-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.package-header h3 { font-size: 1.8rem; }
.package-header .time { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
.package-header .price { display: flex; flex-direction: column; align-items: center; }
.old-price { text-decoration: line-through; color: #999; font-size: 1rem; }
.new-price { font-size: 2.5rem; font-weight: 700; color: var(--primary-color); line-height: 1; }

.package-features {
    flex-grow: 1;
    margin-bottom: 2rem;
}

.package-features li {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.package-features li strong { color: var(--primary-color); }

.disabled { opacity: 0.4; text-decoration: line-through; }

.pricing-note {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem;
    background: rgba(191, 163, 126, 0.1);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    font-size: 0.95rem;
}

/* =========================================
   8. QR SECTION (DARK MODE)
   ========================================= */
.qr-section {
    padding: var(--spacing-xl) 0;
    background-color: #f9f6f0;
    color: var(--text-primary);
}

.qr-section .section-heading { color: var(--primary-color); }
.qr-section .section-subheading { color: var(--text-secondary); margin-bottom: 1rem; }

.qr-link {
    display: inline-block;
    color: var(--accent-color);
    margin-bottom: 2rem;
}
.qr-desc { color: var(--text-secondary); margin-bottom: 4rem; }

.dark-card {
    background: var(--surface-color);
    border: 1px solid rgba(0,0,0,0.05);
}

.dark-card .package-header { border-bottom-color: rgba(0,0,0,0.05); }
.dark-card .new-price, .dark-card h3 { color: var(--primary-color); }
.dark-card .package-features li strong { color: var(--primary-color); }

.price-list { text-align: left; margin-top: 1rem; }
.price-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    font-size: 0.95rem;
}
.price-list li span { font-weight: 600; color: var(--accent-color); }

/* =========================================
   9. COMPARE SECTION
   ========================================= */
.compare-section {
    padding: var(--spacing-xl) 0;
    background: var(--surface-color);
}

.table-responsive {
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 3rem;
}

.compare-table th, .compare-table td {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.compare-table th {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary-color);
    background: var(--bg-color);
}

.compare-table th:first-child, .compare-table td:first-child {
    text-align: left;
    font-family: var(--font-body);
    font-weight: 500;
}

/* =========================================
   10. CTA SECTION
   ========================================= */
.cta-section {
    padding: 8rem 2rem;
    background-color: #f0e9df;
    color: var(--text-primary);
}

.cta-subtitle {
    font-family: var(--font-heading);
    color: var(--accent-hover);
    font-style: italic;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.cta-title {
    color: var(--primary-color);
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 2rem;
}

.cta-alert {
    display: inline-block;
    padding: 1rem 2rem;
    background: rgba(255,255,255,0.6);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================
   11. FOOTER
   ========================================= */
.footer {
    background-color: #faf9f7;
    color: var(--text-secondary);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    gap: 2rem;
}

.footer-logo {
    color: var(--primary-color);
    font-family: var(--font-heading);
    letter-spacing: 2px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.footer-links h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.85rem;
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 992px) {
    .split-layout { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .story-quote blockquote { padding: 0; border-left: none; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; }
    .pricing-card.popular { transform: scale(1); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .cta-actions { flex-direction: column; }
    .footer-content { flex-direction: column; text-align: center; }
}
