/* ── HEADER ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: var(--site-header-h);
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
  animation: fadeDown 0.5s ease both;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.site-subtitle {
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dev-badge {
  display: inline-block;
  background: #FFF3CD;
  color: #856404;
  border: 1px solid #FFE083;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  padding: 0 5px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.site-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* ── ABOUT LINK (right-aligned header entry to "Sobre mí") ── */
.header-about-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink-muted);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.header-about-link:hover,
.header-about-link.active {
  color: var(--ink);
  border-color: var(--ink-faint);
  background: rgba(28,28,26,0.05);
}

/* ── SITE NAV (bottom tab bar on mobile, top bar on desktop) ── */
.site-nav {
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--cream);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 20;
  /* Standalone/installed mode can render edge-to-edge under the OS gesture
     bar (unlike a regular browser tab, which always reserves that space) —
     pad it out so the tab bar isn't hidden behind it. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Desktop: bottom tab bars are a mobile/thumb-reach pattern that reads as
   misplaced once there's no reason to hug the bottom edge. Move it right
   under the header instead — reordered via flex `order` since header, main
   and .site-nav are all direct `body` children (body is a flex column), so
   no markup changes are needed per page. */
@media (min-width: 769px) {
  header { order: -2; }
  .site-nav {
    order: -1;
    position: sticky;
    top: var(--site-header-h);
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
  }
}

.site-nav-item {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  text-decoration: none;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-top: 2px solid transparent;
  margin-top: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav-item:hover { color: var(--ink); }

.site-nav-item.active {
  color: var(--ink);
  border-top-color: var(--ink);
}

/* ── EDITOR NAV LINK (Vista pública button, right-aligned) ── */
.nav-link {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 100px;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.nav-link:hover {
  color: #fff;
  border-color: #134d87;
  background: #134d87;
  box-shadow: 0 4px 14px rgba(24,95,165,0.35);
}

/* ── SOCIAL ── */
.social-link {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  text-decoration: none;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.social-link:hover {
  color: var(--ink);
  border-color: var(--ink-faint);
  background: rgba(128,128,120,0.06);
}

/* ── INTRO STRIP ── */
.intro {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 11px 60px 11px 24px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  animation: fadeDown 0.5s 0.1s ease both;
}

.intro-text {
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  color: var(--ink-muted);
  text-align: center;
}

.intro-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex-shrink: 0;
}

.intro-tip {
  font-size: 12px;
  /* var(--ink-faint) on --cream is ~3.6:1, below the 4.5:1 AA floor for
     this text size — darkened just for this label rather than touching
     the shared variable (used elsewhere for borders/placeholders too). */
  color: #6B6864;
  white-space: nowrap;
}

.intro-corner-note {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ── HELP BUTTON ── */
.help-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px 6px 11px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 100px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.help-btn:hover {
  color: #fff;
  border-color: #134d87;
  background: #134d87;
  box-shadow: 0 4px 14px rgba(24,95,165,0.35);
}
.help-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.help-btn.active svg { stroke: #fff; }
.help-label { line-height: 1; }

/* ── FOOTER ── */
footer {
  padding: 14px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  animation: fadeUp 0.5s 0.3s ease both;
}

.footer-left { font-size: 12px; color: var(--ink-faint); }
