/* ==========================================================================
   SEITEL — Internal pages (DESIGN v2.0 §8): projects archive, single project,
   solution lines, generic pages, 404. Loaded on every page except the home.
   ========================================================================== */

/* ---------- Shared ---------- */
.section--tight { padding-block: calc(var(--section-y) * .5) var(--section-y); }
.section--alt { background: var(--paper); }

/* Page head: breadcrumbs + H1 + lead, on the container edges */
.page-head { padding-block: var(--s-6) var(--s-7); }
.page-head__title { max-width: 28ch; margin-top: var(--s-5); }
.page-head__lead { margin-top: var(--s-4); color: var(--slate-600); }
.page-head__meta { margin-top: var(--s-4); color: var(--slate-600); }

/* Breadcrumbs */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  color: var(--slate-600);
}
.breadcrumb li { display: inline-flex; align-items: center; gap: var(--s-2); }
.breadcrumb li + li::before { content: "/"; color: var(--slate-400); }
.breadcrumb a {
  color: var(--ink-900);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}
.breadcrumb a:hover { color: var(--blue-600); text-decoration-color: currentColor; }
.breadcrumb [aria-current] { color: var(--slate-600); }

/* Readable long text (policy, line pages) */
.prose { max-width: 68ch; color: var(--slate-600); }
.prose > * + * { margin-top: var(--s-4); }
.prose h2,
.prose h3 { color: var(--ink-900); font-weight: 600; letter-spacing: var(--ls-h3); line-height: 1.25; }
.prose h2 { font-size: var(--fs-h3-lg); margin-top: var(--s-7); }
.prose h3 { font-size: var(--fs-h3); margin-top: var(--s-6); }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: var(--s-2); }
.prose a { color: var(--blue-600); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink-900); }

/* ---------- Projects archive ---------- */
.filters { display: grid; gap: var(--s-4); margin-top: var(--s-6); }
.filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.filters__label { min-width: 56px; color: var(--slate-600); }
a.chip { transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
a.chip:hover { border-color: var(--slate-400); }
a.chip.is-active:hover { border-color: var(--ink-900); }

.archive__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-7) var(--gutter);
}
.archive__more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-6);
  margin-top: var(--s-8);
}
.archive__empty { display: grid; justify-items: start; gap: var(--s-5); }

@media (max-width: 959px) { .archive__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .archive__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Single project: hero = featured-card layout at full container width ---------- */
.project-hero { padding-top: var(--s-6); }
.project-hero__card { margin-top: var(--s-5); height: clamp(520px, 72svh, 680px); }
.project-hero__overlay { max-width: 720px; padding: var(--s-7); }
.project-hero__overlay .project-card__title { font-size: var(--fs-h2); }
.project-hero__overlay .project-card__summary { max-width: 52ch; font-size: var(--fs-lead); line-height: 1.5; }
.project-hero__cta { margin-top: var(--s-3); }

@media (max-width: 767px) {
  .project-hero__card { height: auto; min-height: clamp(520px, 80svh, 640px); }
  .project-hero__overlay { padding: var(--s-5); }
}

/* Spec / story / gallery / before-after headers */
.spec__head,
.story__head,
.gallery__head,
.compare__head,
.project-quote__head,
.related__head { display: flex; flex-direction: column; align-items: flex-start; }

.related__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-7) var(--gutter);
}
@media (max-width: 959px) { .related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .related__grid { grid-template-columns: minmax(0, 1fr); } }

.project-quote .carousel__slide { opacity: 1; visibility: visible; }

/* ---------- Solution line ---------- */
.line-head { padding-bottom: var(--section-y); }
.line-head__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s-7) var(--s-9);
  align-items: start;
}
.line-head__chips { margin-top: var(--s-5); }
.line-head__cta { margin-top: var(--s-6); }
.line-head__media { position: relative; margin-top: var(--s-6); }
.line-head__panel {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--sky-50);
  isolation: isolate;
}
.line-head__art { width: 86%; height: 86%; object-fit: contain; mix-blend-mode: multiply; }
.line-head__card {
  position: absolute;
  left: -24px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 220px;
}
.line-head__card .float-card__value { font-size: 40px; color: var(--navy-700); }

.line-intro { padding-top: 0; }

@media (max-width: 959px) {
  .line-head__grid { grid-template-columns: minmax(0, 1fr); }
  .line-head__media { max-width: 520px; }
  .line-head__card { left: var(--s-4); bottom: var(--s-4); min-width: 0; }
}

/* FAQ: native <details> (works without JS) */
.faq__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s-7) var(--s-9);
  align-items: start;
}
.faq__list { border-bottom: 1px solid var(--line); }
.faq__item { border-top: 1px solid var(--line); }
.faq__q {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: var(--s-4);
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.faq__icon .icon { width: 16px; height: 16px; }
.faq__icon .icon--minus,
.faq__item[open] .faq__icon .icon--plus { display: none; }
.faq__item[open] .faq__icon .icon--minus { display: block; }
.faq__item[open] .faq__icon { border-color: var(--blue-600); background: var(--blue-600); color: var(--white); }
.faq__a { padding: 0 56px var(--s-6) 0; color: var(--slate-600); max-width: 62ch; }

@media (max-width: 959px) {
  .faq__grid { grid-template-columns: minmax(0, 1fr); gap: var(--title-gap); }
}

/* ---------- 404 (§8, §10.1): camera that lost its signal ---------- */
.nosignal {
  display: flex;
  align-items: center;
  min-height: max(640px, 100svh);
  margin: var(--inset);
  padding-block: calc(var(--nav-top) + var(--nav-h) + var(--s-7)) var(--s-8);
  border-radius: var(--r-block);
  background: var(--ink-900);
  color: var(--white);
}
.nosignal > .container {
  max-width: calc(var(--container) + 2 * (var(--pad-x) - var(--inset)));
  padding-inline: calc(var(--pad-x) - var(--inset));
}
.nosignal__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: var(--s-7) var(--s-9);
  align-items: center;
}
.nosignal__osd {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--on-dark-72);
}
.nosignal__rec {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sky-400);
  animation: nosignal-blink 1.2s steps(2, jump-none) infinite;
}
.nosignal__title { margin-top: var(--s-5); color: var(--white); max-width: 12ch; }
.nosignal__lead { margin-top: var(--s-5); color: var(--on-dark-72); }
.nosignal__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-5) var(--s-7);
  margin-top: var(--s-7);
}

/* The illustration has a white background: it sits on a light panel, never on ink */
.nosignal__panel {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--sky-50);
  isolation: isolate;
}
.nosignal__art { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

/* Animated overlay (< 20 KB of SVG + CSS) */
.nosignal__overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nosignal__dots circle {
  fill: transparent;
  stroke: var(--blue-600);
  stroke-width: .4;
  transform-box: fill-box;
  transform-origin: center;
  animation: nosignal-dot 2.4s var(--ease) infinite;
  transition: fill var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.nosignal__scan {
  fill: var(--sky-400);
  opacity: .5;
  animation: nosignal-scan 6s linear infinite;
}

/* Signal comes back: hovering or focusing "Volver al inicio" fills the dots */
.nosignal:has(.nosignal__home:hover) .nosignal__dots circle,
.nosignal:has(.nosignal__home:focus-visible) .nosignal__dots circle {
  animation: none;
  fill: var(--sky-400);
  stroke: var(--sky-400);
  opacity: 1;
  transform: scale(1.25);
}
.nosignal:has(.nosignal__home:hover) .nosignal__scan,
.nosignal:has(.nosignal__home:focus-visible) .nosignal__scan { opacity: 0; }

@keyframes nosignal-dot {
  0%, 100% { opacity: .25; }
  40%      { opacity: 1; }
}
@keyframes nosignal-scan {
  from { transform: translateY(0); }
  to   { transform: translateY(100px); }
}
@keyframes nosignal-blink {
  0%   { opacity: 1; }
  100% { opacity: .2; }
}

@media (prefers-reduced-motion: reduce) {
  .nosignal__rec,
  .nosignal__dots circle,
  .nosignal__scan { animation: none; }
  .nosignal__scan { opacity: 0; }
}

@media (max-width: 959px) {
  .nosignal { min-height: 0; }
  .nosignal__grid { grid-template-columns: minmax(0, 1fr); }
  .nosignal__media { max-width: 440px; }
}

/* ---------- Single project sections (§8): spec, story, gallery, before/after ---------- */


/* ---------- 01 · "Lo que instalamos" (§8.1 v2.1): stacked, no empty column ----------
   H2 → lead description (62ch) → spec sheet below at full container width:
   a 2-column grid of rows on desktop, 1 column on mobile. */
.spec__desc { max-width: 62ch; color: var(--slate-600); }

.spec__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gutter);
  margin: 0;
}

.spec__row {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-content: start;
  gap: var(--s-2) var(--s-5);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
}

.spec__term {
  font-size: var(--fs-osd);
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: var(--ls-osd);
  text-transform: uppercase;
  color: var(--slate-600);
}

.spec__value {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-900);
}
.spec__value ul { margin: 0; padding: 0; list-style: none; }

@media (max-width: 767px) {
  .spec__list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 479px) {
  .spec__row { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
}

/* ---------- 02 · Reto · Solución · Resultado (editorial rows, not 3 cards) ---------- */
.story__list { margin: 0; border-top: 1px solid var(--line); }

/* Rows (§8.1 v2.1): label left (4 cols), content right (8 cols), no numbers.
   Reto / Solución: label on the first line of the text (first baseline).
   Resultado: label vertically centered with the big statement. */
.story__row {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: first baseline;
  gap: var(--s-4) var(--gutter);
  padding: var(--s-7) 0;
  border-bottom: 1px solid var(--line);
}
.story__row--result { align-items: center; }

.story__label {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--ls-h3-lg);
  color: var(--ink-900);
}

.story__text { color: var(--slate-600); max-width: 56ch; }

.story__result { display: flex; flex-direction: column; gap: var(--s-7); }

.story__statement {
  font-weight: 600;
  font-size: var(--fs-h2); /* h2 size (§8.1) */
  line-height: 1.1;
  letter-spacing: var(--ls-h2);
  color: var(--ink-900);
  max-width: 24ch;
}

.story__figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.story__figure {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5) var(--s-5) 0;
}
.story__figure:first-child { padding-left: 0; }
.story__figure + .story__figure { border-left: 1px solid var(--line); }
.story__figure-value {
  font-weight: 500;
  font-size: clamp(2.25rem, 1.9rem + 1.5vw, 3rem);
  line-height: 1;
  letter-spacing: var(--ls-stat);
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.story__figure-label { color: var(--slate-600); }

@media (max-width: 767px) {
  .story__row { grid-template-columns: minmax(0, 1fr); padding: var(--s-6) 0; }
  .story__row--result { align-items: start; }
  .story__figures { grid-template-columns: minmax(0, 1fr); }
  .story__figure { padding: var(--s-4) 0; }
  .story__figure + .story__figure { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- 03 · Gallery: asymmetric, captions with place + year ---------- */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "g1 g1 g1 g1 g1 g1 g1 g2 g2 g2 g2 g2"
    "g1 g1 g1 g1 g1 g1 g1 g3 g3 g3 g3 g3"
    "g4 g4 g4 g4 g4 g4 g4 g4 g4 g4 g4 g4";
  gap: var(--s-6) var(--gutter);
}
.gallery__item { margin: 0; display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.gallery__item:nth-child(1) { grid-area: g1; }
.gallery__item:nth-child(2) { grid-area: g2; }
.gallery__item:nth-child(3) { grid-area: g3; }
.gallery__item:nth-child(4) { grid-area: g4; }

.gallery__photo {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-card);
  overflow: hidden;
}
.gallery__item:nth-child(1) .gallery__photo { flex: 1 1 auto; aspect-ratio: auto; min-height: 360px; }
.gallery__item:nth-child(4) .gallery__photo { aspect-ratio: 21 / 9; }
.gallery__photo > * { width: 100%; height: 100%; object-fit: cover; }
.gallery__caption { display: flex; justify-content: space-between; gap: var(--s-4); color: var(--slate-600); }
.gallery__caption span:last-child { color: var(--slate-600); font-weight: 400; }

@media (max-width: 767px) {
  .gallery__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  .gallery__item:nth-child(n) { grid-area: auto; }
  .gallery__item:nth-child(1) .gallery__photo { aspect-ratio: 4 / 5; min-height: 0; }
  .gallery__item:nth-child(4) .gallery__photo { aspect-ratio: 4 / 3; }
}

/* ---------- 04 · Before / after slider ---------- */
.ba {
  --pos: 50%;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--mist);
  user-select: none;
  touch-action: pan-y;
}

.ba__layer { position: absolute; inset: 0; }
.ba__layer > * { width: 100%; height: 100%; object-fit: cover; }
.ba__layer--before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }

/* Placeholder labels sit at the bottom so the Antes/Después tags stay readable */
.ba .placeholder__label { top: auto; bottom: var(--s-4); }
.ba__layer--after .placeholder__label { left: auto; right: var(--s-4); text-align: right; }

.ba__tag {
  position: absolute;
  top: var(--s-4);
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-input);
  background: var(--white);
  color: var(--ink-900);
  box-shadow: var(--shadow-1);
  pointer-events: none;
}
.ba__tag strong { font-weight: 600; }
.ba__tag span { color: var(--slate-600); font-weight: 400; }
.ba__tag--before { left: var(--s-4); }
.ba__tag--after { right: var(--s-4); text-align: right; }

.ba__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 2;
  width: 2px;
  margin-left: -1px;
  background: var(--white);
  pointer-events: none;
}

.ba__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink-900);
  box-shadow: var(--shadow-2);
}
.ba__knob .icon { width: 14px; height: 14px; }

/* The native range covers the whole image: drag anywhere, arrow keys work */
.ba__range {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.ba__range::-webkit-slider-thumb { -webkit-appearance: none; width: 52px; height: 100%; cursor: ew-resize; }
.ba__range::-moz-range-thumb { width: 52px; height: 100%; border: 0; cursor: ew-resize; }

.ba:has(.ba__range:focus-visible) .ba__knob { outline: 2px solid var(--blue-600); outline-offset: 2px; }

.compare__hint { margin-top: var(--s-3); color: var(--slate-600); }

@media (max-width: 767px) {
  .ba { aspect-ratio: 4 / 3; }
  .ba__tag span { display: none; }
  .ba .placeholder__label { display: none; } /* two long labels would collide */
}


