/* Identidad compartida para todas las páginas públicas de Sistemas Infinitos. */
:root {
  --site-navy: #10233f;
  --site-navy-soft: #18385e;
  --site-orange: #d9773b;
  --site-ink: #243449;
  --site-muted: #64748b;
  --site-line: rgba(148, 163, 184, .28);
  --site-header-bg: rgba(255, 255, 255, .94);
  --site-footer-bg: #10233f;
  --site-footer-text: #d6e0eb;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }
body { display: flex; flex-direction: column; min-width: 320px; min-height: 100vh; }
.content-layer { min-width: 0; width: 100%; }

/* Cabecera y navegación únicas. */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 1000;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px clamp(12px, 1.5vw, 22px);
  width: 100%;
  min-width: 0;
  min-height: 78px;
  padding: 10px clamp(16px, 3.2vw, 46px);
  border-bottom: 1px solid var(--site-line);
  background: var(--site-header-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 5px 22px rgba(15, 35, 64, .055);
}
.site-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--site-navy);
  text-decoration: none;
}
.site-brand img { display: block; width: 44px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.site-brand span { display: grid; gap: 2px; min-width: 0; }
.site-brand strong { color: var(--site-navy); font-size: 15px; line-height: 1.2; letter-spacing: .01em; white-space: nowrap; }
.site-brand small { color: var(--site-muted); font-size: 11px; line-height: 1.25; }
.site-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(8px, 1.1vw, 17px);
  min-width: 0;
  margin: 0;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 9px 1px;
  border-radius: 8px;
  color: #475569;
  font-size: clamp(11px, .82vw, 13px);
  line-height: 1.25;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease;
}
.site-nav a:hover, .site-nav a.is-active { color: var(--site-orange); }
.site-nav .nav-icon { display: none; }
.site-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.site-theme-toggle, .site-menu-toggle {
  display: inline-flex;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, .38);
  border-radius: 12px;
  background: rgba(248, 250, 252, .9);
  color: #334155;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.site-theme-toggle:hover, .site-menu-toggle:hover { background: #fff7ed; border-color: rgba(217, 119, 59, .45); color: #b45309; }
.site-theme-toggle:focus-visible, .site-menu-toggle:focus-visible, .site-nav a:focus-visible, .site-footer a:focus-visible {
  outline: 3px solid rgba(217, 119, 59, .45);
  outline-offset: 3px;
}
.site-theme-toggle svg, .site-menu-toggle svg {
  display: none;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#theme-toggle-dark-icon { display: block; }
.dark #theme-toggle-dark-icon { display: none; }
.dark #theme-toggle-light-icon { display: block; }
.site-menu-toggle { display: none; }
#mobile-menu-icon-open { display: block; }
.site-menu-toggle[aria-expanded="true"] #mobile-menu-icon-open { display: none; }
.site-menu-toggle[aria-expanded="true"] #mobile-menu-icon-close { display: block; }

/* Pie de página compartido: evita enlaces montados y recortes laterales. */
.site-footer {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-block-start: auto;
  padding: 28px clamp(16px, 4vw, 48px);
  overflow: visible;
  background: var(--site-footer-bg);
  color: var(--site-footer-text);
  font-size: 13px;
  line-height: 1.55;
}
.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  align-items: center;
  gap: 20px 28px;
  width: min(100%, 1220px);
  min-width: 0;
  margin-inline: auto;
}
.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}
.site-footer-brand img { flex: 0 0 auto; width: 34px; height: 34px; object-fit: contain; opacity: .72; }
.site-footer-brand span { display: block; min-width: 0; overflow-wrap: anywhere; }
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px 18px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
.site-footer-links a {
  display: inline-block;
  max-width: 100%;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .18s ease;
}
.site-footer-links a:hover { color: #fdba74; }

/* Páginas de contenido mantienen la misma estructura vertical. */
body > .site-header + main,
body > .site-header + .shell { flex: 1 0 auto; }
.site-footer nav { display: flex; }

@media (max-width: 1179.98px) {
  .site-header { flex-wrap: wrap; gap: 10px 14px; min-height: 72px; }
  .site-brand { order: 1; }
  .site-controls { order: 2; margin-inline-start: auto; }
  .site-menu-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 7px;
    margin: 0;
    padding: 12px 0 3px;
    border-top: 1px solid var(--site-line);
  }
  .site-nav.is-open { display: grid; }
  .site-nav a {
    justify-content: flex-start;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 11px;
    background: rgba(248, 250, 252, .88);
    color: #334155;
    font-size: 13px;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .site-nav a:hover, .site-nav a.is-active { background: #fff4e9; color: #a94c1d; }
  .site-nav .nav-icon { display: inline; flex: 0 0 auto; margin-inline-end: 8px; font-size: 16px; }
}

@media (max-width: 760px) {
  .site-footer { padding-block: 24px; }
  .site-footer-inner { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .site-footer-links { justify-content: flex-start; gap: 10px 16px; }
}

@media (max-width: 420px) {
  .site-header { padding-inline: 13px; }
  .site-brand img { width: 39px; height: 39px; }
  .site-brand strong { font-size: 14px; }
  .site-theme-toggle, .site-menu-toggle { width: 40px; height: 40px; flex-basis: 40px; }
  .site-nav { gap: 6px; }
  .site-nav a { padding: 9px 8px; font-size: 12px; }
  .site-footer-brand { align-items: flex-start; }
  .site-footer-links { gap: 9px 13px; }
}

.dark .site-header {
  --site-header-bg: rgba(15, 23, 42, .94);
  border-bottom-color: rgba(71, 85, 105, .55);
  background: var(--site-header-bg);
}
.dark .site-brand strong { color: #f8fafc; }
.dark .site-brand small { color: #94a3b8; }
.dark .site-nav a { color: #cbd5e1; }
.dark .site-nav a:hover, .dark .site-nav a.is-active { color: #fdba74; }
.dark .site-theme-toggle, .dark .site-menu-toggle { border-color: #475569; background: #1e293b; color: #e2e8f0; }
.dark .site-theme-toggle:hover, .dark .site-menu-toggle:hover { background: #334155; color: #fdba74; }
@media (max-width: 1179.98px) {
  .dark .site-nav a { border-color: rgba(71, 85, 105, .6); background: rgba(30, 41, 59, .92); color: #dbe4ef; }
  .dark .site-nav a:hover, .dark .site-nav a.is-active { background: rgba(124, 45, 18, .25); color: #fdba74; }
}
