/* v4: reset toward simple personal architecture, rounded blocks, complete shelves */
:root{
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --bone:#F5F0E6;
  --paper:#FBF7EF;
  --ink:#151515;
  --muted:#5c5750;
  --red:#B83A20;
  --sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --display: 'Segoe UI', system-ui, sans-serif;
  --mono: 'Segoe UI', system-ui, sans-serif;
}
body{
  font-family: var(--sans);
  background: var(--bone);
  color: var(--ink);
}
nav.site-nav.light{ background: rgba(245,240,230,.92); border-bottom:1px solid rgba(0,0,0,.08); }
.nav-name{ font-family: var(--sans); font-weight:700; letter-spacing:.02em; }
.nav-links a,.lang-toggle,.book-tag,.strip-tag,.section-label,.filter-btn,.paper-tag,.book-buy-link{ font-family: var(--sans); letter-spacing:.08em; }
.lang-toggle,.btn-primary,.btn-secondary-dark,.filter-btn,.book-tag,.paper-tag,.video-card,.contact-form-area,.form-input,.form-textarea,.book-cover,.book-full-cover,.resource-card,.fiction-featured,.fiction-featured-img{ border-radius: var(--radius-sm); }
.content-area{ max-width:1120px; }
.site-footer{ border-radius:0; }

/* Home: Hidalgo-like simple architecture without copying the look */
.home-simple{
  min-height: calc(100vh - var(--nav-h));
  padding: calc(var(--nav-h) + 3rem) 2.8rem 3rem;
  display:grid;
  grid-template-rows: auto 1fr auto;
  gap:2.2rem;
  max-width:1180px;
  margin:0 auto;
}
.home-button-row{
  display:grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap:.75rem;
}
.home-button{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:.65rem .9rem;
  border:1px solid rgba(21,21,21,.2);
  border-radius:var(--radius-md);
  text-decoration:none;
  color:var(--ink);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
  background:rgba(255,255,255,.25);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.home-button:hover{ transform:translateY(-2px); background:var(--paper); border-color:var(--red); color:var(--red); }
.home-button-bottom{ min-height:78px; flex-direction:column; gap:.3rem; align-items:flex-start; justify-content:flex-end; padding:1rem; }
.home-button-bottom strong{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.home-button-bottom span{ font-size:12px; line-height:1.35; text-transform:none; letter-spacing:0; color:var(--muted); }
.home-main{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(260px,.8fr);
  gap:4rem;
  align-items:center;
}
.home-kicker{ color:var(--red); font-size:12px; letter-spacing:.12em; text-transform:uppercase; margin-bottom:1.1rem; }
.home-title{ font-family:var(--sans); font-weight:800; font-size:clamp(48px,8vw,104px); letter-spacing:-.055em; line-height:.92; margin:0 0 1.4rem; }
.home-bio-simple{ max-width:640px; font-size:18px; line-height:1.55; color:#282520; margin-bottom:1rem; }
.home-bio-note{ max-width:540px; font-size:14px; line-height:1.55; color:var(--muted); }
.home-photo-card{ border:1px solid rgba(21,21,21,.14); border-radius:var(--radius-lg); padding:.8rem; background:var(--paper); transform:rotate(.8deg); box-shadow:0 18px 50px rgba(0,0,0,.08); }
.home-photo-card img{ display:block; width:100%; aspect-ratio:4/5; object-fit:cover; object-position:center 16%; border-radius:calc(var(--radius-lg) - 4px); filter:contrast(1.02) saturate(.88) brightness(1.04); }
.home-credit{ display:flex; justify-content:space-between; gap:1rem; margin-top:.65rem; font-size:10px; text-transform:uppercase; letter-spacing:.1em; color:var(--muted); }
.home-bottom-row{ align-self:end; }

/* Books */
.books-full-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.6rem 2rem; }
.book-full-card{
  min-height:0;
  border:1px solid rgba(21,21,21,.12);
  border-radius:var(--radius-md);
  padding:1rem;
  background:rgba(255,255,255,.22);
  transition:border-color .16s ease, transform .16s ease;
}
.book-full-card:hover{ border-color:rgba(184,58,32,.55); transform:translateY(-1px); }
.book-full-cover,.compact-books .book-full-cover{
  width:104px; height:150px; object-fit:contain; object-position:center; background:#fff; border:1px solid rgba(21,21,21,.08); padding:4px; flex-shrink:0;
}
.book-full-title{ font-family:var(--sans); font-weight:800; letter-spacing:-.02em; }
.book-full-subtitle{ font-size:13px; color:var(--muted); }
.books-page .section-label{ margin-top:1rem; }
.section-gap{ margin-top:3rem; }
.inner-intro{ border-bottom:1px solid rgba(21,21,21,.12); grid-template-columns:1fr; }
.inner-title{ font-family:var(--sans); font-weight:800; letter-spacing:-.045em; }
.intro-mark{ display:none; }

/* Research */
.research-filters{ position:sticky; top:var(--nav-h); background:rgba(245,240,230,.94); z-index:10; padding:.75rem 0; border-bottom:1px solid rgba(0,0,0,.06); }
.paper-list{ display:flex; flex-direction:column; gap:.7rem; }
.paper-item{
  display:grid;
  grid-template-columns:1fr auto;
  gap:1rem;
  align-items:start;
  border:1px solid rgba(21,21,21,.11);
  border-radius:var(--radius-md);
  padding:1rem 1.1rem;
  background:rgba(255,255,255,.18);
}
.paper-item:first-child{ padding-top:1rem; }
.paper-title{ font-family:var(--sans); font-size:15px; font-weight:700; }
.paper-meta{ font-size:12.5px; color:var(--muted); }
.paper-tag{ border-color:rgba(184,58,32,.75); }
.research-note{ color:var(--muted); font-size:14px; margin:0 0 1.4rem; max-width:760px; }

@media(max-width:860px){
  .home-simple{ padding-left:1.2rem; padding-right:1.2rem; }
  .home-main{ grid-template-columns:1fr; gap:2rem; }
  .home-button-row{ grid-template-columns:1fr 1fr; }
  .home-button-row .home-button:last-child{ grid-column:1 / -1; }
  .books-full-grid{ grid-template-columns:1fr; }
  .paper-item{ grid-template-columns:1fr; }
}
@media(max-width:520px){
  .home-button-row{ grid-template-columns:1fr; }
  .home-title{ font-size:48px; }
  .home-bio-simple{ font-size:16px; }
}

/* v5 photo placement supplied by user */
.page-hero{
  display:flex !important;
  border-radius:0 0 var(--radius-lg) var(--radius-lg);
}
.page-hero-bg img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.page-hero .page-photo-media{ object-position: 35% 34%; }
.page-hero .page-photo-research{ object-position: 48% 35%; }
.page-hero .page-photo-about{ object-position: 50% 27%; }
.home-photo-card img{
  content: initial;
  object-position:center 18%;
  filter:contrast(1.02) saturate(.88) brightness(1.02);
}
.fiction-featured-img.fiction-photo{
  object-position:center 34%;
}
.research-page-hero + .content-area .inner-intro{
  margin-top:0;
}

/* v6: language visibility fix after button display rules */
[data-lang="en"] { display: none !important; }
body.lang-en [data-lang="es"] { display: none !important; }
body.lang-en [data-lang="en"] { display: revert !important; }
body.lang-en a[data-lang="en"],
body.lang-en .home-button[data-lang="en"],
body.lang-en button[data-lang="en"] { display: flex !important; }
body:not(.lang-en) a[data-lang="es"],
body:not(.lang-en) .home-button[data-lang="es"],
body:not(.lang-en) button[data-lang="es"] { display: flex !important; }

/* v6: full-width image headers for Ensayos and Ficción */
.page-hero-essays,
.page-hero-fiction{
  min-height: 340px;
  height: 42vh;
  max-height: 520px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}
.page-hero-essays .page-hero-bg img,
.page-hero-fiction .page-hero-bg img{
  width:100%; height:100%; object-fit:cover;
}
.page-hero-essays .page-photo-essays{ object-position: 50% 30%; }
.page-hero-fiction .page-photo-fiction{ object-position: 50% 48%; }
.page-hero .page-photo-about{ object-position: 50% 30%; }

/* v6: Subsuelo cover in the fiction feature */
.subsuelo-featured{
  grid-template-columns: minmax(180px, 270px) 1fr;
  align-items: start;
}
.fiction-featured-img.fiction-cover{
  width:100%;
  height:auto;
  aspect-ratio:auto;
  object-fit:contain;
  object-position:center;
  background:#fff;
  padding:8px;
  border:1px solid rgba(21,21,21,.10);
  box-shadow:0 12px 30px rgba(0,0,0,.08);
}
@media(max-width:760px){
  .page-hero-essays,.page-hero-fiction{ min-height:260px; height:34vh; }
  .subsuelo-featured{ grid-template-columns:1fr; }
  .fiction-featured-img.fiction-cover{ max-width:260px; margin:0 auto; display:block; }
}


/* v7: top nav alignment + minimal mirrored home buttons */
.nav-links li{ display:flex; align-items:center; }
.nav-links a{ display:flex; align-items:center; min-height:22px; }
.home-bottom-row.minimal .home-button-bottom{
  min-height:58px;
  align-items:center;
  justify-content:center;
  padding:.8rem 1rem;
}
.home-bottom-row.minimal .home-button-bottom strong{
  font-size:12px;
  letter-spacing:.1em;
}
.home-bottom-row.minimal .home-button-bottom span{ display:none !important; }

/* v7: media columns with dates and external archives */
.column-item{ align-items:flex-start; }
.column-outlet{
  display:block;
  margin-top:.18rem;
  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
}
.archives-section{ margin-top:2rem; padding-top:1.4rem; border-top:1px solid rgba(21,21,21,.12); }
.archive-link-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.75rem;
}
.archive-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:44px;
  border:1px solid rgba(21,21,21,.16);
  border-radius:var(--radius-md);
  padding:.7rem .85rem;
  color:var(--ink);
  text-decoration:none;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
  background:rgba(255,255,255,.22);
}
.archive-link::after{ content:'↗'; color:var(--red); }
.archive-link:hover{ border-color:var(--red); color:var(--red); background:var(--paper); }
@media(max-width:760px){ .archive-link-grid{ grid-template-columns:1fr; } }


/* v9: cleaner section headers */
.page-hero-sub{ display:none !important; }
.research-page-hero + .content-area{ padding-top: 2.4rem !important; }
.video-archive-section{ margin-bottom: 2rem; }
.video-thumb-placeholder .video-play{ font-size: 1.1rem; letter-spacing: .08em; }



/* v15: home image as antique postage stamp */
.home-photo-card{
  position:relative;
  padding:18px !important;
  background:#f6f0e4 !important;
  border:1px solid rgba(21,21,21,.16) !important;
  border-radius:12px !important;
  box-shadow:0 18px 50px rgba(0,0,0,.10) !important;
  transform:rotate(.45deg);
  overflow:visible !important;
}
.home-photo-card::before{
  content:"";
  position:absolute;
  inset:-10px;
  z-index:-1;
  background:
    radial-gradient(circle at 10px 10px, transparent 0 7px, #f6f0e4 7.5px) top left / 24px 24px repeat;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.10));
  border-radius:10px;
}
.home-photo-card img{
  border-radius:7px !important;
  border:1px solid rgba(21,21,21,.12);
  aspect-ratio:4/5;
  object-fit:cover;
  object-position:center 18%;
  filter:contrast(1.02) saturate(.92) brightness(1.02);
}
.home-credit{ display:none !important; }

/* v15: move Ensayos hero image upward to avoid heavy chin crop */
.page-hero-essays .page-photo-essays{
  object-position:50% 18% !important;
}
@media(max-width:760px){
  .home-photo-card{ padding:14px !important; }
  .home-photo-card::before{ inset:-8px; background-size:20px 20px; }
}


/* v16: home uses cropped stamp image itself, without extra background */
.home-photo-card{
  padding:0 !important;
  background:transparent !important;
  border:none !important;
  border-radius:0 !important;
  box-shadow:none !important;
  transform:rotate(-1.6deg) !important;
  overflow:visible !important;
}
.home-photo-card::before{ display:none !important; content:none !important; }
.home-photo-card img{
  width:100%;
  display:block;
  border:none !important;
  border-radius:0 !important;
  aspect-ratio:auto !important;
  object-fit:contain !important;
  object-position:center center !important;
  filter:none !important;
}

/* v16: align Ensayos hero crop with Sobre mí */
.page-hero-essays .page-photo-essays{ object-position: 50% 30% !important; }

@media(max-width:760px){
  .home-photo-card{ transform:rotate(-1deg) !important; }
}


/* v17: home navigation behavior */
@media(min-width:761px){
  .home-bottom-row.home-mobile-row{
    display:none !important;
  }
}
@media(max-width:760px){
  .home-simple{
    padding-top: calc(var(--nav-h) + 1.2rem);
    grid-template-rows: 1fr auto;
    min-height: auto;
  }
  .home-top-row{
    display:none !important;
  }
  .home-main{
    gap:1.4rem;
  }
  .home-photo-card{
    max-width: 74vw;
    margin: 0 auto;
    order:-1;
  }
  .home-copy-simple{
    text-align:left;
  }
  .home-title{
    font-size: clamp(42px, 15vw, 64px);
  }
  .home-bottom-row.home-mobile-row{
    display:grid !important;
    margin-top:1rem;
  }
}


/* v25: first home restored; buttons below; new integrated portrait */
.home-simple{
  min-height: calc(100vh - var(--nav-h));
  padding: calc(var(--nav-h) + 2.2rem) 2.8rem 2rem !important;
  display:grid;
  grid-template-rows: 1fr auto;
  gap:1.45rem !important;
  max-width:1180px;
  margin:0 auto;
}
.home-top-row{
  display:none !important;
}
.home-main{
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(300px,.82fr);
  gap:3.4rem !important;
  align-items:center;
}
.home-title{
  font-size:clamp(48px,8vw,104px);
  line-height:.92;
  margin:0 0 1.35rem;
}
.home-bio-simple{
  max-width:640px;
  font-size:18px;
  line-height:1.55;
}
.home-bio-note{
  max-width:540px;
  font-size:14px;
  line-height:1.55;
}
.home-photo-card{
  justify-self:end;
  width:min(100%, 410px);
  margin:0;
  padding:0 !important;
  background:transparent !important;
  border:none !important;
  border-radius:0 !important;
  box-shadow:none !important;
  transform:none !important;
  overflow:visible !important;
}
.home-photo-card::before{
  display:none !important;
  content:none !important;
}
.home-photo-card img{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:auto !important;
  object-fit:contain !important;
  object-position:center center !important;
  border:none !important;
  border-radius:0 !important;
  filter:drop-shadow(0 7px 12px rgba(81,62,38,.07));
  mix-blend-mode:multiply;
}
.home-credit{
  display:none !important;
}
.home-bottom-row{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:.75rem;
  align-self:end;
  margin-top:.1rem;
}
.home-bottom-row.minimal .home-button-bottom,
.home-bottom-row .home-button-bottom{
  min-height:52px;
  align-items:center;
  justify-content:center;
  padding:.75rem .9rem;
}
.home-bottom-row.minimal .home-button-bottom strong,
.home-bottom-row .home-button-bottom strong{
  font-size:12px;
  letter-spacing:.1em;
}
.home-bottom-row .home-button-bottom span{
  display:none !important;
}

@media(max-width:860px){
  .home-simple{
    padding: calc(var(--nav-h) + 1.4rem) 1.2rem 1.6rem !important;
    gap:1.2rem !important;
  }
  .home-main{
    grid-template-columns:1fr;
    gap:1.8rem !important;
  }
  .home-photo-card{
    justify-self:center;
    width:min(100%,380px);
    transform:none !important;
  }
  .home-bottom-row{
    grid-template-columns:1fr 1fr;
  }
  .home-bottom-row .home-button-bottom:last-child{
    grid-column:1 / -1;
  }
}
@media(max-width:520px){
  .home-bottom-row{
    grid-template-columns:1fr;
  }
}

/* v28 definitive home portrait integration */
.home-simple{
  min-height: calc(100svh - var(--nav-h)) !important;
  padding: calc(var(--nav-h) + 1.55rem) 2.8rem 1rem !important;
  gap: 1rem !important;
}
.home-main{
  gap: 3rem !important;
}
.home-photo-card{
  width: min(100%, 430px) !important;
  transform: none !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.home-photo-card img{
  width: 100% !important;
  height: auto !important;
  transform: none !important;
  mix-blend-mode: normal !important;
  filter: drop-shadow(0 5px 7px rgba(80,62,40,.055)) !important;
}
.home-bottom-row{
  margin-top: 0 !important;
}
@media(min-width:861px){
  .home-main{
    min-height: calc(100svh - var(--nav-h) - 6.1rem) !important;
  }
  .home-photo-card img{
    max-height: calc(100svh - var(--nav-h) - 7.2rem) !important;
    object-fit: contain !important;
  }
}

/* v30 final home */
.home-simple{
  min-height:calc(100svh - var(--nav-h)) !important;
  padding:calc(var(--nav-h) + 1.35rem) 2.8rem 1.25rem !important;
  gap:.8rem !important;
}
.home-main{
  grid-template-columns:minmax(0,1.18fr) minmax(360px,.82fr) !important;
  gap:2.65rem !important;
  align-items:center !important;
}
.home-title{
  margin-bottom:1.15rem !important;
}
.home-bio-simple{
  max-width:650px !important;
  font-size:18px !important;
  line-height:1.52 !important;
}
.home-bio-note{display:none !important;}
.home-photo-card{
  width:min(100%,440px) !important;
  justify-self:end !important;
  margin:0 !important;
  transform:none !important;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  overflow:visible !important;
}
.home-photo-card img{
  display:block !important;
  width:100% !important;
  height:auto !important;
  aspect-ratio:auto !important;
  object-fit:contain !important;
  transform:none !important;
  border:none !important;
  border-radius:0 !important;
  filter:drop-shadow(0 6px 9px rgba(70,52,34,.07)) !important;
  mix-blend-mode:normal !important;
}
.home-bottom-row{
  margin-top:.1rem !important;
}
@media(min-width:861px){
  .home-main{min-height:calc(100svh - var(--nav-h) - 6.35rem) !important;}
  .home-photo-card img{max-height:calc(100svh - var(--nav-h) - 7.15rem) !important;}
}
@media(max-width:860px){
  .home-main{grid-template-columns:1fr !important;}
  .home-photo-card{justify-self:center !important;width:min(100%,380px) !important;}
}

/* v31 packaging and final home portrait */
.home-photo-card{
  width:min(100%,430px) !important;
  justify-self:end !important;
  transform:none !important;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  padding:0 !important;
}
.home-photo-card img{
  display:block !important;
  width:100% !important;
  height:auto !important;
  max-width:100% !important;
  aspect-ratio:auto !important;
  object-fit:contain !important;
  object-position:center !important;
  transform:none !important;
  filter:none !important;
}
.home-bio-note{display:none !important;}
@media(max-width:860px){
  .home-photo-card{order:-1;justify-self:center !important;width:min(82vw,390px) !important;}
  .home-main{gap:1.2rem !important;}
}
