/* =========================================================
   Tipografías
========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&family=Playfair+Display&display=swap');

/* =========================================================
   Variables de color
========================================================= */
:root {
  --color-fondo: #0e0b16;
  --color-texto: #d1cce3;
  --color-acento: #5c5470;
  --color-hover: #a29bfe;
  --color-input: #1a1a2e;
}

/* =========================================================
   Reset
========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* =========================================================
   General
========================================================= */
body {
  background-color: var(--color-fondo);
  color: var(--color-texto);
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
}

/* =========================================================
   Encabezado lateral
========================================================= */
header {
  position: fixed;
  top: 0; left: 0;
  width: 120px;
  height: 100vh;
  background: rgba(14, 11, 22, 0.85);
  border-right: 1px solid rgba(255,255,255,0.08);
  padding: 1.5rem 0.5rem;
  z-index: 1000;
  display: flex; flex-direction: column; align-items: flex-start;
}
header img { width: 80px; height: auto; margin-bottom: 1.5rem; }
nav { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
nav a {
  color: #fff; text-decoration: none; font-size: 1rem;
  padding: 8px 0; border-radius: 6px; transition: background 0.2s; width: 100%;
}
nav a:hover { background: rgba(255,255,255,0.08); }

/* =========================================================
   Galería horizontal
========================================================= */
.galeria-horizontal {
  display: flex; flex-wrap: nowrap;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  gap: 20px; padding: 20px;
  width: 100%; min-width: max-content;
  margin-left: 120px;
}
.galeria-horizontal::-webkit-scrollbar { height: 8px; }
.galeria-horizontal::-webkit-scrollbar-thumb { background-color: var(--color-hover); border-radius: 4px; }

/* Indicadores de scroll (visuales sutiles) */
.galeria-horizontal { position: relative; }
.galeria-horizontal::before,
.galeria-horizontal::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40px; pointer-events: none;
}
.galeria-horizontal::before { left: 0; background: linear-gradient(to right, var(--color-fondo), transparent); }
.galeria-horizontal::after  { right: 0; background: linear-gradient(to left, var(--color-fondo), transparent); }

/* =========================================================
   Tarjetas de obra
========================================================= */
.obra {
  flex: 0 0 auto;
  width: 620px;              /* más compacto */
  min-height: 480px;         /* altura proporcional */
  background: #fff;          /* contraste limpio */
  color: #1a1a1a;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  align-items: center;       /* centra imagen y texto */
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.obra:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}


.obra img {
  width: 100%; height: auto; max-height: 400px; object-fit: cover;
  border-radius: 8px; margin-bottom: 15px; transition: transform 0.4s ease;
}
.obra img:hover { transform: scale(1.05); }

.obra h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 500;
  margin: 12px 0;
  color: #222;
}
.obra p {
  font-size: 0.95rem;
  color: #555;
}


/* =========================================================
   Descripción expandible
========================================================= */
.obra p.descripcion {
  font-size: 0.95em; line-height: 1.5; color: #444;
  margin: 10px 0; max-height: 160px; overflow: hidden; text-overflow: ellipsis;
  transition: max-height 0.4s ease;
}
.obra p.descripcion.expandida { max-height: 1000px; overflow: visible; }

/* =========================================================
   Botones
========================================================= */
button {
  background: none;
  border: 1px solid var(--color-acento);
  color: var(--color-acento);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}
button:hover {
  background: var(--color-acento);
  color: #fff;
}


.btn-vermas {
  background: none; color: var(--color-acento); border: none; font-weight: 600;
  cursor: pointer; transition: color 0.3s ease;
}
.btn-vermas:hover { color: var(--color-hover); }
.btn-vermas::after { content: "▼"; margin-left: 6px; transition: transform 0.3s ease; font-size: .9em; }
.btn-vermas.expandido::after { transform: rotate(180deg); }

/* =========================================================
   Animaciones de entrada (sutiles)
========================================================= */
.obra { opacity: 0; transform: translateY(20px); animation: aparecer .8s ease forwards; }
@keyframes aparecer { to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 1200px) {
  .obra { width: 520px; min-height: 560px; }
  .obra img { max-height: 360px; }
}

@media (max-width: 1024px) {
  .obra { width: 440px; min-height: 520px; }
  .obra img { max-height: 300px; }
}

@media (max-width: 768px) {
  /* Header compacto + menú */
  header { width: 60px; padding: 1rem 0.5rem; align-items: center; }
  header img { width: 40px; margin-bottom: 1rem; }
  nav { display: none; }
  .menu-toggle {
    display: block; background: none; border: none; color: #fff;
    font-size: 2rem; margin-top: 1rem; cursor: pointer;
  }
  header.active nav { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }

  .galeria-horizontal { margin-left: 60px; gap: 15px; padding: 10px; }
  .obra { width: 92vw; min-height: auto; }
  .obra img { max-height: 240px; }
  .obra h3 { font-size: 1.3em; }
  .obra p.descripcion { font-size: 0.95em; }
}

@media (max-width: 480px) {
  .galeria-horizontal { gap: 12px; padding: 8px; }
  .obra {
    width: 96vw; padding: 16px;
    box-shadow: 0 5px 18px rgba(92, 84, 112, 0.30);
  }
  .obra img { max-height: 200px; }
  .obra h3 { font-size: 1.2em; }
  .obra p.descripcion { font-size: 0.9em; }
}