/* ==========================================================================
   Maqueta · Ilustre Municipalidad de Pica
   health.css — Servicios Traspasados · Salud: portada con fotografía, tarjetas de
   contacto flotantes, misión y visión, establecimientos y funciones.
   Usa el verde turquesa de la paleta como color de salud.
   Ruta de navegación y títulos: commune.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Portada con fotografía
   -------------------------------------------------------------------------- */
.health-hero {
  position: relative;
  overflow: hidden;
  padding: 2rem 0 7rem;
  background:
    radial-gradient(circle at 88% 25%, rgba(93, 204, 163, .28), transparent 42%),
    radial-gradient(circle at 70% 90%, rgba(41, 191, 203, .22), transparent 45%),
    linear-gradient(120deg, var(--pm-navy-900), var(--pm-navy-800));
}

.health-hero__inner {
  position: relative;
}

/* Con foto: texto a la izquierda y la fachada del CESFAM enmarcada a la derecha */
.health-hero__layout {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.health-hero--photo .health-hero__layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

.health-hero__figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 3px solid var(--pm-teal-500);
  border-radius: 20px;
  box-shadow: 0 22px 48px rgba(3, 12, 28, .5);
  transform: rotate(1.2deg);
}

.health-hero__figure img {
  display: block;
  width: 100%;
  height: auto;
}

.health-hero__figure figcaption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  padding: 2rem 1.1rem .8rem;
  background: linear-gradient(180deg, rgba(8, 33, 66, 0), rgba(8, 33, 66, .92));
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
}

.health-hero__figure figcaption .bi {
  color: var(--pm-teal-500);
}

.health-hero__figure figcaption a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.health-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
  padding: .3rem .9rem;
  border: 1px solid rgba(93, 204, 163, .6);
  border-radius: 999px;
  background: rgba(93, 204, 163, .14);
  color: var(--pm-teal-500);
  font-family: var(--pm-font-condensed);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.health-hero__title {
  margin-bottom: .6rem;
  color: #fff;
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}

.health-hero__lead {
  max-width: 48ch;
  margin-bottom: 1.75rem;
  color: var(--pm-text);
  font-size: 1.1rem;
  line-height: 1.6;
}

.health-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}

.health-hero__link {
  color: var(--pm-gold-300);
  font-weight: 600;
}

.health-hero__link:hover {
  color: var(--pm-gold-400);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* --------------------------------------------------------------------------
   Contacto rápido (cruza el borde de la portada)
   -------------------------------------------------------------------------- */
.health-contact {
  position: relative;
  z-index: 1;
  margin-top: -3.5rem;
}

.health-contact__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.health-contact__card {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(3, 12, 28, .38);
  color: var(--pm-navy-900);
}

.health-contact__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pm-teal-500), var(--pm-blue-400));
  color: var(--pm-navy-900);
  font-size: 1.25rem;
}

.health-contact__label {
  display: block;
  color: #4a5b70;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.health-contact__card strong,
.health-contact__card a {
  color: var(--pm-navy-900);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.health-contact__card a:hover {
  color: var(--pm-blue-500);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Misión y visión
   -------------------------------------------------------------------------- */
.health-purpose {
  padding: 3.5rem 0 1rem;
  background: var(--pm-navy-900);
}

.health-purpose__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.health-purpose__card {
  position: relative;
  overflow: hidden;
  padding: 2rem 2rem 2.2rem;
  border-radius: 22px;
  color: #fff;
}

.health-purpose__card--mission {
  background: linear-gradient(140deg, var(--pm-blue-500) 0%, var(--pm-navy-800) 100%);
}

.health-purpose__card--vision {
  background: linear-gradient(140deg, var(--pm-teal-500) -30%, var(--pm-blue-500) 40%, var(--pm-navy-800) 100%);
}

.health-purpose__card::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.health-purpose__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 1rem;
  border-radius: 16px;
  background: var(--pm-gold-500);
  color: var(--pm-navy-900);
  font-size: 1.5rem;
}

.health-purpose__title {
  margin-bottom: .6rem;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
}

.health-purpose__card p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   Establecimientos
   -------------------------------------------------------------------------- */
.health-head {
  max-width: 62ch;
  margin-bottom: 2rem;
}

.health-places {
  padding: 3.5rem 0 3rem;
  background: var(--pm-navy-900);
}

.health-places__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.health-place {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
  padding: 1.8rem;
  border: 2px solid rgba(41, 191, 203, .35);
  border-left: 8px solid var(--pm-blue-400);
  border-radius: 18px;
  background: var(--pm-navy-850);
}

.health-place--cesfam {
  border-left-color: var(--pm-teal-500);
}

.health-place__badge {
  padding: .25rem .8rem;
  border-radius: 999px;
  background: var(--pm-gold-500);
  color: var(--pm-navy-900);
  font-family: var(--pm-font-condensed);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
}

.health-place__title {
  margin: 0;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.health-place p {
  margin: 0;
  color: var(--pm-text);
  line-height: 1.7;
}

.health-place__address {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  color: var(--pm-text-soft);
  font-size: .9rem;
}

.health-place__address .bi {
  margin-top: .15rem;
  color: var(--pm-teal-500);
}

.health-place__call {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1.1rem;
  border: 2px solid var(--pm-gold-500);
  border-radius: 999px;
  color: var(--pm-gold-400);
  font-weight: 700;
  transition: background-color .2s ease, color .2s ease;
}

.health-place__call:hover {
  background: var(--pm-gold-500);
  color: var(--pm-navy-900);
}

/* --------------------------------------------------------------------------
   Funciones del DESAM
   -------------------------------------------------------------------------- */
.health-functions {
  padding: 3.5rem 0 4.5rem;
  background: linear-gradient(180deg, var(--pm-navy-900) 0%, var(--pm-navy-950) 100%);
}

.health-functions__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.health-function {
  display: grid;
  align-content: start;
  gap: .8rem;
  padding: 1.3rem 1.3rem 1.4rem;
  border-radius: 16px;
  background: rgba(41, 191, 203, .07);
  border: 1px solid rgba(41, 191, 203, .22);
  transition: background-color .25s ease, border-color .25s ease, translate .25s ease;
}

.health-function:hover {
  border-color: var(--pm-teal-500);
  background: rgba(93, 204, 163, .1);
  translate: 0 -4px;
}

.health-function__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--pm-teal-500);
  color: var(--pm-navy-900);
  font-size: 1.25rem;
}

.health-function p {
  margin: 0;
  color: var(--pm-text);
  font-size: .92rem;
  line-height: 1.65;
}

@media (max-width: 1199.98px) {
  .health-contact__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-functions__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .health-hero {
    padding-bottom: 6rem;
  }

  .health-purpose__grid,
  .health-places__grid {
    grid-template-columns: 1fr;
  }

  .health-hero--photo .health-hero__layout {
    grid-template-columns: 1fr;
  }

  .health-hero__figure {
    transform: none;
  }
}

@media (max-width: 575.98px) {
  .health-contact__grid,
  .health-functions__grid {
    grid-template-columns: 1fr;
  }

  .health-purpose__card {
    padding: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .health-function {
    transition: none;
  }

  .health-function:hover {
    translate: none;
  }
}
