/*
  deLiebana — site.css
  Paleta orgánica + Layout + Componentes + Utilidades
  - Carga recomendada: tokens.css -> site.css -> (opcionales) news.css
*/

/* =========================================================
   0) ROOT TOKENS / MAPEOS (con fallbacks si falta tokens.css)
   ========================================================= */
:root {
  /* ---- Paleta orgánica (mapea a tokens.css si existe) ---- */
  /* Evita que el navegador aplique estilos oscuros por defecto
     a los controles nativos cuando el SO está en modo oscuro */
  color-scheme: light;
  --dl-brown: var(--color-brown, #8B4E34);
  --dl-brown-700: var(--color-brown-700, #6B3924);
  --dl-terracotta: var(--color-terracotta, #A47864);
  --dl-cta: var(--color-cta, #C75B35);
  --dl-mustard: var(--color-mustard, #DFAE5A);
  --dl-orange: var(--color-orange, #EB6A45);
  --dl-purple: var(--color-purple, #934A7A);
  --dl-cream: var(--color-cream, #F6EFE8);
  --dl-cream-soft: var(--color-cream-soft, #FCF7F0);
  --dl-surface: var(--color-surface, #FFFDF9);
  --dl-ink: var(--color-ink, #2A1D16);
  --dl-ink-2: var(--color-ink-2, #5B4B40);

  --border-soft: var(--border-soft, #e8e1d8);

  /* Tipografías (tokens o fallbacks) */
  --font-sans: var(--font-sans, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif);
  --font-serif: var(--font-serif, 'Lora', 'Cormorant Garamond', Georgia, serif);

  /* Radio + sombras */
  --radius: var(--radius, 14px);
  --shadow-sm: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, .06));
  --shadow-md: var(--shadow-md, 0 6px 18px rgba(0, 0, 0, .08));
  --shadow-lg: var(--shadow-lg, 0 12px 30px rgba(0, 0, 0, .12));

  /* Espacios base */
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;

  /* Varios */
  --link: var(--dl-brown-700);
  --transition: all .25s ease;
}

/* =========================================================
   1) RESET / BASE
   ========================================================= */
html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  background: var(--dl-cream);
  color: var(--dl-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}

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

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  color: var(--dl-ink);
  margin: 0 0 var(--space-3);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.wrap,
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: clamp(1.5rem, 4vw, 3rem) 0;
}

.visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  padding: 0;
  border: 0;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

/* Marca de agua solo en imágenes de contenido (compraventa y artículos) */
.dl-wm {
  position: relative;
}

.dl-wm::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 110px;
  height: auto;
  background-image: url('/assets/img/cropped-logo_383_106px.webp');
  background-repeat: no-repeat;
  background-size: contain;
  opacity: .22;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .25));
}

/* =========================================================
   2) ACCESIBILIDAD
   ========================================================= */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  background: #000;
  color: #fff;
  padding: .5rem 1rem;
  border-radius: .5rem;
  z-index: 10000
}

/* =========================================================
   3) HEADER + NAV (incluye estado .scrolled)
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--dl-cream-soft);
  color: var(--dl-ink);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  transition: var(--transition);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 1rem;
  transition: padding .2s ease;
}

.logo img {
  display: block;
  height: 34px;
  width: auto;
  transition: height .2s ease;
}

/* Estado compacto al hacer scroll */
.site-header.scrolled {
  background: var(--dl-cream);
  border-bottom-color: rgba(0, 0, 0, .10);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
}

.site-header.scrolled .wrap {
  padding: .45rem 1rem;
}

.site-header.scrolled .logo img {
  height: 30px;
}

/* Toggle móvil */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: .5rem;
  cursor: pointer;
}

.nav-toggle .bar {
  display: block;
  height: 2px;
  margin: 6px 8px;
  background: var(--dl-ink);
  border-radius: 2px;
}

/* Nav desktop (solo primer nivel) */
.site-nav>ul {
  list-style: none;
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  color: var(--dl-ink);
  font-weight: 700;
  letter-spacing: .15px;
  padding: .55rem .85rem;
  border-radius: .6rem;
  transition: background .15s ease, color .15s ease;
}

.site-nav a:hover {
  background: var(--dl-cream);
  text-decoration: none;
  color: var(--dl-brown-700);
}

.site-nav a.is-active,
.site-nav a.active {
  background: #FFF;
  color: var(--dl-ink);
  box-shadow: var(--shadow-sm);
}

/* CTA Publicar con animación sutil */
.site-nav .btn-publish {
  background: var(--dl-cta);
  color: #FFF;
  font-weight: 700;
  border-radius: .6rem;
  box-shadow: var(--shadow-sm);
}

/* Mantener el CTA visible al hacer hover: pasa a azul y no hereda el hover genérico */
.site-nav .btn-publish:hover {
  background: #34526b;
  /* azul acorde al estilo del panel */
  color: #fff;
  filter: none;
}

/* Pulso sutil solo en >= 861px y respetando reduced-motion */
@keyframes dl-breathe {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: var(--shadow-sm)
  }

  50% {
    transform: translateY(0) scale(1.03);
    box-shadow: 0 8px 22px rgba(199, 91, 53, .25)
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow: var(--shadow-sm)
  }
}

@media (min-width: 861px) {
  .site-nav .btn-publish {
    animation: dl-breathe 2.8s ease-in-out infinite;
  }

  .site-nav .btn-publish:hover,
  .site-nav .btn-publish:focus {
    animation: none;
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav .btn-publish {
    animation: none !important
  }
}

/* Nav móvil */
@media (max-width: 860px) {
  .nav-toggle {
    display: block
  }

  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: 64px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    background: var(--dl-cream-soft);
    border-top: 1px solid var(--border-soft);
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 64px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .site-nav.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav>ul {
    flex-direction: column;
    padding: .5rem .75rem;
    gap: .25rem
  }

  .site-nav li a {
    display: block;
    padding: .7rem .9rem;
    border-radius: .7rem;
  }

  .site-nav li a:hover {
    background: var(--dl-cream);
    color: var(--dl-brown-700);
  }

  .site-nav li a.btn-publish:hover {
    background: #34526b;
    color: #fff;
  }

  .site-nav li a.is-active,
  .site-nav li a.active {
    background: #FFF;
    color: var(--dl-ink);
    box-shadow: var(--shadow-sm);
  }

  body.nav-open {
    overflow: hidden;
  }
}

.header-spacer {
  height: 0
}

/* =========================================================
   4) HERO
   ========================================================= */
.hero {
  position: relative;
  isolation: isolate;
  background-image: var(--hero-img);
  /* definida en _inc/hero.php */
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(164, 120, 100, .38), rgba(164, 120, 100, .38));
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  min-height: 46vh;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 3rem) 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero--sm .hero__inner {
  min-height: 26vh
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.08;
  margin: 0 0 .5rem;
  color: #F6EFE8;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.hero__sub {
  color: #F6EFE8;
  opacity: .98;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  max-width: 65ch;
  margin: 0 0 .75rem;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .25);
}

.hero-banner {
  max-width: 1100px;
  margin: 1rem auto;
  padding: 0 1rem;
}

/* =========================================================
   5) BOTONES / CHIPS / BADGES
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1rem;
  border-radius: .8rem;
  background: var(--dl-brown-700);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  transition: filter .15s ease, transform .06s ease;
}

.btn:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px)
}

.btn--accent {
  background: var(--dl-mustard);
  color: #3A2C16;
}

.btn.btn-ghost {
  background: var(--dl-cream-soft);
  color: var(--dl-ink);
  border: 1px solid var(--border-soft);
}

/* (El dropdown de Explora se ha eliminado; se usa panel lateral unificado) */
/* Submenú simple (Explora) con <details>/<summary> */
.site-nav .nav-sub details {
  position: relative;
}

/* Quitar marcador por defecto y usar un icono consistente */
.site-nav .nav-sub summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  padding: .55rem .85rem;
  border-radius: .6rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.site-nav .nav-sub summary::-webkit-details-marker {
  display: none;
}

.site-nav .nav-sub summary::marker {
  content: '';
}

/* Chevron simple con carácter; fiable cross‑browser */
.site-nav .nav-sub details>summary::after {
  content: '▾';
  font-size: .85em;
  opacity: .8;
  transition: transform .2s ease;
}

.site-nav .nav-sub details[open]>summary::after {
  transform: rotate(180deg);
}

.site-nav .nav-sub .sub {
  list-style: none;
  margin: 0;
  padding: .35rem;
  display: block;
}

.site-nav .nav-sub .sub li a {
  display: block;
  padding: .55rem .7rem;
  border-radius: 10px;
  color: #1b1f2a;
  text-decoration: none;
}

.site-nav .nav-sub .sub li a:hover {
  background: #f7f4ef;
}

@media (min-width: 861px) {

  /* Solo el primer nivel del dropdown es flotante */
  .site-nav .nav-sub>details>.sub {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .12);
    min-width: 200px;
    z-index: 1200;
    max-height: min(70vh, 480px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Asegurar que el panel no captura eventos cuando el <details> está cerrado */
  .site-nav .nav-sub>details:not([open])>.sub {
    display: none !important;
    pointer-events: none !important;
  }

  /* Subniveles dentro del panel bajan en vertical (no flyout horizontal) */
  .site-nav .nav-sub details details>.sub {
    position: static !important;
    left: auto !important;
    top: auto !important;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: .35rem 0 0 .5rem;
    min-width: auto;
    display: block;
  }

  /* Resumen anidado en vertical con su chevron */
  .site-nav .nav-sub details details>summary {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .5rem;
    border-radius: 8px;
  }

  .site-nav .nav-sub details details>summary:hover {
    background: #f7f4ef;
  }
}

@media (max-width: 860px) {
  .site-nav .nav-sub {
    width: 100%;
  }

  .site-nav .nav-sub .sub {
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0 .25rem .5rem .75rem;
    background: transparent;
    min-width: auto;
  }

  .site-nav .nav-sub summary {
    padding: .7rem .9rem;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.5rem;
  min-width: 2.5rem;
  padding: 0 .55rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  background: #fff;
  border: 1px solid var(--border-soft);
  color: var(--dl-brown-700);
}

.chip {
  display: inline-block;
  font-size: .85rem;
  padding: .35rem .65rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border-soft);
  color: var(--dl-ink-2);
}

/* Pastilla unificada (enlaces y botones pequeños) */
.pill {
  display: inline-block;
  padding: .45rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--dl-brown-700);
  color: #fff;
  text-decoration: none;
}

.pill:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

/* =========================================================
   6) LAYOUTS / GRIDS / CARDS
   ========================================================= */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.tile {
  background: var(--dl-surface);
  border-radius: 18px;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-soft);
  text-align: center;
}

.tile__icon {
  font-size: 2.2rem;
  margin-bottom: .5rem;
  display: inline-block;
}

.tile--orange .tile__icon {
  color: var(--dl-orange);
}

.tile--purple .tile__icon {
  color: var(--dl-purple);
}

.tile h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 1.7rem);
  margin: .25rem 0 .35rem;
}

.tile p {
  margin: 0;
  color: var(--dl-ink-2);
}

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

.card {
  background: var(--dl-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #eef1f5 url("/assets/img/no-photo.webp") center/contain no-repeat;
}

.card-body {
  padding: .95rem;
  display: grid;
  gap: .55rem
}

.card-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.32
}

.card-text {
  margin: 0;
  color: var(--dl-ink-2)
}

/* Grids reutilizables */
.grid-auto {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

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

@media (max-width: 900px) {
  .news-grid {
    grid-template-columns: 1fr
  }
}

/* Noticias (cards rápidas) */
.news-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.news-card__media img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.news-card__body h3 {
  font-size: 1.05rem;
  margin: .2rem 0;
}

.news-card__body p {
  margin: 0 0 .25rem;
  color: var(--dl-ink-2);
}

/* Empresas (1:1) */
.biz-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.biz-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.biz-card__media img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.biz-card__body {
  padding: .85rem;
}

.biz-card__body h3 {
  margin: .2rem 0;
  font-size: 1.05rem;
  font-family: var(--font-serif);
}

.biz-card__meta {
  margin: 0;
  color: var(--dl-ink-2);
}

@media (max-width: 900px) {
  .biz-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* =========================================================
   7) BLOQUES ESPECÍFICOS (Teleprompter, Guardias, CTA)
   ========================================================= */
/* Teleprompter de avisos */
.dl-teleprompter {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.dl-teleprompter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}

.dl-teleprompter__title {
  font-size: 1.15rem;
  margin: 0;
}

.dl-teleprompter__tags {
  display: flex;
  gap: .4rem;
}

.dl-teleprompter__tags span {
  font-size: .75rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: var(--dl-cream-soft);
  border: 1px solid var(--border-soft);
}

.dl-teleprompter__viewport {
  position: relative;
  height: 52px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--dl-cream-soft);
  margin-top: .25rem;
}

.dl-teleprompter__item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 .65rem;
  text-decoration: none;
  color: inherit;
  transform: translateY(100%);
  opacity: 0;
}

.dl-teleprompter__item .src {
  font-size: .7rem;
  text-transform: uppercase;
  background: #fff;
  padding: 2px 6px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

.dl-teleprompter__item .msg {
  flex: 1;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-teleprompter__item .when {
  font-size: .8rem;
  color: var(--dl-ink-2);
}

.dl-teleprompter__item.is-skeleton {
  opacity: .6;
  transform: translateY(0)
}

.dl-teleprompter__controls {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: .5rem;
}

.dl-teleprompter__controls button {
  background: #fff;
  border: 1px solid #d8cfc7;
  border-radius: 8px;
  font-size: .8rem;
  padding: .35rem .6rem;
}

.dl-teleprompter__controls button:hover {
  background: var(--dl-cream-soft);
}

.dl-teleprompter__item.is-in {
  animation: tp-in .3s ease forwards
}

.dl-teleprompter__item.is-out {
  animation: tp-out .25s ease forwards
}

@keyframes tp-in {
  from {
    transform: translateY(100%);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

@keyframes tp-out {
  from {
    transform: translateY(0);
    opacity: 1
  }

  to {
    transform: translateY(-100%);
    opacity: 0
  }
}

/* Farmacias de guardia */
.dl-guardias {
  background: var(--dl-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.dl-guardias__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

.dl-guardias__title {
  font-size: 1.15rem;
  margin: 0;
}

.dl-guardias__date {
  font-size: .9rem;
  color: var(--dl-ink-2);
}

.dl-guardias__list {
  display: grid;
  gap: .75rem;
}

.guardia-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: .75rem 1rem;
  border: 1px solid var(--border-soft);
}

.guardia-card h3 {
  font-size: 1rem;
  margin: 0 0 .35rem;
}

.guardia-card .muted {
  color: var(--dl-ink-2);
  font-size: .9rem;
  margin: .25rem 0;
}

.guardia-card .actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}

.item.skeleton {
  background: var(--dl-cream-soft);
  color: var(--dl-ink-2);
  padding: .6rem .8rem;
  border-radius: 10px;
}

/* CTA con fondo */
.home-cta {
  position: relative;
  isolation: isolate;
  margin: 2rem 0;
}

.home-cta__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(.78) saturate(1.02);
}

.home-cta__inner {
  position: relative;
  padding: 3rem 0;
}

.home-cta__content {
  color: #fff;
  max-width: 700px;
}

.home-cta h2 {
  margin: 0 0 .5rem;
  font-size: 1.8rem;
}

/* =========================================================
   8) FORMULARIOS / BUSCADOR
   ========================================================= */
/* Bases de formularios: forzamos fondo claro y texto legible
   para evitar el gris oscuro automático en algunos navegadores */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
textarea,
select {
  background: #fff;
  color: var(--dl-ink);
}

.form-publish {
  display: grid;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto;
  background: #FFFDF9;
  padding: 2rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.form-publish label {
  font-weight: 700;
  display: block;
  margin-bottom: .3rem;
}

.form-publish input[type="text"],
.form-publish textarea,
.form-publish select {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid #d8cfc7;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
}

.form-publish input[type="file"] {
  margin-top: .3rem;
}

.form-publish button {
  justify-self: start;
}

.search-card {
  background: var(--dl-surface);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  margin: 1rem 0 2rem;
}

.search-card__form {
  display: grid;
  gap: .75rem
}

.search-card__filters {
  margin: 0;
  padding: 0;
  border: 0
}

.search-card__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .5rem;
  align-items: center;
}

.search-card__select {
  min-width: 11rem;
  padding: .75rem .9rem;
  border: 1px solid #d8cfc7;
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

.search-card__row input[type="search"] {
  width: 100%;
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px solid #d8cfc7;
  background: #fff;
  font: inherit;
}

.search-card__row .btn {
  padding: .85rem 1rem
}

@media (max-width:720px) {
  .search-card__row {
    grid-template-columns: 1fr;
  }

  .search-card__select,
  .search-card__row .btn {
    width: 100%;
  }
}

/* =========================================================
   9) AVISOS / CHIPS SUELTAS
   ========================================================= */
.home-alerts {
  background: var(--dl-cream-soft);
  padding: 1rem 0;
  margin: 2rem 0;
  border-top: 1px solid rgba(0, 0, 0, .06);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.alerts-chips {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

/* =========================================================
   10) FOOTER
   ========================================================= */
.site-footer {
  background: var(--dl-brown);
  color: #F6EFE8;
  margin-top: 3rem;
  border-top: 4px solid var(--dl-terracotta);
}

.site-footer a {
  color: #F6EFE8;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .wrap {
  padding: 2rem 1rem;
}

.site-footer .grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.25rem;
  align-items: flex-start;
}

.site-footer h3,
.site-footer h4 {
  color: #fff;
  margin-bottom: .5rem;
  font-family: var(--font-serif);
}

.site-footer .brand p {
  margin: .25rem 0 0;
  color: #f3e9e1;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin: .25rem 0;
}

.site-footer .copy {
  border-top: 1px solid rgba(255, 255, 255, .25);
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: .9rem;
  color: #f3e9e1;
}

.site-footer .copy .to-top {
  display: inline-block;
  margin-left: .25rem;
  padding: .28rem .6rem;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  color: #fff;
  background: transparent;
  text-decoration: none;
}

.site-footer .copy .to-top:hover {
  background: rgba(255, 255, 255, .12);
}

@media (max-width: 860px) {
  .site-footer .wrap {
    padding: 2rem 1.25rem;
  }

  .site-footer .grid {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 1.5rem;
  }

  .site-footer .brand {
    text-align: left;
  }

  .site-footer nav ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.5rem;
  }
}

/* Chat ticker — teaser último mensaje (pie del hero) */
.chat-ticker {
  margin: .9rem auto 0;
  max-width: 720px;
}

.chat-ticker__inner {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .9rem;
  border-radius: 999px;
  background: #6b5b4b;
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .8rem;
  text-decoration: none;
}

.chat-ticker__inner:hover {
  background: #5c4e41;
}

.chat-ticker__label {
  flex: 0 0 auto;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .7rem;
  color: #facc15;
}

.chat-ticker__marquee {
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
}

.chat-ticker__text {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation: chat-ticker-scroll 18s linear infinite;
}

@keyframes chat-ticker-scroll {
  0% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(-100%);
  }
}

/* =========================================================
   11) UTILIDADES
   ========================================================= */
.muted {
  color: var(--dl-ink-2)
}

.center {
  text-align: center
}

.mt-0 {
  margin-top: 0
}

.mt-1 {
  margin-top: .25rem
}

.mt-2 {
  margin-top: .5rem
}

.mt-3 {
  margin-top: 1rem
}

.mb-0 {
  margin-bottom: 0
}

.mb-1 {
  margin-bottom: .25rem
}

.mb-2 {
  margin-bottom: .5rem
}

.mb-3 {
  margin-bottom: 1rem
}

.pt-0 {
  padding-top: 0
}

.pb-0 {
  padding-bottom: 0
}

.is-hidden {
  display: none !important
}

.is-disabled {
  pointer-events: none;
  opacity: .6
}

/* Skeleton rápido */
.skeleton {
  background: linear-gradient(90deg, #eee, #f5f5f5, #eee);
  background-size: 200% 100%;
  animation: skel 1.2s ease-in-out infinite;
  border-radius: .6rem;
}

@keyframes skel {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

/* Helpers de animación */
.fade-in {
  animation: fadeIn .24s ease both;
}

.slide-up {
  animation: slideUp .28s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes slideUp {
  from {
    transform: translateY(8px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

/* === Icono de usuario sutil (silueta sin fondo) === */
.nav-auth {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.nav-auth__icon,
.nav-auth__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem;
  text-decoration: none;
  color: var(--text-color, #2a1f1a);
  opacity: .85;
  transition: opacity .2s ease;
}

.nav-auth__icon:hover,
.nav-auth__logout:hover {
  opacity: 1;
}

.nav-auth__icon .icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  filter: brightness(0.2);
}

/* En modo oscuro la silueta se aclara ligeramente */
@media (prefers-color-scheme: dark) {

  .nav-auth__icon,
  .nav-auth__logout {
    color: #f1f1f1;
    filter: brightness(1.2);
  }
}

/* =========================================================
   Estilo anuncios
   ========================================================= */

/* === Banners publicitarios === */
.dl-banner {
  display: block;
  width: 100%;
  margin: 1.5rem auto;
  max-width: 1200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dl-banner img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Farmacia card — estilos orgánicos */
#farmacia .card {
  background: #fff;
  border: 1px solid #eadfce;
}

#farmacia .badge {
  background: #fff1cc;
  border-color: #f1d58a;
  color: #856404;
}

#farmacia .fc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

#farmacia .fc-item {
  border: 1px solid #e7dbcf;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

#farmacia .fc-title {
  font-weight: 800;
  margin-bottom: 2px;
}

#farmacia .fc-line {
  font-size: .95rem;
  color: #8a6f5a;
}

#farmacia .fc-when {
  margin-top: 6px;
  font-size: .9rem;
}

#farmacia .fc-note {
  margin-top: 4px;
  font-size: .86rem;
  color: #6a4e3a;
}

#farmacia a.fc-phone {
  color: #2a1a10;
  text-decoration: underline dotted #DFAE5A;
}

/* =========================================
   Estados especiales: error / 404 / 500 / mantenimiento
   ========================================= */
.error-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  color: var(--color-light, #fff);
  font-family: var(--font-primary, "Inter", system-ui, sans-serif);
  background: #000;
  /* fallback mientras carga img */
}

.hero-error {
  position: relative;
  flex: 1;
  min-height: 80vh;
  max-height: 100vh;
  overflow: hidden;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-radius: 0;
  /* si en desktop quieres que sea como tarjeta, cámbialo */
}

.hero-error .hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.45);
  z-index: 1;
}

/* degradado por encima para legibilidad del texto */
.hero-error .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.8) 0%,
      rgba(0, 0, 0, 0.25) 60%,
      rgba(0, 0, 0, 0.4) 100%);
  z-index: 2;
}

/* contenedor del contenido */
.hero-error .hero-content {
  position: relative;
  z-index: 3;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  color: #fff;
}

/* "píldora" del código de error */
.err-code-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  padding: .5rem .75rem;
  font-size: .75rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.err-code-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .75rem;
  color: rgba(255, 255, 255, 0.9);
}

.err-sep {
  width: .4rem;
  height: .4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}

.err-code-txt {
  font-size: .7rem;
  color: rgba(255, 255, 255, 0.6);
}

.hero-error h1 {
  color: #fff;
  font-size: clamp(2rem, 1.2rem + 2vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  margin: 0 0 1rem;
}

.err-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 48ch;
  margin: 0 auto 2rem;
  text-wrap: balance;
}

.err-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 480px) {
  .err-actions {
    flex-direction: row;
    justify-content: center;
  }
}

/* botón principal */
.btn-volver {
  display: inline-block;
  background: var(--color-primary, #c17d4f);
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: 2rem;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .8);
  transition: background .2s ease, box-shadow .2s ease;
}

.btn-volver:hover,
.btn-volver:focus {
  background: var(--color-primary-dark, #a86c42);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .9);
  text-decoration: none;
  color: #fff;
}

/* acción secundaria tipo enlace */
.err-secondary {
  font-size: .85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

.err-secondary-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.err-secondary-link:hover {
  color: #fff;
  text-decoration-color: #fff;
}

/* adornos opcionales tipo borde suave y sombra interior
   (da ese rollo de “tarjeta hero premium” en desktop)
*/
.hero-ring {
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 30px 120px 60px rgba(0, 0, 0, 1) inset;
}

.hero-inner-shadow {
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  pointer-events: none;
  z-index: 2;
  box-shadow:
    0 80px 200px 120px rgba(0, 0, 0, 1) inset,
    0 40px 120px rgba(0, 0, 0, .6);
}

/* en móviles, no redondeamos porque ocupa toda pantalla */
@media (max-width: 640px) {

  .hero-ring,
  .hero-inner-shadow {
    border-radius: 0;
  }
}

/* ========== EXPLORA MENÚ DESKTOP ========== */

.explora-wrapper {
  position: relative;
  list-style: none;
}

/* botones */
.explora-trigger {
  background: none;
  border: 0;
  font: inherit;
  color: var(--color-text, #332b1f);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.5rem;
}

.explora-trigger:focus {
  outline: 2px solid var(--color-accent, #b9834a);
  outline-offset: 2px;
}

/* dropdown */
.explora-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  border-radius: 0.75rem;
  padding: 0.5rem 0;
  min-width: 180px;
  display: none;
  z-index: 999;
}

.explora-wrapper:hover .explora-dropdown {
  display: block;
}

.explora-dropdown li {
  list-style: none;
}

.explora-dropdown a {
  display: block;
  padding: 0.7rem 1rem;
  color: var(--color-text, #332b1f);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.3;
}

.explora-dropdown a:hover {
  background: var(--color-accent-soft, #f5efe7);
  color: var(--color-accent, #7a4c2a);
}

/* ========== EXPLORA PANEL MOBILE ========== */

.explora-panel {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.explora-panel-inner {
  position: relative;
  background: var(--color-bg-elevated, #fffefc);
  width: 85%;
  max-width: 320px;
  height: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-radius: 0 1rem 1rem 0;
  padding: 1rem 1rem 2rem;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.explora-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-text-strong, #2a2115);
  border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.07));
  padding-bottom: 0.5rem;
}

.explora-panel-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.explora-close-btn {
  background: none;
  border: 0;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text, #605344);
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.explora-close-btn:focus {
  outline: 2px solid var(--color-accent, #b9834a);
  outline-offset: 2px;
}

/* enlaces dentro del panel */
.explora-panel-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.explora-link {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-decoration: none;
  background: var(--color-card-bg, #faf8f4);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.05));
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  color: var(--color-text, #332b1f);
}

.explora-link:active,
.explora-link:focus {
  outline: 2px solid var(--color-accent, #b9834a);
  outline-offset: 2px;
}

.explora-emoji {
  font-size: 1.25rem;
  line-height: 1.25rem;
}

.explora-texts strong {
  font-size: 1rem;
  font-weight: 600;
  display: block;
  color: var(--color-text-strong, #2a2115);
}

.explora-texts small {
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--color-text-dim, #6b5b43);
}


/* fondo oscuro clicable */
.explora-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* --- estados abiertos --- */

.explora-panel.is-open {
  pointer-events: auto;
}

.explora-panel.is-open .explora-panel-inner {
  transform: translateX(0);
}

.explora-panel.is-open .explora-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ========== RESPONSIVE RULES ========== */

/* escritorio: ocultar trigger mobile y panel */
@media (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }

  .explora-panel {
    display: none !important;
  }
}

/* móvil: ocultar dropdown desktop */
@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }
}

.empresa-views {
  text-align: right;
  color: #776;
  font-size: 0.85rem;
  margin-top: 1rem;
  padding-top: .5rem;
  border-top: 1px solid #ddd;
  opacity: 0.7;
}

.listing-views {
  text-align: right;
  color: #776;
  font-size: 0.85rem;
  margin-top: 1rem;
  padding-top: .5rem;
  border-top: 1px solid #e5ddd5;
  opacity: .75;
}

/* =========================================================
   3) COMPONENTS: BREADCRUMBS & TOC
   ========================================================= */

/* Breadcrumbs */
.dl-breadcrumbs {
  padding: .75rem var(--space-4);
  background: transparent;
  font-size: .9rem;
  color: #666;
}

.dl-breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.dl-breadcrumbs li {
  display: inline-flex;
  align-items: center;
}

.dl-breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: .5rem;
  color: #ccc;
  font-size: 1.1em;
}

.dl-breadcrumbs a {
  color: var(--dl-brown-700);
  text-decoration: none;
  font-weight: 500;
}

.dl-breadcrumbs a:hover {
  text-decoration: underline;
}

.dl-breadcrumbs li.is-active {
  color: #888;
  pointer-events: none;
}

/* Table of Contents (ToC) */
#toc-container {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  max-width: 400px;
  /* Control width on desktop */
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: .75rem;
  color: var(--dl-ink);
}

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



.toc-item {
  margin-bottom: .4rem;
}

.toc-item a {
  display: block;
  color: var(--dl-ink-2);
  text-decoration: none;
  font-size: .95rem;
  line-height: 1.4;
  border-left: 2px solid transparent;
  padding-left: .75rem;
  transition: all .2s;
}

.toc-item a:hover {
  color: var(--dl-cta);
  border-left-color: var(--dl-cta);
}

.toc-h3 {
  margin-left: 1rem;
  font-size: .9rem;
}

/* Author Bio Box */
.author-bio {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--dl-cream-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.author-bio img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  padding: 4px;
}

.author-bio-text {
  font-size: .9rem;
  color: #555;
}

.author-bio-text strong {
  display: block;
  color: #111;
  margin-bottom: .2rem;
}

/* Globo flotante de Setas IA (Izquierda) */
.dl-floating-btn {
  position: fixed;
  z-index: 9997; /* Just below tour overlay/modal */
  width: 48px; height: 48px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: transform .2s var(--transition, ease), box-shadow .2s;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
}
.dl-floating-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(199, 91, 53, .25); /* Brand color shadow */
}
.dl-mushroom-btn {
  left: 16px;
  bottom: 88px; /* Aligned with tour help button height */
}
.dl-mushroom-btn img {
  width: 32px; height: 32px; object-fit: contain;
}
@media (max-width: 768px) {
  .dl-floating-btn { width: 44px; height: 44px; bottom: 80px; }
  .dl-mushroom-btn img { width: 28px; height: 28px; }
}