/* ================================================================
   CSS GLOBAL — ATREVERSE TANDEM
   Accesibilidad · Diseño · Mobile-first
   Guided by taste-skill (github.com/Leonxlnx/taste-skill)
   ================================================================ */

/* ── 0. GOOGLE FONTS ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ── 1. DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Brand */
  --brand:         #003A6E;
  --brand-hover:   #004D94;
  --brand-light:   #E8F0FB;
  --brand-mid:     #1E5FAA;

  /* Accent */
  --accent:        #B83032;
  --accent-light:  #FEF0F0;

  /* Goal/success (finish line) */
  --goal:          #1A7840;
  --goal-light:    #EDF7F1;

  /* Surfaces & backgrounds */
  --bg:            #F6F4F0;
  --surface:       #FFFFFF;
  --surface-alt:   #EFEDE9;
  --surface-raised:#FFFFFF;

  /* Borders */
  --border:        #D8D5D0;
  --border-strong: #B5B2AC;

  /* Text */
  --text:          #1C1C1E;
  --text-secondary:#48484A;
  --text-muted:    #6B6B70;
  --text-on-brand: #FFFFFF;

  /* Typography */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Border radii */
  --r-sm:  6px;
  --r-md:  12px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.11), 0 4px 8px rgba(0,0,0,0.07);

  /* Layout */
  --max-content: 860px;
  --max-wide:    1100px;
  --header-h:    4.5rem;
}

/* ── 2. RESET ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

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

ul, ol {
  list-style: none;
}

a {
  color: inherit;
}

/* ── 3. ACCESSIBILITY ─────────────────────────────────────────── */

/* Skip to main content — first focusable element on every page */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 9999;
  padding: var(--sp-3) var(--sp-6);
  background: var(--brand);
  color: var(--text-on-brand);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: top 0.15s ease;
  box-shadow: var(--shadow-md);
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Enhanced focus ring — WCAG 2.4.11 */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Visually hidden — screen readers only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── 4. SITE HEADER & NAV ─────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

/* Brand / logo link */
.site-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
  padding: var(--sp-2) 0;
}
.site-brand img {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.site-brand__name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.2;
}

/* Primary nav */
.site-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
.site-nav ul {
  display: flex;
  gap: var(--sp-1);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav a {
  display: inline-block;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav a:hover {
  background: var(--brand-light);
  color: var(--brand);
}
.site-nav a[aria-current="page"] {
  background: var(--brand);
  color: var(--text-on-brand);
  font-weight: 600;
}

/* ── 5. PAGE HERO ─────────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: var(--text-on-brand);
  padding: var(--sp-16) var(--sp-6);
}
.page-hero__inner {
  max-width: var(--max-content);
  margin: 0 auto;
}
.page-hero__label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-4);
  margin-bottom: var(--sp-4);
  color: rgba(255, 255, 255, 0.92);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--sp-4);
  text-wrap: balance;
}
.page-hero__lead {
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  max-width: 62ch;
}

/* ── 6. MAIN CONTENT ──────────────────────────────────────────── */
.site-main {
  flex: 1;
  max-width: var(--max-content);
  width: 100%;
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-6);
}

/* ── 7. TYPOGRAPHY ────────────────────────────────────────────── */
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  text-wrap: balance;
}

h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

p {
  color: var(--text-secondary);
  max-width: 72ch;
  margin-bottom: var(--sp-5);
}
p:last-child {
  margin-bottom: 0;
}

strong {
  color: var(--text);
  font-weight: 600;
}

/* Content section spacing */
.content-section {
  margin-bottom: var(--sp-12);
}
.content-section:last-child {
  margin-bottom: 0;
}

/* Section divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-12) 0;
}

/* ── 8. TRAVESÍA HEADER ───────────────────────────────────────── */
.travesia-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-5);
  border-bottom: 2px solid var(--brand-light);
}
.travesia-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: var(--brand);
  color: var(--text-on-brand);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--r-md);
  line-height: 1;
}
.travesia-title h2 {
  margin-bottom: var(--sp-1);
}
.travesia-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── 9. PROVINCE LIST ─────────────────────────────────────────── */
.province-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: var(--sp-5) 0 var(--sp-6);
}
.province-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--brand);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-4) var(--sp-5);
  font-size: 1rem;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.15s ease;
}
.province-list li:hover {
  background: var(--brand-light);
  transform: translateX(3px);
}
.province-list li strong {
  color: var(--brand);
  display: block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}
/* Destination / finish highlight */
.province-list li:last-child {
  border-left-color: var(--goal);
  background: var(--goal-light);
}
.province-list li:last-child:hover {
  background: #d4eedd;
}
.province-list li:last-child strong {
  color: var(--goal);
}

/* ── 10. FIGURES & GALLERY ────────────────────────────────────── */
figure {
  margin: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
figure img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}
figure:hover img {
  transform: scale(1.025);
}
figcaption {
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.55;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* Responsive photo gallery grids */
.gallery {
  display: grid;
  gap: var(--sp-5);
  margin: var(--sp-6) 0;
}
.gallery--2col {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.gallery--3col {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.gallery--featured {
  grid-template-columns: 1fr;
}
.gallery--featured figure {
  max-width: 720px;
  margin: 0 auto;
  border-radius: var(--r-lg);
}

/* ── 11. ABOUT / INDEX SPECIFIC ───────────────────────────────── */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
  align-items: start;
  margin-top: var(--sp-6);
}
@media (min-width: 680px) {
  .intro-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}
.intro-text p {
  max-width: 100%;
}

/* Values / mission list */
.values-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
}
.values-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.values-list li .value-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-light);
  border-radius: var(--r-sm);
  color: var(--brand);
}

/* Timeline badge (years) */
.timeline-item {
  display: flex;
  gap: var(--sp-5);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child {
  border-bottom: none;
}
.timeline-year {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand);
  width: 52px;
  padding-top: 2px;
}
.timeline-text {
  font-size: 0.97rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0;
  max-width: 100%;
}

/* ── 12. SOCIAL LINKS ─────────────────────────────────────────── */
.social-section {
  padding: var(--sp-8) var(--sp-6);
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.social-section__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
}
.social-section h3 {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  flex-shrink: 0;
}
.social-links-row {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  min-height: 44px;
}
.social-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  opacity: 0.92;
}
.social-link--facebook {
  background: #1877F2;
  color: #fff;
}
.social-link--instagram {
  background: linear-gradient(45deg, #833ab4, #e1306c, #fd1d1d, #f77737);
  color: #fff;
}

/* ── 13. FOOTER ───────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--sp-8) var(--sp-6);
}
.site-footer__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.footer-nav {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
}
.footer-nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  background: var(--surface);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  min-height: 44px;
  white-space: nowrap;
}
.footer-nav a:hover {
  background: var(--brand-light);
  border-color: var(--brand);
  transform: translateY(-1px);
}
.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
}

/* ── 14. RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 640px) {
  html {
    font-size: 17px;
  }

  .site-header__inner {
    padding: var(--sp-4) var(--sp-5);
    min-height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }
  .site-nav ul {
    justify-content: flex-start;
    gap: var(--sp-1);
  }
  .site-nav a {
    font-size: 0.83rem;
    padding: var(--sp-2) var(--sp-3);
  }

  .page-hero {
    padding: var(--sp-10) var(--sp-5);
  }

  .site-main {
    padding: var(--sp-8) var(--sp-5);
  }

  .site-footer__inner {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  .footer-copy {
    text-align: left;
  }

  .gallery--2col,
  .gallery--3col {
    grid-template-columns: 1fr;
  }

  .travesia-header {
    flex-direction: column;
    gap: var(--sp-3);
  }

  .social-section__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-4);
  }
}

/* ── 15. PRINT ────────────────────────────────────────────────── */
@media print {
  .site-header,
  .skip-link,
  .footer-nav,
  .social-section,
  .page-hero__label {
    display: none;
  }
  body {
    font-size: 12pt;
    line-height: 1.55;
    color: #000;
    background: #fff;
  }
  .page-hero {
    background: none;
    color: #000;
    padding: 1rem 0;
    border-bottom: 2pt solid #000;
  }
  .page-hero h1 {
    font-size: 20pt;
  }
  figure {
    break-inside: avoid;
    box-shadow: none;
    border: 1pt solid #ccc;
  }
  .province-list li {
    border: 1pt solid #999;
    box-shadow: none;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }
}

/* ── 16. REDUCED MOTION ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  figure:hover img {
    transform: none;
  }
  .province-list li:hover {
    transform: none;
  }
  .footer-nav a:hover,
  .social-link:hover {
    transform: none;
  }
}

/* ── 17. FORCED COLORS (HIGH CONTRAST MODE) ───────────────────── */
@media (forced-colors: active) {
  .site-nav a[aria-current="page"] {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
  .province-list li {
    border-left-color: Highlight;
  }
  .province-list li:last-child {
    border-left-color: LinkText;
  }
  .social-link--facebook,
  .social-link--instagram {
    forced-color-adjust: none;
    background: ButtonFace;
    color: ButtonText;
    border: 2px solid ButtonText;
  }
  .travesia-number {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
}
