/* Fuentes alojadas en local (sin Google Fonts): Cormorant Garamond y Jost, licencia SIL OFL */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/jost-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jost-latin-500-normal.woff2") format("woff2"); }

/* ---------- Paleta y tipografía (edita aquí para cambiar el look) ---------- */
:root {
  --bg: #f4f5f2;          /* fondo suave */
  --paper: #fbfbf9;       /* superficie de tarjetas y modal */
  --ink: #1e2220;
  --muted: #6a706c;
  --line: #dcdeda;
  --accent: #263a5e;      /* azul tinta: botón de compra */
  --accent-hover: #1a2a46;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(1240px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- Encabezado ---------- */
header.site { padding-bottom: clamp(1.5rem, 4vw, 2.75rem); }
header.site.slim { padding-bottom: 0; border-bottom: 1px solid var(--line); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; padding-block: 1.1rem; }
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo img { height: clamp(2.5rem, 5vw, 3.4rem); width: auto; }
.logo-text { font: 400 1.6rem/1.1 var(--serif); }
.nav { display: flex; gap: 1.5rem; font-size: .95rem; }
.nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--accent); border-color: var(--accent); }
.intro { display: grid; gap: .6rem; padding-top: clamp(1.25rem, 4vw, 3rem); }
.eyebrow { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
h1 { font: 300 clamp(2.1rem, 5.5vw, 3.75rem)/1.05 var(--serif); letter-spacing: -0.01em; }
.intro p:not(.eyebrow) { max-width: 36rem; color: var(--muted); font-weight: 300; font-size: 1.1rem; }

/* ---------- Filtros ---------- */
.filters {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-block: 1px solid var(--line);
}
.filters .wrap { display: flex; gap: .5rem; padding-block: .75rem; overflow-x: auto; scrollbar-width: none; }
.filters .wrap::-webkit-scrollbar { display: none; }
.filters button {
  flex: none; background: none; border: 1px solid transparent; border-radius: 999px;
  padding: .45rem 1.1rem; font: inherit; font-size: .95rem; color: var(--muted); cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }

/* ---------- Grilla ---------- */
main { padding: clamp(2rem, 5vw, 4rem) 0 clamp(4rem, 9vw, 7rem); }
.count { color: var(--muted); font-size: .95rem; margin-bottom: 2rem; }
.grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.card { display: flex; flex-direction: column; gap: 1rem; }
.card .thumb {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  background: var(--line); aspect-ratio: 4 / 5; overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card .thumb:hover img { transform: scale(1.03); }
.card h2 { font: 400 1.65rem/1.15 var(--serif); }
.meta { color: var(--muted); font-size: .92rem; font-weight: 300; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.price { font: 500 1.35rem/1 var(--serif); }
.status { font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; gap: .45rem; }
.status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #5f8a6b; }
.sold .status::before { background: #a2625a; }
.sold .price { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

.btn {
  display: inline-block; text-align: center; text-decoration: none; cursor: pointer;
  background: var(--accent); color: #fff; border: 0; padding: .85rem 1.4rem;
  font: 500 .95rem var(--sans); letter-spacing: .02em; transition: background .2s;
}
.btn:hover { background: var(--accent-hover); }
.btn.ghost { background: none; color: var(--muted); border: 1px solid var(--line); cursor: default; }
.card .btn { width: 100%; }

/* ---------- Modal de detalle ---------- */
dialog {
  border: 0; padding: 0; background: var(--paper); color: var(--ink);
  width: min(1080px, 100% - 1.5rem); max-height: calc(100dvh - 1.5rem); margin: auto; overflow: auto;
}
dialog::backdrop { background: rgba(24, 28, 26, .72); }
dialog[open] { animation: open .25s ease; }
@keyframes open { from { opacity: 0; transform: translateY(10px); } }
.m-grid { display: grid; grid-template-columns: 1.15fr 1fr; }
.m-img { background: #e9eae6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: clamp(1rem, 3vw, 2.5rem); }
.m-img > img { max-height: calc(100dvh - 9rem); width: auto; object-fit: contain; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.m-thumbs { display: flex; gap: .5rem; justify-content: center; }
.m-thumbs:empty { display: none; }
.m-thumbs button { width: 3.5rem; height: 3.5rem; padding: 0; border: 1px solid transparent; background: none; cursor: pointer; opacity: .6; }
.m-thumbs button[aria-current="true"] { border-color: var(--ink); opacity: 1; }
.m-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.m-info { padding: clamp(1.5rem, 4vw, 3rem); display: flex; flex-direction: column; gap: 1.1rem; }
.m-info h2 { font: 400 clamp(2rem, 4vw, 2.8rem)/1.05 var(--serif); }
.m-info h3 { font: 500 .95rem var(--sans); margin-bottom: .2rem; }
.m-info p { color: var(--muted); font-weight: 300; }
.m-info .desc { color: var(--ink); font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; }
.m-info section { border-top: 1px solid var(--line); padding-top: 1rem; }
.close {
  position: absolute; top: .6rem; right: .6rem; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  border: 0; background: var(--paper); font-size: 1.5rem; line-height: 1; cursor: pointer; z-index: 2;
}
.close:hover { background: #fff; }

/* ---------- Pie de página ---------- */
footer { border-top: 1px solid var(--line); padding: clamp(3rem, 6vw, 5rem) 0 2rem; }
.f-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
footer h3 { font: 400 1.4rem var(--serif); margin-bottom: .6rem; }
footer p, footer li { color: var(--muted); font-weight: 300; font-size: .97rem; }
footer ul { list-style: none; display: grid; gap: .35rem; }
footer a { text-decoration: none; border-bottom: 1px solid var(--line); }
footer a:hover { color: var(--accent); border-color: var(--accent); }
.copy { margin-top: 3rem; color: var(--muted); font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .m-grid { grid-template-columns: 1fr; }
  .m-img > img { max-height: 50dvh; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

  /* ---------- Cabecera de las páginas de obra ---------- */
  .topbar { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
  .topbar .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
  .brand { font: 400 1.5rem/1.1 var(--serif); text-decoration: none; }
  .crumbs { padding-top: 1.5rem; font-size: .95rem; }
  .crumbs a, .ask a, .series a, .linkbtn { text-decoration: none; border-bottom: 1px solid var(--ink); }
  .crumbs a:hover, .ask a:hover, .series a:hover, .linkbtn:hover { color: var(--accent); border-color: var(--accent); }

  /* ---------- Página de una obra ---------- */
  .werk { display: grid; grid-template-columns: 1.15fr 1fr; background: var(--paper); margin-block: 1.5rem clamp(3rem, 7vw, 5rem); }
  .werk .m-img > img { max-height: 80dvh; }
  .werk h1 { font: 400 clamp(2.2rem, 5vw, 3.4rem)/1.05 var(--serif); letter-spacing: 0; }
  .ask, .series { font-size: .95rem; color: var(--muted); }
  .links { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: baseline; font-size: .95rem; }
  .linkbtn { background: none; border-top: 0; border-inline: 0; cursor: pointer; padding: 0 0 2px; font: inherit; color: inherit; }
  .card h2 a { text-decoration: none; }
  .card h2 a:hover { color: var(--accent); }
  .legal { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: .6rem; }
  @media (max-width: 760px) { .werk { grid-template-columns: 1fr; } }

/* ---------- Mejoras de venta y SEO (nov 2026) ---------- */
.m-img > a.zoom { display: block; cursor: zoom-in; }
.m-img > a.zoom > img { max-height: calc(100dvh - 9rem); width: auto; object-fit: contain; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.werk .m-img > a.zoom > img { max-height: 80dvh; }
.zoom-hint { font-size: .8rem; color: var(--muted); font-weight: 300; }
.trust { list-style: none; display: grid; gap: .35rem; font-size: .92rem; color: var(--muted); font-weight: 300; }
.trust li::before { content: "✓"; color: #5f8a6b; margin-right: .55rem; }
.about-works { max-width: 46rem; margin: clamp(4rem, 8vw, 6rem) auto 0; padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.about-works h2, .more h2 { font: 400 clamp(1.8rem, 3.5vw, 2.4rem)/1.1 var(--serif); margin-bottom: 1rem; }
.about-works p { font: 400 1.2rem/1.6 var(--serif); margin-bottom: 1rem; }
.more { margin-bottom: clamp(3rem, 7vw, 5rem); }
.more .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.more .thumb { cursor: pointer; }
.card h3 { font: 400 1.45rem/1.15 var(--serif); }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
@media (max-width: 760px) { .m-img > a.zoom > img, .werk .m-img > a.zoom > img { max-height: 60dvh; } }
/* Contenido previo (lo leen los buscadores; el script lo sustituye al cargar) */
.pre { padding: 2rem 0; }
.pre img { max-width: 100%; height: auto; }
.pre .pre-list { list-style: none; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

/* ---------- Cabecera de la portada: logo, título, introducción (nov 2026) ---------- */
.intro { padding-top: clamp(.5rem, 2vw, 1.25rem); gap: .5rem; }
.intro h1 { margin: 0; }
.intro .tagline { max-width: 40rem; color: var(--muted); font-weight: 300; font-size: 1.1rem; }
.intro .lead { max-width: 44rem; margin-top: clamp(1rem, 2.5vw, 1.75rem); padding-top: clamp(1rem, 2.5vw, 1.5rem); border-top: 1px solid var(--line); display: grid; gap: .9rem; }
.intro .lead p { max-width: none; color: var(--ink); font: 400 clamp(1.1rem, 1.6vw, 1.25rem)/1.6 var(--serif); }
@media (max-width: 560px) {
  .bar { flex-wrap: nowrap; padding-block: .9rem; }
  .logo img { height: 2.1rem; }
  .nav { gap: 1rem; font-size: .9rem; }
}

/* Introducción a lo ancho: frase grande + texto en columna (nov 2026) */
.intro .lead { max-width: none; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.25rem, 4vw, 4.5rem); align-items: start; }
.intro .lead .lead-quote { font: 300 clamp(1.5rem, 2.4vw, 2.1rem)/1.3 var(--serif); color: var(--ink); }
.intro .lead .lead-text { display: grid; gap: .9rem; }
.intro .lead .lead-text p { color: var(--ink); font: 400 clamp(1.05rem, 1.35vw, 1.18rem)/1.62 var(--serif); }
@media (max-width: 860px) { .intro .lead { grid-template-columns: 1fr; } }

/* Sin logo (nov 2026): nombre del estudio como enlace al inicio del catálogo en las páginas de obra */
.brand-link { font: 400 clamp(1.35rem, 2.6vw, 1.7rem)/1.1 var(--serif); text-decoration: none; color: var(--ink); }
.brand-link:hover { color: var(--accent); }
header.site:not(.slim) .bar { padding-block: .9rem .2rem; }

/* Marco incluido (nov 2026) */
.price .frame-tag { display: block; font: 300 .78rem/1.3 var(--sans, inherit); letter-spacing: .02em; color: var(--muted); margin-top: .15rem; }
.frame-note { font-size: .92rem; font-weight: 300; color: var(--ink); background: rgba(0,0,0,.035); border-left: 2px solid var(--line); padding: .6rem .8rem; }

/* Páginas legales y botón de Widerruf (nov 2026) */
.legal-page { max-width: 46rem; padding-block: 1rem clamp(3rem, 7vw, 5rem); }
.legal-page h1 { font: 400 clamp(2rem, 4.5vw, 3rem)/1.1 var(--serif); margin: .5rem 0 1.5rem; }
.legal-page h2 { font: 400 1.6rem/1.2 var(--serif); margin: 2.2rem 0 .7rem; }
.legal-page h3 { font: 500 1rem/1.4 var(--sans); margin: 1.4rem 0 .4rem; }
.legal-page p, .legal-page li { font-weight: 300; line-height: 1.7; margin-bottom: .8rem; }
.legal-page ul, .legal-page ol { padding-left: 1.2rem; }
.legal-page .box { border: 1px solid var(--line); padding: 1.2rem 1.4rem; margin: 1.2rem 0; background: rgba(0,0,0,.02); }
.legal-page form { display: grid; gap: 1rem; margin-top: 1.2rem; }
.legal-page label { display: grid; gap: .35rem; font-weight: 500; font-size: .95rem; }
.legal-page input, .legal-page textarea { font: 300 1rem var(--sans); padding: .7rem .8rem; border: 1px solid var(--line); background: #fff; border-radius: 0; }
.legal-page textarea { min-height: 7rem; }
.legal-page .hint { font-size: .85rem; color: var(--muted); font-weight: 300; }
.widerruf-btn { margin-top: .4rem; }
