/* -------------------------------------------------------------------------
   GestFel CSS · 50-public-home.css
   Portada pública: hero, panel de impacto, estadísticas, modal CER.
   Fuentes: Playfair Display (titulares) + DM Sans (cuerpo).
   Fondo: pergamino cálido #faf8f5 en lugar de blanco puro.
   ------------------------------------------------------------------------- */

@layer public {

/* ---- Base de la página pública ---- */
.public-page {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #fff;
}

.public-page .public-nav {
  background: #fff;
  border-bottom-color: #e8eaed;
}

/* Titulares en DM Sans pesado */
.public-page h1,
.public-page h2,
.public-page h3 {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 800;
}

/* Tarjetas con borde más cálido */
.public-page .card {
  border-color: #e5dfd6;
  background: #fff;
}

/* ---- Hero ---- */
.public-hero {
  position: relative;
  overflow: hidden;
  background: #fff;
  grid-template-columns: 1.2fr 1fr;
  min-height: min(760px, calc(100dvh - 74px));
  align-content: center;
}

/* Luz ambiental teal detrás de la tarjeta */
.public-hero::before {
  content: '';
  position: absolute;
  top: -25%;
  right: -8%;
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    color-mix(in srgb, var(--teal) 10%, transparent) 0%,
    transparent 68%
  );
  pointer-events: none;
  z-index: 0;
}

.public-hero > * {
  position: relative;
  z-index: 1;
}

.public-hero h1 {
  max-width: 12ch;
  font-size: clamp(2.7rem, 5.6vw, 5.4rem);
  line-height: 1.04;
  letter-spacing: -.04em;
  margin: 0 0 1rem;
}

.public-hero > div > p {
  max-width: 58ch;
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
  line-height: 1.68;
  color: var(--muted);
}

/* CTAs del hero */
.public-hero .hero-actions {
  display: grid;
  grid-template-columns: minmax(260px, 1.18fr) minmax(220px, .82fr);
  gap: .95rem;
  max-width: 680px;
  margin: 2rem 0 1rem;
  align-items: stretch;
}

.public-hero .hero-actions .btn {
  width: 100%;
  min-height: 62px;
  border-radius: 16px;
  font-weight: 700;
  font-size: clamp(.98rem, 1.1vw, 1.1rem);
  letter-spacing: -.01em;
  padding: .9rem 1.2rem;
  box-shadow: 0 10px 24px rgba(15, 36, 55, .07);
  font-family: 'DM Sans', system-ui, sans-serif;
}

.public-hero .hero-actions .btn .app-icon,
.public-hero .mini-benefits .app-icon,
.pic-footer .app-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: transparent;
}

.public-hero .hero-actions .btn-primary {
  min-height: 68px;
  background: linear-gradient(135deg, #0b7d6d 0%, #0f9080 100%);
  border-color: transparent;
  box-shadow: 0 16px 32px rgba(11, 125, 109, .22);
}

.public-hero .hero-actions .btn-outline {
  background: #fff;
  color: var(--teal);
  border-color: rgba(11, 125, 109, .5);
}

.public-hero .hero-actions .btn-outline:hover {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 4%, #fff);
}

/* Mini beneficios */
.public-hero .mini-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 0;
}

.public-hero .mini-benefits span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--muted);
  background: #fff;
  border: 1px solid #e5dfd6;
}

.public-hero .mini-benefits span:first-child {
  border-color: color-mix(in srgb, var(--teal) 25%, #e5dfd6);
  background: color-mix(in srgb, var(--teal) 5%, #fff);
  color: var(--teal);
}

/* ---- Panel de impacto (hero derecho) ---- */
.public-impact-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(15, 36, 55, .09);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.public-impact-card:hover {
  border-color: color-mix(in srgb, var(--teal) 24%, #e8eaed);
  box-shadow: 0 28px 72px rgba(15, 36, 55, .12);
}

.pic-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #efe9e0;
}

.pic-header::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, #fff);
  flex-shrink: 0;
}

.pic-header span {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: 'DM Sans', system-ui, sans-serif;
}

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

.pic-stat {
  padding: 1rem .6rem;
  text-align: center;
  border-radius: 14px;
  background: #f7f9fb;
  border: 1px solid #e8eaed;
}

.pic-stat strong {
  display: block;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: clamp(2.1rem, 3vw, 3rem);
  font-weight: 800;
  line-height: .95;
  color: var(--dark);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.pic-stat span {
  display: block;
  margin-top: .35rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.2;
}

.pic-stat--accent {
  background: color-mix(in srgb, var(--teal) 6%, #fff);
  border-color: color-mix(in srgb, var(--teal) 18%, #efe9e0);
}

.pic-stat--accent strong {
  color: var(--teal);
}

/* Barra de esterilización */
.pic-bar-section {
  background: #faf8f5;
  border: 1px solid #efe9e0;
  border-radius: 12px;
  padding: .8rem .95rem;
}

.pic-bar-label {
  font-size: .77rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .5rem;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.pic-bar-row {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.pic-bar-track {
  flex: 1;
  height: 7px;
  background: #efe9e0;
  border-radius: 999px;
  overflow: hidden;
}

.pic-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #22b6a6);
  border-radius: 999px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.pic-bar-pct {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--teal);
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Stats secundarias */
.pic-secondary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .45rem;
}

.pic-mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .5rem .5rem .45rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #efe9e0;
  text-align: center;
  gap: .15rem;
}

.pic-mini-stat strong {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pic-mini-stat span {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.2;
}

.pic-mini-stat--warm {
  border-color: color-mix(in srgb, var(--orange) 20%, #efe9e0);
}

.pic-mini-stat--warm strong {
  color: #b45309;
}

.pic-footer {
  padding: .45rem .7rem;
  background: color-mix(in srgb, var(--teal) 5%, #fff);
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--teal) 12%, #efe9e0);
}

.pic-footer span {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* ---- Estadísticas sanitarias: números grandes, estilo editorial ---- */
#estadisticas-generales,
.public-metrics-section {
  scroll-margin-top: 88px;
}

.public-metrics-section {
  background: #f5f7f9;
}

.public-metrics-section .metric-grid {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}

.public-metrics-section h2 {
  text-align: center;
  margin-bottom: .6rem;
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
}

.public-metrics-section .section-intro {
  max-width: 860px;
  margin: 0 auto 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: clamp(.98rem, 1.2vw, 1.08rem);
  line-height: 1.6;
  text-wrap: pretty;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.public-health-metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  justify-content: center;
  gap: .75rem;
  border-top: none;
}

.public-health-metrics .metric {
  min-height: 140px;
  padding: 1.4rem 1rem 1.2rem;
  justify-items: center;
  text-align: center;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #dde1e7;
  box-shadow: 0 2px 8px rgba(15, 36, 55, .04);
}

.public-health-metrics .metric:last-child {
  border-right: 1px solid #dde1e7;
}

.public-health-metrics .metric:hover {
  background: #fff;
  transform: none;
  box-shadow: 0 4px 16px rgba(15, 36, 55, .08);
  border-color: color-mix(in srgb, var(--teal) 30%, #dde1e7);
}

.public-health-metrics .metric strong {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  font-weight: 800;
  color: var(--teal);
  line-height: .9;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.public-health-metrics .metric span {
  max-width: 14ch;
  margin: .55rem auto 0;
  text-align: center;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  text-wrap: balance;
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.3;
}

/* ---- Qué hacemos: iconos de sistema ---- */
.public-page .card-icon {
  width: 44px;
  height: 44px;
  margin: 0 0 .75rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--teal) 16%, #e5dfd6);
}

.public-page .card-icon .app-icon {
  width: 24px;
  height: 24px;
  background: transparent;
}

.public-page .card h3 {
  font-size: 1.08rem;
  line-height: 1.2;
  margin: 0 0 .5rem;
  letter-spacing: -.01em;
}

.public-page .card p {
  font-size: .93rem;
  line-height: 1.6;
  color: var(--muted);
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* ---- Ritmo visual de secciones ---- */
#que-hacemos {
  background: #f5f7f9;
}

#colabora {
  background: #f5f7f9;
}

/* Botones de colabora */
.public-page #colabora .btn-outline {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 600;
}

/* Sección h2 generales */
.public-page .section h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  letter-spacing: -.015em;
  line-height: 1.1;
}

.public-page #que-hacemos .cards.six,
.public-page #colabora .cards {
  gap: .9rem;
}

.public-page #que-hacemos .card,
.public-page #colabora .card,
.public-page #transparencia .card {
  border-color: #dde7e4;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(15, 36, 55, .06);
}

.public-page #que-hacemos .card:hover,
.public-page #colabora .card:hover,
.public-page #transparencia .card:hover {
  border-color: color-mix(in srgb, var(--teal) 26%, #dde7e4);
  transform: translateY(-2px);
}

/* ---- Modal CER ---- */
.project-info-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.project-info-modal.is-open {
  display: block;
}

body.modal-open-project {
  overflow: hidden;
}

.project-info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(5px);
}

.project-info-modal__dialog {
  position: relative;
  width: min(960px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  margin: 14px auto;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 28px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .20);
  padding: clamp(1.2rem, 2vw, 1.8rem);
}

.project-info-modal__close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #efe9e0;
  color: var(--dark);
  font-size: 1.75rem;
  cursor: pointer;
}

.project-info-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .42rem .85rem;
  border-radius: 999px;
  background: #ecfeff;
  color: var(--teal);
  font-weight: 700;
  font-size: .9rem;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.project-info-modal__header {
  text-align: center;
  margin-top: -.3rem;
}

.project-info-modal__header h2 {
  margin: .25rem 0 .55rem;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.project-info-modal__header p {
  max-width: 62ch;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.65;
  text-wrap: pretty;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.project-info-modal__infographic {
  margin-top: 1.35rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .95rem;
}

.project-step-card,
.project-care-card {
  background: #fff;
  border: 1px solid #e5dfd6;
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(15, 36, 55, .05);
}

.project-step-card {
  position: relative;
  text-align: center;
}

.project-step-card__badge {
  position: absolute;
  top: .7rem;
  right: .7rem;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fef3c7;
  color: #9a3412;
  font-weight: 900;
  font-size: .82rem;
  font-family: 'DM Sans', system-ui, sans-serif;
  display: grid;
  place-items: center;
}

.project-step-card__icon {
  font-size: 2rem;
  margin: .2rem 0 .45rem;
}

.project-step-card h3,
.project-care-card h3 {
  margin: 0 0 .45rem;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.project-step-card p,
.project-care-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
  font-size: .9rem;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.project-info-modal__care {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .95rem;
}

.project-care-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: .9rem;
  align-items: start;
  border-color: #c7f9e8;
  background: linear-gradient(160deg, #f0fdfa 0%, #fff 100%);
}

.project-care-card--soft {
  border-color: #fde68a;
  background: linear-gradient(160deg, #fff7ed 0%, #fff 100%);
}

.project-care-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 36, 55, .06);
}

/* ---- Responsive ---- */
@media (max-width: 1180px) {
  .public-hero .hero-actions {
    max-width: 100%;
  }
}

@media (max-width: 960px) {
  .project-info-modal__infographic,
  .project-info-modal__care {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .public-health-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .public-hero .hero-actions {
    grid-template-columns: 1fr;
  }

  .public-hero .hero-actions .btn {
    min-height: 56px;
  }
}

@media (max-width: 720px) {
  .public-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .public-hero h1 {
    max-width: 9.5ch;
    font-size: clamp(2.45rem, 12vw, 3.25rem);
  }

  .public-hero > div > p {
    line-height: 1.52;
  }

  .public-metrics-section .metric-grid,
  .public-health-metrics,
  .project-info-modal__infographic,
  .project-info-modal__care {
    grid-template-columns: 1fr;
  }

  .public-health-metrics .metric {
    border-right: none;
    min-height: auto;
    padding: 1rem;
  }

  .public-health-metrics .metric strong {
    font-size: clamp(2.4rem, 8vw, 3.2rem);
  }

  .public-health-metrics .metric span {
    max-width: none;
    text-wrap: pretty;
  }

  .project-info-modal__dialog {
    width: min(100vw - 16px, 960px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    border-radius: 22px;
  }

  .project-care-card {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .public-impact-card {
    padding: 1.1rem;
    gap: .75rem;
    border-radius: 20px;
  }

  .pic-stat strong {
    font-size: clamp(1.5rem, 5.5vw, 2rem);
  }

  .public-hero::before {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .public-impact-card,
  .public-page #que-hacemos .card,
  .public-page #colabora .card,
  .public-page #transparencia .card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  .public-impact-card,
  .public-page #que-hacemos .card,
  .public-page #colabora .card,
  .public-page #transparencia .card {
    transition: none;
  }

  .public-page #que-hacemos .card:hover,
  .public-page #colabora .card:hover,
  .public-page #transparencia .card:hover {
    transform: none;
  }
}
} /* end @layer public */
