/* ================================================================
   Tribunal de Cuentas — La Pampa · Custom Stylesheet
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --navy:       #00549A;
  --navy-dark:  #0B2545;
  --navy-hover: #003B6D;
  --navy-light: #EBF5FF;
  --accent:     #0284C7;
  --gold:       #B45309;
  --bg:         #F4F7FA;
  --text:       #0B2545;
  --radius-xl:  1.25rem;
  --radius-2xl: 1.5rem;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.05);
  --shadow-xl:  0 20px 50px rgba(0,0,0,.14), 0 8px 16px rgba(0,0,0,.06);
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  transition: font-size .2s ease;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 { font-family: 'Montserrat', sans-serif; }

img { display: block; max-width: 100%; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #F1F5F9; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; border: 2px solid #F1F5F9; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ── Focus ─────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Sticky header ─────────────────────────────────────────── */
#main-header.sticky-scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.08);
  background: rgba(255,255,255,.97);
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero-pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='white'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

/* Pills búsqueda rápida */
.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .875rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  transition: all .2s ease;
  white-space: nowrap;
}
.quick-pill:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.25);
  color: #fff;
}

/* ── Animaciones de entrada ────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fade-up {
  animation: fadeUp .7s ease both;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Encabezados de sección ────────────────────────────────── */
.section-header { max-width: 640px; }
.section-eyebrow {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: .625rem;
}
.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.5rem, 3.5vw, 2.125rem);
  font-weight: 800;
  color: var(--navy-dark);
  line-height: 1.15;
  margin-bottom: .5rem;
}
.section-desc {
  font-size: .9375rem;
  color: #6B7280;
  line-height: 1.7;
  margin-bottom: 0;
}

/* ── Cards de acceso rápido ────────────────────────────────── */
.access-card {
  position: relative;
  background: #fff;
  border: 1px solid #E9EEF5;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  height: 220px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s ease, transform .3s ease;
  cursor: pointer;
}
.access-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}
.access-card-front,
.access-card-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: opacity .35s ease, transform .35s ease;
}
.access-card-back {
  background: linear-gradient(135deg, var(--navy), var(--navy-hover));
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
}
.access-card:hover .access-card-front {
  opacity: 0;
  transform: translateY(-12px);
}
.access-card:hover .access-card-back {
  opacity: 1;
  transform: translateY(0);
}

.access-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: transform .3s ease;
}
.access-card:hover .access-icon { transform: scale(1.05); }

.access-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: .25rem;
}
.access-card-desc {
  font-size: .75rem;
  color: #6B7280;
  line-height: 1.5;
}
.access-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.4);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .5rem 1.25rem;
  border-radius: .75rem;
  transition: background .2s ease, border-color .2s ease;
}
.access-btn:hover {
  background: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.7);
}

/* ── Campañas ──────────────────────────────────────────────── */
.campaign-card {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow-md);
  transition: box-shadow .3s ease, transform .3s ease;
}
.campaign-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}
.campaign-img-wrap {
  position: absolute;
  inset: 0;
  background: #0B2545;
}
.campaign-img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .6;
}
.campaign-overlay {
  position: absolute;
  inset: 0;
}
.campaign-body {
  position: relative;
  z-index: 10;
  padding: 1.5rem;
  text-align: left;
}
.campaign-tag {
  display: inline-block;
  color: #fff;
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .625rem;
  border-radius: 9999px;
  margin-bottom: .5rem;
}
.campaign-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: .375rem;
}
.campaign-desc {
  font-size: .6875rem;
  color: rgba(255,255,255,.7);
  line-height: 1.5;
  margin-bottom: .875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.campaign-link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .75rem;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  transition: color .2s ease;
}
.campaign-link:hover { color: #fff; }

/* ── Estadísticas ──────────────────────────────────────────── */
.stat-item {
  padding: 3rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.stat-number {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
  letter-spacing: -.02em;
}
.stat-label {
  font-size: .8125rem;
  font-weight: 500;
  color: rgba(191,219,254,.8);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── Sesiones ──────────────────────────────────────────────── */
.session-card {
  background: #fff;
  border: 1px solid #E9EEF5;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, transform .25s ease;
}
.session-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.session-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: .875rem;
  border-top: 1px solid #F1F5F9;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .25rem .625rem;
  border-radius: 9999px;
  border: 1px solid;
}

/* ── Noticias ──────────────────────────────────────────────── */
.news-card {
  background: #fff;
  border: 1px solid #E9EEF5;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s ease, transform .3s ease;
}
.news-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}
.news-img-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  display: block;
  background: #E2E8F0;
}
.news-img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.news-category-tag {
  position: absolute;
  top: .875rem;
  left: .875rem;
  background: var(--navy);
  color: #fff;
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .25rem .625rem;
  border-radius: 9999px;
}
.news-body {
  padding: 1.25rem 1.375rem 1.375rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.news-meta { margin-bottom: .5rem; }
.news-date {
  font-size: .6875rem;
  color: #9CA3AF;
  font-weight: 500;
}
.news-title {
  font-family: 'Montserrat', sans-serif;
  font-size: .9375rem;
  font-weight: 700;
  color: var(--navy-dark);
  line-height: 1.4;
  margin-bottom: .625rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-excerpt {
  font-size: .8125rem;
  color: #6B7280;
  line-height: 1.65;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}
.news-read-more {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--navy);
  transition: color .2s ease, gap .2s ease;
  margin-top: auto;
}
.news-read-more:hover {
  color: var(--navy-hover);
  gap: .625rem;
}

/* ── Capacitaciones ────────────────────────────────────────── */
.training-card {
  background: #fff;
  border: 1px solid #E9EEF5;
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, transform .25s ease;
}
.training-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.training-duration {
  font-family: 'Montserrat', sans-serif;
  font-size: .6875rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--navy-light);
  border: 1px solid rgba(0,84,154,.15);
  padding: .25rem .625rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.training-title {
  font-family: 'Montserrat', sans-serif;
  font-size: .9375rem;
  font-weight: 700;
  color: var(--navy-dark);
  line-height: 1.4;
  margin-bottom: .5rem;
  flex-grow: 1;
}
.training-desc {
  font-size: .8125rem;
  color: #6B7280;
  line-height: 1.6;
  margin-bottom: 1.125rem;
}
.training-btn {
  display: block;
  text-align: center;
  background: var(--navy);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .625rem 1rem;
  border-radius: .75rem;
  transition: background .2s ease;
}
.training-btn:hover { background: var(--navy-hover); }

/* ── Footer ────────────────────────────────────────────────── */
.footer-heading {
  font-family: 'Montserrat', sans-serif;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #7DD3FC;
  margin-bottom: 1.25rem;
  padding-bottom: .625rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.footer-link {
  font-size: .8125rem;
  color: #94A3B8;
  transition: color .2s ease, translate .2s ease;
  display: block;
  padding: .125rem 0;
}
.footer-link::before {
  content: '›';
  margin-right: .375rem;
  color: #38BDF8;
}
.footer-link:hover {
  color: #CBD5E1;
  translate: 2px 0;
}

/* ── Nav dropdown menus ────────────────────────────────────── */
.nav-link {
  transition: background .15s ease, color .15s ease;
}

/* ── Alto contraste ────────────────────────────────────────── */
body.high-contrast { background: #000 !important; color: #fff !important; }
body.high-contrast :not(a, button, select, option, svg, path, .hc-exclude) {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
body.high-contrast a,
body.high-contrast button {
  background: #000 !important;
  color: #ff0 !important;
  border: 2px solid #ff0 !important;
  text-decoration: underline !important;
}
body.high-contrast a:hover,
body.high-contrast button:hover {
  background: #ff0 !important;
  color: #000 !important;
}
body.high-contrast svg { fill: currentColor !important; stroke: currentColor !important; }
body.high-contrast .hero-section { background: #000 !important; }
body.high-contrast .hero-pattern { display: none; }

/* ── Tello ─────────────────────────────────────────────────── */
@keyframes tello-bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes tello-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(2,132,199,.4); }
  70%  { box-shadow: 0 0 0 12px rgba(2,132,199,0); }
  100% { box-shadow: 0 0 0 0 rgba(2,132,199,0); }
}
.animate-tello-idle { animation: tello-bounce 3s infinite ease-in-out; }
.animate-tello-pulse { animation: tello-pulse 2.5s infinite; }

.tello-chat-bubble {
  box-shadow: 0 12px 40px rgba(11,37,69,.18), 0 4px 12px rgba(11,37,69,.10);
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
  .hero-section { min-height: auto !important; padding: 2rem !important; }
  .access-card { height: auto !important; break-inside: avoid; }
  .access-card-back { display: none !important; }
  .access-card-front { position: static !important; opacity: 1 !important; transform: none !important; }
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .stat-item { padding: 2rem 1rem; }
  .stat-number { font-size: 2.25rem; }
  .campaign-card { height: 260px; }
}

/* ── Switch de Contraste (sol/luna) ─────────────────────────────
   Todos los selectores van bajo .switch para evitar colisiones.
   Keyframes con prefijo tc- para no pisar otros en el proyecto.
   ─────────────────────────────────────────────────────────────── */
.switch {
  font-size: 15px;
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  vertical-align: middle;
  cursor: pointer;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  border: 1px solid #cbd5e1;
  transition: .4s;
  border-radius: 30px;
}
.switch .slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  border-radius: 50%;
  left: 2px;
  bottom: 2px;
  z-index: 2;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: .4s;
}
.switch .sun svg {
  position: absolute;
  top: 5px;
  left: 28px;
  z-index: 1;
  width: 16px;
  height: 16px;
  animation: tc-rotate 15s linear infinite;
}
.switch .moon svg {
  fill: #73c0fc;
  position: absolute;
  top: 5px;
  left: 6px;
  z-index: 1;
  width: 16px;
  height: 16px;
  animation: tc-tilt 5s linear infinite;
}
@keyframes tc-rotate {
  0%   { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}
@keyframes tc-tilt {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(-10deg); }
  75%  { transform: rotate(10deg); }
  100% { transform: rotate(0deg); }
}
.switch .input:checked + .slider {
  background-color: #1e293b;
  border-color: #0f172a;
}
.switch .input:checked + .slider:before {
  transform: translateX(24px);
  background-color: #f8fafc;
}

/* Puente invisible: cubre el hueco de 8px entre el botón y el panel del dropdown
   para que el cursor no "caiga" fuera del área de hover al desplazarse hacia abajo. */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
