/* José Baudilio Jardines Méndez — sitio en memoria */
:root {
  --paper: #f6f1e9;
  --paper-2: #efe7da;
  --card: #fffdf9;
  --ink: #2b2520;
  --ink-2: #4a4038;
  --muted: #7a6e62;
  --line: #e2d7c6;
  --accent: #8a5a3b;
  --accent-2: #b5835a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px rgba(60, 40, 20, .06);
  --topbar: 56px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1916; --paper-2: #24201c; --card: #2a2521;
    --ink: #efe7dc; --ink-2: #d6cbbd; --muted: #a8998a; --line: #3a332d;
    --accent: #d2a37c; --accent-2: #e2bb98;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.65 var(--serif); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }

.eyebrow { font: 600 .78rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 46rem; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__inner { max-width: 1120px; margin: 0 auto; height: var(--topbar); display: flex; align-items: center; gap: 1.25rem; padding: 0 20px; }
.brand { font: 600 1.05rem var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; margin-left: auto; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font: 500 .88rem var(--sans); color: var(--ink-2); text-decoration: none; padding: .45rem .7rem; border-radius: 999px; white-space: nowrap; }
.nav a:hover, .nav a.is-active { background: var(--paper-2); color: var(--ink); }
@media (min-width: 900px) { .nav { mask-image: none; -webkit-mask-image: none; padding-right: 0; } }
@media (max-width: 560px) { .brand { display: none; } .nav { margin-left: 0; } }

/* Hero */
.hero { padding: 48px 20px 24px; }
.hero__inner { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; text-align: center; }
.hero__photo { margin: 0 auto; width: min(220px, 58vw); }
.hero__photo img { width: 100%; aspect-ratio: 242 / 305; object-fit: cover; border-radius: 50% / 42%; box-shadow: 0 0 0 6px var(--card), 0 0 0 7px var(--line), var(--shadow); filter: saturate(.9); }
.hero h1 { font-size: clamp(2.1rem, 7vw, 3.6rem); margin-bottom: .35em; }
.hero__dates { font: 500 .95rem/1.5 var(--sans); color: var(--muted); margin-bottom: .4em; }
.hero__role { font-size: 1.15rem; color: var(--ink-2); font-style: italic; }
.epigraph { margin: 1.4rem auto 0; max-width: 34rem; padding: 1rem 0 0; border-top: 1px solid var(--line); font-size: 1.12rem; font-style: italic; color: var(--ink-2); }
.epigraph cite { display: block; margin-top: .4rem; font: normal 500 .85rem var(--sans); color: var(--muted); }
.hero__intro { max-width: 40rem; margin: 36px auto 0; font-size: 1.12rem; color: var(--ink-2); }
.hero__intro p:first-child::first-letter { float: left; font-size: 3.3em; line-height: .85; padding: .08em .1em 0 0; color: var(--accent); font-weight: 600; }
@media (min-width: 820px) {
  .hero { padding-top: 72px; }
  .hero__inner { grid-template-columns: 260px 1fr; text-align: left; gap: 48px; }
  .hero__photo { width: 260px; }
  .epigraph { margin-left: 0; }
}

/* Sections */
.section { padding: 64px 20px; }
.section--tint { background: var(--paper-2); }
.wrap { max-width: 1080px; margin: 0 auto; }
.wrap--narrow { max-width: 760px; }
.prose { max-width: 44rem; }
.prose p { color: var(--ink-2); }
@media (min-width: 820px) { .section { padding: 88px 24px; } }

/* Timeline */
.timeline { list-style: none; margin: 40px 0 0; padding: 0; position: relative; max-width: 46rem; }
.timeline::before { content: ""; position: absolute; left: 62px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 28px; padding: 0 0 22px; }
.timeline li::before { content: ""; position: absolute; left: 57px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.timeline .year { font: 600 .95rem/1.5 var(--sans); color: var(--accent); text-align: right; padding-top: 1px; }
.timeline h3 { font-size: 1.08rem; margin: 0 0 .15em; }
.timeline p { margin: 0; color: var(--ink-2); font-size: .98rem; }

/* Stats & cards */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 32px 0; }
.stat { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat strong { display: block; font: 600 clamp(1.7rem, 5vw, 2.3rem)/1 var(--serif); color: var(--accent); margin-bottom: .35rem; }
.stat span { font: .9rem/1.4 var(--sans); color: var(--muted); }
@media (min-width: 820px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 48px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border-top: 3px solid var(--accent-2); }
.card h3 { margin-bottom: .1em; }
.card .when { font: 600 .8rem var(--sans); color: var(--muted); letter-spacing: .04em; margin-bottom: .7rem; display: block; }
.card p { margin: 0; color: var(--ink-2); font-size: .98rem; }
.two-col { display: grid; gap: 36px; }
@media (min-width: 820px) { .two-col { grid-template-columns: 1fr 1fr; gap: 56px; } }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .98rem; }
.list li:last-child { border-bottom: 0; }
.list .y { font: 600 .82rem var(--sans); color: var(--accent); margin-right: .6rem; }
.list .where { display: block; font: .85rem/1.4 var(--sans); color: var(--muted); margin-top: .15rem; }
.list--compact li { padding: .45rem 0; font-size: .93rem; }

/* Roots */
.facts { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 28px 0 0; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts div { background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.facts dt { font: 600 .75rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.facts dd { margin: 0; font-size: 1.02rem; }

/* Family */
.people { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 28px 0; }
@media (min-width: 640px) { .people { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .people { grid-template-columns: repeat(4, 1fr); } }
.person { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: grid; grid-template-columns: 56px 1fr; gap: 0 14px; align-items: start; }
.person > :not(.avatar) { grid-column: 2; }
.person .avatar { grid-row: 1 / span 4; width: 56px; height: 56px; margin: 0; font-size: 1.3rem; }
@media (min-width: 980px) { .person { display: block; text-align: center; padding: 22px; } .person .avatar { width: 64px; height: 64px; margin: 0 auto 12px; } }
.avatar { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font: 600 1.5rem var(--serif); color: var(--accent); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person h3 { margin: 0; }
.person .rel { font: 600 .78rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: block; margin: .25rem 0 .6rem; }
.person .full { font: .85rem var(--sans); color: var(--muted); display: block; margin-top: -.3rem; margin-bottom: .6rem; }
.person p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.note { background: var(--card); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 22px; margin: 8px 0 24px; box-shadow: var(--shadow); }
.note h3 { margin-bottom: .2em; }
.note p { margin: 0; color: var(--ink-2); }
.dates { display: grid; gap: 12px; }
@media (min-width: 640px) { .dates { grid-template-columns: 1fr 1fr; } }
.date { display: flex; gap: 14px; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line); }
.date strong { font: 600 1.05rem var(--serif); color: var(--accent); white-space: nowrap; }
.date span { color: var(--ink-2); font-size: .95rem; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.chip { font: 500 .85rem var(--sans); padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 980px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; padding: 0; border: 0; background: var(--card); border-radius: 10px; overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow); text-align: left; color: inherit; font: inherit; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .4s; }
.tile:hover img { transform: scale(1.03); }
.tile .cap { display: block; padding: 10px 12px; font: .85rem/1.35 var(--sans); }
.tile .cap b { display: block; font-weight: 600; color: var(--ink); }
.tile .cap i { font-style: normal; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); font-size: .95rem; }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(960px, 94vw); max-height: 94vh; }
.lightbox::backdrop { background: rgba(20, 15, 10, .86); }
.lightbox figure { margin: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.lightbox img { max-height: 70vh; width: auto; margin: 0 auto; }
.lightbox figcaption { padding: 16px 20px 20px; font: .92rem/1.5 var(--sans); color: var(--ink-2); }
.lightbox figcaption h3 { font-family: var(--serif); margin-bottom: .3em; }
.lightbox figcaption .meta { color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.lightbox__close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; z-index: 2; }

/* Quotes & testimonies */
.quotes { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 18px; margin: 24px -4px 32px; scrollbar-width: thin; }
.quote { flex: 0 0 min(86%, 360px); scroll-snap-align: start; background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin: 0; display: flex; flex-direction: column; }
.quote p { font-size: 1.12rem; font-style: italic; color: var(--ink); flex: 1; }
.quote p::before { content: "“"; display: block; font: 600 3rem/0.6 var(--serif); color: var(--accent-2); margin-bottom: .2rem; }
.quote footer { font: 600 .9rem var(--sans); color: var(--ink-2); }
.quote footer span { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
.testimonies__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.testimonies__head h3 { margin: 0; }
.tst { background: var(--card); border-radius: 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.tst summary { list-style: none; cursor: pointer; padding: 14px 18px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.tst summary::-webkit-details-marker { display: none; }
.tst .who { font: 600 .98rem var(--sans); }
.tst .when { font: .8rem var(--sans); color: var(--muted); grid-column: 1; }
.tst .teaser { grid-column: 1 / -1; color: var(--ink-2); font-size: .95rem; margin-top: .3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tst[open] .teaser { display: none; }
.tst .toggle { grid-row: 1 / 3; grid-column: 2; align-self: center; font: 600 1.3rem var(--sans); color: var(--accent); transition: transform .2s; }
.tst[open] .toggle { transform: rotate(45deg); }
.tst .body { padding: 0 18px 18px; color: var(--ink-2); font-size: .98rem; }
.tst .body p { margin: 0 0 .7em; }
.tst .nota { font: italic .85rem var(--sans); color: var(--muted); margin-bottom: .8rem; }
.more { display: block; margin: 16px auto 0; }

/* Share */
.share { background: var(--card); border-radius: 20px; padding: 32px 24px; box-shadow: var(--shadow); text-align: center; }
.share p { color: var(--ink-2); max-width: 34rem; margin-left: auto; margin-right: auto; }
.checklist { text-align: left; max-width: 30rem; margin: 20px auto 26px; padding: 0; list-style: none; font: .95rem/1.5 var(--sans); color: var(--ink-2); }
.checklist li { padding: .35rem 0 .35rem 1.7rem; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: .2rem; color: var(--accent); font-weight: 700; }
.button { display: inline-block; font: 600 1rem var(--sans); background: var(--accent); color: #fff; text-decoration: none; padding: .85rem 1.5rem; border-radius: 999px; border: 0; cursor: pointer; }
.button:hover { background: var(--ink); color: var(--paper); }
.button--ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.button--ghost:hover { background: var(--card); color: var(--ink); }

/* Sources */
.sources { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.sources li { background: var(--card); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow); display: grid; grid-template-columns: 52px 1fr; gap: 12px; }
.sources .y { font: 600 .9rem var(--sans); color: var(--accent); }
.sources .t { font-size: 1rem; }
.sources .d { display: block; font: .85rem/1.4 var(--sans); color: var(--muted); }
.sources .links { display: flex; gap: 14px; margin-top: .3rem; font: 500 .85rem var(--sans); }

/* Footer */
.footer { padding: 48px 20px 64px; text-align: center; border-top: 1px solid var(--line); }
.footer__name { font: 600 1.1rem var(--serif); margin-bottom: .4rem; }
.footer p { color: var(--ink-2); margin: 0 0 .3rem; }

/* Error */
.load-error { max-width: 640px; margin: 24px auto; padding: 16px 20px; border-radius: 12px; background: #fdecea; color: #7a2018; font: .95rem/1.5 var(--sans); }

@media print {
  .topbar, .chips, .lightbox, #comparte, .more { display: none !important; }
  .section, .hero { padding: 24px 0; }
  .tst .body { display: block !important; }
  body { background: #fff; }
}

@media (min-width: 980px) {
  .quotes { display: grid; grid-template-columns: repeat(6, 1fr); overflow: visible; margin: 24px 0 40px; padding: 0; }
  .quote { grid-column: span 2; }
  .quote:nth-child(4) { grid-column: 2 / span 2; }
}
.hero__dates .places { display: block; font-size: .88rem; margin-top: .15rem; }
.hero__dates .years { font: 600 1.05rem var(--sans); color: var(--ink-2); }
.list .hidden-item { display: none; }
.list.is-open .hidden-item { display: list-item; }
.link-btn { background: none; border: 0; padding: .6rem 0 0; font: 600 .9rem var(--sans); color: var(--accent); cursor: pointer; }

.lang { flex: none; font: 600 .82rem var(--sans); padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; margin-left: .25rem; }
.lang:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 560px) { .lang { padding: .35rem .6rem; } }

.voice { margin-top: 1.2rem; padding: 14px 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); max-width: 34rem; }
.voice__title { font: 600 .9rem var(--sans); margin: 0 0 .5rem; color: var(--ink); }
.voice audio { width: 100%; }
.voice__note { font: .78rem var(--sans); color: var(--muted); margin: .4rem 0 0; }
@media (max-width: 819px) { .voice { margin-left: auto; margin-right: auto; } }
