/* MI RIEGO — capa editorial. Se carga después de style.css y solo actúa bajo body.ed
   Titulares en serif grande y una tubería azul de riego que une las secciones de la portada.
   Las páginas interiores conservan los fondos, fotos y bordes redondeados de style.css. */
.ed {
  --tinta-ed: #10231a;
  --cesped: #1c5a33;
  --cesped-osc: #123f24;
  --tuberia: #1b6fd1;      /* azul del PVC de riego */
  --raya: #cfd8cf;
  --gris-ed: #4f5d55;
  --redondo: 18px;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
}
.ed h1, .ed h2, .ed h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.022em; }
.ed-ancho { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1.15rem, 4vw, 3rem); }
.ed main .ed-ancho p { max-width: 62ch; }

/* ---------- Portada ---------- */
.ed-portada { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(1.5rem, 4vw, 4.5rem); align-items: center; padding: clamp(2.2rem, 5vw, 4.4rem) 0 clamp(2rem, 4vw, 3.2rem); }
.ed-portada h1 { font-size: clamp(2.7rem, 6.1vw, 5.7rem); line-height: 0.98; letter-spacing: -0.035em; margin: 0 0 1.5rem; color: var(--tinta-ed); text-wrap: balance; }
.ed-bajada { font-family: var(--serif); font-size: clamp(1.18rem, 1.6vw, 1.42rem); line-height: 1.45; color: var(--gris-ed); margin: 0 0 2rem; max-width: 34ch; }
.ed-bajada strong { color: var(--cesped); font-weight: 600; }
.ed-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.6rem; }
.ed .ed-boton {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 1.5rem; border-radius: 999px;
  background: var(--cesped); color: #fff; font-weight: 600; font-size: 1.02rem; text-decoration: none;
  box-shadow: 0 10px 24px rgba(20, 70, 38, 0.28);
  transition: background 0.15s ease, transform 0.15s ease;
}
.ed .ed-boton:hover { background: var(--cesped-osc); color: #fff; transform: translateY(-1px); }
.ed .ed-enlace { color: var(--tinta-ed); font-weight: 600; text-decoration: underline; text-decoration-color: var(--tuberia); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.ed .ed-enlace:hover { color: var(--tuberia); }
.ed-foto { margin: 0; }
.ed-foto img { display: block; width: 100%; height: auto; object-fit: cover; border-radius: var(--redondo); box-shadow: 0 22px 48px rgba(16, 42, 26, 0.2); background: var(--raya); }
.ed-portada .ed-foto img { aspect-ratio: 4 / 5; object-position: 22% center; }
.ed-foto figcaption { margin-top: 0.7rem; font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--gris-ed); }

/* Portada a toda pantalla: foto del riego con titular blanco */
.ed-heroe {
  background:
    linear-gradient(90deg, rgba(8, 26, 15, 0.94) 0%, rgba(8, 26, 15, 0.78) 42%, rgba(8, 26, 15, 0.28) 78%, rgba(8, 26, 15, 0.1) 100%),
    url("/assets/img/riego-automatico-aspersores.webp") center 62% / cover no-repeat;
  color: #fff;
  padding: clamp(3.6rem, 8.5vw, 7rem) 0 clamp(5.6rem, 11vw, 9rem);
}
.ed-heroe h1 { font-size: clamp(2.8rem, 6.4vw, 6rem); line-height: 0.98; letter-spacing: -0.035em; margin: 0 0 1.5rem; max-width: 12ch; color: #fff; text-wrap: balance; text-shadow: 0 2px 24px rgba(4, 14, 8, 0.5); }
.ed-heroe .ed-bajada { color: #e6f1e8; max-width: 36ch; text-shadow: 0 1px 12px rgba(4, 14, 8, 0.55); }
.ed-heroe .ed-bajada strong { color: #9be0b0; }
.ed .ed-heroe .ed-boton { background: #2b9a50; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35); }
.ed .ed-heroe .ed-boton:hover { background: #fff; color: var(--cesped-osc); }
.ed .ed-heroe .ed-enlace { color: #fff; text-decoration-color: #9be0b0; }
.ed .ed-heroe .ed-enlace:hover { color: #9be0b0; }
.ed-heroe + .ed-ancho > .ed-datos { position: relative; margin-top: clamp(-4.2rem, -6vw, -2.6rem); }

/* Franja de garantías: panel verde oscuro */
.ed-datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0.4rem 0; list-style: none; background: linear-gradient(150deg, #0f2417 0%, var(--cesped) 100%); border-radius: var(--redondo); color: #fff; box-shadow: 0 18px 40px rgba(16, 42, 26, 0.22); }
.ed-datos li { padding: 1.35rem 1.5rem 1.45rem; }
.ed-datos li + li { border-left: 1px solid rgba(255, 255, 255, 0.18); }
.ed-datos b { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 2.3vw, 2.05rem); line-height: 1.05; letter-spacing: -0.02em; color: #fff; }
.ed-datos span { display: block; margin-top: 0.35rem; font-size: 0.93rem; color: #cfe6d6; line-height: 1.35; }

/* ---------- Cuerpo con la tubería ---------- */
.ed-cuerpo { position: relative; padding-left: clamp(1.7rem, 5.2vw, 5rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.ed-cuerpo::before {
  content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 4px; border-radius: 4px;
  background: var(--tuberia); transform-origin: top; animation: ed-tender 1.4s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes ed-tender { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.ed-seccion { position: relative; padding: clamp(3rem, 6.5vw, 5.4rem) 0 0; }
.ed-seccion > h2 { position: relative; font-size: clamp(2rem, 3.9vw, 3.35rem); line-height: 1.04; margin: 0 0 1rem; max-width: 20ch; color: var(--tinta-ed); text-wrap: balance; }
.ed-seccion h3 { color: var(--tinta-ed); }
/* El emisor: donde la tubería entrega agua a cada sección */
.ed-seccion > h2::before {
  content: ""; position: absolute; top: 0.32em;
  left: calc(-1 * clamp(1.7rem, 5.2vw, 5rem) - 3px);
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 4px solid var(--tuberia); box-sizing: border-box;
}
.ed-entrada { font-size: 1.12rem; line-height: 1.6; color: var(--gris-ed); margin: 0 0 2.2rem; }

/* Servicios: un artículo principal y un índice en panel blanco */
.ed-servicios { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.6rem, 3.4vw, 3.2rem); align-items: start; }
.ed-principal .ed-foto img { aspect-ratio: 3 / 2; }
.ed-principal h3 { font-size: clamp(1.6rem, 2.5vw, 2.2rem); line-height: 1.1; margin: 1.3rem 0 0.6rem; }
.ed-principal h3 a, .ed-indice h3 a { color: inherit; text-decoration: none; }
.ed-principal h3 a:hover, .ed-indice h3 a:hover { color: var(--cesped); }
.ed-principal p { color: var(--gris-ed); margin: 0 0 1rem; }
.ed-indice { list-style: none; margin: 0; padding: 0.5rem 1.5rem; background: #fff; border: 1px solid #dce5d9; border-radius: var(--redondo); box-shadow: 0 12px 32px rgba(20, 42, 28, 0.09); }
.ed-indice li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1.2rem; align-items: center; padding: 1.2rem 0; }
.ed-indice li + li { border-top: 1px solid #e3eae0; }
.ed-indice img { width: 96px; height: 96px; object-fit: cover; display: block; border-radius: 14px; background: var(--raya); }
.ed-indice h3 { font-size: 1.42rem; line-height: 1.12; margin: 0 0 0.35rem; }
.ed-indice p { margin: 0; color: var(--gris-ed); font-size: 0.98rem; line-height: 1.5; }

/* Confianza: una cita grande y una ficha en panel */
.ed-confianza { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr); gap: clamp(1.6rem, 3.4vw, 3.2rem); align-items: start; }
.ed-cita { font-family: var(--serif); font-size: clamp(1.7rem, 3.1vw, 2.75rem); line-height: 1.14; letter-spacing: -0.02em; margin: 0 0 1.4rem; max-width: 19ch; color: var(--cesped); text-wrap: balance; }
.ed-confianza .ed-foto img { aspect-ratio: 16 / 10; }
.ed-panel { background: #fff; border: 1px solid #dce5d9; border-radius: var(--redondo); box-shadow: 0 12px 32px rgba(20, 42, 28, 0.09); padding: 0.6rem 1.6rem 1.5rem; }
.ed-ficha { margin: 0; }
.ed-ficha div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; padding: 0.95rem 0; border-bottom: 1px solid #e3eae0; }
.ed-ficha dt { font-weight: 600; color: var(--tinta-ed); }
.ed-ficha dd { margin: 0; color: var(--gris-ed); }

/* Clientes */
.ed-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1.4rem 1.8rem; align-items: center; margin: 0; padding: 1.8rem 1.8rem; list-style: none; background: #fff; border: 1px solid #dce5d9; border-radius: var(--redondo); box-shadow: 0 12px 32px rgba(20, 42, 28, 0.09); }
.ed-logos li { display: grid; place-items: center; }
.ed-logos img { max-width: 100%; max-height: 56px; width: auto; height: auto; }

/* Campo y lecturas: panel verde oscuro */
.ed-oscuro { background: linear-gradient(150deg, #0f2417 0%, #1a4a2b 100%); border-radius: var(--redondo); padding: clamp(1.4rem, 3vw, 2.4rem); color: #e8f1e9; box-shadow: 0 18px 40px rgba(16, 42, 26, 0.22); }
.ed-campo { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); gap: clamp(1.4rem, 3vw, 2.8rem); align-items: start; }
.ed-campo .ed-foto img { aspect-ratio: 4 / 3; box-shadow: none; }
.ed-oscuro .ed-foto figcaption { color: #b9d6c2; }
.ed-oscuro .ed-entrada { color: #dcebdf; margin-bottom: 1.2rem; }
.ed .ed-oscuro .ed-enlace { color: #fff; text-decoration-color: #7fd39a; }
.ed .ed-oscuro .ed-enlace:hover { color: #7fd39a; }
.ed-lecturas { list-style: none; margin: 1.6rem 0 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, 0.28); }
.ed-lecturas li { padding: 0.95rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.ed-lecturas a { font-family: var(--serif); font-size: 1.32rem; line-height: 1.2; color: #fff; text-decoration: none; }
.ed-lecturas a:hover { color: #7fd39a; }
.ed-lecturas span { display: block; color: #b9d6c2; font-size: 0.95rem; margin-top: 0.2rem; }

/* Cierre: la tubería termina aquí */
.ed-cierre > h2::before { background: var(--tuberia); }
.ed-cierre > h2 { z-index: 1; }
.ed-cierre::after {
  content: ""; position: absolute; width: 14px; background: var(--fondo, #f4f7f2);
  left: calc(-1 * clamp(1.7rem, 5.2vw, 5rem));
  top: calc(clamp(3rem, 6.5vw, 5.4rem) + 0.32 * clamp(2.2rem, 4.8vw, 4.2rem) + 10px);
  bottom: calc(-1 * clamp(3rem, 6vw, 5rem));
}
.ed-cierre > h2 { font-size: clamp(2.2rem, 4.8vw, 4.2rem); max-width: 17ch; line-height: 1; letter-spacing: -0.03em; margin-bottom: 1.3rem; }
.ed-cierre .ed-entrada { margin-bottom: 1.8rem; }

/* ---------- Páginas interiores: se mantiene el diseño con color de style.css ---------- */
.ed .pagina-cabecera h1 { font-weight: 500; font-size: clamp(2.2rem, 4.8vw, 3.7rem); line-height: 1.02; letter-spacing: -0.028em; color: #fff; text-shadow: 0 2px 18px rgba(4, 14, 8, 0.45); }
.ed .pagina-cabecera p.sub { font-size: 1.14rem; color: #e3efe5; }
.ed .hero-agricola h1 { font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.ed .seccion h2 { font-weight: 500; font-size: clamp(1.8rem, 3.3vw, 2.6rem); line-height: 1.08; }
.ed .banda h2, .ed .cta-banda h2 { font-weight: 500; color: #fff; }
.ed .cta-banda h2 { font-size: clamp(1.9rem, 3.9vw, 3rem); line-height: 1.05; }
.ed .pregunta summary { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.ed .pie h4 { font-family: "Archivo", sans-serif; }

/* ---------- Tablet y celular ---------- */
@media (max-width: 900px) {
  .ed-heroe { background: linear-gradient(180deg, rgba(8, 26, 15, 0.9) 0%, rgba(8, 26, 15, 0.72) 100%), url("/assets/img/riego-automatico-aspersores.webp") center / cover no-repeat; }
  .ed-portada { grid-template-columns: 1fr; align-items: start; }
  .ed-portada .ed-foto img { aspect-ratio: 3 / 2; object-position: center; }
  .ed-bajada { max-width: 46ch; }
  .ed-datos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed-datos li:nth-child(3) { border-left: 0; }
  .ed-datos li:nth-child(n + 3) { border-top: 1px solid rgba(255, 255, 255, 0.18); }
  .ed-servicios, .ed-confianza, .ed-campo { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .ed-cuerpo { padding-left: 1.55rem; }
  .ed-cuerpo::before { left: 2px; width: 3px; }
  .ed-seccion > h2::before { left: calc(-1.55rem - 4px); width: 15px; height: 15px; border-width: 3px; top: 0.36em; }
  .ed-cierre::after { left: -1.55rem; width: 10px; top: calc(3rem + 0.36 * 2.2rem + 7px); }
  .ed-acciones { flex-direction: column; align-items: flex-start; }
  .ed .ed-boton { width: 100%; justify-content: center; }
  .ed-datos li { padding: 1.1rem 1.05rem 1.15rem; }
  .ed-indice { padding: 0.3rem 1rem; }
  .ed-indice li { grid-template-columns: 72px minmax(0, 1fr); gap: 0.95rem; }
  .ed-indice img { width: 72px; height: 72px; }
  .ed-panel { padding: 0.4rem 1.1rem 1.2rem; }
  .ed-ficha div { grid-template-columns: 1fr; gap: 0.15rem; }
  .ed-logos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; padding: 1.2rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ed-cuerpo::before { animation: none; }
  .ed .ed-boton { transition: none; }
}
