@import url('https://fonts.googleapis.com/css2?family=Baskervville:ital,wght@0,400;1,400&family=Hind:wght@300;400;500;600;700&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');

/* ─── VARIABLES ─── */
:root {
  --w:    #fafaf8;
  --k:    #111;
  --mid:  #888;
  --line: #e0e0dc;
  --bg:   #fafaf8;
  --nav-h: 52px; /* altura real del nav; JS la actualiza al envolver/redimensionar */
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }

body {
  background: var(--w);
  color: var(--k);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}

a { color:inherit; text-decoration:none; }
img, video { max-width:100%; display:block; }

/* ─── NAV ─── */
#nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 300;
  padding: 0.6rem 2.4rem;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 1.5rem;
  row-gap: 0.35rem;
  transition: background 0.4s, color 0.4s;
}

#nav.light { color: var(--w); background: transparent; }
#nav.dark  { color: var(--k); background: var(--w); border-bottom: 1px solid var(--line); }

/* En páginas sin portada a sangre (home y ficha la usan), el nav ocupa su
   espacio en el flujo en vez de superponerse: así el contenido NUNCA queda
   tapado, por muchas líneas que ocupe el menú, sin depender de JS. */
body:not(.page-home):not(.page-obra) #nav {
  position: sticky;
  inset: 0 0 auto;
}

.nav-id { display:flex; flex-direction:column; line-height:1.3; flex-shrink:0; }

.nav-name {
  font-family: 'Hind', sans-serif;
  font-size: 0.98rem;
  font-weight: 400;
}

.nav-sub {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.45;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem 1.8rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
  transition: opacity 0.15s;
}

.nav-links a:hover, .nav-links a.on { opacity:1; }
.nav-links a.on { border-bottom: 1px solid currentColor; }

.nav-lang {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  opacity: 0.5;
}

/* ─── HERO ─── */
.hero {
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--k);
  cursor: pointer;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: #111;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}

.hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

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

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 70% 40%, rgba(255,60,0,0.08) 0%, transparent 70%),
    linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
}

.hero-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4rem 2.4rem 3.5rem;
  color: var(--w);
}

.hero-eyebrow {
  font-size: 0.56rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-eyebrow::before {
  content: '';
  width: 32px; height: 1px;
  background: currentColor;
  opacity: 0.7;
  display: block;
}

.hero-title {
  font-family: 'Baskervville', serif;
  font-size: clamp(3.5rem, 8vw, 9rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 2.5rem;
}

.hero-title em { font-style:italic; color:rgba(255,255,255,0.7); }

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.hero-meta {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  opacity: 0.4;
  line-height: 1.8;
}

.hero-cta {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--w);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 0.6rem 1.4rem;
  transition: background 0.2s, border-color 0.2s;
}

.hero-cta:hover { background:rgba(255,255,255,0.12); border-color:rgba(255,255,255,0.7); }

/* ─── GRID SECTION ─── */
.grid-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 10;
  background: var(--w);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 2.4rem;
}

.grid-bar-label {
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
}

.filters { display:flex; gap:0; }

.filters button, .filters a {
  font-family: 'DM Mono', monospace;
  font-size: 0.54rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.filters button:hover, .filters a:hover { color:var(--k); }
.filters button.on, .filters a.on { color:var(--k); border:1px solid var(--line); }

/* IMAGE GRID */
.img-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px;
}

.img-row {
  display: flex;
  gap: 2px;
  width: 100%;
}

.img-row .cell {
  flex-shrink: 0;
  flex-grow: 0;
}

.cell {
  position: relative;
  overflow: hidden;
  background: #eee;
  cursor: pointer;
  display: block;
  color: var(--w);
}

.cell-img, .cell-placeholder {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
}

.cell-placeholder { background: #2a2520; }

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

.cell::after {
  content:'';
  position:absolute; inset:0;
  background:rgba(0,0,0,0);
  transition:background 0.3s;
}

.cell:hover::after { background:rgba(0,0,0,0.08); }
.cell:hover .cell-img { transform:scale(1.03); }

.cell-info {
  position: absolute;
  bottom:0; left:0; right:0;
  padding: 1.2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 2;
}

.cell:hover .cell-info { opacity:1; transform:translateY(0); }

.cell-cat {
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.3rem;
}

.cell-title {
  font-family: 'Baskervville', serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
}

/* Grid column/height helpers */
.c3  { grid-column: span 3; }
.c4  { grid-column: span 4; }
.c5  { grid-column: span 5; }
.c6  { grid-column: span 6; }
.c7  { grid-column: span 7; }
.c8  { grid-column: span 8; }
.c12 { grid-column: span 12; }

/* aspect-ratio se aplica inline en cada celda */

/* ─── PROJECT COVER ─── */
.proj-cover {
  height: 90vh;
  min-height: 480px;
  position: relative;
  overflow: hidden;
  background: var(--k);
}

.proj-cover-media {
  position: absolute;
  inset: 0;
  width:100%; height:100%;
  object-fit: cover;
  background-size: cover;
  background-position: center;
}

.proj-cover-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom, transparent 30%, rgba(0,0,0,0.75) 100%
  );
}

.proj-cover-text {
  position: absolute;
  bottom:0; left:0; right:0;
  padding: 3rem 2.4rem;
  color: var(--w);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-end;
  gap: 4rem;
}

.proj-cover-cat {
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.3rem 0.8rem;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.proj-cover-title {
  font-family: 'Baskervville', serif;
  font-size: clamp(2.8rem, 5.5vw, 6.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.proj-cover-title em { font-style:italic; opacity:0.75; }
.proj-cover-sub { font-family:'Baskervville',serif; font-style:italic; font-size:1.1rem; opacity:0.6; margin-top:0.8rem; }

.proj-cover-meta {
  text-align: right;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  line-height: 2;
  opacity: 0.5;
  flex-shrink: 0;
}

/* Back bar */
.proj-back {
  position: sticky;
  top: var(--nav-h);
  z-index: 10;
  background: var(--w);
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 2.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-btn {
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.back-btn:hover { color:var(--k); }

.proj-counter {
  font-size: 0.54rem;
  letter-spacing: 0.15em;
  color: var(--mid);
  text-transform: uppercase;
}

/* ─── CABECERA DE OBRA: subtítulo + ficha en 2 col ─── */
.proj-header {
  /* Sin borde inferior propio — el primer bloque lo separa */
}

/* Contenedor compartido — centrado */
.proj-header-inner,
.proj-block-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2.4rem;
}

.proj-header-inner {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4rem;
  align-items: start;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.proj-subtitle {
  font-family: 'Hind', sans-serif;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--k);
  padding-top: 0.15rem;
}

/* ─── BLOQUES DE CONTENIDO ─── */
.proj-block { border-bottom: 1px solid var(--line); }

.proj-block--text { }

.proj-richtext {
  font-family: 'Hind', sans-serif;
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.8;
  color: var(--k);
}

.proj-richtext p + p { margin-top:1.3em; }
.proj-richtext em { font-style:italic; }
.proj-richtext a { text-decoration:underline; text-underline-offset:3px; }
.proj-richtext img { max-width:100%; margin: 1.5em 0; }

.proj-block--gallery { }

.proj-fact {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.proj-fact:first-child { padding-top: 0; }
.proj-fact:last-child  { border-bottom: none; padding-bottom: 0; }

.fact-label {
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
}

.fact-val {
  font-family: 'Hind', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
}

/* Media gallery */
.proj-imgs {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  padding: 2px;
}

.media-row { grid-column: span 12; display:contents; }
.media-row.c1 .media-block { grid-column: span 12; }
.media-row.c2 .media-block { grid-column: span 6; }
.media-row.c3 .media-block { grid-column: span 4; }

.media-block {
  overflow: hidden;
  background: var(--line);
  grid-column: span 12;
}

.media-block img, .media-block video {
  width:100%; display:block; object-fit:cover;
}

.media-caption {
  font-size: 0.55rem;
  letter-spacing: 0.09em;
  color: var(--mid);
  padding: 0.5rem;
}

/* Prev/Next */
.proj-nav {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
}

.proj-nav-item { padding: 2rem 2.4rem; transition:background 0.15s; }
.proj-nav-item:hover { background:var(--line); }
.proj-nav-next { text-align:right; }
.proj-nav-divider { background:var(--line); }

.proj-nav-label {
  font-size: 0.54rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.6rem;
}

.proj-nav-title {
  font-family: 'Hind', sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
}

/* ─── TEXT PAGE ─── */
.text-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 3.5rem 2.4rem 6rem;
}

.text-page-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2rem;
  margin-bottom: 3rem;
}

/* 
 TAMAÑO DE TITULOS DE SECCIONES DE TEXTO
   Tamaño unificado de los títulos de secciones sin hero
   (Bio/Contacto, Publicaciones, Proyectos educativos, Presentaciones).
   Cambiar el font-size aquí afecta a las tres. */
.text-page-title,
.pub-title,
.sec-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
}

.text-page-title {
  font-family: 'Hind', sans-serif;
  font-weight: 400;
  line-height: 1.05;
}

.text-page-body {
  font-family: 'Hind', sans-serif;
  font-size: 1.1rem;
  line-height: 1.8;
}

.text-page-body p + p { margin-top:1.3em; }
.text-page-body a { text-decoration:underline; text-underline-offset:3px; }

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--line);
  padding: 2.6rem 2.4rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem 3rem;
  align-items: start;
}

.footer-id {
  font-family: 'Hind', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-id span {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  margin-top: 0.2rem;
}

/* Alinea el título de columna con la línea gris del bloque de identidad
   (altura de la 1ª línea del nombre: 0.9rem × 1.5 + margen del subtítulo). */
.footer-col {
  margin-top: 1.55rem;
}

.footer-col-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  opacity: 0.7;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col a {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--k); }

/* ─── 404 ─── */
.error-404 {
  padding: 12rem 2.4rem;
  text-align: center;
}

.error-404 h1 {
  font-family: 'Hind', sans-serif;
  font-size: 8rem;
  font-weight: 400;
  opacity: 0.15;
}

.error-404 p { margin-top:2rem; font-size:0.7rem; letter-spacing:0.15em; }

/* ─── RESPONSIVE ─── */
@media (max-width:900px) {
  .c8 { grid-column:span 12; }
  .c5, .c7 { grid-column:span 12; }
  .c4, .c6 { grid-column:span 6; }
  .proj-cover-text { grid-template-columns:1fr; }
  .proj-header-inner { grid-template-columns:1fr; gap:0; }
  .proj-header-inner > * { padding-bottom: 1.5rem; }
}

@media (max-width:640px) {
  .c3, .c4, .c5, .c6 { grid-column:span 12; }
  .hero-title { font-size:3.2rem; }
  .nav-links { gap:1.2rem;}
  .filters { flex-wrap:wrap; }
  .img-row {
    flex-direction: column;
    height: auto !important;
  }
  .img-row .cell {
    width: 100% !important;
    height: 260px !important;
  }
}

/* ─── PROJ HEADER RESPONSIVE ─── */
@media (max-width:760px) {
  .proj-header-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 2rem 1.4rem;
  }
  .proj-header-ficha { margin-top: 1.5rem; }
  .proj-block-inner { padding: 2.5rem 1.4rem; }
}

/* ─── NAV RESPONSIVE ─── */
@media (max-width:760px) {
  #nav {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.9rem 1.4rem 0.8rem;
    gap: 0.6rem;
  }
  .nav-id {
    width: 100%;
  }
  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.6rem 1.4rem;
    padding-bottom: 0.2rem;
  }
}

/* ─── FOOTER RESPONSIVE ─── */
@media (max-width:760px) {
  footer {
    padding: 2rem 1.4rem;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem 2rem;
  }
  .footer-id {
    grid-column: 1 / -1;
  }
  .footer-col {
    margin-top: 0; /* apiladas: sin desplazamiento */
  }
}

/* ─── RELATED WORKS ─── */
.related-works {
  border-top: 1px solid var(--line);
  padding: 3rem 2.4rem;
}

.related-label {
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.related-cell {
  display: block;
  text-decoration: none;
  color: inherit;
}

.related-cell:hover .related-thumb { transform: scale(1.02); }
.related-cell:hover .related-title  { text-decoration: underline; text-underline-offset:3px; }

.related-thumb {
  aspect-ratio: 4/3;
  background-size: cover;
  background-position: center;
  background-color: var(--line);
  border-radius: 3px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
}

.related-thumb-empty { background-color: #2a2520; }

.related-cat {
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.3rem;
}

.related-title {
  font-family: 'Hind', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
}

/* ─── COOKIES BANNER ─── */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 500;
  background: var(--k);
  color: var(--w);
  padding: 1rem 2.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

#cookie-banner.hidden { transform: translateY(110%); }

#cookie-banner a { color: var(--w); text-decoration: underline; text-underline-offset: 2px; }

#cookie-accept {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--w);
  color: var(--k);
  border: none;
  padding: 0.45rem 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

#cookie-accept:hover { opacity: 0.8; }

/* ─── TOP OFFSET RESPONSIVE ─── */
@media (max-width:760px) {
  /* .grid-bar y .proj-back usan top:var(--nav-h), que JS mantiene
     sincronizado con la altura real del nav aunque envuelva. */
  .hero { min-height: 100svh; }
}

/* ─── GRID BAR RESPONSIVE ─── */
@media (max-width:760px) {
  .grid-bar {
    justify-content: flex-start;
    padding: 0.7rem 1.4rem;
  }
  .grid-bar-label {
    display: none;
  }
  .filters {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .filters button {
    padding: 0.3rem 0.7rem;
  }
}

/* ─── PUBLICACIONES ─── */
.pub-header {
  max-width: 960px;
  margin: 0 auto;
  padding: 3.5rem 2.4rem 0;
}
.pub-header-inner {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2rem;
  margin-bottom: 0;
}
.pub-title {
  font-family: 'Hind', sans-serif;
  font-weight: 400;
  line-height: 1.05;
  color: var(--k);
}

.pub-list {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2.4rem 6rem;
}

.pub-empty {
  padding: 4rem 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--mid);
}

.pub-item {
  border-bottom: 1px solid var(--line);
}
.pub-item:last-child { border-bottom: none; }

.pub-item-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  padding: 3rem 0;
}

.pub-media {
  position: relative;
  overflow: hidden;
  background: var(--line);
  border-radius: 2px;
}
.pub-media-el {
  width: 100%;
  display: block;
  object-fit: cover;
}
.pub-media-empty {
  aspect-ratio: 4/3;
  background: #e8e8e4;
}

.pub-gallery-trigger { position:relative; cursor:pointer; }
.pub-gallery-count {
  position:absolute; bottom:0.5rem; right:0.5rem;
  background:rgba(0,0,0,.65); color:#fff;
  font-size:0.65rem; padding:0.2rem 0.5rem;
  border-radius:2px; letter-spacing:0.05em;
}

/* Lightbox */
.pub-lb {
  display:none; position:fixed; inset:0; z-index:9999;
  background:rgba(0,0,0,.9);
  align-items:center; justify-content:center;
}
.pub-lb.active { display:flex; }
.pub-lb-inner { position:relative; max-width:90vw; max-height:90vh; display:flex; align-items:center; justify-content:center; }
.pub-lb-img { max-width:90vw; max-height:85vh; object-fit:contain; display:block; }
.pub-lb-close {
  position:fixed; top:1.5rem; right:1.5rem;
  background:none; border:none; color:#fff;
  font-size:2rem; cursor:pointer; line-height:1;
}
.pub-lb-prev, .pub-lb-next {
  position:fixed; top:50%; transform:translateY(-50%);
  background:none; border:none; color:#fff;
  font-size:3rem; cursor:pointer; padding:0 1rem; line-height:1;
}
.pub-lb-prev { left:1rem; }
.pub-lb-next { right:1rem; }
.pub-lb-counter {
  position:fixed; bottom:1.5rem; left:50%; transform:translateX(-50%);
  color:rgba(255,255,255,.7); font-size:0.7rem; letter-spacing:0.1em;
}

.pub-content { padding-top: 0.25rem; }

.pub-fecha {
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 1rem;
}

.pub-body {
  font-family: 'Hind', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  color: var(--k);
}
.pub-body p + p { margin-top: 1em; }
.pub-body a { text-decoration: underline; text-underline-offset: 3px; }
.pub-body img { max-width: 100%; margin: 1em 0; }

@media (max-width: 760px) {
  .pub-item-inner {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 2rem 0;
  }
  .pub-header { padding: 2.5rem 1.4rem 0; }
  .pub-list { padding: 0 1.4rem 4rem; }
}

/* ─── CONTACT FORM  ([@MAIL@]) ─── */
.cmail {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 3.5rem;
  margin: 2.5rem 0;
  align-items: start;
  font-family: 'Hind', sans-serif;
}
.cmail-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 1.1rem;
}
.cmail-aside-block { margin-bottom: 2.4rem; }
.cmail-aside-link {
  font-family: 'Hind', sans-serif;
  font-size: 1.25rem;
  color: var(--k);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  word-break: break-word;
}
.cmail-aside-social { font-size: 1.25rem; }
.cmail-aside-social a {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.cmail-aside-social a:hover { opacity: 0.6; }
.cmail-dot { color: var(--mid); margin: 0 0.15rem; }

.cmail-field { margin-bottom: 1.6rem; }
.cmail-label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.55rem;
}
.cmail-input {
  width: 100%;
  font-family: 'Hind', sans-serif;
  font-size: 1.05rem;
  color: var(--k);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.cmail-input:focus { border-color: var(--k); }
.cmail-textarea { resize: vertical; min-height: 150px; line-height: 1.6; }

.cmail-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 1.6rem 0 1.7rem;
  font-size: 0.98rem;
  color: var(--mid);
  cursor: pointer;
}
.cmail-check input {
  width: 18px; height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--k);
  cursor: pointer;
}
.cmail-check a {
  color: var(--k);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cmail-submit {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--w);
  background: var(--k);
  border: 1px solid var(--k);
  padding: 1rem 2.1rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.cmail-submit:hover { opacity: 0.82; }
.cmail-submit:disabled { opacity: 0.5; cursor: default; }

.cmail-status {
  display: none;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
  background: #f3f3f0;
  border-left: 3px solid var(--mid);
}
.cmail-status.on { display: block; }
.cmail-status.ok { border-left-color: #5c7a5c; color: #3f5a3f; }
.cmail-status.err { border-left-color: #b3564b; color: #8a3a32; }

/* honeypot antispam: fuera de pantalla */
.cmail-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 760px) {
  .cmail { grid-template-columns: 1fr; gap: 2.2rem; }
}

/* ═══════════════════════════════════════════════════════════
   SECCIONES  ·  Proyectos educativos / Presentaciones
   Rejilla de tarjetas (fecha · tipo, imagen, título, texto, meta)
═══════════════════════════════════════════════════════════ */
.sec-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 2.4rem 0;
}
.sec-header-inner {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2rem;
}
.sec-title {
  font-family: 'Hind', sans-serif;
  font-weight: 400;
  line-height: 1.05;
  color: var(--k);
}
.sec-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--mid);
}

.sec-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.6rem 2.4rem 6rem;
}
.sec-empty {
  padding: 4rem 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--mid);
}

.sec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.2rem 2.6rem;
}

.sec-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

/* fila superior: fecha · etiqueta de tipo */
.sec-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.sec-card-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
}
/* media */
.sec-card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--line);
  margin-bottom: 1.3rem;
}
.sec-card-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
}
.sec-card-img--empty { background-color: #2a2520; }
.sec-card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sec-card:hover .sec-card-img { transform: scale(1.04); }

/* título */
.sec-card-title {
  font-family: 'Baskervville', serif;
  font-weight: 400;
  font-size: 1.55rem;
  line-height: 1.15;
  color: var(--k);
  margin-bottom: 0.7rem;
}
.sec-card:hover .sec-card-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* texto */
.sec-card-text {
  font-family: 'Hind', sans-serif;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #4a4a46;
  margin-bottom: 1.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* meta inferior: etiqueta / valor */
.sec-card-meta {
  display: flex;
  gap: 2.4rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.sec-card-metacol {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sec-card-metalabel {
  font-family: 'DM Mono', monospace;
  font-size: 0.54rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
}
.sec-card-metaval {
  font-family: 'DM Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--k);
}

@media (max-width: 980px) {
  .sec-grid { grid-template-columns: repeat(2, 1fr); gap: 2.6rem 2rem; }
}
@media (max-width: 760px) {
  .sec-header { padding: 2.5rem 1.4rem 0; }
  .sec-wrap { padding: 2rem 1.4rem 4rem; }
}
@media (max-width: 560px) {
  .sec-grid { grid-template-columns: 1fr; gap: 2.4rem; }
}
