/* ==========================================================================
   Agenda Cultural — hoja de estilos
   Diseño mobile-first: los estilos base son para celular y los @media
   (min-width) agregan ajustes para tablet (768px), escritorio (1024px) y
   pantallas grandes (1280px).
   Identidad: "malbec" (bordó) + dorado sobre papel cálido, títulos con serif.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables
   -------------------------------------------------------------------------- */
:root {
  --primary: #6b1d3f;
  --primary-dark: #521430;
  --primary-soft: rgba(107, 29, 63, 0.09);
  --accent: #1f9d55; /* verde: éxito / WhatsApp */
  --accent-dark: #16803f;
  --gold: #d4952b;
  --gold-soft: rgba(212, 149, 43, 0.16);
  --bg-color: #faf6f0;
  --surface: #ffffff;
  --surface-alt: #f3ece2;
  --text-main: #241b1f;
  --text-muted: #6b5f64;
  --border-color: #e8dfd5;
  --danger: #c62f3b;
  --warning: #d4952b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(36, 27, 31, 0.06), 0 4px 14px rgba(36, 27, 31, 0.06);
  --shadow-lg: 0 14px 34px rgba(36, 27, 31, 0.16);
  --transition: all 0.2s ease;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:
    "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

/* "clip" evita el scroll horizontal SIN crear un contenedor de scroll; con
   "hidden" en html y body la cabecera sticky deja de quedarse arriba. */
body {
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(107, 29, 63, 0.35);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1rem;
}

/* --------------------------------------------------------------------------
   3. Botones, insignias
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(107, 29, 63, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-dark);
}

.btn-outline {
  background-color: var(--surface);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(0.92);
}

.btn-whatsapp {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(31, 157, 85, 0.25);
}

.btn-whatsapp:hover {
  background-color: var(--accent-dark);
}

.btn-instagram {
  background: #c13584;
  color: #fff;
}

.btn-instagram:hover {
  background: #a02a6c;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
}

.badge-pending {
  background: rgba(212, 149, 43, 0.16);
  color: #9a6512;
}

.badge-approved {
  background: rgba(31, 157, 85, 0.13);
  color: var(--accent-dark);
}

.badge-rejected {
  background: rgba(198, 47, 59, 0.12);
  color: var(--danger);
}

.link-btn {
  background: none;
  border: none;
  padding: 0.4rem 0;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   4. Cabecera y navegación
   -------------------------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 240, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  gap: 0.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
}

.logo i {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--text-main);
  font-size: 1.15rem;
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--primary-soft);
}

/* Menú: oculto en celular, se despliega debajo de la cabecera */
.nav-links {
  display: none;
}

.nav-links.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem 0.9rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  z-index: 20;
}

.nav-links a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text-main);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

@media (min-width: 768px) {
  .navbar {
    padding: 0.7rem 1.5rem;
  }

  .nav-toggle {
    display: none;
  }

  .nav-links,
  .nav-links.is-open {
    display: flex;
    flex-direction: row;
    position: static;
    gap: 0.25rem;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
  }

  .nav-links a {
    min-height: 40px;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.92rem;
    color: var(--text-muted);
  }
}

/* --------------------------------------------------------------------------
   5. Portada (index)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 2.25rem 1.1rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  border-radius: 22px;
  background:
    radial-gradient(
      110% 90% at 0% 0%,
      rgba(212, 149, 43, 0.24),
      transparent 55%
    ),
    radial-gradient(
      100% 90% at 100% 100%,
      rgba(107, 29, 63, 0.16),
      transparent 55%
    ),
    var(--surface);
}

.hero h1 {
  font-size: clamp(1.8rem, 7vw, 3.1rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.hero p {
  max-width: 620px;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.whatsapp-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 780px;
  margin: 0 auto;
}

.whatsapp-links .btn-whatsapp {
  width: 100%;
  padding: 0.85rem 1rem;
}

.whatsapp-links .wa-titulo {
  font-size: 0.98rem;
  font-weight: 700;
}

.btn-whatsapp i {
  font-size: 1.25rem;
}

.btn-whatsapp[aria-disabled="true"] {
  pointer-events: none;
}

@media (min-width: 768px) {
  .hero {
    padding: 3.75rem 2.5rem;
  }

  .whatsapp-links {
    flex-direction: row;
  }

  .whatsapp-links .btn-whatsapp {
    flex: 1 1 0;
  }
}

/* Selector de zona (portada) */
.locations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.location-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.location-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--surface-alt);
}

.location-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
}

.location-card h3 {
  margin-bottom: 0.4rem;
  font-size: 1.4rem;
}

.location-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .locations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .locations-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (hover: hover) {
  .location-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
  }
}

/* --------------------------------------------------------------------------
   6. Encabezado de página
   -------------------------------------------------------------------------- */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

.page-title h1,
.page-title h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.55rem, 5.5vw, 2.4rem);
  font-weight: 700;
  color: var(--primary-dark);
}

.page-title p {
  max-width: 640px;
  font-size: 0.98rem;
  color: var(--text-muted);
}

.page-header > .btn {
  width: 100%;
}

@media (min-width: 768px) {
  .page-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
  }

  .page-header > .btn {
    flex-shrink: 0;
    width: auto;
  }
}

/* --------------------------------------------------------------------------
   7. Filtros por fecha
   -------------------------------------------------------------------------- */
.filtros {
  margin: 0 -1rem 1.25rem;
  padding: 0 1rem;
  scroll-margin-top: 80px;
}

.filtros-lista {
  display: flex;
  gap: 0.5rem;
  padding: 0.2rem 0 0.6rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filtros-lista::-webkit-scrollbar {
  display: none;
}

.filtro-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.filtro-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filtro-chip.activo {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chip-count {
  min-width: 1.5rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.chip-count:empty {
  display: none;
}

.filtro-chip.activo .chip-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

@media (min-width: 768px) {
  .filtros {
    margin: 0 0 1.5rem;
    padding: 0;
  }

  .filtros-lista {
    flex-wrap: wrap;
    overflow: visible;
  }
}

/* --------------------------------------------------------------------------
   8. Listado y tarjetas de eventos
   -------------------------------------------------------------------------- */
.events-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.no-events {
  grid-column: 1 / -1;
  padding: 2.5rem 1.25rem;
  text-align: center;
  background: var(--surface);
  border: 1.5px dashed var(--border-color);
  border-radius: 20px;
  color: var(--text-muted);
}

.no-events h3 {
  margin-bottom: 0.4rem;
  font-size: 1.25rem;
  color: var(--text-main);
}

.event-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  scroll-margin-top: 90px;
}

.event-card.featured {
  border-color: var(--gold);
  box-shadow:
    0 0 0 2px var(--gold-soft),
    var(--shadow);
}

.event-card.evento-compartido {
  box-shadow:
    0 0 0 4px rgba(107, 29, 63, 0.4),
    var(--shadow-lg);
}

.event-img {
  display: block;
  width: 100%;
  height: auto; /* el atributo height del <img> no debe estirar la tarjeta */
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--surface-alt);
}

.featured-badge {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--gold);
  color: #2b1d05;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.event-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem 1.1rem 1.2rem;
}

.event-date-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.event-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.event-desc {
  font-size: 0.94rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.event-desc.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-more {
  align-self: flex-start;
  margin-top: -0.25rem;
  padding: 0.3rem 0;
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.2rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.9rem;
}

.event-details > div {
  position: relative;
  padding-left: 1.75rem;
  overflow-wrap: anywhere;
}

.event-details > div > i {
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 1.2rem;
  text-align: center;
  color: var(--primary);
}

.event-details strong {
  font-weight: 600;
  color: var(--text-muted);
}

.event-details a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.event-details > .event-precio {
  padding: 0.5rem 0.75rem 0.5rem 2.3rem;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  font-weight: 700;
}

.event-details > .event-precio > i {
  left: 0.75rem;
  top: 0.78em;
}

.event-details > .event-precio strong {
  color: var(--text-main);
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.9rem;
}

.event-actions .btn {
  flex: 1 1 140px;
}

.share-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.share-opcion {
  flex: 1 1 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.share-opcion:hover {
  border-color: var(--primary);
  color: var(--primary);
}

@media (min-width: 640px) {
  .events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .events-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (hover: hover) {
  .event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
  }
}

/* --------------------------------------------------------------------------
   9. Paginación
   -------------------------------------------------------------------------- */
.paginacion-wrap {
  margin-top: 1.75rem;
}

.paginacion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.pag-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.7rem;
  border: 1.5px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.pag-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pag-btn.actual {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  cursor: default;
}

.pag-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pag-info {
  padding: 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pag-puntos {
  padding: 0 0.1rem;
  color: var(--text-muted);
}

/* Celular: "Página X de Y". Desde 520px: números. */
.pag-num,
.pag-puntos {
  display: none;
}

@media (min-width: 520px) {
  .pag-num,
  .pag-puntos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .pag-info {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   10. Bloque SEO
   -------------------------------------------------------------------------- */
.seo-keywords-section {
  margin: 2.5rem 0 1.5rem;
  padding: 1.5rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.seo-container {
  width: 100%;
  margin: 0 auto;
}

.seo-title {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.seo-title i {
  flex-shrink: 0;
  margin-top: 0.25rem;
  font-size: 1.05rem;
  color: var(--primary);
}

.seo-text {
  margin-bottom: 1rem;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.seo-text:last-child {
  margin-bottom: 0;
}

.seo-text strong {
  font-weight: 600;
  color: var(--text-main);
}

.seo-badges-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.seo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-color);
  font-size: 0.82rem;
  font-weight: 500;
}

.seo-badge i {
  font-size: 0.78rem;
  color: var(--primary);
}

@media (min-width: 768px) {
  .seo-keywords-section {
    margin-top: 3.5rem;
    padding: 2.25rem 2rem;
  }

  .seo-title {
    font-size: 1.5rem;
  }

  .seo-text {
    font-size: 0.97rem;
  }
}

@media (min-width: 1024px) {
  .seo-container {
    max-width: 960px;
  }
}

/* --------------------------------------------------------------------------
   11. Pie de página
   -------------------------------------------------------------------------- */
footer {
  margin-top: 3rem;
  padding: 2rem 1rem;
  background: #241b1f;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   12. Modal (en celular se abre desde abajo; en tablet/PC, centrado)
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(36, 27, 31, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 100%;
  max-width: 680px;
  max-height: 94vh;
  max-height: 94dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(28px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.modal-body {
  padding: 1.1rem;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 1.5rem;
  }

  .modal-container {
    max-height: 90vh;
    border-radius: 24px;
  }

  .modal-header {
    padding: 1.1rem 1.5rem;
  }

  .modal-body {
    padding: 1.5rem;
  }
}

/* Planes de publicación */
.planes-header {
  margin-bottom: 1.1rem;
}

.planes-titulo {
  margin-bottom: 0.35rem;
  font-size: 1.3rem;
}

.planes-subtitulo {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.planes-lista {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.15rem;
  background: var(--surface);
  border: 1.5px solid var(--border-color);
  border-radius: 18px;
}

.plan-card.pago {
  border-color: var(--gold);
  background: linear-gradient(
    180deg,
    rgba(212, 149, 43, 0.1),
    var(--surface) 55%
  );
}

.plan-titulo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.plan-precio {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
}

.plan-subtitulo {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.plan-beneficios {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.plan-beneficios li {
  position: relative;
  padding-left: 1.5rem;
  overflow-wrap: anywhere;
}

.plan-beneficios li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
  color: var(--accent);
}

.plan-requisito {
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-plan {
  width: 100%;
  min-height: 48px;
  margin-top: auto;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-plan.gratuito {
  background: var(--surface);
  color: var(--primary);
}

.btn-plan.pago {
  background: var(--primary);
  color: #fff;
}

.btn-plan.whatsapp {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-plan:hover:not(:disabled) {
  filter: brightness(0.94);
}

.btn-plan:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (min-width: 640px) {
  .planes-lista {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plan-aviso {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius);
  background: var(--primary-soft);
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   13. Formularios
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label,
.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.95rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem; /* 16px: evita el zoom automático en iPhone */
  transition: var(--transition);
}

.form-control::placeholder {
  color: #a39a9e;
}

.form-control:hover {
  border-color: #d5c8ba;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

textarea.form-control {
  min-height: 116px;
  resize: vertical;
}

select.form-control {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b5f64' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  -webkit-appearance: none;
  appearance: none;
}

input[type="file"].form-control {
  padding: 0.55rem 0.7rem;
  font-size: 0.92rem;
}

input[type="file"].form-control::file-selector-button {
  margin-right: 0.8rem;
  padding: 0.5rem 0.95rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 1rem;
}

@media (min-width: 520px) {
  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plan-hint {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.plan-hint.error {
  color: var(--danger);
  font-weight: 600;
}

.desc-counter {
  display: block;
  height: 1rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  text-align: right;
  color: var(--text-muted);
}

.desc-counter.warn {
  color: var(--warning);
}

.desc-counter.danger {
  color: var(--danger);
  font-weight: 700;
}

.form-error {
  margin: 0.9rem 0 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(198, 47, 59, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(198, 47, 59, 0.08);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--danger);
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--surface-alt);
  font-size: 0.9rem;
}

.captcha-box input[type="checkbox"] {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
}

/* Precio: opciones visibles */
.opciones-precio {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.form-group .opcion-precio {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.opcion-precio input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.opcion-precio span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.5rem 0.6rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  transition: var(--transition);
}

.opcion-precio:hover span {
  border-color: var(--primary);
}

.opcion-precio input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 14px rgba(107, 29, 63, 0.22);
}

.opcion-precio input:focus-visible + span {
  outline: 3px solid rgba(107, 29, 63, 0.35);
  outline-offset: 2px;
}

@media (min-width: 520px) {
  .opciones-precio {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.input-prefix {
  display: flex;
  align-items: stretch;
}

.input-prefix > span {
  display: flex;
  align-items: center;
  padding: 0 0.95rem;
  border: 1.5px solid var(--border-color);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface-alt);
  font-weight: 800;
  color: var(--text-muted);
}

.input-prefix > .form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* "¿Cómo consigue la gente su entrada?" */
.entradas-box {
  margin: 1.4rem 0 1.25rem;
  padding: 1.1rem 1rem 0.4rem;
  border: 1.5px solid #ecd9b6;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9ed, var(--surface) 70%);
}

.entradas-head {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.entradas-icono {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--gold-soft);
  color: var(--primary);
  font-size: 1.05rem;
}

.entradas-head h4 {
  margin-bottom: 0.3rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.25;
}

.entradas-aviso {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.entradas-aviso strong {
  color: var(--text-main);
}

.entradas-box .form-group label i {
  width: 1.1rem;
  margin-right: 0.2rem;
  text-align: center;
  color: var(--primary);
}

.tag-reco,
.tag-opc {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.tag-reco {
  background: rgba(31, 157, 85, 0.14);
  color: var(--accent-dark);
}

.tag-opc {
  background: var(--surface-alt);
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .entradas-box {
    padding: 1.35rem 1.35rem 0.5rem;
  }
}

/* Imagen: vista previa y encuadre */
.img-preview-box {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-color);
}

.img-preview {
  flex-shrink: 0;
  width: 112px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.img-preview-side {
  flex: 1;
  min-width: 0;
}

.img-modo {
  display: grid;
  gap: 0.5rem;
}

.form-group .img-modo-op {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 46px;
  margin: 0;
  padding: 0.55rem 0.8rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: var(--transition);
}

.form-group .img-modo-op:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.img-modo-op input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

@media (max-width: 400px) {
  .img-preview-box {
    flex-direction: column;
  }
}

@media (min-width: 640px) {
  .img-preview {
    width: 150px;
  }
}

/* Corrección para input[type="date"] en iOS / Safari móvil */
input[type="date"].form-control {
  /* Evita que Safari fuerce la altura mínima fija de forma rara */
  min-height: 48px;
  height: auto;
  line-height: normal;

  /* Permite que el texto interno o placeholder ocupe todo el espacio */
  display: flex;
  align-items: center;
  -webkit-appearance: none;
  appearance: none;
}

/* Forzar que las partes internas del datepicker en iOS/WebKit sean visibles */
input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.2em;
}

/* Opcional: asegurarte de que el texto del valor o placeholder sea del color correcto */
input[type="date"]:invalid {
  color: #a39a9e; /* Mismo color que el placeholder */
}

/* --------------------------------------------------------------------------
   14. Panel de administración
   -------------------------------------------------------------------------- */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.admin-item-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  min-width: 0;
}

/* Imagen completa (contain) y se abre en grande al tocarla */
.admin-item-img-link {
  display: block;
  flex-shrink: 0;
  align-self: center;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.admin-item-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-item-datos {
  flex: 1;
  min-width: 0;
}

.admin-item-datos p {
  overflow-wrap: anywhere;
}

.admin-desc {
  margin: 0.45rem 0;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-color);
  font-size: 0.88rem;
  color: var(--text-main);
  white-space: pre-line;
}

.admin-datos-extra {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.admin-datos-extra a {
  color: var(--primary);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.admin-actions .btn {
  flex: 1 1 150px;
}

.tabs-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  scrollbar-width: none;
}

.tabs-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .tabs-bar {
    flex-wrap: wrap;
    overflow: visible;
  }
}

/* Edición de evento */
.edit-imagen-actual {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 0.6rem;
}

.edit-imagen-actual img {
  width: 110px;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.edit-acciones {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.edit-acciones .btn {
  width: 100%;
}

@media (min-width: 560px) {
  .edit-acciones {
    flex-direction: row;
    justify-content: flex-end;
  }

  .edit-acciones .btn {
    width: auto;
  }
}

@media (min-width: 768px) {
  .admin-item-info {
    flex-direction: row;
    align-items: flex-start;
  }

  .admin-item-img-link {
    align-self: flex-start;
    width: 200px;
  }
}

@media (min-width: 900px) {
  .admin-item {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .admin-item > .admin-actions {
    flex-direction: column;
    align-items: stretch;
    width: 180px;
    flex-shrink: 0;
  }

  .admin-item > .admin-actions .btn {
    flex: 0 0 auto;
  }
}

/* --------------------------------------------------------------------------
   15. Accesibilidad: menos movimiento
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Evento abierto desde un enlace compartido que no está en el listado */
.evento-extra {
  margin-bottom: 1.5rem;
}

.aviso-compartido {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid #ecd9b6;
  border-radius: var(--radius);
  background: #fff9ed;
  font-size: 0.92rem;
  font-weight: 600;
}

.aviso-compartido i {
  margin-top: 0.2rem;
  color: var(--primary);
}

.evento-extra-grid:empty {
  display: none;
}

@media (min-width: 640px) {
  .evento-extra-grid {
    grid-template-columns: minmax(0, 420px);
  }
}

/* --------------------------------------------------------------------------
   Contador de la comunidad (portada) y su módulo en el admin
   -------------------------------------------------------------------------- */
.hero-comunidad {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.4rem;
}

.comunidad-badge {
  --guinda: #4a1525;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 100%;
  padding: 0.65rem 1.15rem;
  border: 1.5px solid rgba(74, 21, 37, 0.2);
  border-radius: 28px;
  background: #fff6e5;
  box-shadow: 0 4px 14px rgba(74, 21, 37, 0.08);
  color: var(--guinda);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
}

.comunidad-numero {
  font-size: 1.08em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Punto verde "en vivo" */
.live-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  animation: live-pulse 1.8s ease-out infinite;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) {
  .comunidad-badge {
    padding: 0.7rem 1.4rem;
    font-size: 1rem;
  }
}

/* Admin: módulo del contador */
.admin-comunidad-titulo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.admin-comunidad-titulo i {
  color: var(--primary);
}

.admin-comunidad-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-comunidad-form .form-group {
  margin-bottom: 0;
}

@media (min-width: 640px) {
  .admin-comunidad-form {
    flex-direction: row;
    align-items: flex-end;
  }

  .admin-comunidad-form .form-control {
    width: 220px;
  }
}

/* --------------------------------------------------------------------------
   Carga diferida: lo que está fuera de pantalla no se renderiza hasta que se
   acerca (content-visibility). contain-intrinsic-size reserva su alto para
   que el scroll no salte.
   -------------------------------------------------------------------------- */
.seo-keywords-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 560px;
}

footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}
