/* =============================================
   KEHILÁ — main.css
   Variables, Reset, Tipografía, Layout base
   ============================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Frank+Ruhl+Libre:wght@300;400;500;700;900&display=swap');

/* ─── Variables CSS ─── */
:root {
  /* Colores */
  --color-primary:      #1B2E5E;
  --color-primary-dark: #12204A;
  --color-primary-light:#2A4080;
  --color-gold:         #C9A84C;
  --color-gold-light:   #F5EDD6;
  --color-gold-dark:    #A8892E;
  --color-bg:           #F7F8FC;
  --color-white:        #FFFFFF;
  --color-text:         #1A1A2E;
  --color-text-muted:   #6B7280;
  --color-text-light:   #9CA3AF;
  --color-border:       #E5E7EB;
  --color-border-light: #F3F4F6;
  --color-success:      #10B981;
  --color-success-light:#D1FAE5;
  --color-danger:       #EF4444;
  --color-danger-light: #FEE2E2;
  --color-warning:      #F59E0B;
  --color-warning-light:#FEF3C7;
  --color-info:         #3B82F6;
  --color-info-light:   #DBEAFE;

  /* Sombras */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 2px 6px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg:  0 4px 12px rgba(0,0,0,0.07), 0 12px 28px rgba(0,0,0,0.07);
  --shadow-xl:  0 8px 24px rgba(0,0,0,0.08), 0 24px 56px rgba(0,0,0,0.09);

  /* Radios */
  --radius-xs:  3px;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full:9999px;

  /* Tipografía */
  --font-ui:    'Inter', system-ui, -apple-system, sans-serif;
  --font-brand: 'Frank Ruhl Libre', Georgia, serif;

  /* Espaciado base */
  --spacing-xs:  4px;
  --spacing-sm:  8px;
  --spacing-md:  16px;
  --spacing-lg:  24px;
  --spacing-xl:  32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* Sidebar */
  --sidebar-width: 240px;

  /* Transiciones */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow:   0.4s ease;

  /* Z-index */
  --z-sidebar:  100;
  --z-overlay:  200;
  --z-modal:    300;
  --z-toast:    400;
}

/* ─── Reset CSS ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
}

/* ─── Tipografía ─── */
.font-brand {
  font-family: var(--font-brand);
}

.h1 {
  font-family: var(--font-brand);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.h2 {
  font-family: var(--font-brand);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--color-text);
}

.h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.body {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
}

.body-sm {
  font-size: 0.875rem;
  line-height: 1.6;
}

.caption {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.overline {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ─── Layout ─── */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--spacing-lg);
}

.page-wrapper {
  min-height: 100vh;
  background: var(--color-bg);
}

.content-area {
  flex: 1;
  min-width: 0;
  padding: var(--spacing-xl);
}

@media (max-width: 768px) {
  .content-area {
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-md) + 72px);
  }
}

/* ─── Flexbox utilities ─── */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center{ align-items: center; }
.items-end   { align-items: flex-end; }
.justify-start  { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.justify-between{ justify-content: space-between; }
.flex-1      { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ─── Grid utilities ─── */
.grid        { display: grid; }
.grid-2      { display: grid; grid-template-columns: repeat(2, 1fr); }
.grid-3      { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-4      { display: grid; grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Gap ─── */
.gap-xs  { gap: var(--spacing-xs); }
.gap-sm  { gap: var(--spacing-sm); }
.gap-md  { gap: var(--spacing-md); }
.gap-lg  { gap: var(--spacing-lg); }
.gap-xl  { gap: var(--spacing-xl); }

/* ─── Margin-top ─── */
.mt-xs  { margin-top: var(--spacing-xs); }
.mt-sm  { margin-top: var(--spacing-sm); }
.mt-md  { margin-top: var(--spacing-md); }
.mt-lg  { margin-top: var(--spacing-lg); }
.mt-xl  { margin-top: var(--spacing-xl); }
.mt-2xl { margin-top: var(--spacing-2xl); }

/* ─── Margin-bottom ─── */
.mb-xs  { margin-bottom: var(--spacing-xs); }
.mb-sm  { margin-bottom: var(--spacing-sm); }
.mb-md  { margin-bottom: var(--spacing-md); }
.mb-lg  { margin-bottom: var(--spacing-lg); }
.mb-xl  { margin-bottom: var(--spacing-xl); }
.mb-2xl { margin-bottom: var(--spacing-2xl); }

/* ─── Padding ─── */
.p-xs  { padding: var(--spacing-xs); }
.p-sm  { padding: var(--spacing-sm); }
.p-md  { padding: var(--spacing-md); }
.p-lg  { padding: var(--spacing-lg); }
.p-xl  { padding: var(--spacing-xl); }

/* ─── Texto ─── */
.text-primary { color: var(--color-primary); }
.text-gold    { color: var(--color-gold); }
.text-muted   { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-white   { color: var(--color-white); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }

/* ─── Display ─── */
.hidden       { display: none !important; }
.block        { display: block; }
.inline-block { display: inline-block; }

/* ─── Width/Height ─── */
.w-full  { width: 100%; }
.h-full  { height: 100%; }

/* ─── Overflow ─── */
.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Separador ─── */
.divider {
  height: 1px;
  background: var(--color-border);
  border: none;
  margin: var(--spacing-lg) 0;
}

/* ─── Scrollbar personalizado ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-light);
}

/* ─── Selección de texto ─── */
::selection {
  background: var(--color-gold-light);
  color: var(--color-primary);
}

/* ─── Focus visible ─── */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
