/* ═══════════════════════════════════════════════════════════════
   EXPRESO A ORIENTE — Faithful reproduction of the original site
   ═══════════════════════════════════════════════════════════════ */

/* ─── @font-face declarations (original fonts) ─────────────── */

@font-face {
  font-family: 'AvenirLTStd35Light';
  src: url('../fonts/avenirltstd-light-webfont.woff') format('woff'),
       url('../fonts/avenirltstd-light-webfont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'AvenirLTStd55Bold';
  src: url('../fonts/avenirltstd-heavy-webfont.woff') format('woff'),
       url('../fonts/avenirltstd-heavy-webfont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'UniversLT-UltraCondensed';
  src: url('../fonts/universlt59ultracondensed.woff') format('woff'),
       url('../fonts/universlt59ultracondensed.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ─── Custom Properties ──────────────────────────────────────── */

:root {
  --ink:          #000000;
  --ink-soft:     #2c2c2c;
  --ink-faded:    #5D5E5B;
  --stone:        #98998D;
  --ash:          #BABEB9;
  --mist:         #CECFCD;
  --border:       #C9CCC8;
  --fog:          #e8e8e6;
  --paper:        #ffffff;
  --white:        #ffffff;
  --footer-bg:    #404040;

  --font-display: 'UniversLT-UltraCondensed', 'Arial Narrow', sans-serif;
  --font-body:    'Droid Serif', Georgia, serif;
  --font-ui:      'AvenirLTStd55Bold', 'Helvetica Neue', Arial, sans-serif;
  --font-ui-light:'AvenirLTStd35Light', 'Helvetica Neue', Arial, sans-serif;

  --max-width:     980px;
  --content-width: 725px;
  --sidebar-width: 210px;
  --header-height: 95px;
  --slide-width:   980px;
  --slide-height:  550px;
  --slide-gap:     15px;
  --gutter:        0px;

  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast:  200ms;
  --duration-mid:   400ms;
  --duration-slow:  700ms;
}

/* ─── Reset ──────────────────────────────────────────────────── */

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

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

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  padding-top: var(--header-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

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

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

ul, ol {
  list-style: none;
}

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

input, textarea, select {
  font: inherit;
  color: inherit;
}

/* ─── Utilities ──────────────────────────────────────────────── */

.container {
  width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0;
}

.wrapper-content {
  width: var(--max-width);
  margin: auto;
  min-height: 500px;
}

.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;
}

.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.85em 2em;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.btn:hover {
  background: var(--ink);
  color: var(--white);
}

/* ─── Typography ─────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: normal;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--ink);
}

p {
  margin-bottom: 1.2em;
  font-size: 15px;
}

blockquote {
  margin: 20px 0;
  padding: 15px 25px;
  border-left: 4px solid var(--ink);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

hr {
  border: none;
  height: 1px;
  background: var(--ash);
  margin: 30px 0;
}

/* ═══════════════════════════════════════════════════════════════
   SITE HEADER — matches original navbar layout
   ═══════════════════════════════════════════════════════════════ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.site-header.is-scrolled {
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.06);
}

.header-inner {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0;
  height: var(--header-height);
  display: flex;
  align-items: flex-start;
}

/* Logo — black box with sprite (original: 130x45 + padding 25px 15px = 160x95px) */
.header-logo {
  display: block;
  flex-shrink: 0;
  box-sizing: content-box;
  width: 130px;
  height: 45px;
  padding: 25px 15px;
  background: #000 url('../img/sprites.png') no-repeat 15px 25px;
  background-size: auto;
  text-indent: -9999px;
  overflow: hidden;
}

.logo-mark {
  display: block;
  width: 100%;
  height: 100%;
  text-indent: -9999px;
}

/* Tagline */
.header-tagline {
  font-family: var(--font-ui-light);
  font-size: 12px;
  color: var(--stone);
  text-transform: uppercase;
  line-height: 20px;
  width: 300px;
  padding-left: 20px;
  margin: 0;
  align-self: center;
  flex-shrink: 0;
}

/* Navigation — pushed to right with top margin (original: margin: 55px 15px 0 0) */
.main-nav {
  display: flex;
  margin-left: auto;
  margin-top: 55px;
  margin-right: 15px;
  padding: 0;
}

.nav-list {
  display: flex;
  gap: 0;
}

.nav-link {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  text-transform: uppercase;
  padding: 0 0 0 30px;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  color: var(--mist);
}

/* Language switch */
.lang-switch {
  position: absolute;
  right: 24px;
  top: 30px;
  font-family: var(--font-ui-light);
  font-size: 12px;
  color: #333;
  text-decoration: none;
  transition: color var(--duration-fast);
}

.lang-switch:hover {
  color: var(--ink);
}

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 4px;
  z-index: 1001;
}

.menu-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform var(--duration-mid) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out);
  transform-origin: center;
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ═══════════════════════════════════════════════════════════════
   HERO CAROUSEL — horizontal scroller with peek effect
   ═══════════════════════════════════════════════════════════════ */

.chapter-carousel {
  position: relative;
  width: 100%;
}

.carousel-viewport {
  position: relative;
  width: 100%;
  height: var(--slide-height);
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: var(--slide-gap);
  height: var(--slide-height);
}

.carousel-slide {
  flex: 0 0 var(--slide-width);
  width: var(--slide-width);
  height: var(--slide-height);
  position: relative;
  overflow: hidden;
  display: block;
}

.carousel-slide-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dark gradient overlay */
.carousel-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.05) 30%,
    rgba(0, 0, 0, 0.3) 100%
  );
  pointer-events: none;
}

/* Slide content — centered text overlay */
.carousel-slide-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2;
  padding: 20px;
  color: var(--white);
  pointer-events: none;
}

.carousel-chapter-id {
  font-family: var(--font-display);
  font-size: 25px;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 5px;
  letter-spacing: 0.05em;
}

.carousel-chapter-title {
  font-family: var(--font-display);
  font-size: 120px;
  text-transform: uppercase;
  line-height: 0.9;
  color: var(--white);
  margin-bottom: 5px;
}

.carousel-chapter-subtitle {
  font-family: var(--font-display);
  font-size: 35px;
  text-transform: uppercase;
  color: var(--white);
  letter-spacing: 0.05em;
}

/* Chapter number badge — top-left */
.carousel-chapter-number {
  position: absolute;
  top: 15px;
  left: 20px;
  font-family: var(--font-display);
  font-size: 20px;
  background: var(--ink);
  color: var(--white);
  padding: 12px 17px;
  border-radius: 4px;
  z-index: 3;
}

/* Chapter date — top-right */
.carousel-chapter-date {
  position: absolute;
  top: 30px;
  right: 30px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: var(--white);
  z-index: 3;
}

/* Slide link overlay */
.carousel-slide-link {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
}

/* Carousel slide-level arrows (not used; nav bar has the arrows) */

/* ═══════════════════════════════════════════════════════════════
   CHAPTER NAVIGATION BAR — numbered dots with sprite arrows
   ═══════════════════════════════════════════════════════════════ */

.carousel-nav-wrap {
  position: relative;
  border-bottom: 1px solid var(--ash);
  margin: 15px 0;
}

.carousel-dots {
  min-height: 40px;
  position: relative;
  padding: 0 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* Arrow buttons (real elements replacing pseudo-elements) */
.carousel-arrow {
  position: absolute;
  top: 2px;
  width: 47px;
  height: 36px;
  background: transparent url('../img/sprites.png') no-repeat;
  text-indent: -9999px;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 4px;
}

.carousel-arrow-prev {
  left: 0;
  background-position: -477px -232px;
}

.carousel-arrow-prev:hover {
  background-color: #000;
  background-position: -477px -272px;
}

.carousel-arrow-next {
  right: 0;
  background-position: -528px -232px;
}

.carousel-arrow-next:hover {
  background-color: #000;
  background-position: -528px -272px;
}

.carousel-dot {
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: var(--ink);
  padding: 0 6px;
  height: 30px;
  line-height: 30px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  background: none;
  text-decoration: none;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.carousel-dot:hover {
  background: var(--mist);
  color: var(--white);
}

.carousel-dot.is-active {
  background: var(--ink);
  color: var(--white);
  cursor: default;
}

.carousel-dot.is-active:hover {
  background: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */

.main-content {
  min-height: 60vh;
}

/* ═══════════════════════════════════════════════════════════════
   CHAPTER PAGE
   ═══════════════════════════════════════════════════════════════ */

/* Chapter Hero */
.chapter-hero {
  position: relative;
  width: 100%;
  height: var(--slide-height);
  overflow: hidden;
  margin-bottom: 0;
}

.chapter-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapter-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
}

.chapter-hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2;
  color: var(--white);
  padding: 20px;
}

.chapter-hero-id {
  font-family: var(--font-display);
  font-size: 25px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.chapter-hero-title {
  font-family: var(--font-display);
  font-size: 120px;
  color: var(--white);
  text-transform: uppercase;
  line-height: 0.9;
}

.chapter-hero-subtitle {
  font-family: var(--font-display);
  font-size: 35px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 5px;
}

/* Chapter Title Bar */
.chapter-title-bar {
  border-bottom: 5px solid var(--ink);
  padding-bottom: 18px;
  margin-top: 35px;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  height: 45px;
}

.chapter-title-bar h1 {
  font-family: var(--font-display);
  font-size: 40px;
  text-transform: uppercase;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.chapter-title-bar h1 a {
  color: var(--ink);
}

.chapter-title-bar h1 a:hover {
  color: var(--ink-soft);
}

.chapter-title-bar .chapter-title-accent {
  color: var(--mist);
}

.chapter-date {
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: var(--ink);
  flex-shrink: 0;
}

/* Chapter Layout */
.chapter-layout {
  width: var(--max-width);
  margin: 0 auto;
  overflow: hidden;
}

.chapter-layout.layout-sidebar {
  display: block;
}

.layout-full .chapter-body {
  width: var(--max-width);
}

/* Chapter Body */
.chapter-body {
  float: left;
  width: var(--content-width);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  padding: 30px 0;
}

.chapter-body p {
  font-family: var(--font-body);
  font-size: 15px;
  text-align: justify;
  margin: 10px 0;
}

.chapter-body p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.5em;
  float: left;
  line-height: 0.8;
  padding-right: 0.08em;
  padding-top: 0.07em;
  color: var(--ink);
}

.chapter-body img {
  width: 100%;
  margin: 20px 0;
}

.chapter-body h2 {
  margin: 30px 0 15px;
  font-size: 30px;
}

.chapter-body h3 {
  margin: 25px 0 12px;
  font-size: 25px;
  color: var(--ink);
}

.chapter-body a {
  color: var(--ink-faded);
  text-decoration: underline;
}

.chapter-body a:hover {
  color: var(--ink);
}

/* Author attribution */
.chapter-author {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  color: var(--stone);
  margin-bottom: 20px;
}

.chapter-section-title {
  font-family: var(--font-display);
  font-size: 30px;
  text-transform: uppercase;
  margin: 30px 0 10px;
  color: var(--ink);
}

/* Vimeo / Video embeds */
.chapter-body iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  margin: 20px 0;
}

/* ─── Sidebar ────────────────────────────────────────────────── */

.chapter-sidebar {
  float: right;
  width: var(--sidebar-width);
  padding: 30px 0;
}

.sidebar-box {
  margin-bottom: 25px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--ash);
  font-family: var(--font-body);
  font-size: 13px;
}

.sidebar-box:last-child {
  border-bottom: none;
}

.sidebar-box h3 {
  font-family: var(--font-display);
  font-size: 25px;
  text-transform: uppercase;
  padding-bottom: 10px;
  color: var(--ink);
  margin-bottom: 10px;
}

.sidebar-social a {
  display: block;
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink-faded);
  padding: 5px 0;
}

.sidebar-social a:hover {
  color: var(--ink);
}

/* ─── Chapter Pagination ─────────────────────────────────────── */

.chapter-pagination {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  width: var(--max-width);
  margin: 40px auto 30px;
  border-top: 1px solid var(--ash);
  gap: 15px;
}

.chapter-pagination-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 0;
  flex: 1;
  transition: color var(--duration-fast);
}

.chapter-pagination-link:hover {
  color: var(--ink-faded);
}

.chapter-pagination-link.is-disabled {
  visibility: hidden;
}

.chapter-pagination-prev {
  text-align: left;
}

.chapter-pagination-all {
  text-align: center;
  flex: 0 0 auto;
}

.chapter-pagination-next {
  text-align: right;
}

.chapter-pagination-label {
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stone);
  margin-bottom: 4px;
}

.chapter-pagination-id {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════════════════════════════ */

/* The home page does NOT have a chapters grid below the carousel
   in the original — it goes straight to the chapter content.
   But we keep the grid as a modern addition, hidden by default
   to match original. */

.chapters-grid {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════════════════════ */

.about-page {
  width: var(--max-width);
  margin: 0 auto;
  padding: 30px 0;
}

.about-page h1 {
  font-family: var(--font-display);
  font-size: 40px;
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 5px solid var(--ink);
  text-transform: uppercase;
}

.team-grid {
  display: block;
}

.team-member {
  overflow: hidden;
  padding-bottom: 30px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--fog);
}

.team-member:last-child {
  border-bottom: none;
}

.team-member-photo {
  width: 312px;
  float: left;
  margin-right: 21px;
}

.team-member-photo img {
  width: 100%;
  height: auto;
}

.team-member-info h2 {
  font-family: var(--font-body);
  font-size: 30px;
  font-weight: bold;
  padding: 5px 0;
  line-height: 35px;
  text-transform: none;
}

.team-member-info h3 {
  font-family: var(--font-ui-light);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone);
  margin-bottom: 15px;
  font-weight: normal;
}

.team-member-info p {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: justify;
  margin: 15px 0;
}

/* ─── Journey Page ───────────────────────────────────────────── */

.journey-page {
  width: var(--max-width);
  margin: 0 auto;
  padding: 30px 0;
}

.journey-page h1 {
  font-family: var(--font-display);
  font-size: 40px;
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 5px solid var(--ink);
  text-transform: uppercase;
}

.journey-content {
  width: var(--content-width);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.journey-content p {
  text-align: justify;
  margin: 10px 0;
}

/* ─── Cities / Map Page ──────────────────────────────────────── */

.cities-page {
  width: var(--max-width);
  margin: 0 auto;
  padding: 30px 0;
}

.cities-page h1 {
  font-family: var(--font-display);
  font-size: 40px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 5px solid var(--ink);
  text-transform: uppercase;
}

.map-container {
  width: 100%;
  height: 70vh;
  min-height: 400px;
  border: 1px solid var(--ash);
  margin-bottom: 30px;
  overflow: hidden;
}

.map-container .leaflet-popup-content-wrapper {
  border-radius: 2px;
  font-family: var(--font-ui);
}

.map-container .leaflet-popup-content {
  font-size: 13px;
  line-height: 1.5;
}

.map-popup-title {
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.map-popup-chapter {
  font-family: var(--font-ui-light);
  font-size: 12px;
  color: var(--stone);
}

.map-popup-chapter a {
  color: var(--ink);
  text-decoration: underline;
}

/* ─── Contact Page ───────────────────────────────────────────── */

.contact-page {
  width: var(--max-width);
  margin: 0 auto;
  padding: 30px 0;
}

.contact-page h1 {
  font-family: var(--font-display);
  font-size: 40px;
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 5px solid var(--ink);
  text-transform: uppercase;
}

.contact-layout {
  display: block;
  overflow: hidden;
}

.contact-form {
  float: left;
  width: var(--content-width);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
  width: 370px;
  padding: 0.6em 0.8em;
  border: 1px solid var(--ash);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.form-group textarea {
  width: 370px;
  height: 120px;
  resize: vertical;
}

.form-captcha {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-faded);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-captcha input {
  width: 80px;
  padding: 0.5em;
  border: 1px solid var(--ash);
  text-align: center;
  font-size: 14px;
}

.form-captcha input:focus {
  outline: none;
  border-color: var(--ink);
}

.form-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.form-message {
  padding: 12px 18px;
  margin-bottom: 18px;
  font-family: var(--font-body);
  font-size: 14px;
}

.form-message--success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.form-message--error {
  background: #fce4ec;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.contact-info {
  float: right;
  width: var(--sidebar-width);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-faded);
  padding: 30px 0;
}

.contact-info h3 {
  font-size: 25px;
  margin-bottom: 10px;
}

.contact-info p {
  margin-bottom: 8px;
  font-size: 13px;
}

.contact-info a {
  color: var(--ink);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER — sprite-based logo and social icons
   ═══════════════════════════════════════════════════════════════ */

.site-footer {
  background: var(--footer-bg);
  padding: 40px 0 60px 0;
  margin-top: 40px;
}

.footer-inner {
  width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

/* Footer logo from sprite */
.footer-logo {
  display: block;
  width: 130px;
  height: 45px;
  margin: 0 auto 35px auto;
  background: transparent url('../img/sprites.png') no-repeat -99px -384px;
  text-indent: -9999px;
  overflow: hidden;
}

.footer-logo span {
  display: block;
  text-indent: -9999px;
}

.footer-tagline {
  display: none;
}

/* Footer social icons from sprite */
.footer-social {
  display: flex;
  justify-content: center;
  width: 430px;
  margin: 0 auto;
  height: 40px;
}

.social-link {
  display: block;
  float: left;
  margin-left: 30px;
  text-indent: -9999px;
  overflow: hidden;
  background: transparent url('../img/sprites.png') no-repeat;
}

.social-link:first-child {
  margin-left: 0;
}

.social-link svg {
  display: none;
}

.social-facebook {
  width: 90px;
  height: 33px;
  background-position: 0 -464px;
}

.social-twitter {
  width: 83px;
  height: 33px;
  background-position: -116px -463px;
}

.social-vimeo {
  width: 75px;
  height: 33px;
  background-position: -353px -467px;
}

.social-youtube {
  width: 90px;
  height: 33px;
  background-position: -232px -466px;
}

.footer-copy {
  font-family: var(--font-ui-light);
  font-size: 11px;
  color: var(--stone);
  margin-top: 35px;
}

/* ─── 404 Page ───────────────────────────────────────────────── */

.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-page h1 {
  font-family: var(--font-display);
  font-size: 80px;
  margin-bottom: 20px;
}

.error-page p {
  font-size: 18px;
  color: var(--stone);
  margin-bottom: 25px;
}

/* ─── Animations ─────────────────────────────────────────────── */

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

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — adapt the original 980px layout for smaller screens
   ═══════════════════════════════════════════════════════════════ */

/* Tablet and up (768px+) */
@media (min-width: 768px) and (max-width: 1023px) {
  .container,
  .wrapper-content,
  .chapter-pagination,
  .about-page,
  .journey-page,
  .cities-page,
  .contact-page,
  .footer-inner {
    width: auto;
    padding-left: 20px;
    padding-right: 20px;
  }

  .chapter-layout {
    width: auto;
    padding: 0;
  }

  .chapter-body,
  .layout-full .chapter-body {
    float: none;
    width: 100%;
  }

  .chapter-sidebar {
    float: none;
    width: 100%;
  }

  .carousel-slide {
    flex: 0 0 100%;
    width: 100%;
  }

  .carousel-chapter-title {
    font-size: 80px;
  }

  .chapter-hero-title {
    font-size: 80px;
  }
}

/* Mobile (below 768px) */
@media (max-width: 767px) {
  :root {
    --header-height: 65px;
    --slide-height: 350px;
  }

  /* Fluid containers on mobile */
  .container,
  .wrapper-content,
  .chapter-pagination,
  .about-page,
  .journey-page,
  .cities-page,
  .contact-page,
  .footer-inner {
    width: auto;
    padding-left: 15px;
    padding-right: 15px;
  }

  .chapter-layout {
    width: auto;
    padding: 0;
  }

  /* Mobile header — full width, no margins */
  .header-inner {
    height: var(--header-height);
    align-items: center;
    padding: 0;
  }

  .header-logo {
    width: 89px;
    height: 31px;
    padding: 17px 10px;
    background-position: 10px 17px;
    background-size: 685px 342px;
  }

  .header-tagline {
    display: none;
  }

  .lang-switch {
    position: static;
    font-size: 10px;
    order: 2;
    margin-left: auto;
    margin-right: 8px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 2px;
  }

  .menu-toggle {
    display: flex;
    order: 3;
    margin-right: 10px;
  }

  /* Mobile nav overlay */
  .main-nav {
    position: fixed;
    inset: 0;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(100%);
    transition: transform var(--duration-mid) var(--ease-out);
    z-index: 999;
    margin: 0;
  }

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

  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 25px;
  }

  .nav-link {
    font-size: 18px;
    letter-spacing: 0.15em;
  }

  /* Mobile carousel — 95% width with 2.5% peek on each side */
  .carousel-slide {
    flex: 0 0 95%;
    width: 95%;
  }

  .carousel-track {
    gap: 4px;
  }

  .carousel-chapter-title {
    font-size: 50px;
  }

  .carousel-chapter-id {
    font-size: 16px;
  }

  .carousel-chapter-subtitle {
    font-size: 20px;
  }

  .carousel-chapter-number {
    padding: 8px 12px;
    font-size: 16px;
  }

  .carousel-chapter-date {
    font-size: 11px;
    top: 20px;
    right: 15px;
  }

  /* Mobile carousel nav wrapper — flex layout for arrow + dots alignment */
  .carousel-nav-wrap {
    display: flex;
    align-items: center;
    margin: 8px 0;
  }

  /* Mobile carousel dots — centered between arrows, scrollable */
  .carousel-dots {
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
    margin: 0;
    padding: 6px 6px;
    justify-content: flex-start;
    min-height: 32px;
  }

  .carousel-dots::-webkit-scrollbar {
    display: none;
  }

  /* Fade gradients at dot edges to hint at scrollable content */
  .carousel-nav-wrap::before,
  .carousel-nav-wrap::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    z-index: 2;
    pointer-events: none;
  }

  .carousel-nav-wrap::before {
    left: 47px;
    background: linear-gradient(to right, white, transparent);
  }

  .carousel-nav-wrap::after {
    right: 47px;
    background: linear-gradient(to left, white, transparent);
  }

  /* Arrows as flex items, vertically aligned with dots */
  .carousel-arrow {
    position: relative;
    top: auto;
    transform: none;
    flex-shrink: 0;
    z-index: 3;
  }

  .carousel-dot {
    flex-shrink: 0;
    font-size: 11px;
    padding: 0 7px;
    height: 26px;
    line-height: 26px;
  }

  /* Mobile chapter page */
  .chapter-hero {
    height: 350px;
  }

  .chapter-hero-title {
    font-size: 50px;
  }

  .chapter-hero-id {
    font-size: 16px;
  }

  .chapter-hero-subtitle {
    font-size: 20px;
  }

  .chapter-title-bar {
    flex-direction: row;
    gap: 8px;
    height: auto;
    margin-top: 20px;
  }

  .chapter-title-bar h1 {
    font-size: 25px;
  }

  .chapter-body,
  .layout-full .chapter-body {
    float: none;
    width: 100%;
    font-size: 14px;
    padding: 20px 0;
  }

  .chapter-body iframe {
    margin: 0;
  }

  .chapter-body p:has(> iframe) {
    margin: 0;
  }

  .chapter-sidebar {
    float: none;
    width: 100%;
    padding: 15px 0;
    border-top: 1px solid var(--fog);
  }

  /* Mobile pagination */
  .chapter-pagination {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .chapter-pagination-prev,
  .chapter-pagination-next {
    text-align: center;
  }

  /* Mobile about */
  .team-member-photo {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 15px;
  }

  /* Mobile map */
  .map-container {
    height: 50vh;
    min-height: 300px;
  }

  /* Mobile footer */
  .site-footer {
    padding: 30px 15px;
  }

  .footer-social {
    width: auto;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
  }

  .social-link {
    margin-left: 15px;
  }

  /* Mobile contact */
  .contact-form {
    float: none;
    width: 100%;
  }

  .contact-info {
    float: none;
    width: 100%;
  }

  .form-group input[type="text"],
  .form-group input[type="email"],
  .form-group textarea {
    width: 100%;
  }

  /* Mobile 404 */
  .error-page h1 {
    font-size: 50px;
  }
}

/* ─── Print ──────────────────────────────────────────────────── */

@media print {
  .site-header,
  .site-footer,
  .chapter-pagination,
  .carousel-arrow,
  .carousel-dots,
  .menu-toggle,
  .lang-switch {
    display: none !important;
  }

  body {
    padding-top: 0;
    background: white;
    color: black;
  }

  .chapter-body {
    font-size: 12pt;
  }
}

/* ─── Reduced Motion ─────────────────────────────────────────── */

@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;
  }
}
