/*
Theme Name: Familias de Traslasierra
Theme URI: https://yacanto.com.ar/historias/
Author: Familias de Traslasierra
Description: Theme del blog "Historias" de Familias de Traslasierra, con el mismo diseño del sitio (armon-co.com como referencia). Este theme también presta su header/footer a TNG (método Kloosterman) para unificar el diseño de todo el sitio.
Version: 1.0
Requires PHP: 8.0
Text Domain: familias-traslasierra
*/

* { box-sizing: border-box; }
body { margin: 0; }
body {
  --bg: #faf9f6;
  --bg-soft: #f5f3ee;
  --ink: #1a1a1a;
  --ink-soft: #6b7280;
  --line: #e5e1d6;
  --header-bg: #ddcbb4;
  --accent: #c19a6b;
  --accent-dark: #7a5b38;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; }

.color-strip { display: flex; height: 5px; }
.color-strip div { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 9999px; font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600; font-size: 15px; letter-spacing: 0.02em; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fdfaf6; }
.btn-primary:hover { color: #fdfaf6; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(193,154,107,.35); }
.btn-donate {
  background: var(--accent-dark); color: #fff8ef;
  box-shadow: 0 4px 14px rgba(122,91,56,.4), 0 0 0 0 rgba(193,154,107,.5);
  animation: donatePulse 3s ease-in-out infinite;
}
.btn-donate:hover, .btn-donate:hover * { color: #fff8ef; }
.btn-donate:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(122,91,56,.5); }
@keyframes donatePulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(122,91,56,.4), 0 0 0 0 rgba(193,154,107,.5); }
  50% { box-shadow: 0 4px 14px rgba(122,91,56,.4), 0 0 0 9px rgba(193,154,107,0); }
}

.donate-overlay {
  position: fixed; inset: 0; background: rgba(26,26,26,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; opacity: 0; pointer-events: none; transition: opacity .3s ease;
  padding: 20px;
}
.donate-overlay.is-open { opacity: 1; pointer-events: auto; }
.donate-modal {
  background: #fefcfa; border-radius: 26px; max-width: 420px; width: 100%;
  padding: 40px 36px 32px; position: relative; text-align: center;
  box-shadow: 0 30px 70px rgba(40,20,10,.35);
  transform: translateY(16px) scale(.97); transition: transform .35s ease;
}
.donate-overlay.is-open .donate-modal { transform: translateY(0) scale(1); }
.donate-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border-radius: 50%; border: none; background: var(--bg-soft); color: var(--ink-soft);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.donate-close:hover { background: var(--line); color: var(--ink); }
.donate-modal h3 { font-size: 23px; margin: 0 0 12px; }
.donate-modal p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; margin: 0 0 24px; }
.donate-actions { display: flex; gap: 12px; }
.donate-actions .btn { flex: 1; justify-content: center; }
.btn-yes { background: #3f8f5f; color: #fff; }
.btn-yes:hover, .btn-yes:hover * { color: #fff; }
.btn-yes:hover { background: #35784f; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(63,143,95,.35); }
.btn-no { background: #b3423a; color: #fff; border: none; font-family: inherit; }
.btn-no:hover, .btn-no:hover * { color: #fff; }
.btn-no:hover { background: #97362f; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(179,66,58,.3); }

header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "left brand right";
  align-items: center; column-gap: 24px;
  padding: 14px 64px; background: var(--header-bg);
  box-shadow: 0 1px 4px rgba(40,20,10,.08);
  transition: box-shadow .25s ease;
}
header.scrolled { box-shadow: 0 6px 20px rgba(40,20,10,0.14); }
.header-vine { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.brand { grid-area: brand; justify-self: center; position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.brand-logo-wrap {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 80px; height: 80px; border-radius: 50%; background: var(--accent-dark);
  box-shadow: 0 3px 10px rgba(122,91,56,.32);
}
.brand-logo { height: 50px; width: auto; display: block; }
.brand-name { font-family: 'Playfair Display', Georgia, serif; font-size: 34px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.nav-left, .nav-right { position: relative; z-index: 1; display: flex; align-items: center; gap: 32px; }
.nav-left { grid-area: left; justify-self: start; }
.nav-right { grid-area: right; justify-self: end; }
.nav-link { position: relative; font-size: 17px; font-weight: 600; color: var(--ink); padding-bottom: 4px; }
.nav-link::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--accent-dark); transition: width .22s ease; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--accent-dark); }
.nav-link.is-soon { color: var(--ink-soft); cursor: default; }
.nav-link.is-soon:hover::after { width: 0; }
.soon-badge {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft); background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 20px; padding: 2px 7px; margin-left: 7px; vertical-align: 2px;
}

.nav-toggle {
  display: none; grid-area: toggle; position: relative; z-index: 1; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px; width: 36px; height: 36px; background: none; border: none;
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.nav-toggle .bar { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.page-head { background: var(--bg-soft); padding: 68px 64px; }
.page-head .eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 14px; }
.page-head h1 { font-size: 46px; font-weight: 600; margin: 0 0 14px; }
.page-head p { font-size: 16.5px; color: var(--ink-soft); max-width: 560px; margin: 0; }

.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 64px; padding: 72px 64px; align-items: start; }

.post { display: flex; gap: 26px; padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.post-thumb { width: 200px; min-width: 200px; height: 150px; border-radius: 16px; overflow: hidden; background: var(--bg-soft); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; }
.post-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }
.tag { padding: 3px 10px; border-radius: 20px; font-weight: 700; background: #f3ded3; color: #b3502e; }
.post-body h2, .post-body h3 { font-size: 25px; font-weight: 600; margin-bottom: 10px; }
.post-body h2 a, .post-body h3 a { color: inherit; }
.post-body h2 a:hover, .post-body h3 a:hover { color: var(--accent); }
.post-body .excerpt { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 14px; }
.post-actions { display: flex; align-items: center; gap: 18px; }
.read-link { font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }

.sidebar-block { margin-bottom: 44px; }
.sidebar-block h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 0 0 18px; font-weight: 700; }
.search-box { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: #fefcfa; transition: border-color .15s ease; }
.search-box:focus-within { border-color: var(--accent); }
.search-box input { border: none; outline: none; background: transparent; font-size: 14px; width: 100%; color: var(--ink); font-family: inherit; }
.recent-list a { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 16px; line-height: 1.4; }
.recent-list a:hover { color: var(--accent); }
.recent-list span { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 400; margin-top: 3px; }
.cat-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-pill { font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 20px; transition: transform .15s ease, box-shadow .15s ease; background: #f3ded3; color: #b3502e; }
.cat-pill:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(50,30,15,.14); }
.cat-pill.active { outline: 2px solid var(--ink); outline-offset: 2px; }

.no-results { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

/* Single post */
.single-post { max-width: 760px; margin: 0 auto; padding: 72px 64px; }
.single-post .post-meta { margin-bottom: 18px; }
.single-post h1 { font-size: 38px; font-weight: 600; margin-bottom: 24px; }
.single-post .post-thumb-full { width: 100%; height: 340px; border-radius: 20px; overflow: hidden; margin-bottom: 32px; }
.single-post .post-thumb-full img { width: 100%; height: 100%; object-fit: cover; display: block; }
.single-post .post-content { font-size: 16.5px; line-height: 1.75; color: #333; }
.single-post .post-content p { margin: 0 0 20px; }
.single-post .back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; margin-bottom: 32px; }

.comments-area { max-width: 760px; margin: 0 auto; padding: 0 64px 72px; }
.comments-area h3 { font-size: 22px; margin-bottom: 24px; }
.comment-list { list-style: none; margin: 0 0 32px; padding: 0; }
.comment-list li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-author { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.comment-meta { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.comment-text { font-size: 14.5px; line-height: 1.6; color: #333; }
.comment-respond input, .comment-respond textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 14.5px; margin-bottom: 14px; background: #fefcfa; color: var(--ink);
}
.comment-respond textarea { min-height: 110px; resize: vertical; }
.comment-respond label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.comment-form-field { margin-bottom: 14px; }

footer { padding: 56px 64px 40px; border-top: 1px solid var(--line); }
.copyright { font-size: 13px; color: var(--ink-soft); }

.wa-fab {
  position: fixed; right: 28px; bottom: 28px; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: #25D366; color: white; border-radius: 999px;
  padding: 13px; box-shadow: 0 6px 18px rgba(40,25,15,.22);
  cursor: pointer; text-decoration: none;
}
.wa-fab::before { content: ""; position: absolute; inset: 0; border-radius: 999px; animation: pulse 3.2s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.35); }
  70% { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
.wa-fab .wa-text { max-width: 0; overflow: hidden; white-space: nowrap; font-weight: 700; font-size: 14px; transition: max-width .3s ease; }
.wa-fab:hover .wa-text { max-width: 200px; }

/* TNG's own generated dropdown menu (tng_icons output, e.g. Buscar/Ingresar/Apellidos.../Medios/Info) —
   originally designed against the old dark-navy theme background; give it its own dark bar so the
   (white, unstyleable-by-us) link text stays legible against our new light page background. */
.menucontainer, .menucontainer .tngdd { background: var(--accent-dark); }
.menucontainer a { color: #fff8ef !important; }
.menucontainer a:hover { color: #ffffff !important; opacity: .85; }
/* the flyout submenus (e.g. Apellidos...Cementerio under Buscar) are separate elements from
   the top bar — TNG's own genstyle.css gives each flyout row a light #eeeeee/#ffffff background,
   which combined with the white text above becomes unreadable. Give the flyout its own dark
   background too, with a distinct hover state. */
.menucontainer .tngdd ul { background-color: var(--accent-dark) !important; box-shadow: 2px 2px 15px rgba(0,0,0,.35) !important; }
.menucontainer .tngdd ul li a { background-color: var(--accent-dark) !important; color: #fff8ef !important; border-top-color: rgba(255,255,255,.15) !important; }
.menucontainer .tngdd ul li a:hover { background-color: var(--accent) !important; color: #2a1c0e !important; }

/* ============================================================
   TNG's own template19 stylesheet (templatestyle.css) hardcodes a
   navy/indigo palette (#14153a/#1f2159/#2a2d7a/#444ced/#f0f1fa) across
   links, headings, buttons, content boxes and the bare <footer> tag —
   this predates our design and shows through on every TNG-rendered page
   (home page boxes, search results, surname lists, calendar, family
   trees, etc.), not just the header/footer chrome we wrote ourselves.
   Remap it to the site's tan palette so the whole site reads as one
   design. Selectors are copied from templatestyle.css so specificity
   matches; !important is only added where templatestyle.css also used it. */

/* links (default TNG state beats our plain "a" rule above via :link/:active specificity) */
a:link, a:active, div.icons a { color: var(--accent-dark); }
a:visited { color: var(--accent-dark); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

/* headings */
h1, h2, h3, h6 { color: var(--accent-dark); }
h4 { color: #fff8ef; background: var(--accent-dark); background: linear-gradient(var(--accent-dark), var(--accent), var(--accent-dark)); }
.dropcap:first-letter { color: var(--accent-dark); }

/* our own footer.php wraps its copyright line in a bare <footer> tag, which
   template19's templatestyle.css also targets (with a navy gradient meant
   for TNG's own tiny credit footer) — override so it matches our design */
footer { background: var(--bg) !important; background-image: none !important; color: var(--ink) !important; }
footer a { color: var(--accent-dark) !important; }
footer a:hover { color: var(--accent) !important; }

/* row1 (header/footer band, if present on other TNG pages) & row2 (the
   3-box sitemap band at the bottom of every TNG page, e.g. "Enlaces
   rápidos / Contacto / Mensaje de webmaster") */
.row1 { background: var(--accent-dark); background: linear-gradient(var(--accent-dark), var(--accent), var(--accent-dark)); }
.row2 { background: var(--bg-soft); border-bottom-color: var(--line); }

/* content-box "callout" style reused across TNG: home page search/nav
   boxes, sidebar callout box, "Mas"/detail buttons */
.callbox1 { background-color: var(--bg-soft); box-shadow: 0 0 0 5px var(--accent) inset, 0 0 0 6px rgba(255,255,255,.6) inset, 0 0 40px var(--accent-dark) inset, 0 10px 15px -10px rgba(0,0,0,.3); }
.callbox1 h4 { background: var(--accent-dark); background: linear-gradient(var(--accent-dark), var(--accent), var(--accent-dark)); }
.btn-detail { color: #fff8ef !important; background: var(--accent-dark); background: linear-gradient(var(--accent-dark), var(--accent), var(--accent-dark)); border-color: var(--accent-dark); }
.btn-detail:hover { background: var(--accent) !important; border-color: var(--accent); color: #2a1c0e !important; }

/* form buttons (e.g. the "Buscar" submit button) */
input.minifield, input[type=button], input[type=submit], input[type=reset], button { background-color: var(--accent-dark); }
.btn:hover, .btn:focus, .btn.focus { background-color: var(--accent) !important; }

/* alphabet/numeric tabs (surname list pages) */
.snlink, p a.snlink { background-color: var(--accent-dark) !important; }
a.snlink:hover, p a.snlink:hover { background-color: var(--accent) !important; }
.snlinkact { background-color: var(--accent); }

/* ancestor/descendant tab nav on person pages */
#tngnav a { background: var(--accent) !important; }
#tngnav a:hover { background: var(--accent-dark) !important; }
#tngnav a.here { background: var(--accent-dark) !important; }

/* calendar */
table.calendar, #calLegend, a.hidden, td.calToday { background-color: var(--bg-soft) !important; border-color: var(--accent-dark) !important; }
td.calDay { border-color: var(--accent-dark) !important; }

/* family tree pedigree/family boxes */
.pedbox, .hiddenbox, .fambox, .mfambox { background-color: var(--bg-soft) !important; }
.fambackground { background-color: var(--bg-soft); }

/* table header bars (surname counts, media/gallery listings, etc.) */
.fieldnameback, .bar, .page, .tablesaw-cell-label { background-color: var(--accent-dark); }

/* scroll-to-top button */
.scroll-to-top { background-color: var(--accent-dark); }
.scroll-to-top:hover { background-color: var(--accent); }

/* .fancybox is a decorative full-width band (used below the home page search
   box) with a hardcoded navy/purple background PHOTO (fancy.jpg) baked into
   template19 — can't recolor a raster image, so replace it with a gradient
   from our own palette instead; keep the white text since it was already
   designed for a dark backdrop. */
.fancybox { background: linear-gradient(135deg, var(--accent-dark), var(--accent)) !important; border-color: var(--accent-dark) !important; }
.fancybox h5, .fancybox h6 { color: #fff8ef; }

[data-aos] { opacity: 0; transition: opacity .6s ease, transform .6s ease; }
[data-aos="fade-up"] { transform: translateY(30px); }
[data-aos="fade-left"] { transform: translateX(30px); }
[data-aos].aos-animate { opacity: 1; transform: translate(0,0); }

@media (max-width: 900px) {
  header, .page-head, footer, .single-post, .comments-area { padding-left: 24px; padding-right: 24px; }
  .header-vine { display: none; }
  .nav-toggle { display: flex; }
  header {
    grid-template-columns: 1fr auto; grid-template-areas: "brand toggle" "left left" "right right";
    row-gap: 0;
  }
  .brand { justify-self: start; }
  .brand-logo-wrap { width: 54px; height: 54px; }
  .brand-logo { height: 34px; }
  .brand-name { font-size: 22px; }
  .nav-left, .nav-right {
    justify-self: stretch; width: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); border-top: 1px solid var(--line);
    padding: 0 0; margin: 0;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .3s ease, opacity .25s ease, padding .3s ease;
  }
  header.nav-open { box-shadow: 0 16px 28px rgba(40,20,10,.12); }
  header.nav-open .nav-left, header.nav-open .nav-right { max-height: 480px; opacity: 1; padding: 10px 0; }
  .nav-left .nav-link, .nav-right .nav-link { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-right .btn-primary, .nav-right .btn-donate { margin-top: 14px; justify-content: center; }
  .content-grid { grid-template-columns: 1fr; padding: 40px 24px; }
  .post { flex-direction: column; }
  .post-thumb { width: 100%; }
  .single-post h1 { font-size: 28px; }
}
