/* Portada de ecointec.net: recupera el diseño de la portada antigua (tema ECT) dentro del tema de bloques.
   Se carga solo en la página de inicio (functions.php). Archivo del tema, sin código incrustado: compatible con una
   CSP sin 'unsafe-inline'. Los colores salen de tokens.css (--band, --on-band, --accent-on-band…); la cabecera con foto y
   la rejilla son oscuras en los dos modos, como en la portada antigua. Referencia: docs/sesiones/capturas/portada-antigua/ */

/* ---------- Cabecera con foto, vídeo al pasar el cursor y 4 fichas ---------- */
.ect-portada { --ect-p-lado: max(1.5rem, calc((100% - 1120px) / 2)); position: relative; isolation: isolate; align-items: flex-start; min-height: 0; padding: 3.5rem 0 0; background: #000; color: var(--on-band); overflow: hidden; }
.ect-portada .wp-block-cover__image-background { object-fit: cover; object-position: top center; transition: opacity .65s ease; z-index: 0; }
.ect-portada .wp-block-cover__background { background: linear-gradient(90deg, rgba(0,0,0,.76) 0%, rgba(0,0,0,.52) 42%, rgba(0,0,0,.32) 100%) !important; opacity: 1 !important; z-index: 2; }
.ect-portada::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(circle at center, transparent 18%, rgba(0,0,0,.25) 100%); }
.ect-portada__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .65s ease; z-index: 1; pointer-events: none; }
.ect-portada.is-video-active .wp-block-cover__image-background { opacity: 0; }
.ect-portada.is-video-active .ect-portada__video { opacity: .85; }
.ect-portada .wp-block-cover__inner-container { position: relative; z-index: 4; width: 100%; max-width: none; color: var(--on-band); }
.ect-portada__interior { width: min(1120px, 100%); margin-inline: auto; padding-inline: 1.5rem; box-sizing: border-box; }
.ect-portada .ect-eyebrow { display: inline-flex; align-items: center; gap: .5rem; color: var(--accent-on-band); letter-spacing: .125rem; margin: 0 0 1.125rem; }
.ect-portada .ect-eyebrow::before { content: ""; width: .375rem; height: .375rem; border-radius: 50%; background: var(--accent-on-band); box-shadow: 0 0 8px color-mix(in srgb, var(--accent-on-band) 65%, transparent); }
.ect-portada h1 { margin: 0 0 1.25rem; max-width: 51rem; font-size: clamp(1.9rem, 5vw, 3.25rem); line-height: 1.06; letter-spacing: -.0875rem; color: #fff; }
.ect-portada h1 .ect-destacado { color: var(--accent-on-band); }
.ect-portada .ect-entradilla { max-width: 42.5rem; margin: 0 0 2.125rem; font-size: 1rem; line-height: 1.6; color: var(--on-band-muted); }
.ect-fichas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0; }
.ect-ficha { position: relative; display: flex; flex-direction: column; min-height: 10.9rem; padding: 1.375rem 1.375rem 1.25rem; box-sizing: border-box; background: rgba(5, 14, 10, .58); border: 1px solid color-mix(in srgb, var(--on-band) 18%, transparent); border-radius: .5625rem; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow: hidden; transition: transform .35s ease, background .35s ease, border-color .35s ease, box-shadow .35s ease; }
.ect-ficha::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent-on-band), transparent); opacity: 0; transition: opacity .35s ease; }
.ect-ficha:hover, .ect-ficha:focus-within { transform: translateY(-.3125rem); background: rgba(4, 16, 10, .66); border-color: color-mix(in srgb, var(--accent-on-band) 46%, transparent); box-shadow: 0 18px 45px rgba(0,0,0,.3); }
.ect-ficha:hover::before, .ect-ficha:focus-within::before { opacity: 1; }
.ect-ficha > * { margin: 0 !important; }
.ect-ficha h2 { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; margin: 0 0 .75rem !important; font-size: 1.0625rem; line-height: 1.25; font-weight: 700; color: #fff; }
.ect-ficha h2 a { color: inherit; text-decoration: none; }
.ect-ficha h2 a::after { content: ""; position: absolute; inset: 0; z-index: 2; } /* toda la ficha es el enlace */
.ect-ficha:hover h2 a, .ect-ficha h2 a:focus-visible { color: var(--accent-on-band); }
.ect-ficha h2::before { content: ""; width: 2.5rem; height: 2.5rem; border-radius: .625rem; background: color-mix(in srgb, var(--accent-on-band) 18%, transparent) center / 1.3rem 1.3rem no-repeat; border: 1px solid color-mix(in srgb, var(--accent-on-band) 25%, transparent); transition: transform .3s ease; }
.ect-ficha:hover h2::before { transform: scale(1.06); }
.ect-ficha p { margin-top: auto !important; font-size: .8125rem; line-height: 1.5; color: var(--on-band-muted); }
/* Iconos (trazos del tema antiguo) como imagen de fondo en data: URI; color fijo verde claro */
.ect-ficha--planeamiento h2::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238be3a2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l6-3 6 3 6-3v15l-6 3-6-3-6 3V6z'/%3E%3Cpath d='M9 3v15'/%3E%3Cpath d='M15 6v15'/%3E%3C/svg%3E"); }
.ect-ficha--infraestructura h2::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238be3a2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z'/%3E%3Cpath d='M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12'/%3E%3C/svg%3E"); }
.ect-ficha--formacion h2::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238be3a2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 10v6M2 10l10-5 10 5-10 5z'/%3E%3Cpath d='M6 12v5c3 3 9 3 12 0v-5'/%3E%3C/svg%3E"); }
.ect-ficha--geoespacial h2::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238be3a2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E"); }
.ect-portada .ect-ultimas { margin: 2.5rem 0 1.375rem; font-size: 2rem; line-height: 1.15; letter-spacing: -.0375rem; color: #fff; }

/* ---------- Rejilla 3×3 a todo el ancho: 8 entradas y la celda central ---------- */
.ect-rejilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin: 0 !important; padding: 0 !important; background: var(--band); }
.ect-rejilla > * { margin: 0 !important; }
.ect-rejilla .wp-block-query, .ect-rejilla .wp-block-post-template { display: contents; }
.ect-rejilla .wp-block-post-template { list-style: none; margin: 0; padding: 0; }
.ect-rejilla .wp-block-post { position: relative; min-width: 0; min-height: 25rem; overflow: hidden; background: color-mix(in srgb, var(--band) 90%, #fff); margin: 0 !important; }
.ect-rejilla .wp-block-post-featured-image { position: absolute; inset: 0; margin: 0; height: 100%; }
.ect-rejilla .wp-block-post-featured-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease, filter .5s ease; }
.ect-rejilla .wp-block-post::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(13,22,18,.05) 0%, rgba(13,22,18,.08) 35%, rgba(13,22,18,.88) 100%); transition: background .45s ease; }
.ect-rejilla .wp-block-post::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 4; pointer-events: none; background: linear-gradient(90deg, transparent, var(--accent-on-band), transparent); opacity: 0; transition: opacity .35s ease; }
.ect-rejilla .wp-block-post:hover::before, .ect-rejilla .wp-block-post:focus-within::before { opacity: 1; }
.ect-rejilla .wp-block-post:hover img { transform: scale(1.06); filter: saturate(.9) brightness(.82); }
.ect-rejilla .wp-block-post-title { position: absolute; left: 1.5rem; right: 1.5rem; bottom: 1.375rem; z-index: 3; margin: 0; font-size: 1.4375rem; line-height: 1.25; letter-spacing: -.02rem; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.ect-rejilla .wp-block-post-title a { color: #fff; text-decoration: none; }
.ect-rejilla .wp-block-post:hover .wp-block-post-title a, .ect-rejilla .wp-block-post-title a:focus-visible { color: var(--accent-on-band); }
.ect-rejilla .wp-block-post-date { position: absolute; top: 1.25rem; left: 1.5rem; z-index: 3; margin: 0; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09rem; color: var(--accent-on-band); opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.ect-rejilla .wp-block-post:hover .wp-block-post-date, .ect-rejilla .wp-block-post:focus-within .wp-block-post-date { opacity: 1; }

/* Celda central: arriba, llamada a «portfolio»; abajo, socios y partners */
.ect-hub { grid-column: 2; grid-row: 2; min-width: 0; min-height: 25rem; display: grid; grid-template-rows: minmax(0, .8fr) minmax(0, 1.2fr); gap: 1px; background: color-mix(in srgb, var(--accent-on-band) 25%, transparent); }
.ect-hub__cta { position: relative; display: flex; flex-direction: column; justify-content: center; gap: .5rem; padding: 0 1.75rem; overflow: hidden; background: linear-gradient(135deg, #8be3a2 0%, #4f9462 100%); color: #06140c; }
.ect-hub__cta::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(0,0,0,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.07) 1px, transparent 1px); background-size: 1.5rem 1.5rem; }
.ect-hub__cta > * { position: relative; margin: 0 !important; }
.ect-hub__cta .ect-hub__eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .15rem; text-transform: uppercase; color: rgba(6,20,12,.7); }
.ect-hub__cta h2 { max-width: calc(100% - 5rem); font-size: 2rem; line-height: 1.05; letter-spacing: -.05rem; color: #06140c; transition: transform .35s ease; }
.ect-hub__cta h2 a { color: inherit; text-decoration: none; }
.ect-hub__cta h2 a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.ect-hub__cta:hover h2 { transform: translateX(.25rem); }
.ect-hub__cta::after { content: "\2192"; position: absolute; right: 1.5rem; top: 50%; width: 3.25rem; height: 3.25rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #06140c; color: #8be3a2; font-size: 1.5rem; transform: translateY(-50%) rotate(-45deg); transition: transform .35s ease, background .3s ease, color .3s ease; }
.ect-hub__cta:hover::after { transform: translateY(-50%) rotate(0); background: #fff; color: #06140c; }
.ect-hub__cta :focus-visible { outline: 2px solid #06140c; outline-offset: 4px; }
.ect-hub__socios { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); min-width: 0; overflow: hidden; background: color-mix(in srgb, var(--band) 92%, #fff); }
.ect-hub__socios > p { margin: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent-on-band) 14%, transparent); border-right: 1px solid color-mix(in srgb, var(--accent-on-band) 25%, transparent); writing-mode: vertical-rl; transform: rotate(180deg); font-size: .8125rem; font-weight: 700; letter-spacing: .3rem; text-transform: uppercase; white-space: nowrap; color: var(--accent-on-band); }
.ect-hub__socios .ect-socios { align-self: center; min-width: 0; width: 100%; overflow: hidden; container-type: inline-size; padding: .75rem 0; mask-image: linear-gradient(90deg, transparent 0%, #000 7%, #000 93%, transparent 100%); -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 7%, #000 93%, transparent 100%); }
.ect-socios__pista { display: flex; width: max-content; animation: ect-cinta 20s linear infinite; }
.ect-socios__pista:has(.ect-socio:hover), .ect-socios__pista:has(.ect-socio:focus-visible) { animation-play-state: paused; }
.ect-socios__grupo { display: flex; align-items: center; flex-shrink: 0; min-width: 100cqw; margin: 0; padding: 0; list-style: none; }
.ect-socio { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 12rem; height: 6rem; margin-right: 1rem; padding: .75rem 1rem; box-sizing: border-box; border-radius: .75rem; text-decoration: none; background: color-mix(in srgb, var(--band) 92%, #fff); transition: transform .3s ease, background .3s ease, box-shadow .3s ease; }
.ect-socio:hover, .ect-socio:focus-visible { transform: translateY(-.25rem) scale(1.04); background: #eef4ef; box-shadow: 0 .75rem 1.75rem rgba(0,0,0,.45), 0 0 0 2px rgba(139,227,162,.75); }
.ect-socio img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; filter: brightness(0) invert(1); opacity: .75; transition: filter .3s ease, opacity .3s ease; }
.ect-socio:hover img, .ect-socio:focus-visible img { filter: none; opacity: 1; }
.ect-socio--jpg img { filter: invert(1) grayscale(1); mix-blend-mode: screen; }
.ect-socio--jpg:hover img, .ect-socio--jpg:focus-visible img { filter: none; mix-blend-mode: multiply; opacity: 1; }
.ect-socio--oscura img { filter: none; opacity: .8; }
.ect-socio--oscura:hover, .ect-socio--oscura:focus-visible { background: #1c2e23; }
.ect-socio--oscura:hover img, .ect-socio--oscura:focus-visible img { opacity: 1; }
@keyframes ect-cinta { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- «Otros servicios» ---------- */
.ect-otros { margin-top: var(--wp--preset--spacing--50); border: 1px solid var(--border-strong); border-radius: var(--wp--custom--radius--lg); background: var(--surface-100); }
.ect-otros > summary { cursor: pointer; padding: 1rem 1.25rem; font: 700 1.0625rem/1.3 var(--wp--preset--font-family--display); }
.ect-otros[open] > summary { border-bottom: 1px solid var(--border); }
.ect-otros > :not(summary) { margin: 1.25rem; }

/* ---------- Adaptación ---------- */
@media (max-width: 1100px) {
  .ect-fichas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ect-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ect-rejilla .wp-block-post { min-height: 18.75rem; }
  .ect-hub { grid-column: 1 / -1; grid-row: auto; min-height: 22.5rem; order: 99; }
}
@media (max-width: 680px) {
  .ect-portada { padding-top: 2.5rem; }
  .ect-portada .wp-block-cover__image-background { opacity: .2; object-position: center; }
  .ect-portada__video { display: none; }
  .ect-portada__interior { padding-inline: 1.25rem; }
  .ect-fichas { grid-template-columns: 1fr; gap: .75rem; }
  .ect-ficha { min-height: 10rem; }
  .ect-portada .ect-ultimas { font-size: 1.625rem; }
  .ect-rejilla { grid-template-columns: 1fr; }
  .ect-rejilla .wp-block-post { min-height: 20rem; }
  .ect-rejilla .wp-block-post-title { left: 1.25rem; right: 1.25rem; bottom: 1.25rem; font-size: 1.25rem; }
  .ect-hub { min-height: 25rem; }
  .ect-hub__cta h2 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ect-portada__video { display: none; }
  .ect-portada *, .ect-ficha, .ect-rejilla *, .ect-socio { transition: none !important; }
  .ect-socios__pista { animation: none !important; }
}
