/* Global Design System for Junta de Estudios Históricos de Ramallo */
:root {
    /* Color Palette */
    --color-primary: #15803d;
    /* Modern Green (Emerald-700) - darker for readability */
    --color-secondary: #d97706;
    /* Amber-600 (Gold/Bronze update to match) */
    --color-accent: #e76f51;
    /* Terracotta/Brick (Archaeology) */
    --color-background: #f4f1ea;
    /* Parchment/Paper */
    --color-surface: #ffffff;
    --color-text: #2c3e50;
    --color-text-light: #606f7b;
    --color-border: #dcd6cc;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

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

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-surface);
}

.btn-primary:hover {
    background-color: #2c3e50;
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-surface);
}

/* Header & Navigation */
header {
    background-color: var(--color-surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.25rem;
    text-decoration: none;
}

.logo img {
    height: 85px;
    /* Restrict logo height */
    width: auto;
}

/* Hero Section */
.hero {
    background-color: var(--color-primary);
    color: var(--color-surface);
    padding: var(--spacing-xl) 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    /* Only on the right */
    width: 50%;
    /* Occupy right half */
    height: 100%;
    background-image: url('../assets/hero_background_map_final.jpg');
    background-size: cover;
    background-position: center left;
    /* Adjust focus */
    filter: sepia(1) contrast(1.1) opacity(0.8);
    /* Max Sepia */
    z-index: 1;
    /* Soft fade from left (transparent) to right (visible) */
    mask-image: linear-gradient(to right, transparent 0%, black 30%, black 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 30%, black 100%);
    background-color: transparent;
}

/* Red Dot Removed */
.hero::after {
    display: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 50%;
    /* Strictly limit text to lighter side */
    padding-right: 2rem;
    /* Buffer */
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--color-surface);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    /* Improve readability over image */
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.95;
    max-width: 600px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

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

.nav-links a {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text);
}

@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
        padding: 1rem 0;
        border-top: 1px solid var(--color-border);
        margin-top: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 0.5rem 0;
    }

    /* Mobile Hero Optimizations */
    .hero {
        padding: var(--spacing-lg) 0;
        /* Reduce padding */
    }

    .hero h1 {
        font-size: 2.5rem;
        /* Smaller heading */
    }

    .hero-content {
        max-width: 100%;
        /* Full width text */
        padding-right: 0;
        text-align: center;
        /* Center text on mobile */
    }

    .hero::before {
        /* Move map to bottom or make it subtle background */
        width: 100%;
        height: 50%;
        top: auto;
        bottom: 0;
        mask-image: linear-gradient(to top, black 20%, transparent 100%);
        -webkit-mask-image: linear-gradient(to top, black 20%, transparent 100%);
        opacity: 0.6;
    }

    /* Fix Footer/Container Overflow */
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    footer .container {
        padding: 0 1rem;
    }
}

/* =========================================
   Micro-animations & Transitions
   ========================================= */

/* 1. Page Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeIn 0.6s ease-out forwards;
}

/* 2. Navigation Link Underline */
.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-secondary);
    /* Using secondary color for contrast */
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* 3. Button Interactions */
.btn {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.2s ease,
        color 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 4. Card Hover Effects */
/* Applying to common card classes */
.feature-card,
.archive-card,
.activity-card,
.card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover,
.archive-card:hover,
.activity-card:hover,
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

/* 5. Image Lazy Load Fade In */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

.activity-card {
    animation: fadeIn 0.5s ease-out forwards;
}

.activity-card:nth-child(2) {
    animation-delay: 0.2s;
}