/*
Theme Name: Alto Aragón Explorer
Theme URI: https://vallealtoaragon.es
Description: Tema personalizado para la Mancomunidad del Valle Alto Aragón
Version: 1.0
Author: Mancomunidad del Valle Alto Aragón
Text Domain: alto-aragon
*/

/* ===================== VARIABLES ===================== */
:root {
    --primary: #2d6a4f;
    --primary-dark: #1e4d39;
    --primary-foreground: #ffffff;
    --background: #ffffff;
    --foreground: #0f2518;
    --secondary: #f0f5f2;
    --secondary-foreground: #1a3d28;
    --card: #ffffff;
    --border: #d4e8db;
    --muted: #f0f5f2;
    --muted-foreground: #6b8072;
    --accent: #52b788;
    --radius: 0.75rem;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.14);
}

/* ===================== RESET ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--foreground);
    background: var(--background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; }

/* ===================== LAYOUT ===================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; padding-top: 64px; }

/* ===================== HEADER ===================== */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    height: 64px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.2s;
}
.site-header.scrolled { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    flex-shrink: 0;
}
.site-logo .logo-icon { color: var(--primary); flex-shrink: 0; }

/* Desktop nav */
.main-nav { display: flex; align-items: center; gap: 0.25rem; }
.main-nav a {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.main-nav a:hover { color: var(--foreground); background: var(--muted); }
.main-nav a.is-current { background: var(--primary); color: var(--primary-foreground); }

/* Mobile toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    color: var(--foreground);
    border-radius: 0.375rem;
    transition: background 0.15s;
}
.nav-toggle:hover { background: var(--muted); }

/* Mobile nav */
.mobile-nav {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    z-index: 49;
    padding: 0.75rem 1.5rem 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.mobile-nav.is-open { display: block; }
.mobile-nav a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: background 0.15s, color 0.15s;
}
.mobile-nav a:hover { background: var(--muted); color: var(--foreground); }
.mobile-nav a.is-current { background: var(--primary); color: var(--primary-foreground); }

@media (max-width: 768px) {
    .main-nav { display: none; }
    .nav-toggle { display: block; }
}

/* ===================== HERO SECTIONS ===================== */
.home-hero {
    position: relative;
    height: 85vh;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}
.home-hero .hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.home-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15,37,24,0.38) 0%, rgba(15,37,24,0.18) 50%, rgba(15,37,24,0.62) 100%);
}
.home-hero .hero-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a3d28 0%, #2d6a4f 60%, #52b788 100%);
}
.home-hero-content {
    position: relative;
    z-index: 10;
}
.home-hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.home-hero-content .hero-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    max-width: 42rem;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.page-hero {
    position: relative;
    height: 50vh;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.page-hero .hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.page-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,37,24,0.72) 0%, rgba(15,37,24,0.3) 60%, transparent 100%);
}
.page-hero .hero-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a3d28 0%, #2d6a4f 100%);
}
.page-hero-content {
    position: relative;
    z-index: 10;
    padding-bottom: 2.5rem;
    width: 100%;
}
.page-hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.page-hero-content p {
    color: rgba(255,255,255,0.88);
    font-size: clamp(0.9375rem, 2vw, 1.125rem);
    max-width: 42rem;
    line-height: 1.6;
}

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    cursor: pointer;
    border: none;
    line-height: 1;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(45,106,79,0.4); }
.btn-email { background: var(--primary); color: var(--primary-foreground); }
.btn-email:hover { background: var(--primary-dark); }

/* ===================== STATS BAR ===================== */
.stats-bar {
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 1.5rem 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 1rem;
}
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-item { display: flex; align-items: center; gap: 0.75rem; }
.stat-icon { opacity: 0.7; flex-shrink: 0; }
.stat-value { font-size: 1.625rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8125rem; opacity: 0.82; margin-top: 0.125rem; }

/* ===================== SECTIONS ===================== */
.section { padding: 4rem 0; }
.section-sm { padding: 2.5rem 0; }
.section-secondary { background: var(--secondary); }

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 2rem;
    line-height: 1.2;
}
.section-secondary .section-title { color: var(--secondary-foreground); }

/* Intro */
.intro-block {
    max-width: 48rem;
    margin: 0 auto;
    text-align: center;
}
.intro-block h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.intro-block p {
    color: var(--muted-foreground);
    font-size: 1.0625rem;
    line-height: 1.75;
}

/* ===================== GRIDS ===================== */
.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
}
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

.grid-2-seasonal {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) { .grid-2-seasonal { grid-template-columns: repeat(2, 1fr); } }

/* ===================== INFO CARD ===================== */
.info-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s;
}
.info-card:hover { box-shadow: var(--shadow-hover); }
.info-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    background: rgba(45,106,79,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary);
}
.info-card h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--foreground);
    line-height: 1.3;
}
.info-card p { color: var(--muted-foreground); font-size: 0.875rem; line-height: 1.65; }

/* Small info card (used in villages grid) */
.info-card-sm { padding: 1.25rem; }
.info-card-sm .info-card-icon { width: 2.5rem; height: 2.5rem; margin-bottom: 0.75rem; }
.info-card-sm h3 { font-size: 1rem; }

/* ===================== SECTION CARD ===================== */
.section-card {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.3s, transform 0.3s;
}
.section-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.section-card-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--muted);
}
.section-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.section-card:hover .section-card-image img { transform: scale(1.05); }
.section-card-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}
.section-card-body { padding: 1.25rem; }
.section-card-body h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}
.section-card-body p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.65;
    margin-bottom: 0.875rem;
}
.section-card-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.2s;
}
.section-card:hover .section-card-link { gap: 0.5rem; }

/* ===================== DISH / ITEM CARD ===================== */
.dish-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}
.dish-card h3 {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.dish-card p { color: var(--muted-foreground); font-size: 0.875rem; line-height: 1.65; }

/* ===================== SEASON CARD ===================== */
.season-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}
.season-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
}
.season-list { display: flex; flex-direction: column; gap: 0.625rem; }
.season-list li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.4;
}
.season-list li::before {
    content: '';
    display: block;
    width: 0.5rem;
    height: 0.5rem;
    min-width: 0.5rem;
    border-radius: 50%;
    background: var(--accent);
}

/* ===================== FEATURE SECTION ===================== */
.feature-text h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--secondary-foreground);
    margin-bottom: 1rem;
    line-height: 1.2;
}
.feature-text > p {
    color: var(--muted-foreground);
    line-height: 1.75;
    margin-bottom: 1.25rem;
}
.feature-list { display: flex; flex-direction: column; gap: 0.625rem; }
.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--muted-foreground);
    font-size: 0.9375rem;
}
.feature-list li::before {
    content: '';
    display: block;
    width: 0.5rem;
    height: 0.5rem;
    min-width: 0.5rem;
    border-radius: 50%;
    background: var(--primary);
}

/* Winter section icon+title */
.winter-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.winter-heading .winter-icon { color: var(--primary); flex-shrink: 0; }
.winter-heading h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--secondary-foreground);
    line-height: 1.2;
}

/* Rounded image block */
.rounded-image {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow-card);
}
.rounded-image img { width: 100%; height: 100%; object-fit: cover; }
.rounded-image .no-image {
    width: 100%;
    height: 100%;
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Villages sub-grid */
.villages-sub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}
@media (min-width: 500px) { .villages-sub-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===================== CTA BLOCKS ===================== */
.cta-block {
    text-align: center;
    max-width: 36rem;
    margin: 0 auto;
}
.cta-block h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--secondary-foreground);
    margin-bottom: 1rem;
    line-height: 1.2;
}
.cta-block p { color: var(--muted-foreground); margin-bottom: 1.5rem; line-height: 1.7; }

.map-cta {
    text-align: center;
    max-width: 32rem;
    margin: 0 auto;
}
.map-cta-icon {
    color: var(--primary);
    margin: 0 auto 1rem;
    display: flex;
    justify-content: center;
}
.map-cta h2 {
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.map-cta p { color: var(--muted-foreground); line-height: 1.7; }

/* ===================== FOOTER ===================== */
.site-footer {
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 3rem 0 0;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-logo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.footer-logo span { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; }
.footer-desc { font-size: 0.875rem; opacity: 0.8; line-height: 1.65; }
.footer-heading { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { font-size: 0.875rem; opacity: 0.8; transition: opacity 0.15s; }
.footer-links a:hover { opacity: 1; }
.footer-contact-info { font-size: 0.875rem; opacity: 0.8; line-height: 1.8; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.18);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.8125rem;
    opacity: 0.6;
}

/* ===================== 404 ===================== */
.not-found-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--muted);
}
.not-found-page h1 { font-size: 5rem; font-weight: 700; line-height: 1; margin-bottom: 1rem; }
.not-found-page p { color: var(--muted-foreground); font-size: 1.25rem; margin-bottom: 1.5rem; }
.not-found-page a { color: var(--primary); text-decoration: underline; }

/* ===================== UTILITY ===================== */
.mb-16 { margin-bottom: 4rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
