/* Emaús Miciu — web pública */
:root {
  --bg: #f6f2ec;
  --bg-alt: #ede6dc;
  --surface: #fffdf9;
  --ink: #1d1916;
  --ink-soft: #5b524a;
  --muted: #8a7f74;
  --line: #ddd3c6;
  --accent: #9c4a26;
  --accent-ink: #fff;
  --hero-ink: #fff;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(29, 25, 22, .06), 0 8px 24px rgba(29, 25, 22, .06);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110f; --bg-alt: #1c1815; --surface: #201b18; --ink: #efe8de; --ink-soft: #c4b9ab;
    --muted: #93877a; --line: #352d27; --accent: #d98a5f; --accent-ink: #14110f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14110f; --bg-alt: #1c1815; --surface: #201b18; --ink: #efe8de; --ink-soft: #c4b9ab;
  --muted: #93877a; --line: #352d27; --accent: #d98a5f; --accent-ink: #14110f;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
@supports (overflow: clip) { html { overflow-x: clip; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
:lang(ja) body, body:lang(ja) { font-family: var(--sans), "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { margin: 0 0 .4em; font-weight: 500; line-height: 1.15; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.display { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -.01em; }
.h3 { font-family: var(--serif); font-size: 1.6rem; }
.eyebrow { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .6em; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* Botones y enlaces */
.btn {
  display: inline-flex; align-items: center; gap: .5em; padding: .8em 1.5em; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: 500 .85rem/1 var(--sans); letter-spacing: .08em;
  text-transform: uppercase; text-decoration: none; border-radius: var(--radius); cursor: pointer; transition: .2s;
}
.btn:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.link-arrow, .link-back { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: var(--ink-soft); }
.link-back { display: inline-block; margin-bottom: 1.2rem; }

/* Cabecera */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 24px; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: .45em; line-height: 1; }
.brand-name { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; letter-spacing: .01em; }
.brand-sub { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); padding: 6px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
.langs { display: flex; gap: 10px; padding-left: 22px; border-left: 1px solid var(--line); }
.langs a { font-size: .72rem; letter-spacing: .08em; }
.langs a[aria-current="true"] { color: var(--accent); border-color: transparent; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; cursor: pointer; color: var(--ink); }
.nav-toggle span { display: block; height: 1.5px; background: currentColor; margin: 6px 0; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 960px) {
  /* sin backdrop-filter: si no, el menú "fixed" queda atrapado dentro de la cabecera */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; top: 68px; left: 0; right: 0; bottom: 0; height: calc(100dvh - 68px); z-index: 39; background: var(--bg); flex-direction: column; align-items: flex-start;
    padding: 12px var(--gutter) 24px; gap: 20px; transform: translateX(100%); transition: transform .3s ease, visibility 0s .3s; overflow-y: auto;
    visibility: hidden;
  }
  .site-nav.is-open { transform: none; visibility: visible; transition: transform .3s ease; }
  .site-nav ul { flex-direction: column; gap: 4px; width: 100%; }
  .site-nav ul a { display: block; font-family: var(--serif); font-size: 1.3rem; text-transform: none; letter-spacing: 0; color: var(--ink); border: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .site-nav ul li:last-child a { border-bottom: 0; }
  .langs { border: 0; padding: 0; gap: 18px; }
  .langs a { font-size: .8rem; }
  body.nav-open { overflow: hidden; }
}

/* Hero */
.hero { position: relative; height: min(88vh, 860px); min-height: 480px; background: #0f0d0b; color: var(--hero-ink); overflow: hidden; }
.hero-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.6s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 9s ease-out; }
.hero-slide.is-active img { transform: scale(1); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,8,6,.72) 0%, rgba(10,8,6,.25) 55%, rgba(10,8,6,.05) 100%), linear-gradient(0deg, rgba(10,8,6,.55), transparent 35%); pointer-events: none; }
.hero-slide figcaption { position: absolute; right: var(--gutter); bottom: 28px; z-index: 2; font-size: .8rem; letter-spacing: .06em; opacity: .85; }
.hero-slide figcaption a { color: #fff; text-decoration: none; }
.hero-text { position: absolute; z-index: 2; left: 0; right: 0; bottom: clamp(48px, 12vh, 120px); max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.hero-text h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.8rem, 8vw, 6rem); line-height: .95; margin-bottom: .3em; }
.hero-text h1 span { font-style: italic; font-weight: 400; opacity: .9; }
.hero-text .eyebrow { color: rgba(255,255,255,.75); }
.hero-text .lead { color: rgba(255,255,255,.85); margin-bottom: 1.6em; }
.hero-dots { position: absolute; z-index: 3; left: var(--gutter); bottom: 22px; display: flex; gap: 8px; }
.hero-dots button { width: 22px; height: 3px; padding: 0; border: 0; background: rgba(255,255,255,.35); cursor: pointer; }
.hero-dots button.is-active { background: #fff; }
@media (min-width: 1320px) { .hero-dots { left: calc((100vw - var(--wrap)) / 2 + var(--gutter)); } }

/* Secciones */
.section { padding: clamp(48px, 8vw, 96px) var(--gutter); }
.section-tight { padding-bottom: 80px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 28px; }
.page-head { padding-top: clamp(32px, 6vw, 72px); padding-bottom: 24px; }
.intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.intro-text p { color: var(--ink-soft); font-size: 1.05rem; }
.intro-feature { position: relative; display: block; text-decoration: none; box-shadow: var(--shadow); }
.intro-feature img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.tag { position: absolute; top: 14px; left: 14px; background: var(--surface); color: var(--ink); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; padding: 6px 10px; }
.feature-cap { display: block; padding: 12px 0 0; font-family: var(--serif); font-size: 1.2rem; }
@media (max-width: 800px) { .intro { grid-template-columns: 1fr; } }

/* Tabs */
.tabs { margin-top: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; white-space: nowrap; }
.tabs a { display: block; padding: 12px 0; text-decoration: none; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"], .tabs a:hover { color: var(--ink); border-color: var(--accent); }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 20px 0 8px; }
.filters input[type="search"], .filters select {
  height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius); font: inherit; font-size: .92rem; min-width: 0;
}
.f-search { flex: 1 1 280px; }
.f-search input { width: 100%; }
.filters select { flex: 0 1 auto; max-width: 100%; }
.f-check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-soft); cursor: pointer; }
.f-check input { accent-color: var(--accent); width: 18px; height: 18px; }
.results-count { font-size: .85rem; color: var(--muted); margin: 6px 0 22px; }
@media (max-width: 640px) { .filters select { flex: 1 1 calc(50% - 5px); } }

/* Grilla de obras */
.grid-obras { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: clamp(16px, 2.5vw, 32px); }
.card-obra .card-link { display: block; text-decoration: none; }
.card-img { background: var(--bg-alt); overflow: hidden; aspect-ratio: 4/3; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, opacity .4s; }
.card-link:hover .card-img img, .card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 12px 0 0; }
.card-body h3 { font-family: var(--serif); font-size: 1.3rem; margin-bottom: .1em; }
.card-body p { font-size: .85rem; color: var(--muted); margin: 0; }
.grid-obras.is-loading { opacity: .5; transition: opacity .2s; }
.more { display: flex; justify-content: center; padding: 40px 0 80px; }
.empty { padding: 40px 0; color: var(--muted); text-align: center; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 32px; padding-bottom: 80px; }
.card { display: block; text-decoration: none; color: inherit; }
.card-press .card-img { aspect-ratio: 3/4; }
.card-press .card-img img { object-fit: cover; object-position: top; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); padding: 0; border-block: 1px solid var(--line); max-width: none; }
.tile { background: var(--bg); padding: clamp(28px, 5vw, 56px) var(--gutter); text-decoration: none; font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.8rem); transition: background .2s; }
.tile:hover { background: var(--bg-alt); }
.tile span::after { content: " →"; color: var(--accent); }
@media (max-width: 800px) { .tiles { grid-template-columns: 1fr 1fr; } }

/* Detalle de obra */
.obra-detail { padding-top: 32px; padding-bottom: 80px; }
.obra-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.obra-figure { margin: 0; background: var(--bg-alt); position: sticky; top: 92px; }
.obra-figure img { width: 100%; max-height: 80vh; object-fit: contain; margin: 0 auto; cursor: zoom-in; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 24px 0; padding: 20px 0; border-block: 1px solid var(--line); font-size: .95rem; }
.specs dt { color: var(--muted); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; padding-top: 3px; }
.specs dd { margin: 0; }
.obra-nav { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.obra-nav a { text-decoration: none; color: var(--ink-soft); }
@media (max-width: 860px) { .obra-layout { grid-template-columns: 1fr; } .obra-figure { position: static; } }

/* Prosa */
.prose { max-width: 68ch; color: var(--ink-soft); }
.prose p { margin-bottom: 1.1em; }
.prose-lg { font-size: 1.08rem; line-height: 1.8; }
.prose-lg > p:first-child::first-letter { font-family: var(--serif); float: left; font-size: 4.2em; line-height: .85; padding: 6px 10px 0 0; color: var(--accent); }
.prose blockquote { margin: 1.6em 0; padding-left: 1.2em; border-left: 2px solid var(--accent); font-family: var(--serif); font-size: 1.3em; line-height: 1.5; color: var(--ink); font-style: italic; }
.prose h3 { font-family: var(--serif); font-size: 1.6rem; color: var(--ink); margin-top: 1.4em; }
.prose .firma, .prose p.firma { text-align: right; font-style: italic; color: var(--muted); }
.prose .memoria { margin-top: 2em; padding: 1.2em 1.4em; background: var(--bg-alt); border-left: 3px solid var(--accent); color: var(--ink); }
.about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr); gap: clamp(32px, 6vw, 80px); padding-bottom: 40px; }
.about-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.about-photos a:first-child { grid-column: 1 / -1; }
.about-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; }
.about-photos a:first-child img { aspect-ratio: 4/3; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } .about-photos { grid-template-columns: repeat(3, 1fr); } }

/* Timeline */
.timeline { list-style: none; margin: 24px 0 0; padding: 0; border-left: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 90px 1fr; gap: 20px; padding: 0 0 28px 24px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.tl-year { font-family: var(--serif); font-size: 1.5rem; line-height: 1.1; color: var(--ink); }
.tl-text { color: var(--ink-soft); max-width: 70ch; }
.tl-text p:last-child { margin-bottom: 0; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }

/* Citas */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 32px; }
.quote { margin: 0; padding: 32px; background: var(--surface); border: 1px solid var(--line); font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; }
.quote footer { margin-top: 1em; font-family: var(--sans); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Galerías */
.masonry { columns: 3 260px; column-gap: 14px; }
.masonry a { display: block; break-inside: avoid; margin-bottom: 14px; position: relative; text-decoration: none; }
.masonry img { width: 100%; cursor: zoom-in; }
.masonry .cap { display: block; font-size: .82rem; color: var(--muted); padding: 6px 0 0; }
.album { padding: 24px 0 40px; border-bottom: 1px solid var(--line); }
.album:last-child { border-bottom: 0; }
.album header { margin-bottom: 16px; }

/* Videos */
.grid-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 32px; }
.video { margin: 0; }
.video-frame { position: relative; aspect-ratio: 16/9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.video-play img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .2s; }
.video-play:hover img { opacity: 1; }
.play-icon { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.6); }
.play-icon::after { content: ""; position: absolute; left: 27px; top: 21px; border-style: solid; border-width: 13px 0 13px 20px; border-color: transparent transparent transparent #fff; }
.video figcaption { padding-top: 10px; display: flex; flex-direction: column; }
.video figcaption strong { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }

.links { list-style: none; padding: 0; margin: 0; max-width: 680px; }
.links li { border-bottom: 1px solid var(--line); }
.links a { display: flex; justify-content: space-between; padding: 18px 0; text-decoration: none; font-family: var(--serif); font-size: 1.35rem; }

.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 32px; padding-bottom: 80px; padding-top: 16px; }
.place ul { list-style: none; padding: 0; margin: 0; }
.place li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.place a { text-decoration: none; }

/* Contacto */
.contact { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-bottom: 80px; max-width: 980px; margin-left: 0; }
.contact:has(.contact-obra) { grid-template-columns: minmax(200px, 340px) minmax(0, 1fr); }
.contact-obra img { width: 100%; }
.contact-obra p { font-family: var(--serif); font-size: 1.2rem; margin-top: 10px; }
.form { display: grid; gap: 18px; max-width: 620px; }
.form label { display: grid; gap: 6px; }
.form label span { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.form input, .form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius); font: inherit; }
.form textarea { resize: vertical; }
.form .btn { justify-self: start; }
.form-status { min-height: 1.5em; font-size: .95rem; }
.form-status.ok { color: #2f7a43; }
.form-status.err { color: #b3261e; }
@media (max-width: 720px) { .contact:has(.contact-obra) { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 48px 0 32px; margin-top: 40px; }
.footer-in { display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; }
.footer-in .brand-name { margin-bottom: .2em; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-start; font-size: .85rem; }
.footer-nav a { text-decoration: none; color: var(--ink-soft); }
.footer-in .small { grid-column: 1 / -1; margin: 0; }
@media (max-width: 720px) { .footer-in { grid-template-columns: 1fr; } }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 8, 6, .96); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.lb-figure img { max-width: 92vw; max-height: 82vh; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-figure figcaption { color: #e9e2d8; font-size: .9rem; padding-top: 14px; text-align: center; }
.lb-figure figcaption a { color: #fff; margin-left: 10px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.6rem; line-height: 1; cursor: pointer; padding: 16px; opacity: .75; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: 8px; right: 12px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
body.lb-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* encabezado en pantallas angostas */
.brand-name { white-space: nowrap; }
@media (max-width: 420px) { .brand-sub { display: none; } }
