/* =================================================================================
botón volver================================================================================= */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;

  color: #222;
  background: #fff;
  border: none;
  border-radius: 8px;

  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
}

.btn-back::before {
  content: "←";
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.btn-back:hover {
  transform: translateX(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.btn-back:hover::before {
  transform: translateX(-4px);
}

.btn-back:active {
  transform: scale(0.96);
}









.rollover img[src*="villar.jpeg"] {
  height: 250px;
  object-fit: cover;
  object-position: bottom;
}

/* =================================================================================
   VARIABLES GLOBALES
================================================================================= */
:root {
  --header-h: 60px;
  /* altura real del header */
  --home-offset: 120px;
  /* aire extra para hero en portada */
  --content-max: 1200px;
  /* ancho legible artículos */
}

/* =================================================================================
   TIPOGRAFÍA / TITULARES
================================================================================= */
h1 {
  font-family: "Libre Baskerville", Sans-serif !important;
  font-size: 2.75rem;
  font-weight: 900;
  color: #000;
  background: linear-gradient(90deg, #f7f7f7, #d6d6d6, #b5b5b5);
  display: inline-block;
  padding: 0.25em 0.5em;
  letter-spacing: -1px;
  margin-bottom: 1em;
}



/* Iconos Google */
.material-symbols-outlined {
  font-size: 14px !important;
  color: #cfcfcf;
}

/* =================================================================================
   LAYOUT: HEADER FIJO + ESPACIADO GLOBAL
================================================================================= */
#sp-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h) !important;
  z-index: 100000 !important;
  /* por encima de Smart Slider */
  pointer-events: auto !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  display: flex;
  align-items: center;
}

#sp-header .logo img {
  max-height: 60px !important;
  height: auto;
}

/* Enlaces del menú en el header */
#sp-header .sp-megamenu-parent>li>a,
#sp-header .sp-megamenu-parent>li span {
  line-height: 60px !important;
  padding: 0 12px !important;
}

/* Compensación del header fijo */
#sp-main-body {
  padding-top: var(--header-h) !important;
}

/* Evita stacking-contexts del template que rompen z-index */
.body-innerwrapper,
.body-wrapper {
  transform: none !important;
  filter: none !important;
  perspective: none !important;
}

/* =================================================================================
   HOME (portada con Smart Slider)
================================================================================= */
.is-home #sp-header,
.home #sp-header {
  background: rgba(0, 0, 0, 0.3) !important;
  box-shadow: none !important;
}

.is-home #sp-main-body,
.home #sp-main-body {
  padding-top: var(--home-offset) !important;
  background-color: #F4F5F8;
}

.is-home #sp-slider,
.home #sp-slider,
.is-home #sp-slider .n2-ss-slider,
.home #sp-slider .n2-ss-slider,
.is-home #sp-slider [id^="n2-ss-"],
.home #sp-slider [id^="n2-ss-"] {
  position: relative !important;
  z-index: 1 !important;
}

/* Menú/textos en blanco sobre foto (home) */
.is-home #sp-header .logo,
.is-home #sp-header .logo a,
.is-home #sp-header .sp-megamenu-parent>li>a,
.home #sp-header .logo,
.home #sp-header .logo a,
.home #sp-header .sp-megamenu-parent>li>a {
  color: #fff !important;
  fill: #fff !important;
}

.is-home #offcanvas-toggler,
.is-home .offcanvas-menu-toggler,
.home #offcanvas-toggler,
.home .offcanvas-menu-toggler {
  color: #fff !important;
}

.is-home .burger-icon>span,
.home .burger-icon>span {
  background: #fff !important;
}

/* =================================================================================
   ARTÍCULOS / VISTA DE ARTÍCULO
================================================================================= */
.view-article .com-content-article,
.view-article .article-details,
.view-article .entry-content,
.view-article .article {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-inline: 16px;
}

.view-article .article-details>* {
  max-width: 100%;
}

.article-details {
  padding: 2em;
}

.article-details .article-ratings-social-share {
  padding: 0 !important;
  border-top: 1px solid #f5f5f5;
  border-bottom: 1px solid #f5f5f5;
  margin-bottom: 1rem;
}

/* Smart Slider dentro de artículos (plugin de contenido) */
.view-article .article-details :is(.n2-section-smartslider, .n2-ss-section-outer, .n2-ss-slider, [id^="n2-ss-"]) {
  position: relative !important;
  z-index: 1 !important;
  width: 100%;
  margin-top: 0 !important;
  pointer-events: auto;
}

/* Si el slider es el primer elemento del artículo */
.view-article .article-details> :first-child:is(.n2-section-smartslider, .n2-ss-section-outer, [id^="n2-ss-"]) {
  margin-top: 0 !important;
}

/* --- MODO HERO detectado por :has(...) (header flotado + textos blancos) --- */
body.view-article:has(.article-details > :first-child:is(.n2-section-smartslider, .n2-ss-section-outer, [id^="n2-ss-"])) #sp-header {
  background: rgba(0, 0, 0, 0.3) !important;
  box-shadow: none !important;
}

body.view-article:has(.article-details > :first-child:is(.n2-section-smartslider, .n2-ss-section-outer, [id^="n2-ss-"])) #sp-header .logo,
body.view-article:has(.article-details > :first-child:is(.n2-section-smartslider, .n2-ss-section-outer, [id^="n2-ss-"])) #sp-header .logo a,
body.view-article:has(.article-details > :first-child:is(.n2-section-smartslider, .n2-ss-section-outer, [id^="n2-ss-"])) #sp-header .sp-megamenu-parent>li>a,
body.view-article:has(.article-details > :first-child:is(.n2-section-smartslider, .n2-ss-section-outer, [id^="n2-ss-"])) #offcanvas-toggler,
body.view-article:has(.article-details > :first-child:is(.n2-section-smartslider, .n2-ss-section-outer, [id^="n2-ss-"])) .offcanvas-menu-toggler,
body.view-article:has(.article-details > :first-child:is(.n2-section-smartslider, .n2-ss-section-outer, [id^="n2-ss-"])) .burger-icon>span {
  color: #fff !important;
  fill: #fff !important;
  background: #fff !important;
  /* solo afecta a barritas del burger */
}

body.view-article:has(.article-details > :first-child:is(.n2-section-smartslider, .n2-ss-section-outer, [id^="n2-ss-"])) #sp-main-body {
  padding-top: var(--home-offset) !important;
}

/* --- MODO HERO forzado por clase del artículo --- */
body.view-article.hero-article #sp-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.3) !important;
  box-shadow: none !important;
  z-index: 9999;
}

/* Menú en blanco sobre foto (hero-article) */
body.view-article.hero-article #sp-header .logo,
body.view-article.hero-article #sp-header .logo a,
body.view-article.hero-article #sp-header .sp-megamenu-parent>li>a,
body.view-article.hero-article #offcanvas-toggler,
body.view-article.hero-article .offcanvas-menu-toggler,
body.view-article.hero-article .burger-icon>span {
  color: #fff !important;
  fill: #fff !important;
  background: transparent !important;
  /* limpia caja blanca; en el burger solo afecta a barritas */
}

body.view-article.hero-article #sp-main-body {
  padding-top: var(--home-offset) !important;
}

/* Quita fondos forzados en logo si los hubiese */
#sp-header .logo,
#sp-header .logo a,
#sp-header .logo img {
  background: transparent !important;
}

/* =================================================================================
   EFECTO KEN BURNS (home y hero)
================================================================================= */
@keyframes zoomOutSuave {
  0% {
    transform: scale(1.25) translate3d(-20px, -10px, 0);
  }

  100% {
    transform: scale(1) translate3d(0, 0, 0);
  }
}

.is-home #sp-slider .n2-ss-slide-background img,
.home #sp-slider .n2-ss-slide-background img,
body.view-article.hero-article .n2-ss-slide-background,
body.view-article.hero-article .n2-ss-slide-background img,
body.view-article.hero-article .n2-ss-slide-background picture img,
body.view-article:has(.article-details > :first-child:is(.n2-section-smartslider, .n2-ss-section-outer, [id^="n2-ss-"])) .n2-ss-slide-background img {
  animation: zoomOutSuave 18s ease-in-out infinite alternate;
  transform-origin: center center;
  will-change: transform;
}

/* Asegura que las capas no recorten el zoom */
body.view-article.hero-article .n2-ss-slider .n2-ss-layers-container {
  overflow: visible !important;
}

/* =================================================================================
   COMPONENTES: TOGGLE (+), GALERÍAS, OVERLAYS, TARJETAS
================================================================================= */
/* --- Toggle (+) --- */
.toggle-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 20px auto;
}

.toggle-button {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #0078d7;
  color: #fff;
  font-size: 24px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.3s;
}

.toggle-button:hover {
  background-color: #005fa3;
}

#toggle {
  display: none;
}

/* checkbox invisible */

.toggle-content {
  max-height: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
  margin-top: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: max-height 0.5s ease, padding 0.3s ease;
  padding: 0 15px;
}

#toggle:checked+label+.toggle-content {
  max-height: 500px;
  /* ajusta según tu contenido */
  padding: 15px;
}

#toggle:checked+label .plus {
  transform: rotate(45deg);
  display: inline-block;
  transition: transform 0.3s ease;
}

/* --- Galería rollover (base + correcciones de centrado) --- */
.rollover-container {
  display: flex;
  justify-content: center;
}

.rollover {
  display: flex;
  flex-direction: column;
  /* imagen arriba, texto abajo */
  width: min(700px, 90%);
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background: #fff;
  /* fondo blanco general */
}


.rollover img {
  width: 100%;
  height: 250px;
  /* o 200px, 300px… según tu diseño */
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}

.rollover:hover img {
  transform: scale(1.05);
}

/* Texto debajo de la imagen */
.rollover-text {
  background: #fff;
  padding: 12px 16px;
  color: #333;
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  /* opcional */
}

/* --- Overlays de imagen --- */
.imagen-hover {
  position: relative;
  width: 300px;
  height: 400px;
  overflow: hidden;
  border-radius: 10px;
  display: inline-block;
  cursor: pointer;
}

.imagen-hover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.8s ease, filter 0.4s ease;
  display: block;
}

.imagen-hover .texto-hover {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  opacity: 0;
  z-index: 3;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(10px);
  padding: 20px;
  font-size: 1.2rem;
}

.imagen-hover:hover img {
  transform: scale(1.08);
  filter: brightness(0.85);
}

.imagen-hover:hover .texto-hover {
  opacity: 1;
  transform: translateY(0);
}

/* --- Tarjetas Historia --- */
.historia-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  width: 90%;
  max-width: 1200px;
  margin: 60px auto;
}

.historia-card {
  position: relative;
  width: 320px;
  height: 220px;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.historia-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.historia-card:hover img {
  transform: scale(1.08);
}

.historia-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.historia-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 70%);
  transition: opacity 0.3s ease;
  opacity: 0;
  z-index: 1;
}

.historia-card:hover::after {
  opacity: 1;
}

.historia-card h3 {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-family: "Libre Baskerville", Sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  z-index: 2;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  margin: 0;
}

.historia-card a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* =================================================================================
   LISTADOS / MÓDULOS / POSICIONES
================================================================================= */
.article-list .article {
  border: 1px solid #e0e0e0;
}

span.badge.bg-danger.featured-article-badge {
  display: none;
}

#sp-section-4 {
  background-color: #F4F5F8;
  margin: 0 !important;
}

#sp-section-3 {
  margin-bottom: 3%;
}

/* SP-positions a ancho completo */
/* CONTENEDOR */
#sp-section-5 {
  padding: 60px;
  max-width: 100%;
  margin: 0 !important;
}

/* Columna: estira el contenido */
#sp-section-5 .col-lg-3 {
  display: flex;
  align-items: stretch;
}

/* Módulo / card */
#sp-section-5 .sp-module {
  background: #fff;
  border-radius: 14px;
  padding: 25px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  height: 100%;
}

/* Hover */
#sp-section-5 .sp-module:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  background: #eef3fa;
}

/* Texto */
#sp-section-5 .sp-module p {
  margin: 0;
}

/* Enlace */
#sp-section-5 .sp-module a {
  color: #003366;
  font-weight: 600;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  display: block;
}

/* Tablet */
@media (max-width: 991px) {
  #sp-section-5 .col-lg-3 {
    width: 50%;
    margin-bottom: 20px;
  }
}

/* Móvil */
@media (max-width: 575px) {
  #sp-section-5 .col-lg-3 {
    width: 100%;
  }
}



/* =================================================================================
   PORTADA (FEATURED) EN 3 COLUMNAS — SOLO HOME
================================================================================= */
/* 1) Grid de 3 columnas */
body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items),
body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items),
body.is-home .view-featured #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items),
body.home .view-featured #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 30px !important;
  align-items: start;
}

/* 2) Aplanar wrappers */
body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) :is(.row, .items-row, .items-leading, .items-intro, .blog-items),
body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) :is(.row, .items-row, .items-leading, .items-intro, .blog-items) {
  display: contents !important;
}

/* 3) Neutralizar col-* de Bootstrap SOLO dentro del featured */
body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) [class^="col-"],
body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) [class*=" col-"],
body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) [class^="col-"],
body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) [class*=" col-"] {
  float: none !important;
  flex: none !important;
  width: auto !important;
  max-width: none !important;
}

/* 4) Cada artículo ocupa una celda */
body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items)>article,
body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) .item,
body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items)>article,
body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) .item {
  display: block !important;
}

/* Plan B “a prueba de balas”: flex */
body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items).fallback-flex,
body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items).fallback-flex {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 30px !important;
}

body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items).fallback-flex>*,
body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items).fallback-flex>* {
  width: calc((100% - 60px) / 3) !important;
  /* 3 columnas con 2 gaps de 30px */
}

/* =================================================================================
   BLOQUES DE CONTENIDO PERSONALIZADOS
================================================================================= */
/* Artículo en dos columnas alternas */
.article-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

.article-two-column:nth-child(even) {
  direction: rtl;
}

.article-two-column:nth-child(even)>* {
  direction: ltr;
}

.article-two-column img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.article-two-column .text {
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
}

/* =================================================================================
   UTILIDADES / AJUSTES PUNTUALES
================================================================================= */
.is-home .body-innerwrapper,
.is-home .body-wrapper,
.home .body-innerwrapper,
.home .body-wrapper {
  transform: none !important;
  filter: none !important;
  perspective: none !important;
}

/* =================================================================================
   Uaareglar osgallery
================================================================================= */

.os_fancybox-toolbar {
  top: auto !important;
  bottom: 20px !important;
  left: 50% !important;
  transform: translateX(0%);
}

/* articulos */
.article-list .article {
  background: #fff;
}

/* =================================================================================
   MEDIA QUERIES
================================================================================= */
/* Featured: 2 columnas */
@media (min-width: 576px) and (max-width: 991px) {

  body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items),
  body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }

  body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items).fallback-flex>*,
  body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items).fallback-flex>* {
    width: calc((100% - 24px) / 2) !important;
  }
}

/* Featured: 1 columna + stack en móvil */
@media (max-width: 575px) {

  body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items),
  body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items) {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  body.is-home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items).fallback-flex>*,
  body.home #sp-component :is(.blog-featured, .com-content-featured, .com-content-featured__items).fallback-flex>* {
    width: 100% !important;
  }
}

/* Responsive: artículo dos columnas -> una columna */
@media (max-width: 768px) {
  .article-two-column {
    grid-template-columns: 1fr;
  }
}

/* CALENDARIO - AGENDA, NOTICIAS */
#jevents,
.bloghero-article .article-list {
  max-width: 1200px;
  margin: 10px auto;
  padding: 20px;
}