/* LabAncestral · hoja_de_ruta.css
   Estilos exclusivos de la página Hoja de Ruta. */

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

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

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

.hr-container--hero {
  position: relative;
  max-width: 1100px;
}

.hr-pad {
  width: 100%;
  padding-right: 44px;
  padding-left: 44px;
}

.hr-hero {
  position: relative;
  padding-top: 74px;
  padding-bottom: 64px;
  overflow: hidden;
}

.hr-hero__glow {
  position: absolute;
  top: -150px;
  right: -110px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, #f6ce7e 0%, rgba(238, 154, 28, .3) 38%, transparent 66%);
  pointer-events: none;
}

.hr-hero-h1 {
  overflow-wrap: normal;
  word-break: normal;
}

.hr-stats > div {
  flex-shrink: 0;
}

.hr-legend {
  padding-top: 64px;
  padding-bottom: 64px;
  background: #0e3d22;
  color: #eae3d2;
}

.hr-legend__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 24px;
}

.hr-matrix-section {
  padding-top: 84px;
  padding-bottom: 20px;
  background: #f6efe1;
}

.hr-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.hr-filters {
  padding: 18px 22px;
  margin: 22px 0 26px;
  background: #fff;
  border: 1px solid #e4d9c2;
  border-radius: 16px;
}

.hr-filters__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 30px;
}

.hr-filters button {
  max-width: 100%;
  white-space: normal;
}

.hr-mtx-row,
.hr-mtx-row > *,
.hr-card {
  min-width: 0;
}

.hr-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -18px rgba(14, 61, 34, .45);
}

.hr-ods-section {
  padding-top: 84px;
  padding-bottom: 84px;
  margin-top: 64px;
  background: #efe6d2;
  border-top: 1px solid #e4d9c2;
  border-bottom: 1px solid #e4d9c2;
}

.hr-ods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 16px;
}

.hr-lines-section {
  padding-top: 84px;
  padding-bottom: 84px;
  background: #f6efe1;
}

.hr-lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(255px, 100%), 1fr));
  gap: 18px;
}

.hr-contact {
  padding-top: 84px;
  padding-bottom: 84px;
  background: #0e3d22;
  color: #eae3d2;
}

.hr-contact__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.hr-contact__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hr-detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 40, 16, .46);
  backdrop-filter: blur(2px);
}

.hr-detail-panel {
  width: 100%;
  max-width: 760px;
  max-height: calc(100dvh - 24px);
  padding: 30px 32px 38px;
  overflow-y: auto;
  background: #f6efe1;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .3);
  overscroll-behavior: contain;
}

@keyframes la_rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes la_glow {
  0%, 100% { opacity: .55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

@media (max-width: 880px) {
  .hr-mtx-head {
    display: none !important;
  }

  .hr-mtx-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hr-amb-band {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 16px 18px !important;
  }

  .hr-amb-band span[data-rot] {
    writing-mode: horizontal-tb !important;
    transform: none !important;
  }

  .hr-hero-h1 {
    font-size: 42px !important;
  }

  .hr-stats {
    gap: 26px !important;
  }

  .hr-pad {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 700px) {
  .hr-hero {
    padding-top: 54px;
    padding-bottom: 50px;
  }

  .hr-hero__glow {
    right: -230px;
  }

  .hr-hero-h1 {
    max-width: 100% !important;
    font-size: clamp(36px, 11vw, 46px) !important;
    line-height: 1.08 !important;
  }

  .hr-hero p {
    font-size: 16px !important;
    margin-bottom: 38px !important;
  }

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

  .hr-stats > div {
    width: auto !important;
  }

  .hr-stats > div[style*="width:1px"] {
    display: none;
  }

  .hr-stats > div > div:first-child {
    font-size: clamp(36px, 11vw, 48px) !important;
    white-space: nowrap;
  }

  .hr-stats > div > div:last-child {
    font-size: 9px !important;
    letter-spacing: .08em !important;
    overflow-wrap: normal;
  }

  .hr-legend,
  .hr-matrix-section,
  .hr-ods-section,
  .hr-lines-section,
  .hr-contact {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .hr-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hr-section-heading > div:last-child {
    text-align: left !important;
  }

  .hr-page h2 {
    font-size: clamp(30px, 9vw, 38px) !important;
  }

  .hr-filters {
    padding: 18px;
  }

  .hr-filters__inner,
  .hr-filters__inner > div {
    align-items: flex-start !important;
    flex-direction: column;
    width: 100%;
  }

  .hr-filters__inner > div > span:last-child {
    width: 100%;
  }

  #hr-clear {
    margin-left: 0 !important;
  }

  .hr-mtx-row > div:not(.hr-amb-band) {
    padding: 10px !important;
  }

  .hr-mtx-row > div:not(.hr-amb-band) > div {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hr-ods-section {
    margin-top: 42px;
  }

  #hr-ods,
  #hr-lineas {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hr-contact__inner {
    align-items: stretch;
    flex-direction: column;
  }

  .hr-contact__actions,
  .hr-contact__actions a {
    width: 100%;
  }

  .hr-contact__actions a {
    justify-content: center;
  }

  .hr-detail-panel {
    max-height: calc(100dvh - 12px);
    padding: 24px 20px 30px;
  }

  #hr-detail-panel h3 {
    font-size: 25px !important;
  }
}

@media (max-width: 430px) {
  .hr-pad {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hr-stats {
    gap: 8px !important;
  }

  .hr-stats > div > div:first-child {
    font-size: 36px !important;
  }

  .hr-legend__grid > div {
    padding: 22px !important;
  }

  .hr-filters {
    padding: 16px 14px;
  }

  .hr-detail-panel {
    padding-right: 16px;
    padding-left: 16px;
  }
}

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