/* ====================================================================
   BASE.CSS — LY Arquitectos
   Variables CSS + Reset + GeneratePress overrides
   
   ORDEN DE CARGA: siempre PRIMERO (dependencia de todos los demás CSS)
   Enqueue handle: 'ly-base' (depende de 'ly-child-style')
   
   CONTIENE:
   ├── Variables CSS :root (colores, tipografía, spacing, animación)
   ├── Dark mode variables (.ly-dark-mode)  
   ├── Reset tipográfico y de box-model
   ├── Overrides de GeneratePress (#page, .site-content, etc.)
   └── Breakpoints responsive globales (1024px / 768px / 480px)
   
   NO contiene: estilos de componentes ni templates (→ ly-custom.css)
==================================================================== */

/* VARIABLES — sistema unificado */
:root {
  /* Colores */
  --bg:    #f4f1eb;
  --txt:   #111111;
  --muted: #777777;
  --bdr:   rgba(0,0,0,.12);
  --acc:   #b6a16b;
  --wht:   #ffffff;

  /* Tipografía */
  --f: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Animación */
  --ease: cubic-bezier(.4,0,.2,1);

  /* Layout */
  --max: 1680px;
  --g:   clamp(24px,4vw,80px);
}

/* DARK MODE */
.ly-dark-mode {
  --bg:    #111111;
  --txt:   #f2f0eb;
  --muted: #999999;
  --bdr:   rgba(255,255,255,.12);
  --acc:   #c8b77a;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; font-family: var(--f); background: var(--bg); color: var(--txt); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--txt); text-decoration: none; }
ul, ol { list-style: none; }

/* SITE WRAPPER */
.ly-site { background: var(--bg); color: var(--txt); }

/* DESACTIVAR GENERATEPRESS — evitar que interfiera con nuestros layouts */
.inside-article,
.entry-content,
.content-area,
.site-content,
.grid-container { all: unset; display: block; }
.entry-header,
.page-hero-section,
.generate-page-header { display: none !important; }

/* Quitar padding/margin de TODOS los wrappers de GeneratePress */
.site-main,
.site-content,
.content-area,
.inside-article,
.entry-content,
.grid-container,
.container,
#page {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Sin padding-top al body cuando hay sticky header */
/* RESPONSIVE — Todos los breakpoints en un solo lugar */

/* TABLET ≤1024px */
@media (max-width: 1024px) {
  /* Cards: 3 → 2 columnas */
  .ly-home-grid,
  .ly-arc-grid,
  .ly-ab-team__grid,
  .ly-aut-grid,
  .ly-think-videos__grid { grid-template-columns: repeat(2,1fr) !important; }

  .ly-think-essays__grid { grid-template-columns: 1fr !important; }
  .ly-essay-card--big { grid-column: 1 !important; }

  /* Disciplinas: 3 → 2 columnas */
  .ly-discs__row { grid-template-columns: repeat(2,1fr) !important; }
  .ly-disc:nth-child(3n+1) { padding-left: clamp(24px,2.5vw,48px) !important; }
  .ly-disc:nth-child(3n)   { border-right: 1px solid var(--bdr) !important; }
  .ly-disc:nth-child(2n+1) { padding-left: 0 !important; }
  .ly-disc:nth-child(2n)   { border-right: none !important; }

  /* Layouts 2col → 1col */
  .ly-ab-statement__inner,
  .ly-proc-intro__inner { grid-template-columns: 1fr !important; }
  .ly-ab-statement__pull,
  .ly-proc-intro__pull { position: static !important; }

  /* Related */
  .ly-p-related__grid,
  .ly-disc-related__grid { grid-template-columns: repeat(2,1fr) !important; }

  /* Footer */
  .ly-footer__cols { grid-template-columns: repeat(2,1fr) !important; }

  /* Archive toolbar */
  .ly-arc-card__lv-inner,
  .ly-list-head__inner { grid-template-columns: 1fr 1fr !important; }
  .ly-lv-year,.ly-lv-loc { display: none !important; }

  /* Autónoma hub */
  .ly-think-autonoma__inner { grid-template-columns: 240px 1fr !important; }
}

/* MOBILE ≤768px */
@media (max-width: 768px) {
  /* Cards: 2 → 1 columna */
  .ly-home-grid,
  .ly-arc-grid,
  .ly-ab-team__grid,
  .ly-aut-grid { grid-template-columns: 1fr !important; }

  /* Videos: mantener 2 columnas */
  .ly-think-videos__grid { grid-template-columns: repeat(2,1fr) !important; }

  /* Disciplinas: 1 columna */
  .ly-discs__row { grid-template-columns: 1fr !important; }
  .ly-disc,
  .ly-disc:nth-child(3n+1),
  .ly-disc:nth-child(2n+1) { padding-left: 0 !important; border-right: none !important; border-bottom: 1px solid var(--bdr) !important; }
  .ly-disc:last-child { border-bottom: none !important; }

  /* Intro home */
  .ly-intro__grid { grid-template-columns: 1fr !important; }
  .ly-intro__n { display: none !important; }

  /* Project intro */
  .ly-p-intro { grid-template-columns: 1fr !important; gap: 32px 0 !important; }
  .ly-p-intro__left { flex-direction: row; align-items: flex-start; gap: 32px; }
  .ly-p-meta-row { flex-direction: column; }
  .ly-p-meta-col { border-right: none !important; border-bottom: 1px solid var(--bdr) !important; padding: 16px 0 !important; }

  /* Related */
  .ly-p-related__grid,
  .ly-disc-related__grid { grid-template-columns: 1fr !important; }
  .ly-p-related__head,
  .ly-disc-related__head { flex-direction: column; align-items: flex-start; gap: 16px; }

  /* Section heads */
  .ly-think-section-head,
  .ly-section-head { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* People — manejado por .ly-person .ly-p-hero más abajo */

  /* Autónoma hub */
  .ly-think-autonoma__inner { grid-template-columns: 1fr !important; }
  .ly-think-autonoma__grid { grid-template-columns: repeat(2,1fr) !important; }
  .ly-think-essays__grid { grid-template-columns: 1fr !important; }

  /* TOC — visible en mobile pero adaptado */
  .ly-toc {
    width: calc(100vw - 48px);
    max-width: 280px;
    bottom: 16px;
    right: 16px;
    font-size: 11px;
  }
  .ly-toc__list { max-height: 0; }
  .ly-toc.is-open .ly-toc__list { max-height: 280px; }

  /* Footer */
  .ly-footer__top { grid-template-columns: 1fr !important; }
  .ly-footer__cols { grid-template-columns: repeat(2,1fr) !important; }

  /* Archive toolbar */
  .ly-toolbar__top { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 16px; flex-wrap: nowrap; }
  .ly-toolbar__top::-webkit-scrollbar { display: none; }
  .ly-toolbar__filters { overflow-x: auto; scrollbar-width: none; }
  .ly-dd { min-width: 120px; }
}

/* VERY SMALL ≤480px */
@media (max-width: 480px) {
  :root { --g: clamp(16px,4vw,24px); }
  .ly-think-videos__grid { grid-template-columns: 1fr !important; }
  .ly-think-autonoma__grid { grid-template-columns: 1fr !important; }
}
