/*
Theme Name:   Bruit à l'Intérieur
Theme URI:    https://bruitalinterieur.org
Description:  Child theme de Twenty Twenty-Five para Bruit à l'Intérieur.
Author:       Pablo Herrera
Author URI:   https://pabloherrera.design
Template:     twentytwentyfive
Version:      2.0.0
Text Domain:  bruit-child
*/

/* ============================================================
   VARIABLES DE DISEÑO
   Versión 2.0 — CSS consolidado, sin duplicados
   Todas las sesiones integradas en un solo archivo
   ============================================================ */
:root {
  /* Paleta — OKLCH con tinte de marca (hue 130°, verde lima) */
  --color-black:       oklch(9% 0.008 130);
  --color-white:       oklch(98% 0.005 130);
  --color-gray-light:  oklch(95% 0.006 130);
  --color-gray-mid:    oklch(58% 0.008 130);
  --color-lime-start:  oklch(78% 0.18 130);
  --color-lime-end:    oklch(87% 0.20 118);
  --color-orange:      oklch(62% 0.18 42);
  --color-red:         oklch(40% 0.18 25);

  /* Tipografías */
  --font-display: 'Bebas Neue', 'Anton', Impact, sans-serif;
  --font-body:    'Alegreya', 'Georgia', 'Times New Roman', serif;

  /* Escala tipográfica — ratio 1.333 (perfect fourth) */
  --text-xs:      0.75rem;
  --text-sm:      0.875rem;
  --text-body:    1rem;
  --text-md:      1.125rem;
  --text-lg:      1.5rem;
  --text-heading: clamp(1.5rem, 3vw, 2.25rem);
  --text-section: clamp(2rem, 5vw, 4rem);
  --text-hero:    clamp(3.5rem, 10vw, 9rem);

  /* Line-heights */
  --lh-body-light: 1.70;
  --lh-body-dark:  1.77;

  /* Espaciado — 7 pasos, base 4pt */
  --space-xs:   0.5rem;    /*  8px */
  --space-sm:   1rem;      /* 16px */
  --space-md:   1.5rem;    /* 24px */
  --space-lg:   2.5rem;    /* 40px */
  --space-xl:   4rem;      /* 64px */
  --space-2xl:  6rem;      /* 96px */
  --space-3xl:  10rem;     /* 160px */

  /* Layout */
  --max-width: 1280px;
  --gutter:    clamp(1.5rem, 5vw, 4rem);
}

/* ============================================================
   RESET Y BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-black);
  background-color: var(--color-white);
  line-height: var(--lh-body-light);
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ============================================================
   TIPOGRAFÍA GLOBAL
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.93;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-section); }
h3 { font-size: var(--text-heading); }

p {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body-light);
  max-width: 65ch;
  text-wrap: pretty;
}

/* Selección de texto */
::selection {
  background-color: var(--color-lime-start);
  color: var(--color-black);
}
::-moz-selection {
  background-color: var(--color-lime-start);
  color: var(--color-black);
}

/* ============================================================
   LAYOUT — Contenedores
   ============================================================ */
.bruit-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.bruit-section {
  padding: var(--space-2xl) 0;
}

/* ============================================================
   HEADER Y NAVEGACIÓN
   ============================================================ */
.bruit-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: var(--space-sm) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-black);
  border-bottom: 1px solid oklch(98% 0.005 130 / 0.08);
}

/* Logo */
.bruit-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.bruit-logo:hover { opacity: 0.8; }

.bruit-logo .logo-box {
  border: 1.5px solid var(--color-white);
  padding: 2px 8px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--color-white);
  text-transform: uppercase;
}

.bruit-logo .logo-word {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Nav desktop */
.bruit-nav,
.bruit-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.bruit-nav a,
.bruit-nav__list li a {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: oklch(98% 0.005 130 / 0.6);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  padding-bottom: 2px;
  transition: color 200ms ease;
}

.bruit-nav a::after,
.bruit-nav__list li a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-white);
  transition: width 200ms ease;
}

.bruit-nav a:hover,
.bruit-nav__list li a:hover {
  color: var(--color-white);
}

.bruit-nav a:hover::after,
.bruit-nav__list li a:hover::after,
.bruit-nav__list .current-menu-item > a::after,
.bruit-nav__item--active > a::after {
  width: 100%;
}

.bruit-nav__list .current-menu-item > a,
.bruit-nav__item--active > a {
  color: var(--color-white);
}

/* CTA Adhérer en el header */
.bruit-header__cta {
  margin-left: var(--space-md);
  padding: 0.55rem 1.25rem;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px oklch(78% 0.18 130 / 0.25);
}

.bruit-header__cta:hover {
  box-shadow: 0 4px 16px oklch(78% 0.18 130 / 0.35);
}

/* Botón hamburger */
.bruit-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.bruit-nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--color-white);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 200ms ease;
  transform-origin: center;
}

.bruit-nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.bruit-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.bruit-nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Menú mobile */
.bruit-mobile-nav {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-black);
  z-index: 99;
  padding: var(--space-2xl) var(--gutter);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.bruit-mobile-nav.is-open { transform: translateX(0); }

.bruit-mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.bruit-mobile-nav ul li a {
  font-family: var(--font-display);
  font-size: var(--text-section);
  color: var(--color-white);
  text-transform: uppercase;
  line-height: 1.1;
  display: block;
  opacity: 0.85;
  transition: opacity 200ms ease;
  cursor: pointer;
}

.bruit-mobile-nav ul li a:hover { opacity: 1; }

body.bruit-nav-open { overflow: hidden; }

/* ============================================================
   HERO — Composición asimétrica
   ============================================================ */
main {
  padding-top: 64px;
}

.bruit-hero {
  min-height: 100svh;
  background-color: var(--color-black);
  display: flex;
  align-items: flex-end;
  padding: var(--space-3xl) var(--gutter) var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.bruit-hero__content {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.bruit-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  color: var(--color-white);
  line-height: 0.9;
  letter-spacing: -0.03em;
  max-width: 14ch;
  text-wrap: balance;
}

/* Línea decorativa verde lima entre título y tagline */
.bruit-hero__content::after {
  content: '';
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-lime-start), var(--color-lime-end));
  margin-left: clamp(0rem, 8vw, 8rem);
  flex-shrink: 0;
}

.bruit-hero__tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: oklch(98% 0.005 130 / 0.65);
  line-height: var(--lh-body-dark);
  letter-spacing: 0.01em;
  max-width: 48ch;
  padding-left: clamp(0rem, 8vw, 8rem);
  text-wrap: pretty;
}

/* ============================================================
   SECCIÓN PILARES — Grid con primer pilar destacado
   ============================================================ */
.bruit-pillars {
  background-color: var(--color-gray-light);
}

.bruit-pillars__grid {
  max-width: 100%;
  display: grid;
  /* Layout final con 6 pilares:
     Col:   [ 2fr — Radio Web ] [1fr] [1fr]
     Fila 1: Radio Web (row-span 2)  Festival   Label
     Fila 2: Radio Web (cont.)       Résidences Éditorial
     Fila 3: Formation (span 3 cols — ocupa todo el ancho)
  */
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1px;
  background-color: oklch(9% 0.008 130 / 0.1);
}

/* Primer pilar — Radio Web — col grande, ocupa 2 filas */
.bruit-pillar:first-child {
  grid-row: span 2;
  background-color: var(--color-black);
  color: var(--color-white);
  padding: var(--space-2xl) var(--space-lg);
  min-height: 360px;
  justify-content: flex-end;
  cursor: pointer;
  transition: background-color 200ms ease;
}

/* Último pilar (Formation) — ocupa las 3 columnas */
.bruit-pillar:last-child {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg);
  min-height: 80px;
  border-top: 1px solid oklch(9% 0.008 130 / 0.08);
}

.bruit-pillar:last-child .bruit-pillar__title {
  font-size: var(--text-heading);
}

.bruit-pillar:last-child .bruit-pillar__sub {
  margin-left: auto;
  padding-right: var(--space-md);
}

.bruit-pillar:first-child .bruit-pillar__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--color-white);
}

.bruit-pillar:first-child .bruit-pillar__sub {
  color: var(--color-lime-start);
}

.bruit-pillar:first-child:hover {
  background-color: oklch(14% 0.008 130);
}

/* Pilares normales */
.bruit-pillar {
  background-color: var(--color-white);
  padding: var(--space-lg) var(--space-md) var(--space-2xl);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  cursor: pointer;
  transition: background-color 200ms ease,
              color 200ms ease,
              box-shadow 200ms ease;
  border-bottom: 2px solid transparent;
}

.bruit-pillar:hover {
  background-color: var(--color-black);
  color: var(--color-white);
  box-shadow: 0 4px 24px oklch(9% 0.008 130 / 0.18);
  border-bottom-color: var(--color-lime-start);
}

.bruit-pillar__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}

.bruit-pillar__sub {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-gray-mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 200ms ease;
}

.bruit-pillar:hover .bruit-pillar__sub {
  color: oklch(98% 0.005 130 / 0.5);
}

/* ============================================================
   SECCIONES DE COLOR
   ============================================================ */
.bruit-section--lime {
  background: linear-gradient(135deg, var(--color-lime-start), var(--color-lime-end));
  color: var(--color-black);
}

/* Sección oscura — grid 2 columnas asimétrico
   HTML: .bruit-container > h2 + p + a.bruit-btn
   El h2 ocupa col-1 abarcando las 2 filas.
   p y el btn quedan ambos en col-2, fila-1 y fila-2.
*/
.bruit-section--dark {
  background-color: var(--color-black);
  color: var(--color-white);
  padding: var(--space-3xl) 0;
}

.bruit-section--dark .bruit-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: var(--space-lg) var(--space-2xl);
  align-items: start;
}

/* h2 ocupa col-1, ambas filas */
.bruit-section--dark h2 {
  font-size: var(--text-section);
  line-height: 0.92;
  color: var(--color-white);
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: start;            /* arriba, al nivel del párrafo */
}

/* p en col-2, fila 1 */
.bruit-section--dark p {
  font-size: var(--text-md);
  color: oklch(98% 0.005 130 / 0.7);
  line-height: var(--lh-body-dark);
  letter-spacing: 0.01em;
  max-width: 48ch;
  grid-column: 2;
  grid-row: 1;
}

/* Botón en col-2, fila 2 — alineado con el texto */
.bruit-section--dark .bruit-btn {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  margin-top: 0;                /* el gap ya da espacio */
}

.bruit-section--radio {
  background-color: var(--color-orange);
  color: var(--color-white);
}

/* ============================================================
   BOTONES
   ============================================================ */
.bruit-btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  border: 1.5px solid currentColor;
  cursor: pointer;
  transition: background-color 200ms ease,
              color 200ms ease,
              border-color 200ms ease,
              filter 200ms ease;
}

.bruit-btn--white {
  color: var(--color-white);
  border-color: var(--color-white);
}
.bruit-btn--white:hover {
  background: var(--color-white);
  color: var(--color-black);
}

.bruit-btn--black {
  color: var(--color-black);
  border-color: var(--color-black);
}
.bruit-btn--black:hover {
  background: var(--color-black);
  color: var(--color-white);
}

.bruit-btn--lime {
  color: var(--color-black);
  background: linear-gradient(135deg, var(--color-lime-start), var(--color-lime-end));
  border-color: transparent;
}
.bruit-btn--lime:hover {
  filter: brightness(1.08);
  color: var(--color-black);
}

/* ============================================================
   FOTO GRID
   ============================================================ */
.bruit-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

.bruit-photo-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  filter: grayscale(15%);
}

/* ============================================================
   FOOTER
   ============================================================ */
.bruit-footer {
  background-color: var(--color-black);
  color: oklch(98% 0.005 130 / 0.45);
  padding: var(--space-2xl) var(--gutter) var(--space-md);
}

.bruit-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid oklch(98% 0.005 130 / 0.1);
}

.bruit-footer p {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--lh-body-dark);
  letter-spacing: 0.01em;
}

.bruit-footer a {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: oklch(98% 0.005 130 / 0.55);
  cursor: pointer;
  transition: color 200ms ease, opacity 200ms ease;
}

.bruit-footer a:hover {
  color: var(--color-white);
}

.bruit-footer__bottom {
  max-width: var(--max-width);
  margin: var(--space-sm) auto 0;
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: oklch(98% 0.005 130 / 0.3);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.bruit-footer__bottom a {
  color: oklch(98% 0.005 130 / 0.3);
}
.bruit-footer__bottom a:hover {
  color: oklch(98% 0.005 130 / 0.7);
}

/* ============================================================
   PÁGINAS INTERIORES — page.php
   ============================================================ */
.bruit-page-hero {
  background: linear-gradient(160deg, #111111 0%, var(--color-black) 60%);
  padding: calc(var(--space-3xl) + 64px) var(--gutter) var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.bruit-page-hero::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: oklch(98% 0.005 130 / 0.08);
}

.bruit-page-hero .bruit-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.bruit-page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  color: var(--color-white);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  max-width: 18ch;
  text-wrap: balance;
}

.bruit-page-content {
  padding: var(--space-2xl) 0;
  background-color: var(--color-white);
}

.bruit-page-content__inner {
  max-width: var(--max-width);
  width: 100%;
}

/* Prosa: mantiene medida de lectura */
.bruit-page-content__inner > p,
.bruit-page-content__inner > ul,
.bruit-page-content__inner > ol,
.bruit-page-content__inner > blockquote {
  max-width: 68ch;
}

/* Headings sin restricción de ancho */
.bruit-page-content__inner h2,
.bruit-page-content__inner h3,
.bruit-page-content__inner h4 {
  max-width: none;
}

/* Lead paragraph — primer párrafo de cada página */
.bruit-page-content__inner > p:first-of-type {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 500;
  font-style: italic;
  line-height: 1.65;
  color: var(--color-black);
  margin-bottom: var(--space-lg);
  text-wrap: pretty;
}

.bruit-page-content__inner h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  text-wrap: balance;
}

.bruit-page-content__inner h3 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  text-wrap: balance;
}

.bruit-page-content__inner p {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body-light);
  color: oklch(9% 0.008 130 / 0.75);
  margin-bottom: var(--space-sm);
  text-wrap: pretty;
}

.bruit-page-content__inner ul,
.bruit-page-content__inner ol {
  padding-left: 1.5rem;
  margin-bottom: var(--space-sm);
}

.bruit-page-content__inner li {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body-light);
  color: oklch(9% 0.008 130 / 0.75);
  margin-bottom: 0.4rem;
}

.bruit-page-content__inner a {
  color: var(--color-black);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 200ms ease;
}

.bruit-page-content__inner a:hover {
  color: var(--color-orange);
}

.bruit-page-content__inner blockquote {
  border-left: 3px solid var(--color-lime-start);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
  font-style: italic;
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--color-black);
}

/* ============================================================
   ACCESIBILIDAD — Focus, prefers-reduced-motion
   ============================================================ */
*:focus { outline: none; }

.bruit-btn:focus-visible,
.bruit-nav a:focus-visible,
.bruit-nav__list a:focus-visible,
.bruit-mobile-nav a:focus-visible,
.bruit-logo:focus-visible,
.bruit-footer a:focus-visible,
.bruit-nav-toggle:focus-visible,
.bruit-pillar:focus-visible {
  outline: 2px solid var(--color-lime-start);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .bruit-header__cta { display: none; }

  /* Hero: sin desplazamiento lateral */
  .bruit-hero__tagline { padding-left: 0; }
  .bruit-hero__content::after { margin-left: 0; }

  /* Pilares: tablet → 2 columnas iguales, sin columna ancha */
  .bruit-pillars__grid { grid-template-columns: repeat(2, 1fr); }
  .bruit-pillar:first-child {
    grid-row: auto;              /* Cancelar el row-span en tablet */
    grid-column: span 2;         /* Pilar ancho en las 2 columnas */
    min-height: 220px;
  }

  /* Sección oscura: una columna, orden normal */
  .bruit-section--dark .bruit-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: var(--space-xl);
  }
  .bruit-section--dark h2 {
    grid-column: 1;
    grid-row: auto;
  }
  .bruit-section--dark p {
    grid-column: 1;
    grid-row: auto;
  }
  .bruit-section--dark .bruit-btn {
    grid-column: 1;
    grid-row: auto;
  }

  /* Photo grid */
  .bruit-photo-grid { grid-template-columns: 1fr; }

  /* Footer */
  .bruit-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

@media (max-width: 600px) {
  .bruit-nav-toggle { display: flex; }
  .bruit-nav { display: none; }

  .bruit-hero {
    padding-bottom: var(--space-xl);
    min-height: 100svh;
  }

  .bruit-pillars__grid { grid-template-columns: 1fr; }
  .bruit-pillar:first-child {
    grid-row: auto;
    grid-column: span 1;
  }

  .bruit-section--dark { padding: var(--space-2xl) 0; }

  .bruit-page-hero {
    padding-top: calc(var(--space-2xl) + 64px);
  }
}
