/* LabAncestral · actividades.css
   Estilos exclusivos de la página Actividades. */

.ac-page {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  background: #F6EFE1;
  color: #152514;
  font-family: 'IBM Plex Sans', sans-serif;
}

.ac-page *,
.ac-page *::before,
.ac-page *::after {
  min-width: 0;
}

.ac-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

/* Hero */
.ac-hero {
  position: relative;
  width: 100%;
  padding: 70px 44px 58px;
  overflow: hidden;
}

.ac-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  align-items: end;
  gap: 48px;
}

.ac-title {
  max-width: 100%;
  margin: 0 0 22px;
  color: #152514;
  font-family: 'Spectral', serif;
  font-size: 56px;
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -.02em;
}

.ac-summary {
  min-width: 0;
}

/* Mapa */
.ac-map-section {
  width: 100%;
  padding: 48px 44px 10px;
  background: #F6EFE1;
}

.ac-map-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 22px;
}

.ac-map-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 34px;
}

.ac-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

#mapFilters {
  min-width: 0;
}

#mapFilters > button {
  max-width: 100%;
}

.map-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  align-items: stretch;
  gap: 24px;
}

.ac-page .map-canvas,
.ac-page .map-panel {
  min-width: 0;
}

.ac-page .la-scroll::-webkit-scrollbar {
  width: 8px;
}

.ac-page .la-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: #d8c9a8;
}

.ac-page .ac-row:hover {
  border-left-color: #EE9A1C !important;
  background: #f7efde;
}

.ac-page .map-dot {
  transition: transform .15s ease, box-shadow .15s ease;
}

.ac-page .map-dot:hover {
  transform: scale(1.08);
}

.ac-page .map-marker-label {
  font-family: 'Spectral', serif;
  white-space: nowrap;
  overflow-wrap: normal;
  text-shadow:
    0 1px 3px rgba(246, 239, 225, .95),
    0 0 3px rgba(246, 239, 225, .95);
}

.ac-page .leaflet-container {
  background: #e9e0cb;
  font-family: 'IBM Plex Sans', sans-serif;
}

/* Detalle desplegable */
.ac-detail {
  display: none;
  width: 100%;
  padding: 54px 44px 70px;
  background: #0E3D22;
}

.ac-detail__container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.ac-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  align-items: start;
  gap: 40px;
}

#adVideo iframe,
#adVideo video {
  max-width: 100%;
}

#adGallery {
  width: 100%;
}

#adGallery > div {
  min-width: 0;
}

/* Agenda */
.ac-agenda {
  width: 100%;
  padding: 64px 44px 74px;
  background: #F6EFE1;
}

.ac-agenda__container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.ac-agenda__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 30px;
}

.ac-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.ac-item {
  min-width: 0;
  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
}

.ac-item:hover {
  border-color: #EE9A1C !important;
  box-shadow: 0 12px 30px rgba(14, 61, 34, .12);
  transform: translateY(-4px);
}

/* CTA */
.ac-cta {
  padding: 64px 44px;
  background: #0E3D22;
  color: #eae3d2;
  text-align: center;
}

.ac-cta__inner {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.ac-cta__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* Tablet */
@media (max-width: 920px) {
  .ac-hero-grid,
  .map-grid,
  .ac-detail-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ac-summary {
    max-width: 660px;
  }

  .ac-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .ac-page .map-canvas,
  .ac-page .map-panel {
    height: 480px !important;
  }

  .ac-detail-grid {
    gap: 32px;
  }

  #adGallery > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Móvil */
@media (max-width: 700px) {
  .ac-hero {
    padding: 54px 20px 46px;
    background-position: 60% center !important;
  }

  .ac-hero-grid {
    gap: 34px;
  }

  .ac-title {
    font-size: clamp(38px, 11vw, 48px);
  }

  .ac-hero p {
    font-size: 16px !important;
  }

  .ac-summary {
    padding: 20px !important;
  }

  .ac-map-section {
    padding: 42px 20px 10px;
  }

  .ac-map-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
  }

  .ac-map-heading h2 {
    max-width: 100% !important;
    font-size: clamp(31px, 9vw, 40px) !important;
  }

  .ac-map-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 12px;
  }

  .ac-map-stats > div > div:first-child {
    font-size: 30px !important;
  }

  .ac-map-stats > div > div:last-child {
    font-size: 9px !important;
    letter-spacing: .06em !important;
  }

  .ac-filters {
    align-items: flex-start;
    flex-direction: column;
  }

  #mapFilters {
    display: flex !important;
    width: 100%;
    flex-wrap: wrap !important;
  }

  #mapFilters > button {
    white-space: normal;
    overflow-wrap: normal;
  }

  .map-grid {
    gap: 18px;
  }

  .ac-page .map-canvas {
    height: 400px !important;
  }

  .ac-page .map-panel {
    height: 500px !important;
  }

  .ac-page .ac-row {
    align-items: flex-start !important;
    padding: 13px 16px !important;
  }

  .ac-detail {
    padding: 46px 20px 58px;
    scroll-margin-top: 70px;
  }

  .ac-detail-grid {
    gap: 30px;
  }

  #adTitle {
    font-size: clamp(30px, 9vw, 40px) !important;
  }

  #adMeta {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px !important;
  }

  #adVideo iframe,
  #adVideo video {
    height: auto !important;
    aspect-ratio: 16 / 9;
  }

  #adVideo > div {
    height: auto !important;
    aspect-ratio: 16 / 9;
  }

  #adGallery > div[style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ac-agenda {
    padding: 54px 20px 64px;
  }

  .ac-agenda__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .ac-agenda__heading h2 {
    font-size: clamp(29px, 8vw, 36px) !important;
  }

  .ac-cards {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ac-cta {
    padding: 52px 20px;
  }

  .ac-cta__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ac-cta__actions a {
    width: 100%;
  }
}

/* Teléfonos estrechos */
@media (max-width: 430px) {
  .ac-hero,
  .ac-map-section,
  .ac-detail,
  .ac-agenda,
  .ac-cta {
    padding-right: 16px;
    padding-left: 16px;
  }

  .ac-map-stats {
    gap: 8px;
  }

  .ac-page .map-canvas {
    height: 340px !important;
  }

  .ac-page .map-panel {
    height: 460px !important;
  }

  .ac-page .ac-row {
    flex-wrap: wrap;
  }

  .ac-page .ac-row > div:last-child {
    width: 100%;
    padding-left: 76px;
    text-align: left !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ac-page *,
  .ac-page *::before,
  .ac-page *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}