:root {
  --bg-base: #000000;
  --bg-surface: rgba(255, 248, 238, 0.05);
  --bg-elevated: rgba(255, 248, 238, 0.09);
  --bg-hover: rgba(255, 248, 238, 0.13);
  --text-primary: #f0e8d8;
  --text-secondary: rgba(240, 232, 216, 0.58);
  --text-muted: rgba(240, 232, 216, 0.32);
  --border: rgba(255, 248, 238, 0.10);
  --border-strong: rgba(255, 248, 238, 0.22);
  --glass-blur: none;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 40px;
  --bg-color: #000000;
  --text-color: #f0f0f0;
  --accent-color: #ffffff;
  --hover-color: #999;
  --font-family: 'Montserrat', sans-serif;
  --font-serif: 'Extenda30Deca', sans-serif;
}

@font-face {
  font-family: 'Montserrat';
  src: url('./media/fontes/Montserrat-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

@font-face {
  font-family: 'Montserrat';
  src: url('./media/fontes/Montserrat-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
}

@font-face {
  font-family: 'Extenda30Deca';
  src: url('./fuentes/Extenda30Deca.woff2') format('woff2'),
       url('./fuentes/Extenda30Deca.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'CN';
  src: url('./media/fontes/leaguespartan-bold.ttf') format('truetype');
}

@font-face {
  font-family: 'NL';
  src: url('./media/fontes/HolidayFree.ttf') format('truetype');
}

@font-face {
  font-family: 'BR';
  src: url('./media/fontes/Anton-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'FAB';
  src: url('./media/fontes/Neuropol.ttf') format('truetype');
}

@font-face {
  font-family: 'RIG';
  src: url('./media/fontes/Kilsonburg.ttf') format('truetype');
}

@font-face {
  font-family: 'LIB';
  src: url('./media/fontes/AICON-VF.ttf') format('truetype');
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

html, body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;

  /* Universal layout - works on ANY screen */
  display: grid;
  grid-template-rows: auto 1fr auto; /* header-container, main, footer */
  min-height: 100vh; /* Changed from height to min-height */
}

main {
  /* Main takes only the remaining space */
  overflow-y: auto; /* Allow vertical scrolling in main */
  overflow-x: hidden; /* Prevent horizontal scroll */
  display: flex;
  flex-direction: column;
  min-height: 0; /* Critical: allows content to shrink on ANY screen */
}

/* HEADER CONTAINER */
#header-container {
  position: relative;
}

/* HEADER */
header {
  background-color: rgba(0, 0, 0, 0.85);
  color: var(--accent-color);
  text-align: center;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

header a {
  display: flex;
  justify-content: center;
  align-items: center;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 500;
}

/* NAV TOGGLE ARROW */
.nav-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #ffffff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

/* hover only on devices that really hover: on touch screens it would stay "stuck" after a tap */
@media (hover: hover) and (pointer: fine) {
  .nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.05);
  }
}

/* "pop" on every tap, open or close (class added by shared.js) */
.nav-toggle.is-tapped {
  animation: navTogglePop 0.32s ease-out;
}

@keyframes navTogglePop {
  0%   { transform: translateY(-50%) scale(1);    background: rgba(255, 255, 255, 0.1); }
  40%  { transform: translateY(-50%) scale(1.18); background: rgba(255, 255, 255, 0.22); }
  100% { transform: translateY(-50%) scale(1);    background: rgba(255, 255, 255, 0.1); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle.is-tapped { animation: none; }
}

.nav-icon {
  color: var(--accent-color);
  font-size: 1rem;
}

/* NAV */
nav {
  background-color: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid var(--border);
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}

nav.active {
  max-height: 200px;
  opacity: 1;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  padding: 0.5rem;
  gap: 0.75rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  background: transparent;
  border: none;
  transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.2s ease, background-color 0.2s ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--text-primary);
  background-color: var(--bg-surface);
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.8),
    0 0 10px rgba(255, 255, 255, 0.6),
    0 0 20px rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
  outline: none;
}

nav a.active {
  color: #fff;
  background-color: var(--bg-elevated);
  text-shadow:
    0 0 8px rgba(255, 255, 255, 1),
    0 0 15px rgba(255, 255, 255, 0.8),
    0 0 25px rgba(255, 255, 255, 0.6);
  font-weight: 600;
}




/* ===========================
     FOOTER
=========================== */

/* LANGUAGE SWITCHER */
[data-lang] { display: none; }
[data-lang].active { display: revert; }

/* ── Cooking-state placeholder (shared across Eventos, .KO, Mercado) ── */
.cooking-state {
  padding: 4rem 1rem 5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-family);
}
.cooking-state-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.cooking-state-title {
  font-size: 1.3rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}
.cooking-state-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0;
}
.cooking-state-ig {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0.6rem 1.25rem;
  transition: color 0.2s, border-color 0.2s;
}
.cooking-state-ig:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

footer {
  background-color: rgba(0, 0, 0, 0.95);
  color: var(--accent-color);
  text-align: center;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  font-size: 0.75rem;
  font-family: var(--font-family);

  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;

  flex-shrink: 0;
  min-height: 40px;
}

.footer-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: flex-start;
}

footer .copyright {
  text-align: center;
}

.social-icons {
  position: absolute;
  right: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-icons a {
  color: var(--accent-color);
  font-size: 1rem;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.social-icons a:hover {
  color: #fff;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.8),
    0 0 12px rgba(255, 255, 255, 0.6),
    0 0 20px rgba(255, 255, 255, 0.4);
}






/* ===========================
     EVENTOS
=========================== */

.proximos-eventos {
  margin: 2rem auto;
  padding: 2rem 3rem;
  max-width: 1050px;
  min-width: 320px;
  width: 90%;
  background-color: rgba(15, 15, 15, 0.6); /* tono más profundo */
  border: 1px solid rgba(255, 255, 255, 0.08); /* borde sutil tipo glassmorphism */
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
}


.proximos-eventos h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 0.5rem;
}

.evento-lista-item {
  display: flex;
  justify-content: space-between;
  background-color: rgba(255,255,255,0.05);
  padding: 1rem 2rem;
  border-radius: 10px;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;        /* Evita que los elementos se envuelvan */
  max-width: 100%;
  box-sizing: border-box;
}

.evento-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 200px;
}

.evento-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.evento-info p {
  font-size: 0.9rem;
  color: #ccc;
}

.evento-btn {
  background-color: #fff;
  color: #000;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.evento-btn:hover {
  background-color: #ddd;
  transform: scale(1.05);
}



/* ----------------- ESTILOS DE EVENTOS SIGNATURE ------------------- */
.eventos-signature {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  padding: 2rem 1rem 1rem 1rem; /* reduce padding-bottom a 1rem */
  max-width: 1300px; /* aquí aumentamos a 1300px */
  margin: 0 auto;
}

.evento-card {
  flex: 0 0 320px;
  height: 260px;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background-color: rgba(15, 15, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}


.evento-card:hover {
  transform: scale(1.03);
}

/* Resto sin cambios */
.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  z-index: 1;
}

.card-content {
  position: relative;
  z-index: 2;
  padding: 1rem;
  color: #fff;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.card-content p {
  font-size: 0.9rem;
  color: #ddd;
}

.card-content .ver-detalhes {
  align-self: flex-start;
  background-color: rgba(255, 255, 255, 0.15); /* translúcido claro */
  border: 1px solid rgba(255, 255, 255, 0.2); /* borde sutil blanco */
  color: #fff;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.1); /* glow sutil */
}

.card-content .ver-detalhes:hover {
  background-color: rgba(255, 255, 255, 0.25); /* un poco más brillante al hacer hover */
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}




/* ===========================
     BIBLIOTECA
=========================== */

.biblioteca-main {
  flex: 1;
  overflow: hidden;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
}

.livros-section {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.livros-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  text-align: center;
}

.livros-section p {
  font-size: 0.9rem;
  text-align: center;
  color: #ccc;
  margin-bottom: 1.5rem;
}

.livros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.2rem;
  overflow-y: auto;
  padding: 1rem 0.5rem;
  flex: 1;
}

.livro-card {
  position: relative;
  width: 100%;
  padding-bottom: 150%;
  overflow: hidden;
  background-color: rgba(15, 15, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.livro-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.livro-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}




/* Ventana Popup */
.popup1-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  background: rgba(20, 20, 20, 0.85);

  border: 1px solid rgba(255, 255, 255, 0.1); /* borde sutil */
  border-radius: 15px;
  width: 50vw;
  max-width: 700px;
  min-height: 80vh;
  padding: 1rem 2rem 2rem 2rem;
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  font-family: Arial, sans-serif;
  color: white;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); /* sombra para destacar */
}
/* Cuando el popup está activo */
.popup1-window.active {
  opacity: 1;
  pointer-events: auto;
  animation: popup1FadeIn 0.3s ease;
}

/* Fondo Overlay */
.popup1-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000cc;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Overlay visible */
.popup1-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Título */
.popup1-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}

/* Contenedor de productos */
.popup1-products {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

/* Producto individual */
.popup1-product {
  background-color: #222;
  padding: 1rem;
  border-radius: 10px;
  flex-basis: 48%;
  box-sizing: border-box;
  box-shadow: 0 0 10px #111;
}

.popup1-product img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

/* Título producto */
.popup1-product-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #eee;
}

/* Precio producto */
.popup1-product-price {
  font-size: 1rem;
  color: #ccc;
}

/* Botón cerrar */
.popup1-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  z-index: 100001;
}

/* Animación de fade in */
@keyframes popup1FadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Scrollbar para el popup (opcional) */
.popup1-window::-webkit-scrollbar {
  width: 8px;
}

.popup1-window::-webkit-scrollbar-track {
  background: #222;
  border-radius: 4px;
}

.popup1-window::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.popup1-product button {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.popup1-product button:hover {
  background-color: #666;
}

/* BLUR solo en el fondo */
.popup2-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9998;
  display: none;
}

/* Mostrar overlay activo */
.popup2-overlay.active {
  display: block;
}

/* La ventana va encima del overlay */
.popup2-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 20, 0.9); /* sin blur aquí */
  color: white;
  padding: 2rem;
  border-radius: 16px;
  z-index: 9999;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.popup2-window.active {
  opacity: 1;
  pointer-events: auto;
}

.popup2-img {
  width: 100%;
  max-height: 250px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.popup2-title {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.popup2-desc {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 1rem;
}

.popup2-price {
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
}

.popup2-buy {
  background-color: #00cc88;
  border: none;
  color: black;
  font-weight: bold;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.popup2-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}

/* POPUP2 debe estar sobre popup1 */
.popup2-window,
.popup2-overlay {
  z-index: 9999;
}

/* popup1 tiene menor prioridad */
.popup1-window,
.popup1-overlay {
  z-index: 999;
}

/* Efecto hover para productos */
.popup1-product {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}
.popup1-product:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

/* Imagen en el popup2 */
#popup2-img {
  max-width: 90%;
  max-height: 50vh;
  border-radius: 12px;
  margin-bottom: 1rem;
  object-fit: contain;
}

/* popup2 responsivo y centrado */
.popup2-window {
  background: rgba(10, 10, 10, 0.95);
  color: white;
  padding: 2rem;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Botón Comprar */
.btn-comprar {
  background: #ffffff10;
  border: 1px solid #ffffff30;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-comprar:hover {
  background: #ffffff20;
}

#popup2 {
  display: none;
  /* o con opacity y visibility para animaciones */
  /* opacity: 0; visibility: hidden; transition: opacity 0.3s ease; */
}

#popup2.active {
  display: block;
  /* o opacity: 1; visibility: visible; */
}




/* ===========================
     BACKGROUNDS
=========================== */
/* Base background styles - common properties */
body{
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Individual background images - only what's unique */
body.bg-club { background-image: url("media/B01 Club Benares.webp"); }
body.bg-eventos { background-image: url("media/B03 Eventos.png"); }
body.bg-biblioteca { background-image: url("media/B05 Biblioteca Nacional.png"); }
body.bg-cinemateca { background-image: url("media/B06 Canal 14.png"); }
body.bg-laboratorio { background-image: url("media/Eventos\ \(3\).png"); }
body.bg-mercado { background-image: url("media/Eventos\ \(2\).png"); }
body.bg-comunidade { background-image: url("media/B10\ Comunidade.png"); }
body.bg-contactos { background-image: url("media/B04\ Noticias.png"); }


/* Add this to your existing footer styles in styles.css */

.shadow-toggle-btn {
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  font-size: 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
  font-family: var(--font-family);
  user-select: none;
  line-height: 1.2;
}

.shadow-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.shadow-toggle-btn.shadows-off {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
}

.shadow-toggle-btn.shadows-off:hover {
  background-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

/* GitHub Status Indicator */
.github-status {
  font-size: 0.65rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.2;
}

.github-status.success {
  background-color: rgba(0, 200, 100, 0.2);
  border-color: rgba(0, 200, 100, 0.4);
  color: #00ff88;
}

.github-status.failure {
  background-color: rgba(255, 50, 50, 0.2);
  border-color: rgba(255, 50, 50, 0.4);
  color: #ff6666;
}

.github-status.pending {
  background-color: rgba(255, 200, 0, 0.2);
  border-color: rgba(255, 200, 0, 0.4);
  color: #ffcc00;
}

.github-status.error,
.github-status.unknown {
  background-color: rgba(150, 150, 150, 0.2);
  border-color: rgba(150, 150, 150, 0.4);
  color: #aaa;
}

/* ── Glass utility components ───────────────────── */
.glass {
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.glass-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--text-primary);
  color: var(--bg-base);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.section-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 0.85rem;
}

.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a231a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3028; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   NEW DESIGN SYSTEM — atmosphere, components, layout
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Atmosphere orbs and vignette removed — plain black background */
.atmosphere, .vignette { display: none; }

/* ── Enhanced glass card ───────────────────────────────────── */
.glass-bright {
  background: linear-gradient(140deg, rgba(255,248,238,0.10), rgba(255,248,238,0.02) 60%, rgba(255,248,238,0.06));
  border: 1px solid rgba(255,248,238,0.18);
  box-shadow: inset 0 1px 0 rgba(255,248,238,0.20), inset 0 -1px 0 rgba(255,248,238,0.04), 0 32px 64px -32px rgba(0,0,0,0.75);
  border-radius: var(--radius-lg, 16px);
  position: relative;
  overflow: hidden;
}
.glass-bright::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255,248,238,0.14) 0%, rgba(255,248,238,0) 38%, rgba(255,248,238,0) 62%, rgba(255,248,238,0.05) 100%);
  mix-blend-mode: overlay;
  opacity: 0.7;
}

/* ── Section header ────────────────────────────────────────── */
.s-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: end;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border, rgba(255,248,238,0.08));
  margin-bottom: 3rem;
}
.s-num {
  font-family: var(--font-family);
  font-size: 0.62rem;
  color: var(--text-muted, rgba(240,232,216,0.32));
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding-bottom: 0.4rem;
  font-weight: 500;
}
.s-title {
  font-family: var(--font-family);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-primary, #f0e8d8);
}
.s-title em { font-style: normal; color: var(--text-secondary, rgba(240,232,216,0.58)); }
.s-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ── Filter pills ──────────────────────────────────────────── */
.pill {
  display: inline-flex;
  padding: 0.4rem 0.9rem;
  border-radius: 40px;
  background: rgba(255,248,238,0.04);
  border: 1px solid var(--border, rgba(255,248,238,0.08));
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary, rgba(240,232,216,0.58));
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}
.pill.on, .pill:hover {
  background: var(--bg-elevated, rgba(255,248,238,0.09));
  border-color: var(--border-strong, rgba(255,248,238,0.22));
  color: var(--text-primary, #f0e8d8);
}
.pill.on {
  background: var(--text-primary, #f0e8d8);
  color: #000000;
  border-color: var(--text-primary, #f0e8d8);
}

/* ── Film strip marquee ────────────────────────────────────── */
.marquee-wrap {
  overflow: hidden;
  border-top: 1px solid var(--border, rgba(255,248,238,0.08));
  border-bottom: 1px solid var(--border, rgba(255,248,238,0.08));
  padding: 0.9rem 0;
}
.marquee-track {
  display: inline-flex;
  gap: 2.5rem;
  white-space: nowrap;
  animation: marquee 42s linear infinite;
  will-change: transform;
}
.marquee-track span {
  font-family: var(--font-family);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-muted, rgba(240,232,216,0.32));
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  flex-shrink: 0;
}
.marquee-track span::after {
  content: '●';
  font-size: 0.4rem;
  color: rgba(240,232,216,0.14);
  font-style: normal;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Manifesto ─────────────────────────────────────────────── */
.manifesto {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border, rgba(255,248,238,0.08));
}
.manifesto-quote {
  font-family: var(--font-family);
  font-size: clamp(1.6rem, 3.8vw, 3rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 840px;
  margin: 0 0 2.5rem;
  color: var(--text-primary, #f0e8d8);
}
.manifesto-quote .m-strike {
  color: var(--text-muted, rgba(240,232,216,0.28));
  text-decoration: line-through;
  text-decoration-color: rgba(240,232,216,0.14);
}
.manifesto-quote em {
  font-style: italic;
  color: var(--text-secondary, rgba(240,232,216,0.58));
}
.manifesto-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted, rgba(240,232,216,0.32));
  font-size: 0.82rem;
}
.manifesto-author .m-line {
  flex: 0 0 48px;
  height: 1px;
  background: currentColor;
}
.manifesto-author strong { color: var(--text-secondary, rgba(240,232,216,0.58)); }

/* ── Event row ─────────────────────────────────────────────── */
.event-row-link {
  display: grid;
  grid-template-columns: 120px 1fr 44px;
  gap: 2rem;
  align-items: center;
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius-md, 12px);
  background: transparent;
  transition: background 0.25s ease;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.event-row-link + .event-row-link { margin-top: 0.5rem; }
.event-row-link:hover { background: var(--bg-surface, rgba(255,248,238,0.04)); }

.erl-date {
  font-family: var(--font-family);
  font-size: 3rem;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--text-primary, #f0e8d8);
}
.erl-date small {
  display: block;
  font-family: var(--font-family);
  font-size: 0.6rem;
  color: var(--text-muted, rgba(240,232,216,0.32));
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.35rem;
  font-style: normal;
  font-weight: 400;
}
.erl-body {}
.erl-title {
  font-family: var(--font-family);
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text-primary, #f0e8d8);
  margin-bottom: 0.4rem;
}
.erl-title em { font-style: italic; color: var(--text-secondary, rgba(240,232,216,0.58)); }
.erl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted, rgba(240,232,216,0.32));
}
.erl-meta .mk {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 0.3rem;
}
.erl-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface, rgba(255,248,238,0.05));
  border: 1px solid var(--border, rgba(255,248,238,0.10));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-primary, #f0e8d8);
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.event-row-link:hover .erl-arrow {
  background: var(--text-primary, #f0e8d8);
  color: #000000;
  transform: rotate(-45deg);
}

/* ── Archive cards ─────────────────────────────────────────── */
.arc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.arc-card {
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s ease;
  position: relative;
  aspect-ratio: 4/5;
  text-decoration: none;
}
.arc-card:hover { transform: translateY(-4px); }
.arc-img {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e1e22, #0a0a0b);
}
.arc-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(255,248,238,0.12), transparent 60%);
}
.arc-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 38%, rgba(0,0,0,0.80));
}
.arc-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.65;
  display: block;
}
.arc-label {
  position: absolute;
  top: 1rem; left: 1rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  background: rgba(0,0,0,0.8);
  border: 1px solid var(--border, rgba(255,248,238,0.08));
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary, rgba(240,232,216,0.58));
  z-index: 2;
}
.arc-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1.25rem;
  z-index: 3;
}
.arc-date {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(240,232,216,0.32));
  margin-bottom: 0.45rem;
}
.arc-name {
  font-family: var(--font-family);
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 0.2rem;
  text-transform: uppercase;
  color: var(--text-primary, #f0e8d8);
}
.arc-name em { font-style: italic; color: var(--text-secondary, rgba(240,232,216,0.58)); }
.arc-place { color: var(--text-muted, rgba(240,232,216,0.32)); font-size: 0.75rem; }

/* ── Next event glass card ─────────────────────────────────── */
.next-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg, 16px);
  position: relative;
  overflow: hidden;
}
.next-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.nc-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 40px;
  background: rgba(255,248,238,0.07);
  border: 1px solid var(--border-strong, rgba(255,248,238,0.22));
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary, rgba(240,232,216,0.58));
}
.nc-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-primary, #f0e8d8);
  box-shadow: 0 0 8px rgba(255,248,238,0.8);
  animation: ncPulse 2s ease-in-out infinite;
}
@keyframes ncPulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.4; transform:scale(0.8); } }

.nc-countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.nc-cd {
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-sm, 8px);
  background: rgba(255,248,238,0.04);
  border: 1px solid var(--border, rgba(255,248,238,0.08));
  text-align: center;
}
.nc-cd .nc-n {
  font-family: var(--font-family);
  font-size: 2.2rem;
  line-height: 1;
  color: var(--text-primary, #f0e8d8);
}
.nc-cd .nc-u {
  font-size: 0.55rem;
  color: var(--text-muted, rgba(240,232,216,0.32));
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.3rem;
}
.nc-title {
  font-family: var(--font-family);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: var(--text-primary, #f0e8d8);
}
.nc-title em { font-style: italic; color: var(--text-secondary, rgba(240,232,216,0.58)); }
.nc-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary, rgba(240,232,216,0.58));
}
.nc-meta .nc-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border, rgba(255,248,238,0.08));
}
.nc-meta .nc-row:first-child { border-top: none; }
.nc-meta .nc-k {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(240,232,216,0.32));
}
.nc-cta { display: flex; gap: 0.5rem; }
.nc-cta .btn-solid { flex: 1.4; justify-content: center; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .arc-grid { grid-template-columns: repeat(2, 1fr); }
  .s-head { grid-template-columns: 1fr; gap: 0.75rem; }
  .s-actions { flex-wrap: wrap; }
  .event-row-link { grid-template-columns: 90px 1fr 44px; gap: 1rem; }
  .erl-date { font-size: 2.2rem; }
}
@media (max-width: 600px) {
  .arc-grid { grid-template-columns: 1fr 1fr; }
  .event-row-link { grid-template-columns: 1fr; }
  .erl-date { font-size: 2rem; }
  .erl-arrow { display: none; }
  .nc-countdown { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE GLOBAL OVERRIDES  ≤ 768px
══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Hamburger button ── */
  .nav-toggle { display: flex !important; }

  /* ── Nav: full-width vertical dropdown ── */
  nav.active { max-height: 480px; }

  nav ul {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0.75rem 1rem;
    gap: 0.15rem;
  }

  nav a {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    letter-spacing: 0.08em;
  }

  /* ── Footer: stack vertically ── */
  footer {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 1.5rem;
    gap: 0.75rem;
    min-height: auto;
  }

  .footer-controls { justify-content: center; }

  /* ── iOS: background-attachment: fixed causes glitches ── */
  body { background-attachment: scroll; }

  /* ── Eventos list ── */
  .proximos-eventos { padding: 1.25rem 1rem; }

  .evento-lista-item {
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
  }

  .evento-info { min-width: 0; }

  /* ── Cinemateca popup ── */
  .popup1-window {
    width: 95vw;
    min-height: auto;
    max-height: 88vh;
    padding: 1.25rem 1rem;
  }

  .popup1-product { flex-basis: 100%; }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE CONTENT SCALE-DOWN  ≤ 600px
   Reduce font sizes, padding and gaps so nothing feels cramped
══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* ── Typography ── */
  h1, h2, h3 { letter-spacing: 0.03em; }

  /* Page-level headings */
  .page-banner-heading {
    font-size: clamp(1.6rem, 8vw, 2.4rem) !important;
  }

  .page-banner-eyebrow {
    font-size: 0.55rem !important;
    letter-spacing: 0.18em !important;
  }

  /* Section heading */
  .s-title  { font-size: 1.5rem !important; margin-bottom: 1.5rem !important; }
  .s-eyebrow{ font-size: 0.58rem !important; margin-bottom: 0.5rem !important; }

  /* ── Pillar cards ── */
  .pillar-card  { padding: 1.1rem 0.9rem; }
  .pillar-num   { font-size: 0.55rem; margin-bottom: 0.9rem; }
  .pillar-title { font-size: 0.95rem; margin-bottom: 0.6rem; }
  .pillar-desc  { font-size: 0.76rem; line-height: 1.62; }

  /* ── Stats ── */
  .stat-item { padding: 0.85rem 0.5rem; }
  .stat-num  { font-size: 1.4rem; }
  .stat-label{ font-size: 0.58rem; }

  /* ── Project cards ── */
  .project-card  { padding: 1.1rem; gap: 0.55rem; }
  .project-title { font-size: 0.95rem; }
  .project-desc  { font-size: 0.78rem; line-height: 1.6; }
  .project-type, .project-status { font-size: 0.55rem; }
  .project-date  { font-size: 0.58rem; }

  /* ── Discover cards ── */
  .discover-card-body  { padding: 1rem 1rem 1.25rem; }
  .discover-card-num   { font-size: 0.55rem; margin-bottom: 0.35rem; }
  .discover-card-title { font-size: 1.05rem; margin-bottom: 0.3rem; }
  .discover-card-desc  { font-size: 0.72rem; line-height: 1.5; }
  .discover-card-arrow { font-size: 0.65rem; margin-top: 0.6rem; }

  /* ── About section text ── */
  .about-text p { font-size: 0.85rem; line-height: 1.75; }

  /* ── Grid gaps ── */
  .pillars-grid  { gap: 1px; }
  .projects-grid { gap: 0.75rem; }
  .stats-row     { gap: 0.6rem; }

  /* ── Section padding via wrap ── */
  .wrap { padding: 0 1rem; }

  /* ── Cinemateca arc-grid ── */
  .arc-title { font-size: 0.88rem !important; }
  .arc-meta  { font-size: 0.6rem !important; }

  /* ── Eventos page ── */
  .event-name    { font-size: 0.9rem; }
  .event-time,
  .event-location{ font-size: 0.72rem; }
  .event-date-day{ font-size: 1.5rem; }
  .event-date-month { font-size: 0.58rem; }
  .btn-ticket    { font-size: 0.68rem; padding: 0.55rem 1rem; }

  /* ── Fototeca ── */
  .event-title { font-size: 1rem !important; }
  .event-date  { font-size: 0.6rem !important; }
  .photo-grid  { grid-auto-rows: 130px !important; }
}

/* ═══════════════════════════════════════════════════════════
   PAGE BANNER
   Full-width image below the header.
   Usage:
     <div class="page-banner">
       <img src="/media/banners/page.jpg" alt="" class="page-banner-img">
     </div>
   Swap the <img> in when the photo is ready.
   ═══════════════════════════════════════════════════════════ */
.page-banner {
  width: 100%;
  aspect-ratio: 21 / 4;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: rgba(255, 248, 238, 0.025);
  border-bottom: 1px solid var(--border);
}

/* Fade bottom edge into page background */
.page-banner::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 35%;
  background: linear-gradient(to bottom, transparent, var(--bg-base, #000000));
  pointer-events: none;
  z-index: 1;
}

/* Photo — covers the box, centred */
.page-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Placeholder shown while no image is present */
.page-banner-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Responsive height */
@media (max-width: 900px) {
  .page-banner { aspect-ratio: 16 / 5; }
}
@media (max-width: 600px) {
  .page-banner { aspect-ratio: 16 / 7; }
}

/* Banner title — overlaid at bottom-left */
.page-banner-title {
  position: absolute;
  bottom: clamp(1.5rem, 4vh, 3rem);
  left: clamp(1.5rem, 5vw, 4rem);
  z-index: 2;
  max-width: 640px;
}
.page-banner-eyebrow {
  display: block;
  font-family: var(--font-family);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(240, 232, 216, 0.5);
  margin-bottom: 0.6rem;
}
.page-banner-heading {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(2.8rem, 5vw, 5rem);
  color: var(--text-primary);
  line-height: 1.1;
  margin: 0;
}
