/* ============================================================
   BASE.CSS — Reset · Tipografía · Utilidades · Navbar · Footer
   SINERGÍA — Centro de Desarrollo Humano Ubuntu330 — 2025
   ============================================================ */

/* ------------------------------------------------------------
   1. MODERN RESET
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

blockquote,
q {
  quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: '';
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ------------------------------------------------------------
   2. TIPOGRAFÍA BASE
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-base); font-weight: 600; }
h6 { font-size: var(--fs-sm); font-weight: 600; }

p {
  font-size: var(--fs-base);
  color: var(--color-text-muted);
  line-height: 1.7;
}

strong {
  font-weight: 700;
  color: var(--color-text);
}

em {
  font-style: italic;
}

small {
  font-size: var(--fs-xs);
}

cite {
  font-style: italic;
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
}

/* ------------------------------------------------------------
   3. LAYOUT UTILITIES
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

section {
  padding-block: var(--section-pad);
}

/* ------------------------------------------------------------
   4. SECTION TYPOGRAPHY UTILITIES
   ------------------------------------------------------------ */
.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--sp-2);
  position: relative;
  padding-left: var(--sp-3);
}

.section-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 2px;
  background-color: var(--color-gold);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 900;
  color: var(--color-text);
  line-height: 1.1;
  margin-bottom: var(--sp-2);
}

.section-subtitle {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: var(--sp-6);
}

/* ------------------------------------------------------------
   5. BUTTONS
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  padding: 14px 32px;
  border: 2px solid transparent;
  transition:
    background-color var(--dur-fast) var(--ease-in-out),
    color           var(--dur-fast) var(--ease-in-out),
    border-color    var(--dur-fast) var(--ease-in-out),
    transform       var(--dur-fast) var(--ease-spring),
    box-shadow      var(--dur-fast) var(--ease-in-out);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

/* Primary: gold bg, black text */
.btn--primary {
  background-color: var(--color-gold);
  color: #0D1B3E;
  border-color: var(--color-gold);
}

.btn--primary:hover {
  background-color: var(--color-gold-light);
  border-color: var(--color-gold-light);
  transform: scale(1.03);
  box-shadow: var(--shadow-gold);
}

.btn--primary:active {
  transform: scale(0.98);
}

/* Secondary: border gold, gold text, fill on hover */
.btn--secondary {
  background-color: transparent;
  color: var(--color-gold);
  border-color: var(--color-gold);
}

.btn--secondary:hover {
  background-color: var(--color-gold);
  color: #0D1B3E;
  transform: scale(1.03);
  box-shadow: var(--shadow-gold);
}

.btn--secondary:active {
  transform: scale(0.98);
}

/* Outline: border white, white text, fill surface on hover */
.btn--outline {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-text);
}

.btn--outline:hover {
  background-color: var(--color-surface);
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.btn--outline:active {
  transform: scale(0.98);
}

/* ------------------------------------------------------------
   6. NAVBAR
   ------------------------------------------------------------ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--container-pad);
  height: 64px;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-surface-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow var(--dur-fast) var(--ease-in-out);
}

.navbar.navbar--scrolled {
  box-shadow: var(--shadow-md);
}

.navbar__brand {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 900;
  color: var(--color-gold);
  letter-spacing: 0.06em;
  cursor: default;
  user-select: none;
  transition: color var(--dur-fast) var(--ease-in-out);
}

.navbar__brand:hover {
  color: var(--color-gold-light);
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  list-style: none;
}

.navbar__links a {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition:
    color        var(--dur-fast) var(--ease-in-out),
    background   var(--dur-fast) var(--ease-in-out);
  white-space: nowrap;
}

.navbar__links a:hover {
  color: var(--color-text);
  background-color: var(--color-surface);
}

.navbar__links a:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.navbar__links a.navbar__link--active {
  color: var(--color-gold);
  background-color: var(--color-surface);
}

.navbar__cta {
  background-color: var(--color-gold) !important;
  color: #0D1B3E !important;
  font-weight: 700 !important;
  border-radius: var(--radius-full) !important;
  padding: 8px 20px !important;
  transition:
    background-color var(--dur-fast) var(--ease-in-out),
    transform        var(--dur-fast) var(--ease-spring),
    box-shadow       var(--dur-fast) var(--ease-in-out) !important;
}

.navbar__cta:hover {
  background-color: var(--color-gold-light) !important;
  transform: scale(1.04) !important;
  box-shadow: var(--shadow-gold) !important;
}

/* Hamburger — hidden on desktop */
.navbar__hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  line-height: 1;
  transition: color var(--dur-fast) var(--ease-in-out);
}

.navbar__hamburger:hover {
  color: var(--color-gold);
}

.navbar__hamburger:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Mobile — ocultar links inline; el sidebar se encarga de la navegación completa */
@media (max-width: 900px) {
  .navbar__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .navbar__links {
    display: none;
  }
}

/* ── SIDEBAR DE NAVEGACIÓN LATERAL ───────────────────────────────────────── */

/* Overlay oscuro */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 25, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-normal) var(--ease-smooth);
  z-index: 200;
}

.sidebar-overlay.sidebar-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

/* Panel lateral */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  background: var(--color-bg);
  border-left: 1px solid var(--color-surface-2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-normal) var(--ease-smooth);
  z-index: 201;
  overflow: hidden;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
}

.sidebar.sidebar--open {
  transform: translateX(0);
}

/* Encabezado */
.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5);
  height: 64px;
  border-bottom: 1px solid var(--color-surface-2);
  flex-shrink: 0;
  background: var(--color-surface);
}

.sidebar__logo {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 900;
  color: var(--color-gold);
  letter-spacing: 0.06em;
}

.sidebar__close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  line-height: 1;
  transition: color var(--dur-fast) var(--ease-in-out), background var(--dur-fast) var(--ease-in-out);
}

.sidebar__close:hover {
  color: var(--color-gold);
  background: var(--color-surface-2);
}

/* Lista de secciones */
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2) 0;
}

.sidebar__nav::-webkit-scrollbar { width: 4px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb { background: var(--color-surface-2); border-radius: 2px; }

.sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-left: 3px solid transparent;
  text-decoration: none;
  transition:
    background      var(--dur-fast) var(--ease-in-out),
    border-color    var(--dur-fast) var(--ease-in-out);
}

.sidebar__link:hover {
  background: var(--color-surface);
  border-left-color: var(--color-surface-2);
}

.sidebar__link.sidebar__link--active {
  background: var(--color-surface);
  border-left-color: var(--color-gold);
}

/* Número */
.sidebar__num {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  min-width: 22px;
  line-height: 1;
  transition: color var(--dur-fast) var(--ease-in-out);
}

.sidebar__link.sidebar__link--active .sidebar__num,
.sidebar__link:hover .sidebar__num {
  color: var(--color-gold);
}

/* Texto de la sección */
.sidebar__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__info b {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
  transition: color var(--dur-fast) var(--ease-in-out);
}

.sidebar__link.sidebar__link--active .sidebar__info b {
  color: var(--color-gold);
}

.sidebar__info em {
  font-size: var(--fs-xs);
  font-style: normal;
  color: var(--color-text-muted);
  line-height: 1.3;
}

/* CTA footer */
.sidebar__footer {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--color-surface-2);
  flex-shrink: 0;
}

.sidebar__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-gold);
  color: #0D1B3E !important;
  font-weight: 700;
  font-size: var(--fs-sm);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition:
    background  var(--dur-fast) var(--ease-in-out),
    transform   var(--dur-fast) var(--ease-spring),
    box-shadow  var(--dur-fast) var(--ease-in-out);
}

.sidebar__cta:hover {
  background: var(--color-gold-light);
  transform: scale(1.02);
  box-shadow: var(--shadow-gold);
}

.sidebar__cta-arrow {
  font-size: 1.1rem;
  transition: transform var(--dur-fast) var(--ease-spring);
}

.sidebar__cta:hover .sidebar__cta-arrow {
  transform: translateX(4px);
}

/* Móvil: sidebar ocupa todo el ancho */
@media (max-width: 420px) {
  .sidebar { width: 100%; }
}

/* ------------------------------------------------------------
   7. FOOTER
   ------------------------------------------------------------ */
.footer {
  background-color: var(--color-surface);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-surface-2);
}

/* Nav grid */
.footer__nav {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--sp-6);
  padding: var(--sp-10) var(--container-pad) var(--sp-6);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Brand column */
.footer__brand-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer__logo {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--color-gold);
}

.footer__tagline {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

.footer__cta {
  display: inline-block;
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: var(--color-gold);
  color: var(--color-bg);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity var(--dur-fast) var(--ease-smooth);
}

.footer__cta:hover { opacity: 0.85; }

/* Nav columns */
.footer__col h4 {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 var(--sp-3);
}

.footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.footer__col a {
  font-size: var(--fs-sm);
  color: var(--color-text);
  text-decoration: none;
  opacity: 0.70;
  transition: opacity var(--dur-fast) var(--ease-smooth), color var(--dur-fast) var(--ease-smooth);
}

.footer__col a:hover {
  opacity: 1;
  color: var(--color-gold);
}

/* Bottom bar */
.footer__bottom {
  padding: var(--sp-4) var(--container-pad);
  text-align: center;
}

.footer__bottom p {
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  margin: 0;
}

/* Footer responsive */
@media (max-width: 900px) {
  .footer__nav {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8) var(--sp-6);
  }
  .footer__brand-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .footer__nav {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-6);
  }
}

/* ------------------------------------------------------------
   8. FOCUS VISIBLE — ACCESSIBILITY
   ------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------
   9. SCROLLBAR CUSTOM
   ------------------------------------------------------------ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-dark);
}

/* ------------------------------------------------------------
   10. SELECTION COLOR
   ------------------------------------------------------------ */
::selection {
  background-color: var(--color-gold);
  color: var(--color-bg);
}

/* ------------------------------------------------------------
   11. REDUCED MOTION
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto;
  }
}
