/*
 * emapaac-aguapotable.css
 * Rediseño visual de emapaac-aguapotable.php (portada + tarjetas + banda de composición).
 * Fecha: 2026-09-11
 * Sistema visual compartido con laboratorio.css y emapaac-denuncias.css (valores copiados, archivo independiente).
 */

/* ===== TOKENS ===== */
.ap-page {
  --ap-primary: #1e3a8a;
  --ap-primary-2: #1d4ed8;
  --ap-accent: #06b6d4;          /* solo bordes, fondos y decoración */
  --ap-accent-hover: #0891b2;
  --ap-accent-text: #0e7490;     /* texto e íconos cian sobre claro (5.4:1) */
  --ap-bg: #f8fafc;
  --ap-band: #f0f4f8;
  --ap-text: #334155;
  --ap-muted: #4b5563;
  --ap-border: #f3f4f6;
  --ap-shadow: 0 10px 15px -3px rgba(0,0,0,.05);
  --ap-shadow-hover: 0 20px 40px rgba(0,0,0,.08);
  display: block;
  font-family: "Poppins", sans-serif;
  color: var(--ap-text);
  background: var(--ap-bg);
}

/* ===== PORTADA ===== */
.ap-page section#page-title.ap-hero {
  position: relative;
  padding: 64px 0;
  background: linear-gradient(135deg, #ffffff 0%, var(--ap-band) 100%);
  border-bottom: 1px solid #e5e7eb;
  overflow: hidden; /* permitido: la portada no es ancestro de la columna lateral */
  min-height: 440px;
  display: flex;
  align-items: center;
}
@media (max-width: 991px) {
  .ap-page section#page-title.ap-hero {
    min-height: 320px;
  }
}
@media (max-width: 768px) {
  .ap-page section#page-title.ap-hero {
    padding: 48px 0;
  }
}

.ap-page .ap-hero .container {
  position: relative;
  z-index: 2;
}

.ap-page .ap-hero__media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: 74%;
  height: 100%;
  max-width: 1100px; /* no amplía la imagen (1536px reales) más allá de este ancho en pantallas muy anchas */
  z-index: 1;
  pointer-events: none;
}
@media (max-width: 991px) {
  .ap-page .ap-hero__media {
    position: static;
    width: auto;
    height: 220px;
    margin-top: 24px;
  }
}

.ap-page .ap-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  display: block;
}

.ap-page .ap-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255,255,255,.95) 16%, rgba(255,255,255,0) 52%);
}
@media (max-width: 991px) {
  .ap-page .ap-hero__media::after {
    background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(255,255,255,0) 45%);
  }
}

@supports (mask-image: linear-gradient(#000,#000)) or (-webkit-mask-image: linear-gradient(#000,#000)) {
  .ap-page .ap-hero__media {
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 36%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 36%);
  }
  @media (max-width: 991px) {
    .ap-page .ap-hero__media {
      -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 35%);
      mask-image: linear-gradient(180deg, transparent 0%, #000 35%);
    }
  }
}

.ap-page .ap-hero__copy {
  position: relative;
  z-index: 2; /* el texto siempre por encima de la imagen */
  padding: 0;
  max-width: 480px;
}
.ap-page #page-title .ap-hero__copy {
  text-align: left; /* vence a #page-title .page-title{text-align:center} de style.css:136-138 (mismo id, más clases) */
}
@media (max-width: 991px) {
  .ap-page .ap-hero__copy {
    max-width: none;
  }
}

.ap-page #page-title .page-title > h1.ap-hero__title {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: normal;
  color: var(--ap-primary);
  margin: 0 0 8px;
}
@media (max-width: 768px) {
  .ap-page #page-title .page-title > h1.ap-hero__title {
    font-size: 26px;
  }
}

.ap-page #page-title .breadcrumb.ap-breadcrumb {
  text-align: left;
  margin: 10px 0 0;
  font-size: 14px;
}
.ap-page #page-title .breadcrumb.ap-breadcrumb ul li a {
  color: var(--ap-muted);
}
.ap-page #page-title .breadcrumb.ap-breadcrumb ul li a:hover {
  color: var(--ap-primary);
}
.ap-page #page-title .breadcrumb.ap-breadcrumb ul li:last-child {
  color: var(--ap-primary);
  font-weight: 600;
  opacity: 1;
}

/* ===== SECCIÓN Y TÍTULOS ===== */
.ap-page section.ap-section {
  padding: 64px 0;
  background: transparent;
  overflow: visible; /* obligatorio: vence custom.css:84 (section{overflow:hidden}); es ancestro de la columna lateral con sticky */
}
@media (max-width: 768px) {
  .ap-page section.ap-section {
    padding: 48px 0;
  }
}

@media (max-width: 991px) {
  .ap-page .ap-main {
    padding-bottom: 24px;
  }
}

.ap-page .ap-heading {
  margin: 0 0 24px;
}

.ap-page .ap-heading .ap-section-title {
  border-left: 4px solid var(--ap-accent);
  padding-left: 16px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: normal;
  color: var(--ap-primary);
  margin: 0;
  text-transform: none;
}
@media (max-width: 768px) {
  .ap-page .ap-heading .ap-section-title {
    font-size: 20px;
  }
}

.ap-page .ap-heading + .ap-mission,
.ap-page .ap-mission + .ap-heading,
.ap-page .ap-cards + .ap-band,
.ap-page .ap-heading + .row.ap-cards {
  margin-top: 48px;
}

/* ===== MISIÓN ===== */
.ap-page .ap-mission {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--ap-border);
  border-left: 4px solid var(--ap-accent);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--ap-shadow);
}
@media (max-width: 768px) {
  .ap-page .ap-mission {
    padding: 20px;
  }
}
@media (max-width: 576px) {
  .ap-page .ap-mission {
    flex-direction: column;
    gap: 14px;
  }
}

.ap-page .ap-mission__icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(30,58,138,.05);
  color: var(--ap-primary);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ap-page .ap-mission h4.ap-mission__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: normal;
  color: var(--ap-primary);
  margin: 0 0 8px;
}

.ap-page .ap-mission p.ap-mission__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ap-muted);
  text-align: left;
}

/* ===== TARJETAS DE PRODUCTOS Y SERVICIOS ===== */
.ap-page .ap-cards {
  margin-left: -12px;
  margin-right: -12px;
}
.ap-page .ap-cards > [class*="col-"] {
  padding: 0 12px;
  margin-bottom: 24px;
  display: flex;
}

.ap-page a.ap-card {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--ap-border);
  box-shadow: var(--ap-shadow);
  padding: 28px;
  overflow: hidden;
  color: var(--ap-text); /* vence a:not(.btn):not(.badge):hover de style.css:4014 con misma especificidad (0,2,1)+pseudo, ver :hover abajo */
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .3s;
}
@media (max-width: 768px) {
  .ap-page a.ap-card {
    padding: 22px;
  }
}

.ap-page a.ap-card::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: rgba(6,182,212,.10);
  transform: scale(0);
  transition: transform .5s ease-in-out;
}
.ap-page a.ap-card:hover::before {
  transform: scale(1.5);
}

.ap-page a.ap-card > * {
  position: relative;
  z-index: 1;
}

.ap-page a.ap-card:hover,
.ap-page a.ap-card:focus-within {
  color: var(--ap-text);
}

.ap-page a.ap-card:focus-visible {
  outline: 3px solid var(--ap-accent);
  outline-offset: 3px;
}

.ap-page .ap-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(30,58,138,.05);
  color: var(--ap-primary);
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: background-color .3s, color .3s;
}
.ap-page a.ap-card:hover .ap-card__icon {
  background: var(--ap-primary);
  color: #fff;
}

.ap-page .ap-card h5.ap-card__title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: normal;
  color: var(--ap-primary);
  margin: 0 0 12px;
  transition: color .3s;
}
.ap-page a.ap-card:hover h5.ap-card__title {
  color: var(--ap-accent-hover);
}

.ap-page ul.ap-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.ap-page ul.ap-card__list li {
  position: relative;
  padding-left: 26px;
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ap-muted);
  text-align: left;
}
.ap-page ul.ap-card__list li:last-child {
  margin-bottom: 0;
}
.ap-page ul.ap-card__list li::before {
  content: "\f054";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 4px;
  font-size: 10px;
  color: var(--ap-accent-text);
}

/* ===== BANDA DE COMPOSICIÓN ===== */
.ap-page .ap-band {
  position: relative;
  border-radius: 20px;
  padding: 40px 32px;
  background: linear-gradient(135deg, var(--ap-primary) 0%, var(--ap-primary-2) 55%, var(--ap-accent-text) 100%);
  overflow: hidden;
}
@media (max-width: 768px) {
  .ap-page .ap-band {
    padding: 28px 20px;
  }
}

.ap-page .ap-band::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.ap-page .ap-band::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.ap-page .ap-band > * {
  position: relative;
  z-index: 1;
}

.ap-page .ap-heading--onDark .ap-section-title--onDark {
  color: #fff;
  border-left-color: rgba(255,255,255,.55);
}

.ap-page .ap-units {
  margin-left: -8px;
  margin-right: -8px;
}
.ap-page .ap-units > [class*="col-"] {
  padding: 0 8px;
  margin-bottom: 16px;
  display: flex;
}

.ap-page a.ap-unit {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 20px;
  border-radius: 14px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  text-decoration: none;
  transition: background-color .3s, transform .3s, border-color .3s;
}
.ap-page a.ap-unit:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.3);
  transform: translateY(-4px);
}
.ap-page a.ap-unit:focus-visible {
  outline: 3px solid #67e8f9;
  outline-offset: 3px;
}

.ap-page .ap-unit__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s;
}
.ap-page a.ap-unit:hover .ap-unit__icon {
  transform: scale(1.08);
}

.ap-page .ap-unit__text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: #fff;
}

/* ===== REVEAL Y MOVIMIENTO ===== */
.ap-page.ap-js .ap-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.ap-page.ap-js .ap-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .ap-page {
    transition: none;
  }
  .ap-page.ap-js .ap-reveal,
  .ap-page.ap-js .ap-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none; /* mismo selector y especificidad (0,3,0) que la regla de arriba; gana por venir después en el archivo, sin necesitar !important */
  }
}
