/* Studio Chesco — Colección Solitarios
   Sistema visual: cálido, minimal, joyería fina. */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-muted: #f3efe8;
  --ink: #211e1a;
  --ink-soft: #5b564d;
  --ink-faint: #8c867a;
  --line: #e8e2d6;
  --accent: #a3854f;
  --accent-soft: #cdb582;
  --shadow: 0 1px 2px rgba(33, 30, 26, 0.04), 0 8px 24px rgba(33, 30, 26, 0.06);
  --shadow-hover: 0 4px 10px rgba(33, 30, 26, 0.06), 0 16px 32px rgba(33, 30, 26, 0.10);
  --radius: 3px;
  --maxw: 1280px;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
  line-height: 1;
}

.wordmark span {
  display: block;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.header-tagline {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: uppercase;
  display: none;
}

@media (min-width: 640px) {
  .header-tagline { display: block; }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.back-link:hover { color: var(--accent); }

.back-link svg { width: 14px; height: 14px; }

/* ---------- Hero / intro ---------- */

.hero {
  padding: 56px 0 36px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 48px);
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}

.hero p {
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 15.5px;
  margin: 0;
}

.hero .count {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Grid ---------- */

.grid-section { padding: 40px 0 80px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 22px; }
}

@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 26px; }
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(5, 1fr); gap: 28px; }
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-soft);
}

.card-media {
  aspect-ratio: 1 / 1;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.card:hover .card-media img { transform: scale(1.045); }

.card-label {
  padding: 12px 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.card-ref {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.card-arrow {
  color: var(--accent);
  font-size: 15px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.card:hover .card-arrow { opacity: 1; transform: translateX(0); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 50px;
  color: var(--ink-faint);
  font-size: 12.5px;
  letter-spacing: 0.03em;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  align-items: center;
}

.site-footer a { color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.site-footer a:hover { color: var(--accent); border-color: var(--accent-soft); }

/* ---------- Detail page ---------- */

.detail-hero { padding: 40px 0 8px; }

.detail-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 6px;
}

.detail-title {
  font-family: var(--serif);
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 500;
  margin: 0;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding: 28px 0 70px;
  align-items: start;
}

@media (min-width: 960px) {
  .detail-layout { grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 52px; }
}

.viewer-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.viewer-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-muted);
}

.viewer-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 14px;
}

.gallery button {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.gallery button:hover, .gallery button:focus-visible { border-color: var(--accent); }

.gallery img { width: 100%; height: 100%; object-fit: contain; }

.gallery-cap {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  margin-top: 6px;
}

.side-panel > * + * { margin-top: 28px; }

.panel-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.panel-title {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 16px;
  font-weight: 600;
}

.spec-table { width: 100%; border-collapse: collapse; }

.spec-table tr + tr td, .spec-table tr + tr th { border-top: 1px solid var(--line); }

.spec-table th, .spec-table td {
  text-align: left;
  padding: 9px 0;
  font-size: 14px;
}

.spec-table th {
  font-weight: 500;
  color: var(--ink-soft);
}

.spec-table td { text-align: right; font-variant-numeric: tabular-nums; }

.spec-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.5;
}

.cta-link {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.cta-link:hover { color: var(--accent); border-color: var(--accent); }

.ref-note { color: var(--ink-faint); font-size: 13px; margin: 6px 0 0; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(24, 22, 18, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: min(94vw, 1200px);
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  background: #fff;
}

.lightbox-cap {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  text-align: center;
  color: #f2ede2;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f2ede2;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.15s ease;
}

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 10px; right: 10px; }
}

/* En móvil el visor 3D queda muy pequeño con 16:9 dentro del margen del
   contenedor: lo sacamos a todo el ancho de pantalla y lo hacemos más
   cuadrado para que el visor tenga bastante más área. */
@media (max-width: 640px) {
  .viewer-col {
    margin-left: -28px;
    margin-right: -28px;
  }

  .viewer-wrap {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  .viewer-frame {
    aspect-ratio: 1 / 1;
  }
}
