/* Paleta tomada de la ilustración de El Ovejo:
   lana índigo, cinta rosa empolvado, contorno café y monóculo dorado. */
:root {
  --paper: #fbf8f3;
  --paper-deep: #f3ece4;
  --surface: #ffffff;
  --ink: #26244a;
  --ink-soft: #57546f;
  --wool: #4b4fb8;
  --wool-deep: #363a94;
  --wool-mist: #e7e7f6;
  --ribbon: #d8bdb6;
  --ribbon-soft: #efe2de;
  --bark: #6b4330;
  --gold: #c9962e;
  --line: #e4dcd2;
  --danger: #a23b3b;

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Source Serif 4", "Iowan Old Style", Georgia, serif;

  --radius: 14px;
  --shadow: 0 1px 2px rgb(38 36 74 / 0.05), 0 8px 24px rgb(38 36 74 / 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

a { color: var(--wool-deep); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--wool); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; text-wrap: balance; }

p { text-wrap: pretty; }

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.container--narrow { width: min(720px, 100% - 32px); }
.center { text-align: center; margin-top: 2.5rem; }

/* Cabecera */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgb(251 248 243 / 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.wordmark { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 1.25rem; margin-left: auto; }
.nav__link { color: var(--ink-soft); text-decoration: none; }
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--wool-deep); }
.nav__link[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; }
.nav__link--icon { display: inline-flex; align-items: center; }
.nav__link--icon svg { display: block; }

@media (max-width: 640px) {
  .site-header__inner { flex-wrap: wrap; gap: 0.25rem 1rem; padding-block: 0.5rem; }
  .site-header .site-header__cta { display: none; }
  .nav { gap: 1rem; font-size: 0.95rem; }
}

/* Botones */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem;
  border: 1px solid var(--wool-deep); border-radius: 3px;
  background: var(--wool-deep); color: #fff;
  font: 600 1rem/1 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.button:hover { background: var(--wool); border-color: var(--wool); color: #fff; }
.button--ghost { background: transparent; color: var(--wool-deep); }
.button--ghost:hover { background: var(--wool-mist); color: var(--wool-deep); }
.button--small { min-height: 38px; padding: 0 1rem; font-size: 0.9rem; }
.button--danger { background: transparent; color: var(--danger); border-color: currentColor; }
.button--danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Mensajes */
.flash { background: var(--wool-mist); color: var(--wool-deep); padding: 0.85rem 0; }
.flash--alert { background: #f6e3e1; color: var(--danger); }

/* Portada */
.hero {
  text-align: center;
  padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(3rem, 8vw, 6rem);
  background: var(--paper);
}
.hero__emblem { width: min(420px, 90%); margin: 0 auto 1.5rem; }
.hero__illustration { width: 100%; height: auto; mix-blend-mode: multiply; }
.eyebrow { font-family: var(--font-display); font-style: italic; font-size: 1.35rem; color: var(--bark); margin: 0 0 0.25rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.hero__name { font-size: clamp(2.6rem, 8vw, 5rem); color: var(--ink); }
.hero__role { font-family: var(--font-display); font-style: italic; font-size: clamp(1.35rem, 3.5vw, 1.75rem); color: var(--wool-deep); margin: 0.75rem 0 0.25rem; }
.hero__dates { color: var(--ink-soft); margin: 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 2rem; }

/* Secciones */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section--paper { background: var(--paper-deep); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section__title { font-size: clamp(2rem, 5vw, 2.75rem); }
.section__more { white-space: nowrap; }
.page-title { font-size: clamp(2.4rem, 6vw, 3.5rem); }
.lede { font-size: 1.15rem; color: var(--ink-soft); margin: 0.5rem 0 1.75rem; }
.empty { color: var(--ink-soft); font-style: italic; }

.prose { font-size: 1.2rem; }
.prose .section__title { margin-bottom: 1.5rem; }
.prose p { margin: 0 0 1em; }

/* Escritos */
.writing-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.writing-card {
  display: flex; flex-direction: column; padding: 1.75rem; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
}
.writing-card:hover { color: var(--ink); box-shadow: 0 2px 4px rgb(38 36 74 / 0.06), 0 10px 28px rgb(38 36 74 / 0.09); }
.writing-card__category { margin: 0 0 0.35rem; font-family: var(--font-display); font-style: italic; font-size: 1.1rem; color: var(--bark); }
.writing-card__title { font-size: 1.6rem; margin-bottom: 0.75rem; }
.writing-card__excerpt { margin: 0; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.writing-card__excerpt--verse { white-space: pre-line; font-style: italic; -webkit-line-clamp: 4; }
.writing-card__date { display: block; margin-top: auto; padding-top: 1rem; font-size: 0.85rem; color: var(--bark); margin-bottom: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: -0.5rem 0 2rem; }
.filters__link { color: var(--ink-soft); text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.filters__link:hover { color: var(--wool-deep); }
.filters__link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.writing__back { margin: 0 0 1.5rem; color: var(--ink-soft); }
.writing__back a { color: inherit; }
.writing__title { font-size: clamp(2.4rem, 6vw, 3.25rem); margin-bottom: 2rem; }
.writing__body { font-size: 1.2rem; line-height: 1.75; }
.writing__body p { margin: 0 0 1.2em; }
.writing__body--verse { font-family: var(--font-display); font-size: clamp(1.35rem, 3vw, 1.6rem); line-height: 1.55; }
.writing__signature { margin-top: 2.5rem; color: var(--bark); font-style: italic; }
.writing__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem; margin-top: 1.5rem; }
.like__button { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0; border: 0; background: none; color: var(--wool-deep); font: inherit; cursor: pointer; }
.like__button:hover { color: var(--wool); }
.like__button--on { color: var(--danger); }
.like__count { color: var(--ink-soft); }
.writing-card__likes { margin-left: 0.6rem; color: var(--danger); }
.hero__share { margin-top: 1.25rem; }
.share-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--wool-deep); }
.share-link svg { flex: none; }
.field select { width: 100%; min-height: 48px; padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: 1rem/1.5 var(--font-body); }

/* Recuerdos */
.memory-list { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.memory-list--stack { grid-template-columns: 1fr; margin-top: 2rem; }
@media (max-width: 400px) { .memory-list { grid-template-columns: 1fr; } }
.memory { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; scroll-margin-top: 90px; }
.memory:target { outline: 2px solid var(--gold); }
.memory__body p { margin: 0 0 0.8em; }
.memory__photos { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); margin: 1rem 0; }
.memory__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; font-size: 0.9rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 0.85rem; margin-top: 0.5rem; }
.memory__author { font-weight: 600; color: var(--bark); }

/* Fotos */
.photo-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.photo { display: block; border-radius: 10px; overflow: hidden; background: var(--ribbon-soft); aspect-ratio: 1; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.photo:hover img { transform: scale(1.03); }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgb(20 18 40 / 0.9); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox { height: 100dvh; max-height: 100dvh; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); border-radius: 8px; object-fit: contain; }
.lightbox__close { position: fixed; top: 12px; right: 16px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.15); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }

/* Formularios */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; background: var(--surface); padding: clamp(1.25rem, 4vw, 2rem); border-radius: var(--radius); box-shadow: var(--shadow); }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
.field label { font-weight: 600; }
.field__hint { margin: 0; font-size: 0.875rem; color: var(--ink-soft); }
.field input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]), .field textarea {
  width: 100%; padding: 0.8rem 0.9rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  color: var(--ink); font: 1rem/1.5 var(--font-body);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--wool); outline-offset: 0; border-color: transparent; background: #fff; }
.field input[type="file"] { width: 100%; font: inherit; font-size: 1rem; padding: 0.75rem; border: 1px dashed var(--ribbon); border-radius: 10px; background: var(--ribbon-soft); }
.field input[type="file"]::file-selector-button { min-height: 44px; margin-right: 0.75rem; padding: 0 1rem; border: 1px solid var(--wool-deep); border-radius: 3px; background: var(--surface); color: var(--wool-deep); font: 600 1rem/1 var(--font-body); cursor: pointer; }
.input--poem { font-family: var(--font-display) !important; font-size: 1.25rem !important; }
.field--trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.file-preview { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
.file-preview img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.form__errors { background: #f6e3e1; color: var(--danger); border-radius: 10px; padding: 0.75rem 1rem; }
.form__errors p, .form__errors ul { margin: 0; }
.form .button { justify-self: start; }

/* Pie */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--ink-soft); font-size: 0.95rem; text-align: center; }

/* Panel */
.admin-item { margin-bottom: 1.25rem; display: grid; gap: 0.75rem; }
.admin-item > form { justify-self: start; }
.admin-photo { margin: 0; display: grid; gap: 0.4rem; }
.admin-photo img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.admin-table td { padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table td:last-child { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.admin .memory__photos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.login { margin-inline: auto; max-width: 420px; }
.nav__button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* Familia */
.family__heading { font-size: 1.75rem; margin: 2.5rem 0 1rem; }
.family__list { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.person { display: grid; gap: 0.15rem; padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.person:hover { color: var(--wool-deep); }
.person__name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.person__meta { font-size: 0.9rem; color: var(--ink-soft); min-height: 1.4em; }

.writing-list { display: grid; gap: 1.25rem; margin-top: 2rem; }
.writing-entry { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.writing-entry__title { font-size: 1.6rem; margin-bottom: 0.75rem; }
.writing-entry__title a { color: inherit; text-decoration: none; }
.writing-entry__body p { margin: 0 0 0.8em; }
.writing-entry--verse .writing-entry__body { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.55; }
.writing-entry__meta { margin: 0.75rem 0 0; font-size: 0.9rem; color: var(--bark); }
.writing-entry__meta a { color: inherit; }
.writing__people { margin-top: 2.5rem; color: var(--ink-soft); }
.writing__people + .writing__signature { margin-top: 0.5rem; }

/* Comentarios en los escritos */
.comments { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.comments__count { color: var(--ink-soft); font-size: 0.7em; }
.comments__list { display: grid; gap: 1rem; margin-top: 1.5rem; }
.comment { padding: 1.25rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); scroll-margin-top: 90px; }
.comment:target { outline: 2px solid var(--gold); }
.comment__body p { margin: 0 0 0.75em; }
.comment__body p:last-child { margin-bottom: 0; }
.comment__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.9rem; }
.comment__author { color: var(--bark); font-weight: 600; }
.comments__form { margin-top: 3.5rem; }
.comments__form .lede { margin-bottom: 1.25rem; }

fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 600; margin-bottom: 0.4rem; }
.checks { display: grid; gap: 0.35rem 1rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.checks label { font-weight: 400; display: flex; gap: 0.4rem; align-items: center; }

/* El menú puede desplazarse en horizontal en móvil */
@media (max-width: 640px) {
  .nav { overflow-x: auto; white-space: nowrap; max-width: 100%; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
}


/* Toda la tarjeta del árbol se puede tocar, no solo el nombre */
.tree-node:has(> a.tree-node__name) { cursor: pointer; }
.tree-node > a.tree-node__name::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tree-node__fb { position: relative; z-index: 1; padding-block: 0.35rem; }
.tree-node:has(> a.tree-node__name):hover { border-color: var(--wool); }

.link-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.moderation-label { display: inline-block; margin: 0; color: var(--danger); font-weight: 600; }

/* Celular */
@media (max-width: 640px) {
  .site-header__inner { min-height: 0; padding-block: 0.4rem 0; }
  .nav { width: 100%; margin-left: 0; justify-content: space-between; gap: 0.25rem; overflow: visible; }
  .nav__link { display: inline-flex; align-items: center; min-height: 44px; }
  .wordmark { display: inline-flex; align-items: center; min-height: 44px; }

  .section__head { flex-wrap: wrap; }
  .section__more { display: inline-flex; align-items: center; min-height: 44px; }
  .filters { gap: 0 1.25rem; margin-top: -1rem; }
  .filters__link { display: inline-flex; align-items: center; min-height: 44px; }
  .writing__back a { display: inline-flex; align-items: center; min-height: 44px; }

  .hero__actions .button, .form .button { width: 100%; }
  .form .button { justify-self: stretch; }
  .writing-card { padding: 1.35rem; }
  .memory { padding: 1.25rem; }

  .tree-node { padding: 0.7rem 0.85rem; }

  /* Panel: las tablas pasan a tarjetas apiladas */
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; }
  .admin-table tr { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
  .admin-table td { padding: 0.1rem 0; border: 0; text-align: left; }
  .admin-table td:first-child a { display: inline-block; padding-block: 0.4rem; font-weight: 600; }
  .admin-table td:last-child { text-align: left; margin-top: 0.5rem; }
  .button--small { min-height: 44px; }
  .checks { grid-template-columns: 1fr; }
  .checks label { min-height: 40px; }
}

/* Teléfonos muy estrechos (320 px): el menú cabe sin desplazarse */
@media (max-width: 370px) {
  .nav { font-size: 0.9rem; gap: 0.1rem; }
  .container { width: calc(100% - 24px); }
}

/* Árbol: la pareja arriba y una tarjeta por rama debajo, sin desplazamiento horizontal */
.ft { margin-top: 1rem; }
.ft-couple { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; position: relative; padding-bottom: 1.5rem; }
.ft-couple::after { content: ""; position: absolute; bottom: 0; left: 50%; height: 1.5rem; border-left: 1px solid var(--bark); }
.ft-branches { display: grid; gap: 0.75rem; align-items: start; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); border-top: 1px solid var(--bark); padding-top: 1.25rem; }
.ft-branch { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem 1rem; color: var(--ink); scroll-margin-top: 90px; }
.ft-branch.is-gone { background: var(--paper-deep); }
.ft-branch--orlando { background: var(--wool-deep); border-color: var(--wool-deep); color: #fff; text-decoration: none; }
.ft-branch--orlando:hover { background: var(--wool); color: #fff; }
.ft-branch--orlando .ft-meta { color: rgb(255 255 255 / 0.85); }
.ft-branch__name { display: block; margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.2; }
.ft-branch__name a { color: inherit; text-decoration: none; }
.ft-branch__name a:hover { color: var(--wool-deep); text-decoration: underline; }
.ft-branch > .ft-meta { margin: 0.15rem 0 0; }
.ft-meta { font-size: 0.85rem; color: var(--ink-soft); }
.ft-fb { font-size: 0.8rem; margin-left: 0.35rem; }
.ft-kids { list-style: none; margin: 0.75rem 0 0; padding: 0 0 0 0.9rem; border-left: 1px solid var(--bark); display: grid; gap: 0.45rem; }
.ft-kids li { line-height: 1.3; }
.ft-kids li > a { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.ft-kids li > a:hover { color: var(--wool-deep); text-decoration: underline; }
.ft-kids li > .ft-meta { display: block; }
.ft-kids li.is-gone > a { color: var(--ink-soft); }
.ft-kids .ft-kids { margin-top: 0.4rem; }
[id^="persona-"]:target { outline: 2px solid var(--gold); outline-offset: 2px; }

.tree-node { position: relative; display: grid; gap: 0.1rem; justify-items: center; min-width: 150px; padding: 0.6rem 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.tree-node--root { background: var(--wool-deep); border-color: var(--wool-deep); color: #fff; }
.tree-node--root .tree-node__meta { color: rgb(255 255 255 / 0.85); }
.tree-node--gone { background: var(--paper-deep); }
.tree-node__name { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; line-height: 1.15; color: inherit; text-decoration: none; }
a.tree-node__name:hover { color: var(--wool-deep); text-decoration: underline; }
.tree-node__meta { font-size: 0.8rem; color: var(--ink-soft); }
.tree-node__fb { font-size: 0.8rem; }
.tree-group { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.cross { font-family: "Segoe UI Symbol", "Apple Symbols", system-ui, sans-serif; font-weight: 400; font-size: 0.85em; color: var(--bark); }
.tree-node--root .cross, .ft-branch--orlando .cross { color: rgb(255 255 255 / 0.9); }

.writing__context, .writing-card__context { font-style: italic; color: var(--ink-soft); margin: 0 0 1rem; }
.writing-card__context { font-size: 0.9rem; margin: -0.4rem 0 0.6rem; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; }
.pager__info { color: var(--ink-soft); font-size: 0.9rem; }

.writing-card--untitled .writing-card__excerpt { color: var(--ink); font-family: var(--font-display); font-size: 1.3rem; line-height: 1.45; -webkit-line-clamp: 6; }
.writing-card--untitled .writing-card__context { margin-top: 0; }
.writing-card__open { align-self: flex-start; margin-top: 0.85rem; color: var(--wool-deep); font-size: 0.95rem; text-decoration: underline; text-underline-offset: 0.2em; }

/* Buscador */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search { display: flex; gap: 0.5rem; margin: 0 0 1.5rem; max-width: 640px; }
.search__input { flex: 1; min-width: 0; min-height: 48px; padding: 0 1rem; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--ink); font: 1rem var(--font-body); }
.search__input:focus { outline: 2px solid var(--wool); outline-offset: 0; border-color: transparent; }
.search__button { flex: none; }

.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; }
.wordmark__logo { width: 50px; height: 44px; mix-blend-mode: multiply; flex: none; }
@media (max-width: 640px) { .wordmark__logo { width: 43px; height: 38px; } }

/* ¿Quién eres? */
.person-picker { display: grid; gap: 0.6rem; }
.person-picker legend { font-weight: 600; margin-bottom: 0.4rem; }
.person-picker__combo { position: relative; }
.person-picker__input, .person-picker__select, .person-picker__new select { width: 100%; padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: 1rem/1.5 var(--font-body); }
.person-picker__input:focus { outline: 2px solid var(--wool); outline-offset: 0; border-color: transparent; background: #fff; }
.person-picker__list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 0.3rem; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; }
.person-picker__option { padding: 0.55rem 0.7rem; border-radius: 6px; cursor: pointer; }
.person-picker__option span { color: var(--ink-soft); font-size: 0.9rem; }
.person-picker__option:hover, .person-picker__option[aria-selected="true"] { background: var(--wool-mist); }
.person-picker__option--new { color: var(--wool-deep); border-top: 1px solid var(--line); margin-top: 0.2rem; }
.person-picker__chosen { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0.9rem; border-radius: 10px; background: var(--wool-mist); }
.person-picker__change { background: none; border: 0; padding: 0; color: var(--wool-deep); font: inherit; text-decoration: underline; cursor: pointer; }
.person-picker__new { display: grid; gap: 1rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 10px; }
.person-picker__new[hidden], .person-picker [hidden] { display: none; }

/* Botón de fotos en español */
.field__label { font-weight: 600; }
.file-button { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; cursor: pointer; }
.file-button .button { pointer-events: none; }
.file-button__status { color: var(--ink-soft); }
.file-button:focus-within .button { outline: 2px solid var(--gold); outline-offset: 3px; }
.person-picker__new-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }

/* Álbum */
.photo-grid--album { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-items: start; }
.album-photo { margin: 0; display: grid; gap: 0.4rem; }
.album-photo figcaption { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.4; }
.album-photo__people { display: block; font-size: 0.85rem; }
.album-photo__foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.like--compact .like__button { min-height: 32px; font-size: 0.9rem; }
.lightbox__figure { margin: 0; display: grid; gap: 0.6rem; justify-items: center; }
.lightbox__caption { color: #fff; max-width: 60ch; text-align: center; }
.lightbox__caption:empty { display: none; }
.admin-album { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 1.5rem; }
.admin-photo__preview { max-width: 100%; max-height: 420px; border-radius: 8px; margin-bottom: 1rem; }

/* Su vida con retrato */
.life { display: grid; gap: 2.5rem; grid-template-columns: minmax(180px, 260px) 1fr; align-items: start; max-width: 960px; }
.life__portrait { margin: 0; display: grid; gap: 0.6rem; }
.life__photos { display: grid; gap: 0.75rem; }
.life__photos a { display: block; }
.life__portrait img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
.life__portrait figcaption { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; color: var(--bark); text-align: center; }
@media (max-width: 700px) {
  .life { grid-template-columns: 1fr; gap: 1.5rem; }
  .life__portrait { max-width: 420px; margin-inline: auto; }
  .life__photos { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
}
