/* ════════════════════════════════════════════════════════
   storytelling.cool · nav, subbarra y footer compartidos
   Requiere el bloque :root de tokens en la página.
   Prefijo stc- para no chocar con el CSS propio de cada página.
════════════════════════════════════════════════════════ */

html { scroll-padding-top: 5rem; }
html:has(.stc-sub) { scroll-padding-top: 7.5rem; }

/* ── Header (nav + subbarra opcional) ─────────────────── */
.stc-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border-l);
  font-family: var(--body);
}
.stc-nav {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.1rem clamp(1.5rem,5vw,4rem);
}
.stc-logo {
  font-family: var(--disp); font-weight: 900;
  font-size: .95rem; letter-spacing: .04em; line-height: 1;
  text-transform: uppercase; color: var(--black); text-decoration: none;
  white-space: nowrap;
}
.stc-logo span { color: var(--acc); }

.stc-links {
  display: flex; align-items: center; gap: 2.25rem;
  list-style: none; margin: 0; padding: 0;
}
.stc-links a {
  font-size: .82rem; font-weight: 500; color: var(--ink2);
  text-decoration: none; transition: color .2s; white-space: nowrap;
}
.stc-links a:hover { color: var(--black); }
.stc-links a[aria-current="page"] { color: var(--acc); }
.stc-links a.stc-cta {
  display: inline-block;
  background: var(--black); color: var(--white);
  padding: .55rem 1.4rem; border-radius: 2rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .03em;
  transition: background .2s, transform .15s;
}
.stc-links a.stc-cta:hover { background: var(--acc); color: var(--white); transform: translateY(-1px); }

.stc-toggle {
  display: none; background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 4px;
}
.stc-toggle span { display: block; width: 22px; height: 1.5px; background: var(--black); transition: .3s; }
.stc-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(4px,4px); }
.stc-toggle.open span:nth-child(2) { opacity: 0; }
.stc-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(4px,-4px); }

@media (max-width:1100px) and (min-width:821px) {
  .stc-links { gap: 1.75rem; }
  .stc-links .stc-hide-md { display: none; }
}

@media (max-width:820px) {
  .stc-toggle { display: flex; }
  .stc-links {
    position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100dvh - 100%);
    display: block; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--white); border-top: 1px solid var(--border-l);
    visibility: hidden; opacity: 0; pointer-events: none;
    transition: opacity .2s ease, visibility .2s;
  }
  .stc-links.open { visibility: visible; opacity: 1; pointer-events: auto; }
  .stc-links li {
    display: block; padding: 0 clamp(1.5rem,5vw,4rem);
    border-bottom: 1px solid var(--border-l);
  }
  .stc-links a { display: block; padding: .9rem 0; font-size: 1rem; }
  .stc-links a:hover { color: var(--acc); }
  .stc-links li:has(.stc-cta) { border-bottom: none; }
  .stc-links a.stc-cta { display: inline-block; margin: 1.25rem 0 1.5rem; padding: .75rem 1.5rem; font-size: .78rem; }
}

/* ── Subbarra: navegación propia de cada sección ──────── */
.stc-sub { border-top: 1px solid var(--border-l); }
.stc-sub-in {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
  flex-wrap: wrap;
  padding: .6rem clamp(1.5rem,5vw,4rem);
  font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink3);
}
.stc-crumb { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.stc-crumb a { color: var(--ink3); text-decoration: none; transition: color .2s; }
.stc-crumb a:hover { color: var(--black); }
.stc-crumb .stc-here { color: var(--black); }
.stc-sub-links { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.stc-sub-links a { color: var(--ink3); text-decoration: none; transition: color .2s; }
.stc-sub-links a:hover { color: var(--black); }
.stc-sub-act { color: var(--acc); text-decoration: none; display: inline-flex; gap: .3rem; transition: gap .2s; }
.stc-sub-act:hover { gap: .55rem; }
@media (max-width:600px) {
  .stc-sub-in { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; scrollbar-width: none; }
  .stc-sub-in::-webkit-scrollbar { display: none; }
  .stc-sub-links { flex-wrap: nowrap; }
}

/* ── Footer ───────────────────────────────────────────── */
.stc-footer {
  background: var(--black);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 2.5rem clamp(1.5rem,5vw,4rem) 2rem;
  font-family: var(--body);
}
.stc-f-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1.25rem 2rem;
}
.stc-f-logo {
  font-family: var(--disp); font-weight: 900; font-size: .9rem;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--white); text-decoration: none;
}
.stc-f-logo span { color: var(--acc-on-dark); }
.stc-f-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.stc-f-links a { font-size: .75rem; color: rgba(255,255,255,.55); text-decoration: none; letter-spacing: .02em; transition: color .2s; }
.stc-f-links a:hover { color: var(--white); }
.stc-f-bottom {
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 2rem;
  font-size: .7rem; line-height: 1.6; letter-spacing: .03em; color: rgba(255,255,255,.45);
}
.stc-f-bottom a { color: rgba(255,255,255,.55); text-decoration: underline; text-underline-offset: 2px; }
.stc-f-bottom a:hover { color: var(--white); }
.stc-f-bottom strong { color: rgba(255,255,255,.55); font-weight: 600; }

.stc-header :focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.stc-footer :focus-visible { outline: 2px solid var(--acc-on-dark); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .stc-links a.stc-cta:hover { transform: none; }
}

/* ── Selector de idioma (sutil) ───────────────────────── */
.stc-lang {
  order: 2;
  font-size: .68rem; font-weight: 600; letter-spacing: .12em; line-height: 1;
  color: var(--ink3); text-decoration: none;
  border: 1px solid var(--border-l); border-radius: 2rem;
  padding: .4rem .6rem;
  transition: color .2s, border-color .2s;
}
.stc-lang:hover { color: var(--black); border-color: var(--black); }
.stc-links { order: 1; }
.stc-toggle { order: 3; }
@media (min-width:821px) { .stc-links { margin-left: auto; } }
@media (max-width:820px) { .stc-lang { margin-left: auto; } }
