/* --- Variables y Reset --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Open+Sans:wght@400;600&display=swap');

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e67e22;
    --bg-light: #f4f6f7;
    --text-dark: #333;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
 
::-webkit-scrollbar-thumb {
    background: var(--primary-color); 
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color); 
}

body {
    font-family: 'Open Sans', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

h1, h2, h3, .header__logo, .hero__title, .section__title {
    font-family: 'Montserrat', sans-serif;
    letter-spacing: -0.5px;
}

/* --- Header --- */
.header {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header__container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.header__logo {
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); 
}

.nav__list {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav__link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav__link:hover {
    color: var(--primary-color);
}

/* --- Estilos Generales de Sección --- */
.section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section__title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--secondary-color);
    font-size: 2rem;
    position: relative;
}

.section__title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 10px auto 0;
}

/* --- Hero Section & Slider --- */
.hero {
    position: relative;
    height: 70vh; /* Un poco más alto para lucir el slider */
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    overflow: hidden; /* Importante para que no se salgan las imágenes */
}

/* El contenedor del slider ocupa toda la sección Hero */
.hero__slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
}

/* Cada diapositiva del slider */
.hero__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: scale(1.05); /* Efecto inicial para suavizar zoom */
}

/* Clase para mostrar la diapositiva activa + Animación Ken Burns (Zoom suave) */
.hero__slide.active {
    opacity: 1;
    animation: kenBurns 15s linear infinite alternate;
}

@keyframes kenBurns {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

/* Capa oscura con degradado para mejor lectura */
.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Degradado sutil en vez de plano */
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 2;
}

/* Puntos de navegación del slider */
.slider__dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}

.dot {
    height: 12px;
    width: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.dot:hover {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

.dot.active {
    background-color: var(--white);
    transform: scale(1.3);
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* El contenido (título y botón) debe estar encima de todo */
.hero__content {
    position: relative;
    z-index: 3;
    padding: 0 20px;
}

.hero__title {
    font-size: 3.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

/* --- Requisito: Grid Layout (Destinos) --- */
.destinations__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

/* Card */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card__content {
    padding: 20px;
}

.card__title {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* --- Requisito: Flexbox Layout (Noticias) --- */
.news__flex-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.post {
    flex: 1 1 300px; /* Flex-grow, Flex-shrink, Basis */
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.post__title {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* Botones */
.button {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
}

.button:hover {
    background-color: var(--secondary-color);
}

/* --- FAQ Acordeón --- */
.faq__container {
    max-width: 800px;
    margin: 0 auto;
}

.faq__item {
    margin-bottom: 20px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); /* Sombra muy ligera */
    overflow: hidden;
}

body.dark-mode .faq__item {
    background-color: var(--card-bg);
}

.faq__question {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    text-align: left;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.4s;
    outline: none;
    position: relative;
    /* Icono + */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq__question:after {
    content: '+';
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.faq__question.active {
    background-color: var(--secondary-color);
}

.faq__question.active:after {
    transform: rotate(45deg); /* Convertir + en x */
}

/* El contenido (respuesta) oculto por defecto */
.faq__answer {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s;
    background-color: var(--card-bg); /* Fondo acorde a tema */
    color: var(--text-color);
}

.faq__question.active + .faq__answer {
    padding: 18px; /* Espacio cuando se abre */
    /* max-height se calcula en JS */
}

/* --- Formulario --- */
.contact {
    text-align: center;
    background-color: var(--bg-light); /* Adaptar fondo */
    margin-bottom: 0;
}

body.dark-mode .contact {
    margin-bottom: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form__input {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.form__feedback {
    margin-top: 15px;
    font-weight: bold;
    min-height: 1.5em; /* Prevenir salto de layout */
}

.form__button {
    margin-top: 20px;
    width: 100%;
    max-width: 200px;
}

/* --- Botón Scroll Top --- */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--white);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

/* --- Footer --- */
.footer {
    background-color: var(--secondary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}


/* --- Scroll Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px); /* Reducido para ser más sutil */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform; /* Optimización de rendimiento */
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Evitar que la animación oculte contenido si falla JS o en móviles muy antiguos */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* --- Responsive (Media Queries) --- */
@media (max-width: 768px) {
    .header__container {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero__title {
        font-size: 2.5rem;
    }
}

/* --- Modal y Galería de Imágenes --- */
.card__cta {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.card__cta:hover {
    color: var(--accent-color); /* Naranja al pasar el ratón */
    text-decoration: underline;
}

.card:hover .card__cta {
    text-decoration: underline; /* Subrayar cuando se hace hover en la tarjeta también */
}

.card {
    /* cursor: pointer;  Eliminado para interactividad solo en el botón */
    position: relative;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.card:hover { /* Levitación */
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

body.dark-mode .card {
    background-color: var(--card-bg);
}

/* Modal contenedor (fondo oscuro) */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 1000; /* Asegurar que esté por encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

/* Clase para mostrar el modal con Flexbox */
.modal--show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Contenido del modal */
.modal__content {
    background-color: var(--white);
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: var(--border-radius);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* Botón de cerrar */
.modal__close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal__close:hover,
.modal__close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal__title {
    margin-top: 0;
    color: var(--secondary-color);
    text-align: center;
}

/* Grid de imágenes dentro del modal */
.modal__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery__img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.2s;
    cursor: zoom-in;
}

.gallery__img:hover {
    transform: scale(1.05);
}

/* --- Lightbox (Imagen a pantalla completa) --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000; /* Encima del modal */
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

.lightbox--show {
    display: flex;
    animation: fadeIn 0.3s;
}

.lightbox__content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 90%;
    max-height: 80vh;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
    border-radius: 4px;
}

.lightbox__close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.lightbox__close:hover,
.lightbox__close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@media only screen and (max-width: 700px){
    .lightbox__content {
        width: 100%;
    }
}
