/* ──────────────────────────────────────────────────────────────
   J. Carlos Garvía — web (estética del sitio original, código limpio)
   ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --text: #ffffff;
  --text-dim: #c0c0c0;
  --text-soft: #8a8a8a;
  --accent: #c9a96e;
  --link: #ffffff;
  --link-hover: #c9a96e;
  --bg-overlay: rgba(0,0,0,0.55);
  --tile-bg: #1a1a1a;
  --tile-border: #2a2a2a;
}

html, body { height: 100%; }
body {
  background: #000;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  /* Fade transition entre páginas */
  opacity: 1;
  transition: opacity 0.6s ease;
}
body.is-leaving { opacity: 0; }

a { color: var(--link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--link-hover); }

img { display: block; max-width: 100%; border: 0; }

/* ── Cabecera con el nombre y el botón "atrás" ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 0;
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}
.back-btn {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  transition: all 0.25s;
  background: rgba(255,255,255,0.05);
}
.back-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.name-img { height: 55px; width: auto; }

/* ── Layout principal centrado ── */
main.center { max-width: 760px; margin: 0 auto; padding: 0.25rem 1rem 1rem; }

/* ── Bloques tipo "hover_block" del original ── */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 300px);
  gap: 20px;
  justify-content: center;
  margin: 0 auto 1.5rem;
}
.tiles + .tiles { margin-top: 1.5rem; }
main.center > .tiles:first-of-type { margin-top: 0; }
.tile {
  position: relative;
  width: 300px;
  height: 182px;
  background: var(--tile-bg);
  border: 3px solid #666;
  overflow: hidden;
  display: block;
  color: var(--text-dim);
}
.tile-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  z-index: 2;
}
/* Animación slide vertical para la primera fila */
.tile.slide-down:hover .tile-img { transform: translateY(100%); }
/* Animación slide horizontal para la segunda fila (como el original) */
.tile.slide-right:hover .tile-img { transform: translateX(100%); }

.tile-info {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tile-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dim);
}
.tile-info p {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ── Enlaces de menú secundario (Curriculum / Vídeos) ── */
.menu-row {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin: 2rem auto 1rem;
  flex-wrap: wrap;
}
.menu-row a {
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  padding-bottom: 4px;
  transition: all 0.25s;
}
.menu-row a:hover { color: var(--accent); border-color: var(--accent); }

.email-row {
  text-align: center;
  margin: 1.5rem 0 3rem;
  font-size: 0.9rem;
}
.email-row a { color: #fff; }
.email-row a:hover { color: var(--accent); }

/* ── Cards de página interior (curriculum, mi-obra, videos) ── */
.panel {
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 2.5rem 2rem;
  margin: 1rem auto 1rem;
  max-width: 760px;
  border-radius: 4px;
  backdrop-filter: blur(2px);
}
.panel h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--accent);
  margin: 1.8rem 0 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201,169,110,0.3);
  letter-spacing: 0.02em;
}
.panel h2:first-child { margin-top: 0; }
.panel p { margin-bottom: 0.6rem; }

/* ── Lista de exposiciones del curriculum ── */
.expos {
  list-style: none;
  margin: 1rem 0 2rem;
}
.expos > li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.expos .year {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}
.expos .info { font-size: 0.88rem; line-height: 1.5; }
.expos .info .tag {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid rgba(201,169,110,0.4);
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Tablas a 2 columnas (concursos, cursos) */
.two-col {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1.5rem;
  margin: 1rem 0 1.5rem;
  font-size: 0.85rem;
}
.two-col li {
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
  font-weight: 600;
}

/* ── Citas / opiniones ── */
.quote {
  border-left: 2px solid var(--accent);
  padding: 0.4rem 0 0.4rem 1.4rem;
  margin: 1.6rem 0;
}
.quote p {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #e8e2d2;
  margin-bottom: 0.6rem;
}
.quote cite {
  display: block;
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.quote cite span { color: var(--text-soft); font-weight: 400; }

/* ── Galería de páginas internas ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto 4rem;
  padding: 0 1rem;
}
.gallery-item {
  display: block;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid #444;
  background: #1a1a1a;
  cursor: zoom-in;
  transition: border-color 0.3s, transform 0.3s;
}
.gallery-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.gallery-item:hover img { transform: scale(1.06); }

/* ── Videos ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
}
.video-grid video {
  width: 100%;
  background: #000;
  border: 2px solid #333;
}
.video-caption {
  text-align: center;
  font-style: italic;
  color: var(--text-dim);
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

/* ──────────────────────────────────────────────────────────────
   Galería con canvas grande + thumbnails (estilo original)
   ────────────────────────────────────────────────────────────── */
.canvas-wrap {
  max-width: 760px;
  margin: 0.5rem auto 1.5rem;
  padding: 0 1rem;
}
.canvas-wrap--tight { margin-top: 0; margin-bottom: 0.6rem; }
.canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border: 0;
  overflow: hidden;
  cursor: zoom-in;
  user-select: none;
}
.canvas .display-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
  transition: opacity 0.4s;
}
.canvas .zoom-lens {
  position: absolute; inset: 0;
  background-repeat: no-repeat;
  background-size: 220%;
  background-color: #000;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.canvas.zooming { cursor: zoom-out; }
.canvas.zooming .zoom-lens { opacity: 1; }
/* Lista de thumbnails */
.thumblist {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  max-width: 1000px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}
.thumblist a {
  display: block;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid #333;
  background: #1a1a1a;
  transition: border-color 0.25s, transform 0.25s;
}
.thumblist a img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.thumblist a:hover { border-color: rgba(201,169,110,0.5); transform: translateY(-2px); }
.thumblist a.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201,169,110,0.3);
}

@media (max-width: 700px) {
  .canvas { aspect-ratio: 3 / 4; }
  .thumblist { grid-template-columns: repeat(5, 1fr); }
}

/* ── Layout lado a lado: canvas a la izquierda, thumbs a la derecha ── */
.gallery-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  max-width: 1200px;
  margin: 0.5rem auto 2rem;
  padding: 0 1rem;
}
.gallery-split .canvas-wrap {
  max-width: none;
  margin: 0;
  padding: 0;
  aspect-ratio: 4 / 3;
}
.gallery-split .thumblist {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  aspect-ratio: 4 / 3;
  max-width: none;
  margin: 0;
  padding: 0;
  gap: 6px;
  height: auto;
}
.gallery-split .thumblist li {
  min-width: 0;
  min-height: 0;
}
.gallery-split .thumblist a {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
}
@media (max-width: 800px) {
  .gallery-split {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .gallery-split .canvas-wrap { aspect-ratio: 4 / 3; }
  .gallery-split .thumblist {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto;
    aspect-ratio: auto;
    height: auto;
  }
  .gallery-split .thumblist a {
    aspect-ratio: 1;
    height: auto;
  }
}

/* ──────────────────────────────────────────────────────────────
   Tabla de grabados (13 columnas con título en la primera)
   ────────────────────────────────────────────────────────────── */
.grabados-main { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

.grabados-tbl {
  width: 100%;
  max-width: 1000px;
  margin: 0.6rem auto 2rem;
  border-collapse: collapse;
  table-layout: fixed;
  border: 2px solid #fff;
}
.grabados-tbl td {
  border: 2px solid #fff;
  padding: 0;
  vertical-align: middle;
  text-align: center;
}
.grabados-tbl .grabados-row-title {
  width: 90px;
  font-size: 0.82rem;
  font-weight: 400;
  color: #fff;
  line-height: 1.2;
  padding: 4px 2px;
  background: #000;
}
.grabados-tbl .grabados-cell {
  width: calc((100% - 90px) / 12);
  background: #000;
}
.grabados-thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 60 / 51;
  overflow: hidden;
  background: #000;
}
.grabados-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.grabados-thumb:hover { outline: 1px solid #c9a96e; outline-offset: -1px; }
.grabados-thumb.active { outline: 2px solid red; outline-offset: -2px; }

@media (max-width: 700px) {
  .grabados-tbl .grabados-row-title { width: 70px; font-size: 0.7rem; }
  .grabados-tbl .grabados-cell { width: calc((100% - 70px) / 6); }
}

/* ── Lightbox compartido ── */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.94);
  display: none;
  align-items: center; justify-content: center;
  padding: 3rem;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: lb-fade 0.4s ease;
}
@keyframes lb-fade { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.lightbox-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff; font-size: 1.4rem;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}
.lightbox-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-close { position: absolute; top: 1rem; right: 1rem; transform: none; }
.lightbox-counter {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  color: var(--text-soft); font-size: 0.8rem; letter-spacing: 0.1em;
}

/* ── Navegación entre galerías (flechas inferiores) ── */
.gallery-nav {
  text-align: center;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

/* ── Enlace de continuación al final de una sección (curriculum, mi-obra) ── */
.next-link { margin-top: 2rem; }
.next-link--center { text-align: center; }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  letter-spacing: 0.05em;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { width: 100%; max-width: 360px; margin: 0 auto; }
  .menu-row { gap: 2rem; }
  .panel { padding: 1.5rem 1rem; }
  .expos > li { grid-template-columns: 60px 1fr; gap: 0.6rem; }
  .two-col { grid-template-columns: 1fr; }
  .page-header { padding: 1rem; }
  .name-img { height: 40px; }
  .back-btn { left: 0.5rem; width: 30px; height: 30px; font-size: 1rem; }
}
