/* TRAMA BCN — Barcelona Edition
   Exodus & Resilience — Barcelona
   
   CSS Architecture:
   1. Variables & Design Tokens
   2. Reset & Typography
   3. Layout (Header, Footer, Grid)
   4. Components (Buttons, Cards, Hero, etc.)
   5. Pages (specific page styles)
   6. Utilities (helpers)
   7. Animations (transitions, keyframes)
*/

@import url('variables.css');
@import url('reset.css');
@import url('layout.css');
@import url('components.css');

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

.animate-slide-in-up {
  animation: slideInUp 0.6s ease-in-out;
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--color-primary);
}

.text-secondary {
  color: var(--color-gray-500);
}

.text-muted {
  color: var(--color-gray-400);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-lg {
  font-size: var(--font-size-lg);
}

.font-bold {
  font-weight: 600;
}

.font-italic {
  font-style: italic;
}

.font-mono {
  font-family: var(--font-mono);
}

.mt-0 { margin-top: 0; }
.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); }

.mb-0 { margin-bottom: 0; }
.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); }

.p-0 { padding: 0; }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

.py-sm { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-md { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-lg { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
.py-xl { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }
.py-2xl { padding-top: var(--spacing-2xl); padding-bottom: var(--spacing-2xl); }

.px-sm { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
.px-md { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.px-lg { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

.rounded-sm {
  border-radius: var(--radius-sm);
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-full {
  border-radius: var(--radius-full);
}

.shadow {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.opacity-0 {
  opacity: 0;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-100 {
  opacity: 1;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.sticky {
  position: sticky;
}

.fixed {
  position: fixed;
}

.max-w-full {
  max-width: 100%;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.border-top {
  border-top: 1px solid var(--color-gray-200);
}

.border-bottom {
  border-bottom: 1px solid var(--color-gray-200);
}

.border {
  border: 1px solid var(--color-gray-200);
}

.bg-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.bg-gray-light {
  background-color: var(--color-gray-100);
}

.bg-white {
  background-color: var(--color-white);
}

.list-unstyled {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-unstyled li {
  margin: 0;
}

/* Print Styles */
@media print {
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .site-header,
  .site-footer,
  .no-print {
    display: none;
  }

  a {
    text-decoration: underline;
  }

  section {
    page-break-inside: avoid;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  /* Optional: add dark mode support in future */
}

/* =========================================================
   Barcelona visual alignment with Exodus & Resilience master
   Inspired by newyork.exodusandresilience.org
   Override layer — 20260510
========================================================= */

:root {
  --color-primary: #C43D23;
  --color-primary-dark: #8F2A18;
  --color-black: #070707;
  --color-ink: #111111;
  --color-cream: #EEE8DE;
  --color-cream-light: #F6F3ED;
  --color-paper: #FFFFFF;
  --color-muted: #7D7872;

  --container-max-width: 1180px;
  --container-padding: 2rem;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Base */
body {
  background: var(--color-cream);
  color: #2F2F2F;
  font-size: 16px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--color-ink);
}

h1 {
  font-size: clamp(3.2rem, 7vw, 6.6rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(2.2rem, 4.2vw, 4.5rem);
  line-height: 1;
}

h3 {
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
  line-height: 1.1;
}

p {
  color: #4E4A46;
}

/* Header */
.site-header {
  min-height: 76px;
  padding: 0 3rem;
  background: #FFFFFF;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  gap: 2rem;
}

.brand {
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
}

.brand-logo,
.brand-text {
  height: auto;
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0B0B0B;
}

.brand-separator {
  height: 22px;
  background: rgba(0, 0, 0, 0.12);
}

.desktop-nav {
  align-items: center;
  justify-content: flex-end;
  gap: 1.65rem;
  min-width: 0;
}

.desktop-nav a {
  white-space: nowrap;
  font-size: 0.78rem;
  color: #222;
  text-decoration: none;
}

.desktop-nav a.active,
.desktop-nav a:hover {
  color: var(--color-primary);
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.language-switch,
.lang-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  line-height: 1;
}

.lang-separator {
  color: rgba(0, 0, 0, 0.35);
}

.btn-support {
  padding: 0.85rem 1.25rem;
  border-radius: 0;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.btn-support:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

/* Chapter switcher */
.chapter-switcher {
  background: #F4F1EA;
  color: #8A8580;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.chapter-switcher a {
  color: var(--color-primary);
  text-decoration: none;
  margin: 0 0.35rem;
}

.chapter-switcher a:hover {
  text-decoration: underline;
}

/* Hero — New York style */
.hero,
.page-hero {
  min-height: 620px;
  background: #070707;
  color: #fff;
  padding: 7rem 0 5rem;
  align-items: flex-start;
}

.hero-bg {
  background: #070707 !important;
}

.hero-gradient {
  background:
    radial-gradient(circle at 20% 20%, rgba(196, 61, 35, 0.28), transparent 35%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.96) 70%) !important;
}

.hero-content {
  max-width: var(--container-max-width);
}

.hero-eyebrow,
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 500;
}

.hero-title {
  max-width: 760px;
  margin-top: 1.2rem;
  margin-bottom: 1.8rem;
  color: #fff;
  font-size: clamp(3.5rem, 7vw, 7.2rem);
  line-height: 0.92;
  font-weight: 500;
}

.hero-title em {
  color: rgba(255, 255, 255, 0.74) !important;
  font-style: italic;
}

.hero-subtitle {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.06rem;
  line-height: 1.8;
}

.hero-actions {
  margin-top: 2.2rem;
}

.hero-metrics {
  max-width: 980px;
  margin-top: 4rem;
  padding-top: 2.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-metric {
  text-align: left;
}

.hero-metric strong {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3.4rem);
  font-weight: 500;
  color: var(--color-primary);
}

.hero-metric span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
}

/* Sections */
section {
  padding: 6.5rem 0;
  background: #fff;
}

section.alt {
  background: var(--color-cream);
}

.section-header {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 4rem;
}

.section-header h2 {
  margin-top: 0.7rem;
}

.section-description {
  color: #5E5953;
  line-height: 1.8;
}

/* Cards and boxes */
.card,
.feature-box,
.icon-box,
.cta-box {
  border-radius: 0;
}

.card {
  border: 0;
  background: #fff;
  box-shadow: none;
  padding: 2.2rem;
}

.card:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

.feature-box {
  border-left: 2px solid var(--color-primary);
  background: transparent;
  padding: 1.75rem 1.75rem 1.75rem 1.35rem;
}

.icon {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #111;
}

.icon-box h3 {
  font-size: 1.65rem;
}

.icon-box p {
  color: #706B65;
}

.cta-box {
  background: #F4E9E2;
  border-top: 3px solid var(--color-primary);
  padding: 4rem 3rem;
}

/* Buttons */
.btn {
  border-radius: 0;
  font-size: 0.82rem;
  padding: 1rem 1.45rem;
}

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Footer */
.site-footer {
  margin-top: 0;
  background: #070707;
  color: rgba(255, 255, 255, 0.72);
  border-top: 0;
  padding: 5rem 3rem 2.5rem;
}

.footer-section h3 {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
}

.footer-section p,
.footer-section a,
.footer-bottom {
  color: rgba(255, 255, 255, 0.62);
}

.footer-section a:hover,
.footer-bottom a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* Mobile */
@media (max-width: 1100px) {
  .site-header {
    padding: 0 1.5rem;
  }

  .desktop-nav {
    gap: 1rem;
  }

  .desktop-nav a {
    font-size: 0.72rem;
  }

  .header-actions {
    gap: 0.55rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    min-height: 68px;
    padding: 0 1rem;
  }

  .brand-text {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .language-switch,
  .lang-separator {
    display: none;
  }

  .btn-support {
    display: none;
  }

  .hero,
  .page-hero {
    min-height: auto;
    padding: 5rem 0 4rem;
  }

  .hero-title {
    font-size: clamp(3.1rem, 15vw, 4.8rem);
  }

  .hero-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  section {
    padding: 4rem 0;
  }

  .cta-box {
    padding: 3rem 1.5rem;
  }
}