/* Salvid Salud — paleta: #1c40d7, #91a3ec, #e20f17 */
:root {
  --c-primary: #1c40d7;
  --c-light: #91a3ec;
  --c-accent: #e20f17;
  --c-ink: #0d1117;
  --c-ink-soft: #1a2332;
  --c-surface: #f5f7fc;
  --c-surface-2: #e8edfb;
  --c-white: #ffffff;
  --shadow: 0 8px 32px rgba(28, 64, 215, 0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --header-h: 72px;
  --max: 1140px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height:1.6;
  color: var(--c-ink-soft);
  background: var(--c-surface);
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--c-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--c-accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ——— Skip link ——— */
.skip {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background: var(--c-accent);
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  transition: top 0.2s;
}

.skip:focus {
  top: 12px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(145, 163, 236, 0.2);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.brand-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-txt strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--c-white);
  font-weight: 600;
}

.brand-txt span {
  font-size: 0.72rem;
  color: var(--c-light);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-main a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.nav-main a:hover,
.nav-main a:focus-visible {
  background: rgba(28, 64, 215, 0.45);
  color: #fff;
  outline: none;
}

.nav-main a.nav-highlight {
  background: var(--c-accent);
  color: #fff;
}

.nav-main a.nav-highlight:hover {
  background: #c00d14;
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: inline;
}

.nav-toggle[aria-expanded="false"] .icon-menu {
  display: inline;
}

.nav-toggle[aria-expanded="false"] .icon-close,
.nav-toggle:not([aria-expanded="true"]) .icon-close {
  display: none;
}

@media (max-width: 1024px) {
  .nav-toggle {
    display: flex;
  }

  .nav-main {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    min-height: calc(100dvh - var(--header-h));
    background: #0d1117;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 2rem;
    gap: 0.15rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .nav-main.is-open {
    transform: translateX(0);
  }

  .nav-main a {
    font-size: 1rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: min(88vh, 900px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
}

.hero-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(10, 15, 26, 0.92) 0%,
    rgba(28, 64, 215, 0.5) 50%,
    rgba(14, 20, 35, 0.75) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.25rem 3.5rem;
  width: 100%;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
  max-width: 22ch;
}

.hero h1 .hl-red {
  color: #f8b4b8;
}

.hero-lead {
  font-size: 1.1rem;
  max-width: 40ch;
  color: #e2e8f0;
  margin: 0 0 1.5rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(145, 163, 236, 0.35);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
}

.badge strong {
  color: var(--c-light);
}

/* ——— Sections ——— */
section {
  padding: 3.5rem 1.25rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  color: var(--c-primary);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.section-kicker {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--c-accent);
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.block-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.wave-top {
  margin-top: -1px;
  line-height: 0;
  color: var(--c-surface);
}

.home-intro {
  background: var(--c-white);
}

.nav-main a[aria-current="page"] {
  background: rgba(28, 64, 215, 0.65);
  color: #fff;
}

.nav-main a.nav-highlight[aria-current="page"] {
  background: var(--c-accent);
  color: #fff;
}

/* Quiénes somos */
#quienes {
  background: var(--c-white);
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .two-cols {
    grid-template-columns: 1fr;
  }
}

.prose p {
  margin: 0 0 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.aside-gfx {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--c-surface-2);
}

/* Cards grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--c-white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--c-surface-2);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--c-primary);
  margin: 0 0 0.75rem;
}

/* Misión / Visión */
#mision-vision {
  background: linear-gradient(180deg, var(--c-surface) 0%, var(--c-surface-2) 100%);
}

.split-highlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .split-highlight {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--c-white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border-left: 4px solid var(--c-primary);
  box-shadow: var(--shadow);
}

.panel.vision {
  border-left-color: var(--c-accent);
}

/* Servicios */
#servicios {
  background: var(--c-ink);
  color: #e2e8f0;
}

#servicios .section-title {
  color: var(--c-light);
}

#servicios .section-kicker {
  color: #f87171;
}

.servicios-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.servicios-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 1.05rem;
}

.servicios-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 0.4rem;
  border-radius: 2px;
  background: var(--c-accent);
  flex-shrink: 0;
}

/* Procesos y valores */
#procesos,
#valores {
  background: var(--c-white);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pill {
  background: var(--c-surface-2);
  color: var(--c-ink-soft);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.95rem;
  border: 1px solid rgba(28, 64, 215, 0.15);
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.value-card {
  text-align: center;
  padding: 1.25rem 0.75rem;
  background: linear-gradient(145deg, #fff, var(--c-surface));
  border-radius: var(--radius);
  border: 1px solid var(--c-surface-2);
  font-weight: 600;
  color: var(--c-primary);
}

/* Políticas (details) */
#politicas {
  background: var(--c-surface);
}

.policy details {
  background: var(--c-white);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  border: 1px solid var(--c-surface-2);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.policy summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--c-primary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.policy summary::-webkit-details-marker {
  display: none;
}

.policy summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--c-accent);
  font-weight: 700;
}

.policy details[open] summary::after {
  content: "−";
}

.policy .policy-body {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.98rem;
  color: #334155;
  border-top: 1px solid var(--c-surface-2);
}

.policy .policy-body ul {
  margin: 0.5rem 0 0 1.1rem;
  padding: 0;
}

.policy .policy-body li {
  margin-bottom: 0.35rem;
}

/* EEFF — destacado */
#eeff {
  background: linear-gradient(135deg, #1c40d7 0%, #0f2a7a 50%, #1a1f35 100%);
  color: #e2e8f0;
  position: relative;
  overflow: hidden;
}

#eeff::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -15%;
  width: 50%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(226, 15, 23, 0.2) 0%, transparent 65%);
  pointer-events: none;
}

#eeff .block-inner {
  position: relative;
  z-index: 1;
}

#eeff .section-title {
  color: #fff;
}

#eeff .section-kicker {
  color: var(--c-light);
}

.eeff-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .eeff-card {
    grid-template-columns: 1fr;
  }
}

.eeff-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}

.eeff-actions p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.98rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--c-accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(226, 15, 23, 0.45);
}

.btn-primary:hover {
  color: #fff;
  background: #c00d14;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.eeff-frame {
  min-height: 360px;
  background: #0a0d14;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.eeff-frame iframe {
  width: 100%;
  height: min(70vh, 520px);
  border: 0;
}

/* Galería */
#galeria {
  background: var(--c-white);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

.gallery-thumb {
  display: block;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
  box-shadow: var(--shadow);
  outline: none;
  width: 100%;
  background: var(--c-white);
}

.gallery-thumb:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
  pointer-events: none;
}

.gallery-thumb:hover img {
  transform: scale(1.04);
}

/* Lightbox galería */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.gallery-lightbox[hidden] {
  display: none !important;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 15, 26, 0.94);
  cursor: pointer;
}

.gallery-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(96vw, 1200px);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  pointer-events: none;
}

.gallery-lightbox-dialog > * {
  pointer-events: auto;
}

.gallery-lightbox-close {
  align-self: flex-end;
  margin: 0 0 0.25rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.gallery-lightbox-close:hover {
  background: var(--c-accent);
  color: #fff;
}

.gallery-lightbox-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: #e8ecff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  background: rgba(28, 64, 215, 0.65);
}

.gallery-lightbox-prev[disabled],
.gallery-lightbox-next[disabled] {
  opacity: 0.35;
  cursor: default;
}

.gallery-lightbox-img {
  width: 100%;
  max-height: min(78vh, 760px);
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  background: transparent;
  display: block;
}

.gallery-lightbox-counter {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  color: #cbd5e1;
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  .gallery-lightbox-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
  }

  .gallery-lightbox-img {
    flex: 1 1 100%;
    max-height: min(62vh, 560px);
    order: 1;
  }

  .gallery-lightbox-prev,
  .gallery-lightbox-next {
    flex: 1;
    min-width: 120px;
    max-width: calc(50% - 0.25rem);
    height: 44px;
    font-size: 1.5rem;
    order: 2;
  }
}

/* Video sección adicional */
#recurso-video {
  background: var(--c-ink);
  color: #e2e8f0;
}

.video-box {
  max-width: 800px;
  margin: 1.5rem auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(145, 163, 236, 0.25);
}

.video-box video {
  width: 100%;
  display: block;
  background: #000;
}

/* Footer */
.site-footer {
  background: #080b10;
  color: #94a3b8;
  padding: 2.5rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer strong {
  color: var(--c-light);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
