/* --- Imports: Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Philosopher:ital,wght@0,400;0,700;1,400&display=swap');

/* --- CSS Variables & Reset --- */
:root {
    --color-bg-body: #1a241a;
    --color-bg-parchment: #f0ece2;
    --color-text-dark: #2b3a29;
    --color-text-light: #f3f8f3;
    --color-accent: #6b8e65; 
    
    --font-heading: 'Cinzel Decorative', cursive;
    --font-body: 'Philosopher', sans-serif;
    
    --container-width: 1100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg-body);
    color: var(--color-text-dark);
    font-family: var(--font-body);
    line-height: 1.6;
    font-size: 16px; /* Smaller mobile base size */
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-text-dark);
    font-weight: 700;
    line-height: 1.3;
}

h1.page-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--color-bg-parchment);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    padding: 0 10px;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.2rem;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.3s ease;
}

img:hover {
    transform: scale(1.02);
}

/* --- Layout Containers --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Navigation --- */
header {
    background-color: rgba(18, 28, 18, 0.98);
    padding: 0.8rem 0;
    border-bottom: 3px solid var(--color-accent);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

nav li a {
    text-decoration: none;
    color: var(--color-text-light);
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 0.3rem;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

nav li a:hover, nav li a.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* --- Page Structure --- */

/* 1. Reset main padding so it doesn't mess up the Home page hero */
main {
    padding: 0;
}

/* 2. Add specific spacing ONLY for standard pages (Map, Culture, etc.) 
   "main.container" targets pages like map.html, but NOT index.html */
main.container {
    /* 100px top = ~60px for menu + 40px visible gap */
    padding-top: 100px; 
    padding-bottom: 2rem;
}

/* --- Content Box --- */
.content-box {
    position: relative;
    padding: 1.5rem 1.2rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text-light); 
    overflow: hidden;
    z-index: 1; 
}

.content-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: inherit; 
    background-size: cover;
    background-position: center;
    filter: blur(12px) brightness(0.25);
    transform: scale(1.1);
}

.content-box h3, 
.content-box h1, 
.content-box strong {
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}

/* Grid layout */
.two-col-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.two-col-grid .image-block {
    order: -1; /* Image on top for mobile */
}
.two-col-grid .text-block {
    order: 1;
}

/* --- Hero Section (Home) MOBILE DEFAULT --- */
.hero-section {
    position: relative;
    min-height: 100vh; 
    width: 100%;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    
    /* PADDING FIX: 80px top clears the menu, 60px bottom for spacing */
    padding: 80px 20px 60px 20px;
    
    /* SAFETY: Remove overflow hidden so text isn't cut off */
    overflow: visible; 
}

/* Background Layers */
.hero-bg-img,
.hero-static-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-static-bg {
    z-index: -2; /* Deepest layer */
    filter: brightness(0.6);
}

.hero-bg-img {
    z-index: -1; /* Above static image */
    transition: opacity 1.5s ease;
    opacity: 1;
}

.hero-bg-img.fade-out {
    opacity: 0;
}

/* Content Layer */
.hero-content {
    position: relative;
    z-index: 10; /* Sits on top */
    
    text-align: center;
    color: var(--color-text-light);
    max-width: 100%;
    width: 800px;
    padding: 1.5rem;
    
    background: rgba(0,0,0,0.6);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(3px);
    
    margin-top: 0;
}

.hero-content h2 {
    font-size: 1.8rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--color-accent);
    font-family: var(--font-heading);
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* --- LIGHTBOX (Popup) --- */
#lightbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox-modal.show {
    display: flex;
    opacity: 1;
}

#lightbox-img {
    max-width: 95%;
    max-height: 80vh;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
    border: 2px solid var(--color-text-light);
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    font-family: sans-serif;
    line-height: 1;
}

/* ========================================= */
/* --- DESKTOP / TABLET OVERRIDES (min-width: 768px) --- */
/* ========================================= */
@media (min-width: 768px) {
    body {
        font-size: 18px;
    }

    .container {
        padding: 0 20px;
    }

    .content-box {
        padding: 3rem;
    }

    .two-col-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    /* Restore order for desktop */
    .two-col-grid .image-block { order: 0; }
    .two-col-grid .text-block { order: 0; }

    nav ul {
        gap: 2rem;
    }
    
    nav li a {
        font-size: 1.1rem;
    }

    h1.page-title {
        font-size: 2.5rem;
    }
    
    h3 {
        font-size: 1.8rem;
    }

    /* DESKTOP HERO FIXES */
    .hero-section {
        /* Allow it to grow if text is long, but fill at least full screen */
        min-height: 100vh;
        height: auto; 
        
        /* Add top padding so content starts BELOW the menu */
        padding-top: 120px; 
        padding-bottom: 60px;
        
        /* Align to top (flex-start) so it doesn't get cut off vertically */
        justify-content: flex-start; 
    }

    .hero-content {
        padding: 3rem;
    }

    .hero-content h2 {
        font-size: 3.5rem;
    }

    .hero-content p {
        font-size: 1.3rem;
    }
}

/* ========================================= */
/* --- PAGE SPECIFIC BACKGROUNDS (Updated) --- */
/* ========================================= */

/* 1. Common settings */
body.bg-map, 
body.bg-culture, 
body.bg-arch, 
body.bg-nature {
    background-size: cover;
    background-position: center;
    background-attachment: fixed; 
    background-repeat: no-repeat;
    
    /* Ensure the base color is still there behind the image */
    background-color: var(--color-bg-body);
}

/* 2. Assign images with a "Half-Transparent" Dark Overlay */
/* We use rgba(26, 36, 26, 0.6) which matches your theme color #1a241a */

body.bg-map {
    /* 0.6 means 60% dark color, 40% image visible */
    background-image: linear-gradient(rgba(26, 36, 26, 0.7), rgba(26, 36, 26, 0.6)), 
                      url('../images/valoria-map.jpg');
}

body.bg-culture {
    background-image: linear-gradient(rgba(26, 36, 26, 0.7), rgba(26, 36, 26, 0.6)), 
                      url('../images/valoria-culture.jpg');
}

body.bg-arch {
    background-image: linear-gradient(rgba(26, 36, 26, 0.7), rgba(26, 36, 26, 0.6)), 
                      url('../images/valoria-architecture.jpg');
}

body.bg-nature {
    background-image: linear-gradient(rgba(26, 36, 26, 0.7), rgba(26, 36, 26, 0.6)), 
                      url('../images/valoria-nature.jpg');
}

/* 3. Footer Styling */
body[class*="bg-"] footer {
    color: var(--color-bg-parchment);
    text-shadow: 0 2px 4px rgba(0,0,0,0.9);
    /* Make footer background slightly darker for contrast */
    background: rgba(0,0,0,0.6); 
}