/* ==========================================================================
   DESCUBRIENDO ESPAÑA — Diseño Editorial Mobile-First Enfocado en el Viajero
   ========================================================================== */

:root {
  --bg-paper: #FAF7F2;
  --bg-sand: #F2ECE1;
  --bg-stone: #E7DFD0;
  --bg-card: #FFFFFF;
  --ink-900: #1A1E1B;
  --ink-700: #3B423D;
  --ink-500: #636B65;
  --ink-400: #878F89;
  --dehesa-900: #14281D;
  --dehesa-800: #1F3A2B;
  --dehesa-700: #2C513C;
  --dehesa-600: #3B694E;
  --dehesa-100: #E3EDE6;
  --dehesa-50: #F1F6F2;
  --terracota-700: #9C3F1E;
  --terracota-600: #B8532E;
  --terracota-500: #D16842;
  --terracota-100: #FBEAE3;
  --ochre-600: #B87D1E;
  --ochre-100: #FDF3DC;
  --border-warm: #DED5C5;
  --border-subtle: #EAE3D5;
  --shadow-sm: 0 2px 8px rgba(26, 30, 27, 0.05);
  --shadow-md: 0 8px 24px rgba(26, 30, 27, 0.08);
  --shadow-lg: 0 16px 36px rgba(26, 30, 27, 0.12);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Lo que app.js oculta con hidden (datos vacíos en Ajustes → Datos de la web) no debe reaparecer por un display de su clase */
[hidden] {
  display: none !important;
}

/* Imágenes que esperan su dirección desde Datos de la web: sin icono roto mientras llega */
img[data-sitio-src]:not([src]) {
  visibility: hidden;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-paper);
  color: var(--ink-900);
  font-family: var(--font-sans);
  line-height: 1.55;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: block;
  background-color: var(--bg-paper);
  overflow-x: clip;
}

#wpadminbar {
  display: none !important;
  min-width: 0 !important;
}

.site-header,
.app-view,
.site-footer {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 16px min font-size on inputs prevents iOS Safari zoom-in bug on tap */
button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
  max-width: 100%;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.serif-title {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.container {
  width: 92%;
  max-width: 1560px;
  min-width: 0;
  margin: 0 auto;
  padding: 0;
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 2.2rem, 1560px);
  }
}

/* ==========================================================================
   HEADER & MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(250, 247, 242, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-warm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1.25rem;
  min-width: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 0 0 auto;
}

.brand-logo > div {
  min-width: 0;
}

.brand-logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--dehesa-700);
  background: #fff;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--dehesa-900);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--terracota-600);
  font-weight: 600;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-tab {
  padding: 0.44rem 0.88rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-700);
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.nav-tab:hover {
  background: var(--bg-sand);
  color: var(--dehesa-900);
}

.nav-tab.active {
  background: var(--dehesa-800);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 58, 43, 0.2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ig-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-sand);
  border: 1px solid var(--border-warm);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dehesa-900);
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

.ig-handle-short {
  display: none;
}

.ig-pill-link:hover {
  background: var(--dehesa-800);
  color: #fff;
  border-color: var(--dehesa-800);
}

@media (max-width: 640px) {
  .header-inner {
    height: 54px;
    gap: 0.5rem;
  }
  .brand-logo {
    gap: 0.5rem;
  }
  .brand-logo img {
    width: 34px;
    height: 34px;
  }
  .brand-name {
    font-size: 1rem;
  }
  .brand-sub {
    display: none;
  }
  .ig-handle-full {
    display: none;
  }
  .ig-handle-short {
    display: inline;
  }
  .ig-pill-link {
    padding: 0.34rem 0.65rem;
    font-size: 0.76rem;
  }
}

/* Cabecera en portátiles y tabletas apaisadas: cada escalón gana sitio para que el menú quepa siempre */
@media (max-width: 1300px) {
  .ig-handle-full {
    display: none;
  }
  .ig-handle-short {
    display: inline;
  }
}

@media (min-width: 921px) and (max-width: 1180px) {
  .brand-sub {
    display: none;
  }
  .main-nav {
    gap: 0.15rem;
  }
  .nav-tab {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
}

@media (min-width: 921px) and (max-width: 1080px) {
  .header-actions {
    display: none;
  }
}

/* Con la pestaña de Colaboraciones visible hay una pestaña más: los mismos escalones, antes */
@media (max-width: 1500px) {
  body.colab-activa .ig-handle-full {
    display: none;
  }
  body.colab-activa .ig-handle-short {
    display: inline;
  }
}

@media (min-width: 921px) and (max-width: 1340px) {
  body.colab-activa .brand-sub {
    display: none;
  }
  body.colab-activa .main-nav {
    gap: 0.15rem;
  }
  body.colab-activa .nav-tab {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
}

@media (min-width: 921px) and (max-width: 1180px) {
  body.colab-activa .header-actions {
    display: none;
  }
}

@media (min-width: 921px) and (max-width: 1040px) {
  body.colab-activa .brand-name {
    display: none;
  }
}

/* Barra de Navegación Inferior estilo App en Móvil */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 920px) {
  .main-nav {
    display: none;
  }
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-warm);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1200;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  .mob-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink-500);
    border-radius: 10px;
    margin: 3px 2px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.15s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
  }
  .mob-nav-item * {
    pointer-events: none;
  }
  .mob-nav-item:active {
    transform: scale(0.94);
  }
  .mob-nav-item .mob-icon {
    font-size: 1.12rem;
    line-height: 1;
  }
  .mob-nav-item.active {
    color: var(--dehesa-800);
    background: var(--dehesa-50);
    font-weight: 700;
  }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.18s ease;
  white-space: nowrap;
  max-width: 100%;
  min-height: 42px;
}

@media (max-width: 560px) {
  .btn {
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    padding: 0.58rem 0.95rem;
    font-size: 0.85rem;
  }
}

.btn-primary {
  background: var(--dehesa-800);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 58, 43, 0.18);
}

.btn-primary:hover {
  background: var(--dehesa-900);
}

.btn-terracota {
  background: var(--terracota-600);
  color: #fff;
  box-shadow: 0 4px 12px rgba(184, 83, 46, 0.22);
}

.btn-terracota:hover {
  background: var(--terracota-700);
}

.btn-outline {
  background: #fff;
  color: var(--ink-900);
  border: 1px solid var(--border-warm);
}

.btn-outline:hover {
  background: var(--bg-sand);
}

/* ==========================================================================
   VIEW VISIBILITY
   ========================================================================== */
.app-view {
  display: none;
}

/* Micro-transición suave y ligera al cambiar de sección (180ms) */
@keyframes viewFadeIn {
  from {
    opacity: 0.35;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.app-view.active {
  display: block;
  animation: viewFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  .app-view.active {
    animation: none;
  }
}

/* ==========================================================================
   VISTA 1: INICIO — HERO Y BUSCADOR DE PUEBLOS
   ========================================================================== */
.hero-editorial {
  padding: clamp(1.75rem, 4vw, 3.5rem) 0 clamp(2.25rem, 5vw, 4rem);
  background:
    radial-gradient(circle at 12% 15%, rgba(184, 83, 46, 0.08), transparent 45%),
    radial-gradient(circle at 88% 80%, rgba(31, 58, 43, 0.09), transparent 50%),
    linear-gradient(180deg, var(--bg-sand) 0%, var(--bg-paper) 100%);
  border-bottom: 1px solid var(--border-warm);
}

.hero-grid {
  display: grid;
  grid-template-columns: 54% 43%;
  justify-content: space-between;
  align-items: stretch;
  width: 100%;
}

.hero-grid > * {
  min-width: 0;
}

.hero-grid > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.hero-grid > div:first-child .town-checker-box {
  width: 100%;
  margin-top: auto;
}

#hero-featured-town-container {
  position: relative;
  width: 100%;
  min-height: 100%;
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 100%;
    gap: 1.5rem;
  }
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  background: var(--dehesa-100);
  color: var(--dehesa-800);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.hero-title {
  font-size: clamp(1.85rem, 4.2vw, 3.25rem);
  color: var(--ink-900);
  margin-bottom: 0.85rem;
  line-height: 1.18;
}

@media (max-width: 768px) {
  .hero-editorial {
    padding: 1.5rem 0 2rem;
  }
  .hero-intro-text {
    padding: 0 1rem;
  }
  .hero-title {
    font-size: clamp(1.72rem, 4.8vw, 2.15rem);
    line-height: 1.22;
    margin-bottom: 0.75rem;
    text-wrap: normal;
  }
  .hero-lead {
    font-size: 0.94rem;
    line-height: 1.52;
    margin-bottom: 1.25rem;
  }
}

.hero-title em {
  font-style: italic;
  color: var(--dehesa-700);
  font-weight: 400;
}

.hero-lead {
  font-size: clamp(0.96rem, 1.5vw, 1.08rem);
  color: var(--ink-700);
  max-width: 580px;
  margin-bottom: 1.4rem;
}

/* Buscador principal responsivo */
.town-checker-box {
  background: #fff;
  border: 2px solid var(--dehesa-800);
  border-radius: var(--radius-lg);
  padding: clamp(0.85rem, 2vw, 1.15rem);
  box-shadow: var(--shadow-lg);
}

.town-checker-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--dehesa-800);
  margin-bottom: 0.5rem;
  display: block;
}

.town-checker-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-paper);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.45rem 0.35rem 0.85rem;
}

.town-checker-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 1rem;
  padding: 0.45rem 0;
  outline: none;
}

@media (max-width: 560px) {
  .town-checker-input-wrap {
    flex-wrap: wrap;
    padding: 0.5rem 0.7rem;
  }
  .town-checker-input {
    width: 100%;
    flex: 1 1 80%;
  }
  .town-checker-submit-btn {
    width: 100%;
    margin-top: 0.35rem;
  }
}

.town-checker-search {
  position: relative;
}

.checker-results-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: min(460px, 65vh);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.65rem 0.5rem;
  display: none;
}

.checker-results-dropdown.open {
  display: block;
}

.checker-item-visited {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.checker-item-visited:hover {
  background: var(--dehesa-50);
}

.checker-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-stone);
  flex-shrink: 0;
}

.checker-unvisited-card {
  background: var(--ochre-100);
  border: 1px solid rgba(184, 125, 30, 0.35);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  margin-top: 0.5rem;
}

.quick-Jump-tags {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.85rem;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 680px) {
  .quick-Jump-tags {
    mask-image: linear-gradient(to right, black 82%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 82%, transparent 100%);
  }
}

.quick-Jump-tags::-webkit-scrollbar {
  display: none;
}

.quick-tag {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-sand);
  color: var(--ink-700);
  border: 1px solid var(--border-warm);
  white-space: nowrap;
  font-weight: 600;
}

.quick-tag:hover {
  background: var(--dehesa-800);
  color: #fff;
  border-color: var(--dehesa-800);
}

/* Tarjeta destacada derecha del Hero (Alineada 100% de arriba abajo con el bloque izquierdo sin inflar la fila) */
.hero-showcase-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 1.6%;
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-lg);
}

.hero-showcase-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--dehesa-900);
}

@media (max-width: 920px) {
  .hero-showcase-card {
    position: static;
    height: 360px;
  }
}

.hero-showcase-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-showcase-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,40,29,0.1) 0%, rgba(20,40,29,0.35) 45%, rgba(20,40,29,0.92) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1rem, 2.5vw, 1.4rem);
  color: #fff;
}

/* ==========================================================================
   SECCIONES Y BLOQUES TEMÁTICOS ("¿QUÉ TE APETECE VER HOY?")
   ========================================================================== */
.section-block {
  padding: clamp(2.25rem, 5vw, 4rem) 0;
}

.section-block.alt-bg {
  background: var(--bg-sand);
  border-top: 1px solid var(--border-warm);
  border-bottom: 1px solid var(--border-warm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: clamp(1.35rem, 3vw, 2rem);
  flex-wrap: wrap;
}

.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracota-600);
  margin-bottom: 0.3rem;
}

.section-title {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  color: var(--ink-900);
}

.section-desc {
  color: var(--ink-500);
  max-width: 600px;
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

/* "¿Qué te apetece ver hoy?": cabe en una línea en escritorio */
.section-desc-wide {
  max-width: 760px;
}

.patrimonio-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

@media (max-width: 1080px) {
  .patrimonio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 680px) {
  .patrimonio-grid {
    display: flex;
    overflow-x: auto;
    gap: 0.85rem;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, black 86%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 86%, transparent 100%);
  }
  .patrimonio-grid::-webkit-scrollbar {
    display: none;
  }
  .patrimonio-card {
    min-width: 235px;
    scroll-snap-align: start;
  }
}

.patrimonio-card {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: left;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.patrimonio-card:hover {
  transform: translateY(-3px);
  border-color: var(--dehesa-700);
  box-shadow: var(--shadow-md);
}

.patrimonio-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-sand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
}

.patrimonio-card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 0.25rem;
}

.patrimonio-card-sub {
  font-size: 0.82rem;
  color: var(--ink-500);
  line-height: 1.4;
}

.patrimonio-card-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dehesa-800);
}

/* ==========================================================================
   TARJETAS DE PUEBLOS Y FILTROS POR PROVINCIA
   ========================================================================== */
.province-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.35rem;
  scrollbar-width: thin;
}

@media (max-width: 768px) {
  .province-strip {
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
  }
  .province-strip::-webkit-scrollbar {
    display: none;
  }
}

.prov-pill {
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border-warm);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}

.prov-pill:hover, .prov-pill.active {
  background: var(--dehesa-800);
  color: #fff;
  border-color: var(--dehesa-800);
}

.town-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 1100px) {
  .town-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .town-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
  }
}

@media (max-width: 500px) {
  .town-cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.town-card {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.town-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--dehesa-600);
}

.town-card-media {
  position: relative;
  height: 205px;
  background: var(--dehesa-900);
  overflow: hidden;
}

.town-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.town-card-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--dehesa-900), var(--dehesa-700));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  text-align: center;
}

.town-card-badges {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  right: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
  pointer-events: none;
}

.badge-prov {
  background: rgba(20, 40, 29, 0.85);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-votes {
  background: rgba(184, 83, 46, 0.94);
  color: #fff;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.town-card-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.town-card-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 0.4rem;
}

.town-card-pois {
  list-style: none;
  font-size: 0.84rem;
  color: var(--ink-700);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-bottom: 0.85rem;
  min-height: 4.8rem;
}

.town-card-pois li {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.town-card-footer {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ink-500);
}

/* ==========================================================================
   VISTA 2: EXPLORADOR (SPLIT-VIEW EN ESCRITORIO + CONMUTADOR MAPA/LISTA EN MÓVIL)
   ========================================================================== */
.explorer-intro {
  margin: 0 auto;
  padding: 0.7rem 0 0.6rem;
  font-size: 0.9rem;
  color: var(--ink-700);
}

.explorer-intro strong {
  color: var(--dehesa-900);
}

.explorer-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--border-warm);
  padding: 0.7rem 0;
  position: sticky;
  top: 64px;
  z-index: 900;
  width: 100%;
  max-width: 100%;
}

.explorer-filters-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}

.exp-search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.exp-search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 0.95rem;
  pointer-events: none;
  color: var(--ink-500);
}

.exp-search-box {
  width: 100%;
  padding-left: 2.35rem !important;
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
}

.exp-province-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.exp-prov-icon {
  position: absolute;
  left: 0.75rem;
  font-size: 0.95rem;
  pointer-events: none;
}

.exp-select-box {
  padding-left: 2.15rem !important;
  min-width: 220px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  cursor: pointer;
}

.exp-reset-pill {
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  background: var(--terracota-100);
  color: var(--terracota-700);
  border: 1px solid var(--terracota-300);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-height: 40px;
  flex-shrink: 0;
}

.exp-reset-pill:hover {
  background: var(--terracota-600);
  color: #fff;
  border-color: var(--terracota-600);
}

.explorer-list-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.list-sort-select {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-sm);
  padding: 0.26rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-700);
  outline: none;
  cursor: pointer;
}

.filter-input, .filter-select {
  background: var(--bg-paper);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  min-height: 40px;
  max-width: 100%;
}

.filter-input:focus, .filter-select:focus {
  border-color: var(--dehesa-700);
  background: #fff;
}

.filter-pills-scroll {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding-top: 0.5rem;
  padding-bottom: 0.15rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

.filter-pills-scroll::-webkit-scrollbar {
  display: none;
}

.cat-filter-pill {
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-paper);
  border: 1px solid var(--border-warm);
  color: var(--ink-700);
  white-space: nowrap;
  flex-shrink: 0;
}

.cat-filter-pill.active {
  background: var(--dehesa-800);
  color: #fff;
  border-color: var(--dehesa-800);
}

/* Mobile toggle between List and Map */
.mobile-explorer-mode-bar {
  display: none;
}

.explorer-split-layout {
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  height: calc(100vh - 246px);
  min-height: 550px;
  max-height: 820px;
  width: 92%;
  max-width: 1560px;
  margin: 1.15rem auto 2.25rem;
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.explorer-list-pane {
  background: var(--bg-paper);
  border-right: 1px solid var(--border-warm);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.explorer-list-pane::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(to top, rgba(248, 245, 238, 0.95), transparent);
  pointer-events: none;
  z-index: 5;
}

@media (max-width: 900px) {
  .explorer-list-pane::after {
    display: none;
  }
}

.explorer-list-status {
  padding: 0.6rem 0.9rem;
  background: var(--bg-sand);
  border-bottom: 1px solid var(--border-warm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--ink-700);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.explorer-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.split-town-item {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 0.7rem;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.16s;
  min-width: 0;
}

.split-town-item:hover {
  border-color: var(--dehesa-700);
  box-shadow: var(--shadow-sm);
  background: var(--dehesa-50);
}

.split-town-thumb {
  width: 92px;
  height: 88px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--dehesa-900);
}

.split-town-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.4rem;
  font-size: 0.76rem;
  color: var(--ink-500);
  gap: 0.4rem;
}

@media (max-width: 400px) {
  .split-town-footer {
    gap: 0.25rem;
    font-size: 0.72rem;
  }
}

.explorer-map-pane {
  position: relative;
  z-index: 1;
  isolation: isolate;
  height: 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #DCE7EC;
}

#explorer-leaflet-map {
  width: 100%;
  height: 100%;
  background: #E5ECEF;
  z-index: 1;
}

#explorer-leaflet-map.leaflet-container {
  touch-action: pan-y !important;
}

.map-gesture-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 30, 27, 0.42);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: 1rem;
}

.map-gesture-overlay.visible {
  opacity: 1;
}

@media (min-width: 921px) {
  .map-gesture-overlay {
    display: none !important;
  }
}

.map-gesture-box {
  background: rgba(31, 58, 43, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 0.65rem 1.3rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.map-gesture-icon {
  font-size: 1.2rem;
}

.map-overlay-top-right {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 500;
  display: flex;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-md);
  max-width: calc(100% - 62px);
}

.map-layer-btn {
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-700);
  white-space: nowrap;
}

.map-layer-btn.active {
  background: var(--dehesa-800);
  color: #fff;
}

/* En móvil: barra compacta sin desbordamiento horizontal y mapa amplio */
@media (max-width: 920px) {
  .explorer-toolbar {
    position: relative;
    top: 0;
    padding: 0.5rem 0;
  }
  .explorer-filters-top {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }
  .exp-search-input-wrap {
    width: 100%;
  }
  .exp-search-box {
    width: 100%;
    min-height: 40px;
    font-size: 0.88rem;
  }
  .exp-province-select-wrap {
    width: 100%;
  }
  .exp-select-box {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    font-size: 0.86rem;
  }
  .exp-reset-pill {
    width: 100%;
    justify-content: center;
    min-height: 38px;
  }
  .explorer-list-controls {
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .explorer-split-layout.mob-show-list .exp-sync-bounds-label {
    display: none !important;
  }
  .filter-pills-scroll {
    padding-top: 0.4rem;
    gap: 0.35rem;
  }
  .cat-filter-pill {
    padding: 0.32rem 0.65rem;
    font-size: 0.74rem;
  }
  .mobile-explorer-mode-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--bg-sand);
    padding: 0.38rem 0.75rem;
    border-bottom: 1px solid var(--border-warm);
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
  }
  .mob-mode-btn {
    padding: 0.42rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    background: #fff;
    color: var(--ink-700);
    border: 1px solid var(--border-warm);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mob-mode-btn.active {
    background: var(--dehesa-800);
    color: #fff;
    border-color: var(--dehesa-800);
  }
  .explorer-split-layout {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    width: 94%;
    max-width: 100%;
    margin: 0.65rem auto 1.25rem;
    border-radius: var(--radius-lg);
  }
  .explorer-split-layout.mob-show-map .explorer-list-pane {
    display: none;
  }
  .explorer-split-layout.mob-show-map .explorer-map-pane {
    display: block;
    height: calc(100dvh - 300px);
    min-height: 380px;
    width: 100%;
    max-width: 100%;
  }
  .explorer-split-layout.mob-show-list .explorer-map-pane {
    display: none;
  }
  .explorer-split-layout.mob-show-list .explorer-list-pane {
    display: flex;
    height: auto;
    border-right: none;
  }
  .explorer-list-scroll {
    overflow-y: visible;
    padding: 0.65rem 0.75rem;
  }
  .map-overlay-top-right {
    top: 8px;
    right: 8px;
    padding: 0.2rem;
    gap: 0.12rem;
    max-width: calc(100% - 58px);
  }
  .map-layer-btn {
    padding: 0.26rem 0.5rem;
    font-size: 0.68rem;
  }
}

/* Custom MarkerCluster & Leaflet Stability Styling */
.leaflet-container {
  font-family: var(--font-sans);
  outline: none;
  z-index: 1 !important;
  isolation: isolate;
}

.leaflet-top,
.leaflet-bottom {
  z-index: 400 !important;
}

.leaflet-container img {
  max-width: none !important;
  display: inline;
}

/* CRÍTICO: Evita que los tooltips intercepten el ratón y provoquen vibración mouseover/mouseout */
.leaflet-tooltip {
  pointer-events: none !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
  border: 1px solid var(--border-warm);
  border-radius: 8px;
  padding: 4px 8px;
}

.custom-cluster-icon {
  background: rgba(31, 58, 43, 0.92);
  border: 3px solid #FAF7F2;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(20, 40, 29, 0.35);
  user-select: none;
}

.custom-cluster-large {
  background: rgba(184, 83, 46, 0.94);
}

.custom-pin-marker {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  background: var(--dehesa-800);
  border: 2.5px solid #fff;
  transform: rotate(-45deg);
  box-shadow: 0 3px 10px rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.custom-pin-marker span {
  transform: rotate(45deg);
  font-size: 0.78rem;
  line-height: 1;
}

/* ==========================================================================
   VISTA 3: FICHA INDIVIDUAL DE PUEBLO (#pueblo/slug)
   ========================================================================== */
.town-detail-header {
  background: var(--bg-sand);
  border-bottom: 1px solid var(--border-warm);
  padding: clamp(1.35rem, 3vw, 2.2rem) 0;
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--ink-500);
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.town-detail-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.town-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  grid-template-areas:
    "main aside"
    "comments aside";
  gap: 2rem;
  align-items: start;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) 0 3.5rem;
}

.town-main-col {
  grid-area: main;
  min-width: 0;
}

.town-aside-col {
  grid-area: aside;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  position: sticky;
  top: 1.25rem;
}

.town-comments-col {
  grid-area: comments;
  min-width: 0;
}

@media (max-width: 920px) {
  .town-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  .town-main-col {
    order: 1;
  }
  .town-aside-col {
    order: 2;
    position: static;
  }
  .town-comments-col {
    order: 3;
  }
}

.town-hero-photo-frame {
  background: #fff;
  padding: 0.55rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.75rem;
}

.town-hero-photo-frame img {
  width: 100%;
  max-height: 580px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.town-story-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.6rem;
}

.editorial-narrative {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--ink-800);
}

.editorial-narrative p {
  margin-bottom: 1.15rem;
}

.editorial-narrative p:last-child {
  margin-bottom: 0;
}

.poi-inventory-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.poi-item-card {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-left: 4px solid var(--dehesa-700);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.05rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 560px) {
  .poi-item-card {
    flex-direction: column;
    gap: 0.45rem;
  }
}

.poi-item-cat-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-sand);
  color: var(--dehesa-800);
  white-space: nowrap;
}

.nearby-route-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-top: 1rem;
}

@media (max-width: 600px) {
  .nearby-route-grid {
    grid-template-columns: 1fr;
  }
}

.nearby-town-card {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  transition: all 0.16s;
}

.nearby-town-card:hover {
  border-color: var(--terracota-600);
  box-shadow: var(--shadow-sm);
}

.nearby-town-card img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--dehesa-900);
}

.distance-badge {
  display: inline-block;
  background: var(--terracota-100);
  color: var(--terracota-700);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* ==========================================================================
   TARJETAS CONTENEDORAS RESPONSIVAS (CALENDARIO, HISTORIA, COLABORACIONES)
   ========================================================================== */
.surface-card {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-xl);
  padding: clamp(1.2rem, 3vw, 2.2rem);
  box-shadow: var(--shadow-sm);
}

.surface-card-dark {
  background: var(--dehesa-900);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: clamp(1.2rem, 3vw, 2.2rem);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   CUADRÍCULA PROPORCIONAL Y TARJETAS PARALELAS (CALENDARIO Y VECINOS EN PORTADA)
   ========================================================================== */
.calendar-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
  align-items: stretch;
  width: 100%;
}

.calendar-layout > * {
  min-width: 0;
  width: 100%;
  height: 100%;
}

.home-card-column {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.home-card-header {
  margin-bottom: 1.15rem;
}

.home-card-title {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  color: var(--dehesa-900);
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.home-card-desc {
  color: var(--ink-500);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
}

.home-card-actions {
  margin-top: auto;
  padding-top: 1.25rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Listado de los 6 pueblos en Portada */
.home-top6-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  justify-content: space-between;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.ranking-row:hover {
  background: #FFFFFF;
  border-color: var(--border-warm);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}

.ranking-row.top-three {
  border-left: 3px solid var(--ochre-600);
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-700);
  flex-shrink: 0;
}

.ranking-row.top-three .rank-number {
  background: var(--ochre-100);
  color: var(--ochre-600);
  border-color: rgba(184, 125, 30, 0.35);
}

.ranking-info {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.ranking-town-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-province {
  font-weight: 400;
  color: var(--ink-500);
  font-size: 0.8rem;
}

.ranking-year-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--dehesa-700);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Listado de comentarios destacados en Portada (Historias de Vecinos) */
.home-comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  justify-content: space-between;
}

.home-comment-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.95rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  justify-content: center;
}

.home-comment-card:hover {
  background: #FFFFFF;
  border-color: var(--dehesa-600);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}

.home-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.home-comment-town {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dehesa-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-comment-prov {
  font-weight: 400;
  color: var(--ink-500);
  font-size: 0.78rem;
}

.home-comment-author {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--terracota-700);
  white-space: nowrap;
  flex-shrink: 0;
}

.home-comment-text {
  font-size: 0.85rem;
  color: var(--ink-700);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: italic;
}

@media (max-width: 900px) {
  .calendar-layout {
    grid-template-columns: 100%;
    gap: 1.75rem;
  }
}

/* Sobre Nosotros (/about/ - ID 252): Cabecera 100% arriba + 50% Historia / 50% Retrato Vertical */
.about-top-header {
  width: 100%;
  text-align: center;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.about-2col-grid {
  display: grid;
  grid-template-columns: 54% 43%;
  justify-content: space-between;
  align-items: stretch;
  width: 100%;
}

.about-2col-grid > * {
  min-width: 0;
  width: 100%;
}

.about-story-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.96rem;
  color: var(--ink-700);
  line-height: 1.68;
  text-align: justify;
}

.about-photo-col {
  position: relative;
  width: 100%;
}

.about-photo-frame {
  position: sticky;
  top: 1.5rem;
  width: 100%;
  max-width: 520px;
  max-height: min(720px, calc(100vh - 140px));
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  background: #fff;
  padding: 10px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-md);
}

.about-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 74%;
  display: block;
  border-radius: var(--radius-lg);
}

@media (max-width: 900px) {
  .about-2col-grid {
    grid-template-columns: 100%;
    gap: 1.5rem;
  }
  .about-photo-col {
    order: -1;
    min-height: auto;
  }
  .about-photo-frame {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 480px;
    height: clamp(280px, 70vw, 360px);
    aspect-ratio: auto;
    margin: 0 auto;
    padding: 8px;
    border-radius: var(--radius-lg);
  }
  .about-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 74%;
    border-radius: calc(var(--radius-lg) - 4px);
  }
}

/* Donaciones (/donaciones/ - ID 5658): Igualdad exacta de altura entre texto e imagen y encaje al 100% de zoom */
.donaciones-section {
  padding: 1.6% 0;
}

.donaciones-layout {
  display: grid;
  grid-template-columns: 60% 36%;
  justify-content: space-between;
  align-items: stretch;
  width: 88%;
  margin: 0 auto;
}

.donaciones-layout > * {
  min-width: 0;
}

.donaciones-text-card {
  padding: 3% 4.2%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.donaciones-body-copy {
  font-size: 0.92rem;
  color: var(--ink-700);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  line-height: 1.52;
  flex: 1;
}

.donaciones-about-callout {
  background: var(--dehesa-50);
  border: 1px solid var(--dehesa-200);
  border-left: 3px solid var(--dehesa-700);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0.25rem 0 0.45rem;
}

.donaciones-callout-icon {
  font-size: 1.3rem;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}

.donaciones-callout-body {
  flex: 1;
  min-width: 0;
}

.donaciones-callout-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dehesa-900);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.donaciones-callout-desc {
  font-size: 0.82rem;
  color: var(--ink-700);
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.donaciones-callout-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--terracota-700);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.donaciones-callout-link:hover {
  color: var(--terracota-800);
}

.donaciones-bizum-box {
  background: var(--bg-sand);
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: clamp(0.9rem, 2vw, 1.25rem) clamp(1rem, 3vw, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.15rem 0;
}

.donaciones-photo-col {
  position: relative;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.donaciones-photo-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.donaciones-photo-frame {
  height: 100%;
  width: auto;
  aspect-ratio: 723 / 1024;
  max-width: 100%;
  background: #fff;
  padding: 2%;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.donaciones-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-lg);
}

/* La foto de Donaciones lleva texto impreso: se ve entera, nunca recortada */
#view-donaciones .donaciones-photo-img {
  object-fit: contain;
}

.contacto-photo-frame {
  aspect-ratio: 833 / 1024;
}

@media (max-width: 900px) {
  .donaciones-layout {
    grid-template-columns: 100%;
    width: 100%;
    gap: 1.5rem;
  }
  .donaciones-photo-stage {
    position: static;
  }
  .donaciones-photo-frame {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
  }
  .donaciones-photo-img {
    width: 100%;
    height: auto;
  }
}

/* ==========================================================================
   VISTA 4: CALENDARIO ANUAL Y FAVORITOS DEL PÚBLICO (FIEL A WORDPRESS)
   ========================================================================== */
.cal-hero-section {
  background: var(--bg-sand);
  border-bottom: 1px solid var(--border-warm);
  padding: clamp(1.75rem, 3.5vw, 2.75rem) 0;
}

.cal-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cal-mode-selector {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--border-warm);
  padding: 4px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  gap: 4px;
  max-width: 100%;
}

.cal-pill-btn {
  background: transparent;
  border: none;
  padding: 0.55rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-700);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.cal-pill-btn:hover {
  color: var(--dehesa-900);
}

.cal-pill-btn.active {
  background: var(--dehesa-800);
  color: #fff;
  box-shadow: 0 2px 6px rgba(44, 84, 29, 0.25);
}

@media (max-width: 640px) {
  .cal-mode-selector {
    display: flex;
    width: 100%;
    border-radius: var(--radius-lg);
    padding: 3px;
  }
  .cal-pill-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.5rem 0.45rem;
    font-size: 0.78rem;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    border-radius: calc(var(--radius-lg) - 2px);
  }
}

.cal-vote-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: start;
}

@media (max-width: 860px) {
  .cal-vote-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cal-vote-form-card,
.cal-vote-info-card,
.cal-closed-card {
  padding: clamp(1.25rem, 3vw, 2.25rem);
}

.cal-form-elementor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cal-form-row-3col {
  display: grid;
  grid-template-columns: 32% 32% 32%;
  justify-content: space-between;
}

.cal-form-row-2col {
  display: grid;
  grid-template-columns: 48.8% 48.8%;
  justify-content: space-between;
}

@media (max-width: 580px) {
  .cal-form-row-3col,
  .cal-form-row-2col {
    grid-template-columns: 100%;
    gap: 0.7rem;
  }
}

.cal-form-field {
  display: flex;
  flex-direction: column;
}

.cal-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-800);
  margin-bottom: 0.35rem;
}

.cal-form-input {
  width: 100%;
  border: 1.5px solid var(--border-warm);
  border-radius: 9px;
  padding: 0.68rem 0.85rem;
  font-size: 0.92rem;
  background: #fff;
  color: var(--ink-900);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.cal-form-input:focus {
  border-color: var(--dehesa-700);
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 84, 29, 0.12);
}

.cal-field-hint {
  display: block;
  font-size: 0.74rem;
  color: var(--ink-500);
  margin-top: 0.3rem;
  line-height: 1.35;
}

.btn-elementor-submit {
  background-color: var(--dehesa-800);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.82rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  width: 100%;
  margin-top: 0.35rem;
  box-shadow: 0 4px 14px rgba(31, 58, 43, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-elementor-submit:hover {
  background-color: var(--dehesa-900);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(31, 58, 43, 0.28);
}

.btn-elementor-submit:active {
  transform: translateY(1px);
}

.cal-logo-center {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.cal-logo-round {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--border-warm);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.cal-stats-strip {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.cal-stat-item {
  flex: 1;
  text-align: center;
  background: var(--bg-sand);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.5rem;
}

.cal-stat-val {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dehesa-900);
  line-height: 1.2;
}

.cal-stat-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cal-closed-card {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

/* FASE 2: LOS FAVORITOS DEL PÚBLICO */
.favs-top-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2rem;
}

.favs-divider {
  width: 60px;
  height: 2px;
  background: var(--border-warm);
  margin: 0.75rem auto 1.25rem;
}

.favs-year-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.favs-year-pills {
  display: inline-flex;
  gap: 0.4rem;
}

.favs-year-pill {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-700);
  cursor: pointer;
  transition: all 0.15s;
}

.favs-year-pill.active {
  background: var(--dehesa-800);
  color: #fff;
  border-color: var(--dehesa-800);
}

.favs-poster-container {
  display: flex;
  justify-content: center;
  margin-bottom: 2.75rem;
}

.favs-poster-card {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-xl);
  padding: 1.4%;
  box-shadow: var(--shadow-md);
  width: 78%;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .favs-poster-card {
    width: 100%;
    padding: 2.5%;
  }
}

.favs-poster-media {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  display: block;
}

.favs-winners-layout {
  display: grid;
  grid-template-columns: 49% 49%;
  justify-content: space-between;
  row-gap: 1.25rem;
}

@media (max-width: 720px) {
  .favs-winners-layout {
    grid-template-columns: 100%;
    row-gap: 1rem;
  }
}

.fav-winner-card {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  gap: 4%;
  padding: 2.5%;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.fav-winner-card:hover {
  border-color: var(--dehesa-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.fav-winner-img-wrap {
  width: 28%;
  aspect-ratio: 2 / 3;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--dehesa-900);
}

.fav-winner-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fav-winner-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.2rem;
}

.fav-winner-rank-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--terracota-600);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.fav-winner-title {
  font-size: 1.25rem;
  color: var(--ink-900);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.fav-winner-province {
  font-size: 0.84rem;
  color: var(--ink-500);
  margin-bottom: 0.85rem;
}

/* Toast emergente fiel a la animación de Elementor */
.elementor-vote-success-toast {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 99999 !important;
  padding: 20px 36px !important;
  background-color: #2C541D !important;
  color: #fff !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  border-radius: 9px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
  text-align: center !important;
  opacity: 0;
  pointer-events: none;
  animation: elementorPopupFade 3.5s forwards;
}

@keyframes elementorPopupFade {
  0% { opacity: 0; transform: translate(-50%, -60%) scale(0.85); }
  10% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
}

/* Colaboraciones */
.colab-showcase-card {
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
}

.colab-showcase-card > * {
  min-width: 0;
}

@media (max-width: 860px) {
  .colab-showcase-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

.colab-carousel {
  position: relative;
  min-height: 280px;
  max-height: 440px;
  background: var(--dehesa-900);
}

.colab-carousel img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: 440px;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
}

.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

@media (max-width: 860px) {
  .colab-carousel,
  .colab-carousel img {
    height: 300px;
    min-height: 0;
  }
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--dehesa-900);
  color: rgba(255, 255, 255, 0.84);
  padding: clamp(2.2rem, 5vw, 3.5rem) 0 2rem;
  border-top: 4px solid var(--terracota-600);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.75rem;
  margin-bottom: 2rem;
}

@media (max-width: 920px) {
  .site-footer {
    padding-bottom: calc(2.2rem + 68px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 500px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }
}

/* Aviso si no se pueden cargar los datos de la web */
.aviso-carga {
  padding: 0.75rem 1rem;
  background: #FEE2E2;
  color: #991B1B;
  font-size: 0.9rem;
  text-align: center;
}

/* Aviso de privacidad en formularios y página de la política */
.aviso-privacidad {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--ink-500);
}

.aviso-privacidad:empty {
  display: none;
}

.aviso-privacidad a,
.legal-text a {
  color: var(--terracota-600);
  text-decoration: underline;
}

.legal-text {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(1.5rem, 3.5vw, 2.65rem);
  color: var(--ink-700);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.legal-text h1 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--dehesa-900);
}

.legal-text .legal-fecha {
  margin: 0.3rem 0 1.2rem;
  font-size: 0.82rem;
  color: var(--ink-500);
}

.legal-text h2 {
  margin: 1.5rem 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--dehesa-900);
}

.legal-text p,
.legal-text ul {
  margin: 0 0 0.75rem;
}

.legal-text ul {
  padding-left: 1.2rem;
}

.legal-text li {
  margin-bottom: 0.45rem;
}
