/* ============================================================
   Suipacha Theme — Sistema de color y tipografía consolidado
   Quick win 1/3 del rediseño visual "Costa Serena Institucional"
   Carga al final de head.php para poder sobreescribir estilos
   inline heredados de las plantillas antiguas.
   ============================================================ */

/* Fix global: el CSS de Font Awesome 5 del sitio (fontawesome-all.min.css)
   apunta a archivos .woff2 que no existen en el servidor (assets/fonts/fonts/*),
   por lo que TODOS los íconos <i class="fa fa-*"> del sitio quedan vacíos.
   El único archivo de fuente de iconos que sí existe es FontAwesome.otf
   (la fuente clásica v4); lo conectamos y forzamos su uso en los íconos "fa". */
@font-face {
    font-family: "FontAwesomeLocal";
    src: url("../fonts/FontAwesome.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

.fa {
    font-family: "FontAwesomeLocal" !important;
    font-weight: normal !important;
}

:root {
    --teal-900: #036b60;
    --teal-700: #048f83;
    --teal-500: #00a88d;
    --teal-100: #e3f5f1;
    --blue-700: #016090;
    --blue-100: #e6f0f7;
    --ink: #132a27;
    --paper: #fbfaf7;
    --line: #d8e6e2;
    --gold-accent: #c8952b;
    --highlight: #ff3b30;

    --font-display: "Archivo Black", "Archivo", sans-serif;
    --font-heading: "Archivo", sans-serif;
    --font-body: "Archivo", sans-serif;
    --font-label: "Archivo Narrow", "Archivo", sans-serif;
}

/* ---------- Tipografía ---------- */

h1 {
    font-family: var(--font-display) !important;
    color: var(--ink);
    letter-spacing: -0.01em;
}

h2.horizontal-line {
    border-top-color: var(--teal-500) !important;
}

h3, h4 {
    font-family: var(--font-heading) !important;
    color: var(--ink);
}

body, p, .card-text, .card-body {
    font-family: var(--font-body);
}

.label-suipacha,
.card small,
figcaption small {
    font-family: var(--font-label);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* ---------- Enlaces de navegación con subrayado animado ---------- */

.navbar-nav .nav-link {
    position: relative;
}

.navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 100%;
    height: 2px;
    background-color: var(--teal-500);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.navbar-nav .nav-link:hover::after {
    transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
    .navbar-nav .nav-link::after {
        transition: none;
    }
}

/* ---------- Hero home — quick win estructural 3/3 ----------
   Layout asimétrico: texto fijo y siempre legible a la izquierda,
   fotos de la galería rotando en cross-fade a la derecha. */

.hero-suipacha {
    display: flex;
    flex-wrap: wrap;
    min-height: 520px;
    background-color: var(--paper);
    border-bottom: 4px solid var(--teal-500);
}

.hero-suipacha__text {
    flex: 0 1 340px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 2.5rem;
}

.hero-suipacha__label {
    font-family: var(--font-label);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--blue-700);
}

.hero-suipacha__title {
    font-family: var(--font-display) !important;
    color: var(--ink);
    font-size: clamp(1.25rem, 1.6vw, 1.75rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
}

.hero-suipacha__subtitle {
    font-family: var(--font-heading);
    color: var(--teal-900);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.hero-suipacha__cta {
    align-self: flex-start;
    background-color: var(--teal-500);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: 999px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.hero-suipacha__cta:hover {
    background-color: var(--teal-900);
    color: #fff;
    transform: translateY(-2px);
}

.hero-suipacha__media {
    position: relative;
    flex: 1 1 600px;
    min-height: 360px;
    overflow: hidden;
}

.hero-suipacha__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero-suipacha__slide.is-active {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .hero-suipacha__slide {
        transition: none;
    }
}

@media (max-width: 767.98px) {
    .hero-suipacha {
        min-height: 0;
    }
    .hero-suipacha__text {
        padding: 2.5rem 1.5rem;
        max-width: none;
        text-align: center;
        align-items: center;
    }
    .hero-suipacha__media {
        min-height: 280px;
        order: -1;
    }
}

/* ---------- Hero de categoría (turismo.php y futuras páginas de listado) ----------
   Reemplaza el div inline con background url() + h1 encimado. Reutilizable:
   solo requiere <div class="hero-category" style="background-image:url(...)">. */

.hero-category {
    position: relative;
    min-height: clamp(300px, 40vw, 480px);
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero-category::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(3, 42, 39, 0.1) 0%, rgba(3, 42, 39, 0.8) 100%);
}

.hero-category__content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 2.5rem clamp(1rem, 5vw, 3rem) 2.75rem;
    text-align: center;
}

.hero-category__rule {
    width: 64px;
    height: 4px;
    background-color: var(--teal-500);
    margin: 0 auto 1.1rem;
    border-radius: 2px;
}

.hero-category__title {
    font-family: var(--font-display) !important;
    color: #fff;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    letter-spacing: -0.01em;
    margin: 0 auto;
    max-width: 900px;
}

/* ---------- Intro de categoría (barra de descripción bajo el hero) ---------- */

.category-intro {
    background-color: var(--teal-900);
    padding: 1.75rem 0;
    margin-bottom: 2rem;
}

.category-intro__label {
    display: block;
    font-family: var(--font-label);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--teal-500);
    text-align: center;
    margin-bottom: 0.6rem;
}

.category-intro__text {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 1.05rem;
    line-height: 1.6;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

/* ---------- Sistema de card unificado ----------
   Reemplaza figure.snip1527 y .box (Turismo / Descubrinos en index.php).
   Un solo lenguaje visual: imagen arriba, cuerpo abajo, franja de acento. */

.card-suipacha {
    display: block;
    background-color: #fff;
    border: none;
    border-radius: 14px;
    box-shadow: 0 10px 26px -10px rgba(19, 42, 39, 0.28);
    overflow: visible;
    height: 100%;
    margin-top: 1.5rem;
    padding: 0 1rem 1.4rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-suipacha:hover,
.card-suipacha:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px -10px rgba(3, 107, 96, 0.35);
    color: inherit;
}

.card-suipacha--flat {
    margin-top: 0;
    padding: 1.25rem 1.25rem 1.4rem;
}

.card-suipacha__media {
    position: relative;
    margin: -1.5rem -0.35rem 1.1rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 14px 26px -12px rgba(0, 0, 0, 0.4);
}

.card-suipacha__img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.card-suipacha__img--square {
    aspect-ratio: 1 / 1;
}

.card-suipacha__body {
    padding: 0 0.35rem;
}

.card-suipacha__label {
    display: block;
    font-family: var(--font-label);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--teal-500);
    margin-bottom: 0.4rem;
}

.card-suipacha__body--accent .card-suipacha__label {
    color: var(--blue-700);
}

.card-suipacha__title {
    font-family: var(--font-heading) !important;
    color: var(--ink);
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}

.card-suipacha__text {
    font-family: var(--font-body);
    color: var(--teal-900);
    font-size: 0.95rem;
    margin: 0 0 0.75rem;
}

.card-suipacha__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--teal-700);
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
}

.card-suipacha__cta:hover {
    color: var(--teal-900);
    gap: 0.6rem;
    text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
    .card-suipacha,
    .card-suipacha__cta {
        transition: none;
    }
    .card-suipacha:hover {
        transform: none;
    }
}

/* ---------- Scroll reveal propio (IntersectionObserver) ----------
   Reemplaza el intento con AOS: control total, sin depender de
   conflictos con el resto de los CSS de plantillas legacy del sitio. */

.reveal {
    opacity: 0 !important;
    transform: translateY(28px) !important;
    transition: opacity 0.7s ease, transform 0.7s ease !important;
}

.reveal.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ---------- Galería principal + miniaturas (sitios_interes.php) ---------- */

.gallery-main {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 26px -12px rgba(19, 42, 39, 0.35);
}

.gallery-main__item {
    display: none;
}

.gallery-main__item.is-active {
    display: block;
}

.gallery-main__item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.gallery-thumbs {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.gallery-thumb {
    flex: 0 0 auto;
    width: 84px;
    height: 64px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: none;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumb:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.gallery-thumb.is-active {
    opacity: 1;
    border-color: var(--teal-500);
}

@media (max-width: 767.98px) {
    .gallery-thumb {
        width: 64px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-thumb {
        transition: none;
    }
    .gallery-thumb:hover {
        transform: none;
    }
}

/* ---------- Botón "volver" ---------- */

.btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background-color: transparent;
    color: var(--teal-700);
    border: 2px solid var(--teal-500);
    border-radius: 999px;
    padding: 0.6rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-volver i {
    font-size: 1rem !important;
    color: inherit !important;
    margin-right: 0 !important;
}

.btn-volver:hover {
    background-color: var(--teal-500);
    color: #fff;
    transform: translateX(-3px);
}

@media (prefers-reduced-motion: reduce) {
    .btn-volver {
        transition: none;
    }
    .btn-volver:hover {
        transform: none;
    }
}

/* ---------- Card con icono (llegar.php) ---------- */

.card-suipacha__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--teal-100);
    color: var(--teal-700);
    font-size: 1.4rem;
    margin-bottom: 0.9rem;
}

.card-suipacha__body--accent .card-suipacha__icon {
    background-color: var(--blue-100);
    color: var(--blue-700);
}

/* ---------- Callout de ruta destacada ---------- */

.route-callout {
    background: linear-gradient(135deg, var(--teal-900), var(--teal-700));
    color: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 16px 32px -12px rgba(3, 107, 96, 0.45);
}

.route-callout__icon {
    font-size: 2.75rem;
    flex: 0 0 auto;
}

.route-callout__content {
    flex: 1 1 260px;
}

.route-callout__badge {
    font-family: var(--font-label);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
    background-color: rgba(255, 255, 255, 0.18);
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.route-callout__title {
    font-family: var(--font-display) !important;
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    margin: 0 0 0.5rem;
    color: #fff;
}

.route-callout__text {
    margin: 0;
    font-size: 1.05rem;
    opacity: 0.95;
}

@media (max-width: 575.98px) {
    .route-callout {
        padding: 1.75rem;
        text-align: center;
        justify-content: center;
    }
}

/* ---------- Plano interactivo (mapas.php) ---------- */

.plano-interactivo {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2.5rem;
}

.plano-interactivo__map {
    position: relative;
    flex: 2 1 480px;
    min-width: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 26px -12px rgba(19, 42, 39, 0.35);
}

.plano-interactivo__svg {
    width: 100%;
    height: auto;
    display: block;
}

.plano-interactivo__ring,
.plano-interactivo__ring-core {
    fill: none;
    opacity: 0;
    pointer-events: none;
    transform-box: fill-box;
    transform-origin: center;
}

.plano-interactivo__ring {
    stroke: var(--highlight);
    stroke-width: 7;
    filter: drop-shadow(0 0 6px var(--highlight));
    transition: opacity 0.15s ease;
}

.plano-interactivo__ring-core {
    stroke: var(--highlight);
    stroke-width: 3;
    transition: opacity 0.15s ease;
}

.plano-interactivo__ring.is-active {
    opacity: 1;
    animation: plano-pulse 1.1s ease-out infinite;
}

.plano-interactivo__ring-core.is-active {
    opacity: 1;
    animation: plano-pop 0.4s ease-out;
}

@keyframes plano-pulse {
    0% {
        stroke-opacity: 1;
        transform: scale(0.9);
    }
    100% {
        stroke-opacity: 0;
        transform: scale(2.1);
    }
}

@keyframes plano-pop {
    0% {
        transform: scale(0.2);
    }
    60% {
        transform: scale(1.35);
    }
    100% {
        transform: scale(1);
    }
}

.plano-interactivo__legend {
    flex: 1 1 260px;
    max-height: 560px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid var(--line);
}

.plano-interactivo__group-label {
    display: block;
    position: sticky;
    top: 0;
    background-color: var(--teal-900);
    color: #fff;
    font-family: var(--font-label);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
}

.plano-interactivo__group-label--publicos {
    background-color: var(--gold-accent);
}

.plano-interactivo__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid var(--line);
    padding: 0.55rem 1rem;
    cursor: pointer;
    font-family: var(--font-body);
    color: var(--ink);
    transition: background-color 0.15s ease;
}

.plano-interactivo__item:hover {
    background-color: var(--teal-100);
}

.plano-interactivo__item.is-active {
    background-color: var(--teal-100);
    font-weight: 600;
}

.plano-interactivo__item-num {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--teal-700);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plano-interactivo__item--publico .plano-interactivo__item-num {
    background-color: var(--gold-accent);
}

@media (max-width: 767.98px) {
    .plano-interactivo {
        flex-direction: column;
    }
    .plano-interactivo__legend {
        max-height: 320px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .plano-interactivo__ring.is-active,
    .plano-interactivo__ring-core.is-active {
        animation: none;
    }
}

/* ---------- Columna de foto "pegajosa" (sitios_interes.php) ----------
   Solo en desktop: en mobile las columnas se apilan y el sticky no aplica. */

@media (min-width: 768px) {
    .gallery-sticky-col {
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }
}

/* ---------- Footer ---------- */

.footer-suipacha {
    background: linear-gradient(160deg, var(--teal-900), #024c44);
    color: #d9ece9;
    margin-top: clamp(48px, 8vw, 130px);
    padding: 4rem 0 0;
    font-family: var(--font-body);
}

.footer-suipacha a {
    color: #d9ece9;
    text-decoration: none;
}

.footer-suipacha__logo {
    max-width: 340px;
    width: 100%;
    margin-bottom: 1.25rem;
}

.footer-suipacha__tagline {
    font-size: 0.95rem;
    color: #a9cec8;
    max-width: 320px;
}

.footer-suipacha__heading {
    font-family: var(--font-label);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--teal-500);
    margin-bottom: 1.1rem;
    display: block;
}

.footer-suipacha__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-suipacha__links a {
    position: relative;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-suipacha__links a:hover {
    color: #fff;
    padding-left: 6px;
}

.footer-suipacha__address {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #d9ece9;
}

.footer-suipacha__address strong {
    color: #fff;
}

.footer-suipacha__social {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.footer-suipacha__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--teal-500);
    font-size: 1.4rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.footer-suipacha__social a:hover {
    background-color: var(--teal-500);
    color: #fff;
    transform: translateY(-3px);
}

.footer-suipacha__qr {
    background: #fff;
    padding: 0.5rem;
    border-radius: 10px;
    width: 96px;
    display: block;
}

.footer-suipacha__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 3rem;
    padding: 1.25rem 0;
    text-align: center;
    font-size: 0.82rem;
    color: #a9cec8;
}

@media (prefers-reduced-motion: reduce) {
    .footer-suipacha__links a,
    .footer-suipacha__social a {
        transition: none;
    }
}

/* ---------- Lista de contacto con ícono (sitios_interes.php) ---------- */

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
    color: var(--ink);
}

.contact-list__item:last-child {
    border-bottom: none;
}

.contact-list__item .icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--teal-100);
    color: var(--teal-700);
    font-size: 1.1rem;
}

.contact-list__item a {
    color: var(--teal-700);
    text-decoration: none;
    word-break: break-word;
}

.contact-list__item a:hover {
    color: var(--teal-900);
    text-decoration: underline;
}

/* ---------- Link flotante "Inicio" (persiste durante el scroll) ---------- */

.float-home-link {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: rgba(3, 42, 39, 0.55);
    color: #fff;
    font-family: var(--font-label);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    opacity: 0.6;
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.float-home-link i {
    font-size: 1rem;
}

.float-home-link:hover {
    opacity: 1;
    color: #fff;
    background-color: var(--teal-700);
    transform: translateY(-2px);
}

@media (max-width: 575.98px) {
    .float-home-link span {
        display: none;
    }
    .float-home-link {
        padding: 0.6rem;
    }
    .float-home-link i {
        font-size: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .float-home-link {
        transition: none;
    }
}
