:root {
  color-scheme: light;
  --blue-900: #0b1b2a;
  --blue-800: #122438;
  --blue-700: #1a3550;
  --blue-600: #23466a;
  --blue-500: #2d5985;
  --blue-400: #3a73a3;
  --blue-200: #b8d3eb;
  --blue-100: #e6f0f9;
  --white: #fdfefe;
  --shadow: 0 20px 40px rgba(11, 27, 42, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--blue-900);
  background: linear-gradient(180deg, #f9fbfe 0%, #edf4fb 45%, #f7fafc 100%);
  line-height: 1.6;
}

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

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

.tips-item a,
.refs-item a,
.story-text a {
  color: var(--blue-500);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.story-text a.photo-link {
  color: var(--blue-600);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 700;
  position: relative;
}

.tips-item a:hover,
.refs-item a:hover,
.story-text a:hover {
  color: var(--blue-700);
}

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

.section {
  padding: 84px 0;
}

.home .section {
  padding: 42px 0;
}

.home .section-header {
  margin-bottom: 20px;
}

.home .story-text p {
  margin-bottom: 1rem;
}

.home .hero-card {
  margin-bottom: 0;
}

.story-page .section {
  padding: 64px 0;
}

.story-page .section-header {
  margin-bottom: 20px;
}

.story-page .story-text p {
  margin-bottom: 1rem;
}

.story-page .story-text {
  padding-top: 8px;
}

.story-page .story-chapter:first-of-type {
  margin-top: 1.4rem;
}

.home .lead {
  font-size: 1rem;
  color: var(--blue-800);
}

.home .hero-card {
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(11, 27, 42, 0.08);
}

.home .prelude-media {
  float: right;
  width: min(48%, 460px);
  margin: 2px 0 16px 24px;
}

.home .story-text .cta-row {
  clear: both;
}

.section.alt {
  background: var(--blue-100);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(253, 254, 254, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(11, 27, 42, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  position: relative;
}

.header-slogan {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: "Palatino Linotype", "Book Antiqua", "Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-style: italic;
  color: var(--blue-800);
  white-space: nowrap;
  pointer-events: none;
}

/* Compact reversible nav: remove `.nav-sandwich` class from headers to revert */
.nav-sandwich .menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  order: 3;
  margin-left: 8px;
}

.nav-sandwich .navbar-collapse {
  flex-basis: auto;
  flex-grow: 0;
}

.nav-sandwich .lang-switch {
  order: 2;
  margin-left: auto;
  margin-right: 0;
}

.nav-sandwich .site-nav {
  position: absolute;
  top: 72px;
  right: 12px;
  width: min(92vw, 360px);
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(11, 27, 42, 0.12);
  background: var(--white);
  box-shadow: var(--shadow);
  display: none;
  gap: 8px;
}

.nav-sandwich .site-nav.show {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
}

.nav-sandwich .site-nav a {
  display: block;
  width: 100%;
  padding: 6px 0;
}

.brand {
  order: 0;
}

.menu-toggle {
  order: 1;
}

.lang-switch {
  order: 2;
  margin-left: auto;
}

.site-nav {
  order: 3;
  margin-left: 24px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(11, 27, 42, 0.15);
  background: var(--white);
}

.lang-switch .lang-active {
  border-color: rgba(11, 27, 42, 0.35);
  background: #e8f0f8;
  font-weight: 700;
}

.flag {
  width: 16px;
  height: 10px;
  display: inline-block;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}


.flag-ita {
  background: linear-gradient(90deg, #1f8a4c 0 33%, #ffffff 33% 66%, #c83b3b 66% 100%);
}

.flag-uk {
  background-color: #012169;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'><rect width='60' height='30' fill='%23012169'/><path d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/><path d='M0,0 L60,30 M60,0 L0,30' stroke='%23C8102E' stroke-width='3'/><rect x='24' width='12' height='30' fill='%23fff'/><rect y='9' width='60' height='12' fill='%23fff'/><rect x='26' width='8' height='30' fill='%23C8102E'/><rect y='11' width='60' height='8' fill='%23C8102E'/></svg>");
  background-size: cover;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-home {
  display: inline-flex;
  align-items: center;
}

.logo-image {
  width: 76px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(26, 53, 80, 0.18);
  background: var(--white);
  padding: 4px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.menu-toggle {
  border: 1px solid rgba(11, 27, 42, 0.2);
  background: var(--white);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.menu-toggle .navbar-toggler-icon {
  width: 1.2em;
  height: 1.2em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2811,27,42,0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.95rem;
  flex-wrap: nowrap;
}

@media (max-width: 1200px) {
  .header-slogan {
    display: none;
  }
}

.site-nav a {
  position: relative;
  padding-bottom: 4px;
  white-space: nowrap;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--blue-500);
  transition: width 0.2s ease;
}

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 100%;
}

.lead {
  font-size: 1.1rem;
  color: var(--blue-700);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.75rem;
  color: var(--blue-400);
  margin: 0;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.cta-row.compact {
  gap: 8px;
  margin-top: 16px;
}

.cta-row.compact .button {
  padding: 10px 18px;
  font-size: 0.95rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
}

.button.primary {
  background: var(--blue-600);
  color: var(--white);
  box-shadow: 0 12px 24px rgba(35, 70, 106, 0.25);
}

.button.ghost {
  border-color: rgba(11, 27, 42, 0.2);
  color: var(--blue-800);
  background: var(--white);
}

.hero-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(11, 27, 42, 0.08);
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.hero-stats {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(11, 27, 42, 0.1);
}

.hero-stats-title {
  font-size: 0.75rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--blue-500);
  margin-bottom: 10px;
}

.hero-stats-list {
  display: grid;
  gap: 10px;
}

.hero-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.95rem;
  color: var(--blue-700);
}

.hero-stat strong {
  color: var(--blue-900);
  font-weight: 700;
}

.section-header {
  margin-bottom: 30px;
}

.section-header h2 {
  margin: 10px 0 0;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
}

.story-text {
  max-width: 860px;
  margin: 0 auto;
  font-size: 1.03rem;
  line-height: 1.85;
  color: var(--blue-900);
}

.story-chapter {
  margin: 2.4rem 0 1rem;
  font-size: 1.3rem;
  color: #0b1b2a !important;
  letter-spacing: 0.4px;
}

.story-index {
  background: var(--white);
  border: 1px solid rgba(11, 27, 42, 0.08);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 0 0 28px;
  box-shadow: 0 10px 24px rgba(11, 27, 42, 0.08);
  color: var(--blue-800);
}

.story-index-title {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue-500);
}

.story-index-list {
  display: grid;
  gap: 6px;
}

.story-index a {
  color: inherit;
}

.story-timeline {
  margin: 18px 0 24px;
  background: var(--white);
  border: 1px solid rgba(11, 27, 42, 0.08);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 10px 24px rgba(11, 27, 42, 0.08);
}

.story-timeline-title {
  margin: 0 0 12px;
  font-size: 0.85rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--blue-500);
}

.story-timeline-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 14px;
}

.story-timeline-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f9fe;
  border: 1px solid rgba(11, 27, 42, 0.06);
  color: var(--blue-900);
  display: grid;
  gap: 4px;
}

.story-timeline-item small {
  color: var(--blue-500);
  font-size: 0.78rem;
}

.url-link {
  color: var(--blue-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.url-link::after {
  content: "🔗";
  margin-left: 6px;
  font-size: 0.9em;
}

.section-subtitle {
  margin: 26px 0 12px;
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue-500);
}

.tips-list,
.refs-list {
  display: grid;
  gap: 18px;
}

.tips-item,
.refs-item {
  background: var(--white);
  border: 1px solid rgba(11, 27, 42, 0.08);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 10px 24px rgba(11, 27, 42, 0.08);
}

.tips-item h3,
.refs-item h3 {
  margin: 0 0 8px;
}

.tips-item p,
.refs-item p {
  margin: 0;
}

.story-note {
  margin-top: 22px;
  font-size: 0.95rem;
  color: var(--blue-700);
}

.stats-list {
  display: grid;
  gap: 12px;
}

.stats-item {
  display: grid;
  gap: 6px;
  background: var(--white);
  border: 1px solid rgba(11, 27, 42, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 18px rgba(11, 27, 42, 0.08);
}

.stats-label {
  font-weight: 700;
  color: #0b1b2a;
}

.stats-value {
  color: var(--blue-800);
}

.thanks-list {
  display: grid;
  gap: 14px;
}

.thanks-item {
  background: var(--white);
  border: 1px solid rgba(11, 27, 42, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 18px rgba(11, 27, 42, 0.08);
}

.thanks-item h3 {
  margin: 0 0 8px;
}

.thanks-item p {
  margin: 0;
}

.tips-item,
.refs-item,
.stats-item,
.thanks-item {
  font-size: 1rem;
  line-height: 1.6;
}

.tips-item h3,
.refs-item h3,
.thanks-item h3 {
  color: #0b1b2a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.tips-item p,
.refs-item p,
.thanks-item p {
  color: var(--blue-800);
  font-size: 1rem;
  line-height: 1.6;
}

.story-places {
  margin-top: 24px;
}

.place-block {
  margin-top: 22px;
  scroll-margin-top: 120px;
}

[id^="cap"] {
  scroll-margin-top: 120px;
}

.place-block h3 {
  margin: 0 0 10px;
  color: #0b1b2a;
}

.place-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, 140px);
  gap: 12px;
  justify-content: start;
}

.place-thumb {
  width: 140px;
  height: 105px;
  display: block;
}

.place-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(11, 27, 42, 0.12);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid rgba(11, 27, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(11, 27, 42, 0.08);
}

.route-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.route-table th,
.route-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(11, 27, 42, 0.08);
  text-align: left;
  font-size: 0.95rem;
}

.route-table thead th {
  background: #e8f0f8;
  color: #0b1b2a;
  font-weight: 700;
}

.route-table tbody tr:nth-child(even) {
  background: #f7fbff;
}


.route-table tfoot td {
  font-weight: 700;
  background: #e8f0f8;
}

.route-map-card {
  margin: 28px 0 22px;
  background: var(--white);
  border: 1px solid rgba(11, 27, 42, 0.08);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 10px 24px rgba(11, 27, 42, 0.08);
}

.route-map-header h3 {
  margin: 0 0 4px;
  color: #0b1b2a;
}

.route-map-header p {
  margin: 0 0 14px;
  color: var(--blue-700);
  font-size: 0.95rem;
}

.route-map-wrap {
  border-radius: 12px;
  border: 1px solid rgba(11, 27, 42, 0.08);
  position: relative;
  overflow: hidden;
}

#route-map {
  width: 100%;
  height: auto;
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.route-map-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.story-text p {
  margin: 0 0 1.4rem;
}

.story-text p:first-of-type::first-letter {
  float: left;
  font-size: 3.2rem;
  line-height: 1;
  padding-right: 8px;
  font-weight: 700;
  color: var(--blue-600);
  text-transform: uppercase;
}

.gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.gallery-item {
  background: var(--white);
  border: 1px solid rgba(11, 27, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(11, 27, 42, 0.08);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}

.gallery-caption {
  padding: 10px 14px 14px;
  font-size: 0.9rem;
  color: var(--blue-700);
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 27, 42, 0.75);
}

.lightbox-content {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  padding: 18px;
  max-width: min(920px, 92vw);
  max-height: 88vh;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  z-index: 1;
  display: grid;
  gap: 12px;
}

.lightbox-image {
  max-width: 100%;
  max-height: 68vh;
  border-radius: 12px;
  object-fit: contain;
  background: #0b1b2a;
}

.lightbox-caption {
  margin: 0;
  color: var(--blue-800);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: #0b1b2a;
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.gallery-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--blue-600);
  background: var(--white);
  border: 1px dashed rgba(11, 27, 42, 0.2);
  padding: 18px;
  border-radius: 12px;
}

.site-footer {
  padding: 36px 0;
  background: var(--blue-800);
  color: var(--blue-100);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-list {
    grid-template-columns: 1fr;
  }

  .home .prelude-media {
    float: none;
    width: 100%;
    margin: 0 0 14px;
  }
}


/* Proposal theme overrides - easy revert by removing link tag */
:root {
  --proposal-accent: #1f5c8b;
  --proposal-ink: #0a1a2a;
  --proposal-sand: #f1efe9;
}

body {
  background: radial-gradient(circle at 20% 10%, #eef5fb 0%, #f7fafc 40%, #f1efe9 100%);
  color: var(--proposal-ink);
}

.site-header {
  background: rgba(241, 239, 233, 0.92);
  border-bottom: 1px solid rgba(10, 26, 42, 0.12);
}

.brand-title {
  letter-spacing: 1px;
  text-transform: uppercase;
}

.site-nav a::after {
  background: var(--proposal-accent);
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 3.4vw, 3.6rem);
}

.button.primary {
  background: var(--proposal-accent);
}

.section-header h2 {
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
}

.card,
.tips-item,
.refs-item,
.gallery-item,
.table-wrap,
.route-map-card {
  border-color: rgba(10, 26, 42, 0.16);
  box-shadow: 0 14px 28px rgba(10, 26, 42, 0.10);
}

.story-text,
.story-text p,
.tips-item p,
.refs-item p,
.gallery-caption {
  color: #1b2a3b;
}

.site-footer {
  background: #12263a;
}

/* tighten sections slightly for narrative flow */
.section {
  padding: 70px 0;
}
