/* ==========================================================================
   VARIABLES DE DISEÑO (Estilo Turístico)
   ========================================================================== */
:root {
    --color-dark: #2c3e50;      /* Azul noche oscuro */
    --color-accent: #b85c38;    /* Terracota (recuerda a la piedra y los tejados) */
    --color-light: #f9f9f9;     /* Fondo gris muy claro */
    --color-white: #ffffff;
    --color-text: #4a4a4a;
    
    --font-heading: 'Lora', serif; /* Elegancia para monumentos */
    --font-body: 'Lato', sans-serif; /* Lectura clara */
    
    --transition: all 0.3s ease;
}

/* ==========================================================================
   RESETEOS BÁSICOS
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.7;
    background-color: var(--color-white);
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}
img { max-width: 100%; height: auto; display: block; }

/* Tipografía Compartida */
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-dark); }
.section-title { font-size: 2.5rem; margin-bottom: 1rem; }
.section-subtitle {
    display: block;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.section { padding: 6rem 0; }
.section--light { background-color: var(--color-light); }
.section-header { text-align: center; max-width: 700px; margin: 0 auto 4rem auto; }

/* Botones */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--color-dark);
    color: var(--color-white);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}
.btn:hover { background-color: var(--color-accent); color: var(--color-white); }
.btn--small { padding: 0.6rem 1.2rem; font-size: 0.8rem; }
.btn--primary { background-color: var(--color-accent); }
.btn--primary:hover { background-color: var(--color-dark); }
.btn--full { width: 100%; text-align: center; }

/* ==========================================================================
   NAVEGACIÓN Y MENÚ DESPLEGABLE MÓVIL
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0; width: 100%;
    background-color: var(--color-white); /* Header siempre blanco desde el inicio */
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Sombra siempre visible */
    z-index: 1000;
    transition: var(--transition);
}

.navbar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 1.5rem; /* Separación básica para evitar solapamientos */
}

.navbar__logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-dark); /* Logo siempre oscuro */
    text-decoration: none;
    transition: var(--transition);
    z-index: 1001; /* Por encima del menú desplegable */
    white-space: nowrap; /* Evita que el texto salte a otra línea */
    flex-shrink: 0; /* Evita que el logo encoja por falta de espacio */
}

/* Botón Hamburguesa (Solo se ve en Móvil) */
.navbar__toggle {
    display: block;
    background: none;
    border: none;
    color: var(--color-dark); /* Icono del menú siempre oscuro */
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    transition: var(--transition);
}

/* Menú (Diseño Móvil Desplegable) */
.navbar__menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-white);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    
    /* Oculto por defecto */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

/* Clase que activa el menú en móvil */
.navbar__menu.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Enlaces en Móvil (Siempre oscuros porque el fondo es blanco) */
.navbar__menu a:not(.btn) {
    color: var(--color-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

/* Centrar el botón en el menú móvil */
.navbar__menu .btn {
    width: max-content;
    margin: 0 auto;
}

/* ==========================================================================
   NAVEGACIÓN DESKTOP (Ordenadores y Tablets horizontales)
   ========================================================================== */
@media (min-width: 768px) {
    .navbar__toggle {
        display: none; /* Ocultar el botón hamburguesa */
    }
    
    .navbar__menu {
        position: static;
        background-color: transparent;
        padding: 0;
        
        display: flex;
        flex-direction: row;
        justify-content: flex-end; /* Fuerza al menú a anclarse a la derecha */
        align-items: center;
        gap: 2rem; /* Separación uniforme entre los enlaces */
        
        box-shadow: none;
        
        /* Siempre visible en desktop */
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    /* Enlaces Desktop (Siempre oscuros ya que el header ahora es siempre blanco) */
    .navbar__menu a:not(.btn) {
        color: var(--color-dark);
        font-size: 0.95rem;
        font-weight: 700; /* Añadimos negrita para que destaquen sobre el blanco */
        transition: var(--transition);
    }

    .navbar__menu a:not(.btn):hover { 
        color: var(--color-accent); 
    }

    /* Restaurar el margen del botón para alinear a la derecha en PC */
    .navbar__menu .btn {
        margin: 0;
    }
}

/* ==========================================================================
   RESTO DE COMPONENTES DE LA PÁGINA
   ========================================================================== */

/* Hero Section */
.hero {
    position: relative;
    height: 90vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    padding-top: 80px; /* NUEVO: Empuja el contenido hacia abajo para que no quede detrás del header fijo */
}
.hero__background {
    position: absolute; inset: 0; z-index: 1;
    background-image: url('https://zafraturismo.com/images/parador.jpg');
    background-size: cover; background-position: center;
}
.hero__background::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to right, rgba(44, 62, 80, 0.9) 0%, rgba(44, 62, 80, 0.4) 100%);
}
.hero__content { position: relative; z-index: 2; color: var(--color-white); max-width: 600px; }
.hero__tagline {
    display: block; font-family: var(--font-body); text-transform: uppercase;
    letter-spacing: 3px; font-size: 0.9rem; color: var(--color-white); margin-bottom: 1rem;
}
.hero__title { font-size: 4rem; color: var(--color-white); margin-bottom: 1.5rem; line-height: 1.1; }
.hero__title em { font-style: italic; font-weight: 400; }
.hero__description { font-size: 1.1rem; margin-bottom: 2rem; opacity: 0.9; }

/* About (Historia) */
.about__grid {
    display: grid; grid-template-columns: 1fr; gap: 3rem; align-items: center;
}
@media (min-width: 768px) { .about__grid { grid-template-columns: 1fr 1fr; } }
.about__text p { margin-bottom: 1.5rem; font-size: 1.1rem; }
.about__image img { border-radius: 8px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); }

/* Monumentos (Tarjetas Editoriales) */
.monuments__grid {
    display: grid; grid-template-columns: 1fr; gap: 2rem;
}
@media (min-width: 768px) { .monuments__grid { grid-template-columns: repeat(3, 1fr); } }
.monument-card {
    background: var(--color-white); border-radius: 8px; overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: var(--transition);
}
.monument-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.monument-card__image { height: 220px; width: 100%; position: relative; }

/* REGLA NUEVA: Para que las fotos encajen perfecto y no se deformen */
.monument-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Simulador de imágenes para los monumentos si no hay fotos */
.placeholder-img {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    color: var(--color-white); font-family: var(--font-heading); font-size: 1.2rem; text-align: center; padding: 1rem;
}
.bg-dark { background-color: var(--color-dark); }
.bg-accent { background-color: var(--color-accent); }

.monument-card__content { padding: 2rem; }
.monument-card__title { font-size: 1.4rem; margin-bottom: 1rem; }
.monument-card__desc { font-size: 0.95rem; color: #666; }

/* Herramientas (Web y App) */
.tools__container { background-color: var(--color-dark); padding: 4rem; border-radius: 12px; color: var(--color-white); }
.tools__header .section-title { color: var(--color-white); }
.tools__grid { display: grid; grid-template-columns: 1fr; gap: 3rem; margin-top: 3rem; }
@media (min-width: 768px) { .tools__grid { grid-template-columns: 1fr 1fr; } }
.tool-item { padding: 2rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; }
.tool-item--highlight { background-color: rgba(255,255,255,0.05); border-color: var(--color-accent); }
.tool-item__icon { font-size: 2.5rem; color: var(--color-accent); margin-bottom: 1.5rem; }
.tool-item h3 { color: var(--color-white); margin-bottom: 1rem; font-size: 1.5rem; }
.tool-item p { color: rgba(255,255,255,0.7); margin-bottom: 1.5rem; }
.tool-item__link { color: var(--color-accent); text-decoration: none; font-weight: 700; transition: var(--transition); }
.tool-item__link:hover { color: var(--color-white); }

/* Footer */
.footer { background-color: #1a252f; color: var(--color-white); padding: 4rem 0 2rem; }
.footer__container { display: grid; grid-template-columns: 1fr; gap: 2rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 2rem; }
@media (min-width: 768px) { .footer__container { grid-template-columns: 2fr 1fr; } }
.footer__info h4 { color: var(--color-white); font-size: 1.5rem; margin-bottom: 1rem; }
.footer__info p { color: rgba(255,255,255,0.6); max-width: 400px; }
.footer__links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer__links strong { color: var(--color-accent); margin-bottom: 0.5rem; display: block; }
.footer__links a { color: rgba(255,255,255,0.6); text-decoration: none; transition: var(--transition); }
.footer__links a:hover { color: var(--color-white); }
.footer__copyright { text-align: center; padding-top: 2rem; font-size: 0.85rem; color: rgba(255,255,255,0.4); }

/* ==========================================================================
   ANIMACIONES (Intersección JS)
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }
.reveal--delay { transition-delay: 0.2s; }
.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.3s; }
