/* Paris, Taxes — estilo compartido */

:root {
  --paper: #fff;
  --ink: #111;
  --muted: #8a8a8a;
  --line: #dcdcdc;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --pad: clamp(16px, 2.5vw, 32px);
}

/* Transición animada entre páginas (navegadores que la soportan) */
@view-transition {
  navigation: auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Evita que reglas antiguas (p. ej. del tema de WordPress) cambien la fuente */
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div,
footer,
button,
input {
  font-family: var(--sans);
}

/* Texto pequeño de metadatos: fechas, categorías, números */
.meta {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.muted {
  color: var(--muted);
}

/* ---------- Cabecera ---------- */
/* Texto blanco + mix-blend-mode: difference => se ve bien sobre el vídeo
   y se vuelve oscuro sobre el fondo blanco al hacer scroll. */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--pad);
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}

.site-header a {
  pointer-events: auto;
}

.site-title {
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: clamp(14px, 2.5vw, 32px);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav a {
  position: relative;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ---------- Hero con vídeo ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  background: #000;
  overflow: hidden;
}

.hero video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-cue {
  position: absolute;
  left: var(--pad);
  bottom: var(--pad);
  color: #fff;
  mix-blend-mode: difference;
}

.hero-cue span {
  display: inline-block;
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

/* ---------- Rejilla de celdas ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  padding: calc(var(--pad) * 1.5) var(--pad) 14px;
}

/* Celdas compactas: varias por fila, imagen pequeña en formato apaisado */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin: 0 var(--pad);
}

.cell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s ease;
}

.cell:hover {
  background: #f6f6f6;
}

.cell-meta {
  display: flex;
  justify-content: space-between;
}

/* La última línea de la celda (la fecha) se pega siempre abajo,
   a la misma distancia de la línea inferior, sea cual sea el título */
.cell > :last-child {
  margin-top: auto;
}

.cell figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eee;
}

.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cell:hover img {
  transform: scale(1.05);
}

.cell h2 {
  margin: 0;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.cell h2 span {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cell:hover h2 span {
  background-size: 100% 1px;
}

/* ---------- Pie ---------- */
.site-footer {
  margin-top: clamp(80px, 14vw, 180px);
  padding: var(--pad);
}

/* ---------- Aparición al hacer scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Páginas interiores ---------- */
.page-top {
  padding-top: clamp(72px, 9vw, 104px);
}

.cell[hidden] {
  display: none;
}

/* ---------- Temas: fotos unidas por cables ---------- */
.temas {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.cables {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cables line {
  stroke: #9a9a9a;
  stroke-width: 0.7;
}

/* La posición la pone el JS con transform; left/top se quedan en 0 */
.nodo {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(96px, var(--w, 16vw), 280px);
  will-change: transform;
}

.nodo:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

/* Marcador de posición: un rectángulo gris. Sustitúyelo por <img> cuando
   tengas la foto (ver comentario en temas/index.html). */
.nodo-img {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--ar, 4 / 3);
  background: var(--tono, #d6d6d6);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.nodo-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.6s ease;
}

/* Textura de líneas finas, como en la referencia */
.nodo-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.28) 0 1px,
    transparent 1px 3px
  );
  pointer-events: none;
}

.nodo-label {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 8px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.nodo:hover .nodo-img,
.nodo:focus-visible .nodo-img,
.nodo.activo .nodo-img {
  transform: scale(1.04);
}

.nodo:hover img,
.nodo:focus-visible img,
.nodo.activo img {
  filter: none;
}

.nodo:hover .nodo-label,
.nodo:focus-visible .nodo-label,
.nodo.activo .nodo-label {
  opacity: 1;
  transform: none;
}

.temas-pie {
  position: absolute;
  left: var(--pad);
  bottom: var(--pad);
}

/* ---------- About: cintas de fotos ---------- */
.cintas {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vw, 20px);
  overflow: hidden;
}

.cinta {
  --alto: clamp(120px, 21vh, 230px);
  overflow: hidden;
}

.cinta-pista {
  display: flex;
  gap: clamp(10px, 1.6vw, 20px);
  width: max-content;
  animation: cinta var(--dur, 60s) linear infinite;
  will-change: transform;
}

/* La de abajo va a otra velocidad (se ajusta con --dur en el HTML) */
.cinta:hover .cinta-pista {
  animation-play-state: paused;
}

@keyframes cinta {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(var(--shift, 1000px) * -1));
  }
}

.foto {
  position: relative;
  flex: none;
  height: var(--alto);
  aspect-ratio: var(--ar, 4 / 3);
  overflow: hidden;
  background: var(--tono, #d6d6d6);
}

.foto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}

.foto::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.28) 0 1px,
    transparent 1px 3px
  );
  pointer-events: none;
}

/* ---------- About: texto ---------- */
.about-texto {
  max-width: 640px;
  margin: clamp(48px, 8vw, 96px) var(--pad) 0;
  font-size: 17px;
  line-height: 1.65;
}

.about-texto p {
  margin: 0 0 1.2em;
}

.about-texto .meta {
  display: block;
  margin-bottom: 20px;
}

/* ---------- Entrada (artículo) ---------- */
.entrada {
  width: calc(100% - var(--pad) * 2);
  max-width: 640px;
  margin: 0 auto;
  padding-top: clamp(24px, 4vw, 56px);
}

.entrada-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.entrada h1 {
  margin: 0 0 clamp(24px, 4vw, 40px);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.entrada figure {
  margin: 0 0 clamp(24px, 4vw, 40px);
  overflow: hidden;
  background: #eee;
}

.entrada figure img {
  display: block;
  width: 100%;
  max-height: 60vh;
  object-fit: cover;
}

.entrada figcaption {
  padding-top: 8px;
}

.entrada-texto {
  font-size: 17px;
  line-height: 1.7;
}

.entrada-texto p {
  margin: 0 0 1.3em;
}

.entrada-texto a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entrada-texto h2 {
  margin: 2em 0 0.6em;
  font-size: 17px;
  font-weight: 600;
}

.entrada-texto blockquote {
  margin: 1.6em 0;
  padding-left: 16px;
  border-left: 1px solid var(--ink);
}

.entrada-texto img {
  display: block;
  max-width: 100%;
  margin: 1.6em 0;
}

.entrada-volver {
  display: inline-block;
  margin-top: clamp(32px, 5vw, 64px);
}

/* ---------- About: shuffle ---------- */
.shuffle-btn {
  margin-top: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.shuffle-btn:hover,
.shuffle-btn:focus-visible {
  background: var(--ink);
  color: #fff;
}

.shuffle-nota {
  display: inline-block;
  margin-left: 12px;
}

/* Aviso de fotosensibilidad */
.shuffle-aviso {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--pad);
  background: #fff;
}

.shuffle-aviso-caja {
  max-width: 440px;
}

.shuffle-aviso-signo {
  margin-bottom: 20px;
  font-size: clamp(56px, 12vw, 96px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.shuffle-aviso-titulo {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
}

.shuffle-aviso-texto {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.6;
}

.shuffle-aviso-botones {
  display: flex;
  gap: 12px;
}

.shuffle-aviso-botones button {
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.shuffle-aviso-botones button:hover,
.shuffle-aviso-botones button:focus-visible {
  background: var(--ink);
  color: #fff;
}

.shuffle {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: #fff;
}

.shuffle.verde {
  background: #8ace00; /* verde brat */
}

.shuffle .foto {
  position: absolute;
  height: auto;
}

.shuffle-cerrar {
  position: fixed;
  left: var(--pad);
  bottom: var(--pad);
  z-index: 101;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  color: #fff;
  background: var(--ink);
  border: 0;
  cursor: pointer;
}

/* ---------- Accesibilidad ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}