/* ==========================================================================
   Estilos globales — Cooperativa San Isidro
   (No pisa componentes: solo tokens, resets, utilidades y animaciones)
   ========================================================================== */

/* -------------------- Tokens / Design System -------------------- */
:root {
  /* Colores base (puedes ajustarlos libremente) */
  --color-verde: #155e40;
  --color-verde-osc: #0f4a32;
  --color-crema: #f3f0e8;
  --color-texto: #1f1f1f;
  --color-muted: #6b6b6b;
  --color-bg: #ffffff;

  /* Layout */
  --maxw: 1240px;
  --gap: 20px;
  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .08);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .12);

  /* Altura dinámica del header (la setea el JS del header) */
  --header-h: 56px;
}

/* -------------------- Reset suave / Base -------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@keyframes shine {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

body {
  margin: 0;
  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--color-texto);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: linear-gradient(90deg, #1f1f1f 0%, #0f4a32 5%,  #c9a63a 50%, #53451a 95%, #1a1a1a 100%);

}

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

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-verde);
  outline-offset: 2px;
}

/* Evita scroll lateral accidental en todo el sitio */
html,
body {
  overflow-x: hidden;
}

/* -------------------- Accesibilidad -------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
  background: #000;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 1000;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------- Tipografía mínima global -------------------- */
h1,
h2,
h3 {
  line-height: 1.2;
  margin: .6em 0 .4em;
}

p {
  margin: .6em 0;
}

.muted {
  color: var(--color-muted);
}

/* -------------------- Contenedores utilitarios -------------------- */
/* Contenedor central sin imponer grid: componentes decidirán su layout */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* Wrapper del app/layout: no define columnas para no interferir */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--gap);
}

/* El contenedor de vistas puede usar esta clase  */
.view {
  /* Altura mínima = viewport útil bajo el header.
     Los componentes (sidebar.js) pueden elevar este mínimo si lo necesitan. */
  min-height: calc(100vh - var(--header-h));
}

/* -------------------- Utilidades rápidas -------------------- */
.rounded {
  border-radius: var(--radius);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

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

.center {
  text-align: center;
}

.maxw {
  max-width: var(--maxw);
  margin-inline: auto;
}

.pad {
  padding: var(--gap);
}

.pad-sm {
  padding: calc(var(--gap) * .5);
}

/* -------------------- Animación de entrada de vistas -------------------- */
/* Igual filosofía a la de otros proyectos */
.animar {
  opacity: 0;
  transform: translateY(12px);
  animation: vistaFadeIn .55s ease-out forwards;
}

@keyframes vistaFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Variante por si quieres solo fade sin translate */
.fade-in {
  opacity: 0;
  animation: fadeOnly .4s ease-out forwards;
}

@keyframes fadeOnly {
  to {
    opacity: 1;
  }
}

/* -------------------- Reducción de movimiento -------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

html.no-scroll,
html.no-scroll body {
  overflow: hidden;
}
/* Garantiza que cualquier [hidden] desaparece del flujo */
[hidden] { display: none !important; }
