/* ==========================================================================
   VOCES EN PAPEL - REVISTA ESCOLAR (ESCUELA DE ARTES Y CULTURA DE OSORNO)
   global.css: Variables de diseño, reset, tipografías y estructura base
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables de Diseño y Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Paleta institucional y editorial (periódico escolar) */
  --color-primary: #2f3542;          /* Tinta principal */
  --color-primary-light: #4a5160;    /* Tinta suave */
  --color-primary-dark: #1f2430;     /* Tinta profunda */
  --color-accent: #f2b705;           /* Amarillo crayón */
  --color-accent-hover: #ffc72c;     /* Amarillo luminoso */
  --color-accent-dark: #c99500;      /* Amarillo intenso */

  /* Colores secundarios de armonía */
  --color-lavanda: #7b5ea7;          /* Violeta crayón */
  --color-morado-gris: #8d7aa8;      /* Violeta suave */
  --color-verde-gris: #4f9d69;       /* Verde hoja */
  --color-gris-azulado: #5b7c99;     /* Azul grisáceo */

  /* Superficies y Fondos */
  --bg-page: #fffdf4;
  --bg-card: #fffdf4;
  --bg-surface-elevated: #fffdf4;
  --bg-dark: #14351f;
  --bg-dark-card: #1b4529;

  /* Papel y decoración */
  --paper: #fffdf4;
  --paper-alt: #f7f0dc;
  --paper-line: #e4dcc4;
  --ink: #2f3542;
  --ink-soft: #555b68;
  --crayon-blue: #235fca;
  --crayon-red: #c7441f;
  --crayon-green: #4f9d69;
  --crayon-purple: #7b5ea7;
  --crayon-yellow: #f2b705;
  --tape: rgba(242, 183, 5, 0.5);

  /* Texto y Contraste */
  --text-primary: #2f3542;
  --text-secondary: #555b68;
  --text-muted: #6c7280;
  --text-inverse: #fffdf4;
  --text-accent: #2f3542;

  /* Bordes y Sombras */
  --border-light: rgba(47, 53, 66, 0.12);
  --border-medium: rgba(47, 53, 66, 0.22);
  --border-accent: rgba(242, 183, 5, 0.45);

  --shadow-sm: 0 2px 6px rgba(47, 53, 66, 0.08);
  --shadow-md: 0 6px 14px rgba(47, 53, 66, 0.10);
  --shadow-lg: 0 12px 24px rgba(47, 53, 66, 0.12);
  --shadow-xl: 15px 28px 25px -18px rgba(47, 53, 66, 0.28);
  --shadow-glow: 0 0 0 4px rgba(242, 183, 5, 0.28);

  /* Radios de curvatura */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --radius-paper: 15px 255px 15px 225px / 225px 15px 255px 15px;
  --radius-paper-sm: 8px 120px 10px 115px / 115px 10px 120px 8px;

  /* Tipografías */
  --font-serif: 'Patrick Hand SC', 'Comic Sans MS', cursive;
  --font-sans: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-script: 'Kaushan Script', cursive;

  /* Transiciones */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   Reset y Normalización Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  background-image:
    radial-gradient(rgba(47, 53, 66, 0.035) 1px, transparent 1px),
    radial-gradient(rgba(47, 53, 66, 0.025) 1px, transparent 1px);
  background-size: 22px 22px, 22px 22px;
  background-position: 0 0, 11px 11px;
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Jerarquía Tipográfica Semántica
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--color-primary);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 0.75rem;
}

h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 1.15rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

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

/* --------------------------------------------------------------------------
   Contenedores y Layout General
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-narrow {
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section {
  padding: 5rem 0;
  position: relative;
}

.section-alt {
  background-color: var(--paper-alt);
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 31px,
    rgba(47, 53, 66, 0.055) 31px,
    rgba(47, 53, 66, 0.055) 32px
  );
}

.section-dark {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: var(--text-inverse);
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: #ffffff;
}

.section-dark p {
  color: rgba(255, 255, 255, 0.85);
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3.5rem auto;
}

.section-tag {
  display: inline-block;
  padding: 0.35rem 1rem;
  background-color: rgba(231, 231, 138, 0.25);
  color: var(--color-primary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.section-dark .section-tag {
  background-color: rgba(231, 231, 138, 0.15);
  color: var(--color-accent);
  border-color: rgba(231, 231, 138, 0.3);
}

.section-header p {
  font-size: 1.15rem;
  color: var(--text-muted);
}
