/* =============================================
   VARIABLES GLOBALES
   ============================================= */
:root {
  --bg1: #f4b49c;
  --bg2: #c8a1b6;
  --ink: #2a2428;
  --muted: rgba(42, 36, 40, .65);
  --card: #ffffffcc;
  --stroke: #ffffff;
  --shadow: 0 20px 60px rgba(0, 0, 0, .18);
  --accent: #d49a78;
  --accent-ink: #3b2a21;
  --radius: 22px;
  /* NUEVO: Transición reutilizable */
  --transition-fast: 0.2s ease;
  --transition-hover: transform 0.2s ease, box-shadow 0.2s ease;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
}

/* =============================================
   LAYOUT PRINCIPAL
   ============================================= */
.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  gap: 18px;
}

/* =============================================
   CARD
   ============================================= */
.card {
  width: min(1150px, 100%);
  display: flex;
  flex-direction: row-reverse;
  background: var(--card);
  border: 4px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: width 0.3s ease;
}

.card-page {
  flex-direction: column;
}

.card-wide {
  width: min(1450px, 100%);
}

/* =============================================
   MEDIA (imágenes portada)
   ============================================= */
.media {
  width: 44%;
  display: flex;
}

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

.media img + img {
  border-left: 4px solid #fff;
}

/* =============================================
   CONTENIDO
   ============================================= */
.content {
  width: 56%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  justify-content: center;
}

.content-page {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  max-height: 80vh;
}

/* =============================================
   HERO
   ============================================= */
.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-text h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  line-height: 1.2;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--accent-ink);
  font-size: 1.05rem;
  font-weight: 500;
  opacity: 0.8;
}

/* =============================================
   TIPOGRAFÍA GENERAL
   ============================================= */
h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--accent-ink);
}

p {
  margin: 0.35rem 0;
}

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

.is-hidden {
  display: none !important;
}

/* =============================================
   BOTONES & NAV
   ============================================= */

/* Estilos base compartidos para botones */
.nav-btn,
.back-btn,
.collection-nav-prev,
.collection-nav-next,
.cv {
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 12px;
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.nav-btn,
.back-btn,
.collection-nav-prev,
.collection-nav-next,
.cv,
.back-btn:hover,
.collection-nav-prev:hover,
.collection-nav-next:hover,
.cv:hover {
  display: inline-block;
}

.nav-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-btn {
  appearance: none;
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  text-align: center;
  transition: transform .08s ease, background var(--transition-fast);
}

.nav-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(212, 154, 120, .85), rgba(212, 154, 120, .55));
}

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  margin-bottom: 8px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.back-btn {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.back-btn:hover,
.collection-nav-prev:hover,
.collection-nav-next:hover,
.cv:hover {
  background: rgba(255, 255, 255, .85);
}

/* =============================================
   GALERÍA DE OBRAS
   ============================================= */
.series {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, .07);
}

.series:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.series-head {
  margin-bottom: 20px;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  align-items: start;
}

/* Tarjeta individual */
.artwork-item {
  margin: 0;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, .02);
  transition: var(--transition-hover);
}

.artwork-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .85);
}

.artwork-img-wrapper {
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  background-color: rgba(0, 0, 0, .02);
  display: flex;
  align-items: center;
  justify-content: center;
}

.artwork-img-wrapper img {
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  transition: transform 0.4s ease;
}

/* Agrupados: comparten casi todos los estilos */
.artwork-tech,
.artwork-dims {
  margin: 2px 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.artwork-dims {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* =============================================
   TALLERRES Y EXPOSICIONES
   ============================================= */

.simple-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 24px;
}

.simple-carousel img {
  flex: 0 0 100%;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  scroll-snap-align: center;
  display: block;
  border-radius: 10%;
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 999;
}

.lightbox-img {
  max-width: min(1200px, 94vw);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  margin: 16px 0 0;
  color: #fff;
  text-align: center;
  font-size: 1.1rem;
  max-width: 600px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  border: none;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, .3);
}

/* =============================================
   SOCIAL
   ============================================= */
.social-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, .06);
}

.social-icon {
  font-size: 1.8rem;
  color: var(--accent-ink);
  opacity: 0.8;
  transition: transform var(--transition-fast);
}

.social-icon:hover {
  transform: translateY(-3px);
  opacity: 1;
}

.legal {
  color: rgba(255, 255, 255, .88);
  text-align: center;
  margin-top: 4px;
}

/* =============================================
   COLECCIONES
   ============================================= */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 8px;
}

.collection-card {
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
  transition: var(--transition-hover), background var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.collection-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .12);
  background: rgba(255, 255, 255, .88);
}

.collection-img-wrapper {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, .03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
}

.collection-info {
  padding: 18px 20px;
}

.collection-info h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.collection-info p {
  margin: 0;
  font-size: 0.88rem;
}

/* =============================================
   NAVEGACIÓN ENTRE COLECCIONES
   ============================================= */
.collection-nav {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.collection-nav-bottom {
  margin-left: 0;
  justify-content: space-between;
  padding-top: 24px;
  margin-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, .07);
}

.collection-nav-prev,
.collection-nav-next {
  padding: 8px 14px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.collection-nav-prev.disabled,
.collection-nav-next.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* =============================================
   PERFIL
   ============================================= */
.perfil-text {
  margin-bottom: 20px;
}

.perfil-text h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--accent-ink);
}

.perfil-text p {
  margin-bottom: 14px;
  line-height: 1.7;
}

.cv {
  padding: 10px 18px;
  border-radius: 12px;
}

.perfil-grid {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.perfil-grid img {
  width: 160px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  flex-shrink: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 880px) {
  .page {
    padding: 10px;
    align-items: flex-start;
  }

  .card {
    flex-direction: column;
    width: 100%;
    border-radius: 16px;
  }

  .media {
    width: 100%;
    height: 250px;
  }

  .content,
  .content-page {
    width: 100%;
    padding: 20px 16px;
  }

  .thumbs {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 700px) {
  .perfil-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .perfil-grid::after {
    content: '';
    flex-shrink: 0;
    width: 1px;
  }

  .perfil-grid img {
    width: 130px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

@media (max-width: 600px) {
  .collections-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .collection-nav {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .thumbs {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .artwork-info {
    padding: 10px;
  }

  .artwork-title {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }

  .artwork-tech,
  .artwork-dims {
    font-size: 0.75rem;
  }

  .artwork-img-wrapper img {
    max-height: 180px;
  }
}