:root {
  --bg: #f4efe7;
  --bg-alt: #ebe3d6;
  --ink: #1d1916;
  --muted: #6b6158;
  --dark: #171412;
  --dark-ink: #efe7dc;
  --leather: #b8682e;
  --leather-dark: #8a4a1d;
  --line: #d8cdbd;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; }
em { font-style: italic; color: var(--leather); }

.eyebrow {
  margin: 0 0 .5rem; font-size: .75rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--leather);
}

.btn {
  display: inline-block; padding: .85rem 1.6rem; border-radius: var(--radius);
  background: var(--leather); color: #fff; text-decoration: none; font-weight: 600;
  transition: background .2s;
}
.btn:hover { background: var(--leather-dark); }

/* Cabecera */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(16px, 4vw, 48px);
  background: rgba(23, 20, 18, .92); backdrop-filter: blur(8px); color: var(--dark-ink);
}
.logo img { height: 40px; width: auto; }
.top nav { display: flex; gap: clamp(.8rem, 2.5vw, 2rem); font-size: .9rem; }
.top nav a { text-decoration: none; opacity: .8; }
.top nav a:hover { opacity: 1; color: var(--leather); }

/* Portada */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 60px);
  background: var(--dark); color: var(--dark-ink);
}
.hero-img { width: 100%; height: 100%; max-height: calc(100vh - 60px); object-fit: cover; }
.hero-text { align-self: center; padding: clamp(24px, 6vw, 80px); }
.hero h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
.hero p { max-width: 34ch; color: #c9bfb3; margin-bottom: 2rem; }

/* Secciones */
.section { padding: clamp(56px, 9vw, 112px) clamp(16px, 4vw, 48px); }
.section.dark { background: var(--dark); color: var(--dark-ink); }
.section-head { max-width: 640px; margin: 0 auto 3rem; text-align: center; }
.section-head h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
.section-head p:last-child { color: var(--muted); }
.dark .section-head p:last-child { color: #a99e92; }

/* Catálogo */
.grid {
  display: grid; gap: clamp(16px, 2vw, 28px); max-width: 1240px; margin: 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  position: relative; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--dark); cursor: pointer; text-align: left; font: inherit; color: #fff;
  aspect-ratio: 3 / 4;
}
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover img { transform: scale(1.05); }
.card-info {
  position: absolute; inset: auto 0 0 0; display: flex; flex-direction: column;
  padding: 3.5rem 1.2rem 1.1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .85));
}
.card-tipo { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #e2b48c; }
.card-nombre { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; line-height: 1.15; }
.card-count { font-size: .78rem; opacity: .7; }

/* La hoja de cerca */
.zoom-grid {
  display: grid; gap: 18px; max-width: 1240px; margin: 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.zoom-item { margin: 0; cursor: zoom-in; }
.zoom-item img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius);
  transition: filter .3s;
}
.zoom-item:hover img { filter: brightness(1.12); }
.zoom-item figcaption { padding-top: .7rem; font-size: .9rem; color: #a99e92; }
.zoom-item strong { display: block; font-family: var(--serif); font-size: 1.35rem; color: var(--dark-ink); font-weight: 600; }

/* El oficio */
.oficio-grid {
  display: grid; gap: 14px; max-width: 1240px; margin: 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.oficio-item { margin: 0; cursor: zoom-in; }
.oficio-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); }
.oficio-item figcaption { padding-top: .5rem; font-size: .85rem; color: var(--muted); }

/* Historia */
.historia {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px);
  align-items: center; max-width: none;
}
.historia-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.historia-text { max-width: 560px; }
.historia-text h2 { font-size: clamp(2rem, 3.5vw, 2.8rem); }
.historia-text p:not(.eyebrow) { color: #c9bfb3; }
@media (max-width: 760px) { .historia { grid-template-columns: 1fr; } }

/* Contacto */
.contact { text-align: center; background: var(--bg-alt); }
.contact h2 { font-size: clamp(2rem, 4vw, 3rem); }
.contact p { color: var(--muted); margin: 0 auto 2rem; max-width: 46ch; }

.foot { padding: 2rem 16px; text-align: center; font-size: .85rem; color: #a99e92; background: var(--dark); }
.foot p { margin: 0; }

/* Ficha */
.ficha {
  width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: 0; border: 0; border-radius: 6px; background: var(--bg); color: var(--ink);
}
.ficha::backdrop { background: rgba(10, 8, 7, .8); }
.ficha-body { display: grid; grid-template-columns: 1.25fr 1fr; }
.ficha-gallery { background: var(--dark); padding: 16px; }
#ficha-main { width: 100%; height: min(70vh, 720px); object-fit: contain; cursor: zoom-in; }
.ficha-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.ficha-thumbs button {
  flex: 0 0 64px; height: 64px; padding: 0; border: 2px solid transparent;
  border-radius: 3px; overflow: hidden; background: none; cursor: pointer; opacity: .6;
  position: relative;
}
.ficha-thumbs button.on { border-color: var(--leather); opacity: 1; }
.ficha-thumbs button.is-zoom::after {
  content: "zoom"; position: absolute; inset: auto 0 0 0; font-size: 10px; color: #fff;
  background: rgba(0, 0, 0, .6); text-transform: uppercase; letter-spacing: .08em;
}
.ficha-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.ficha-info { padding: clamp(24px, 4vw, 48px); align-self: center; }
.ficha-info h3 { font-size: clamp(2rem, 3.5vw, 2.8rem); }
.ficha-info > p:not(.eyebrow) { color: #4a423b; }
.tags { list-style: none; padding: 0; margin: 1.2rem 0 2rem; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: .78rem; padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 99px; }

.close {
  position: absolute; top: 8px; right: 12px; z-index: 2;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
}

/* Visor */
.visor {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(8, 7, 6, .96); color: #fff;
}
.visor[open] { display: flex; flex-direction: column; }
.visor::backdrop { background: transparent; }
.visor-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 16px; }
.visor-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; transition: transform .25s ease; }
.visor-stage.zoomed img { transform: scale(2.5); cursor: zoom-out; }
.visor-hint { margin: 0; padding: 10px; text-align: center; font-size: .8rem; color: #8a8076; }

/* Móvil */
@media (max-width: 760px) {
  .top nav a:not(:last-child) { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-img { max-height: 60vh; }
  .ficha-body { grid-template-columns: 1fr; }
  #ficha-main { height: 50vh; }
  .ficha { overflow-y: auto; }
}
