/* =========================================================
   Família Meyer — Uma Jornada da Suíça ao Brasil
   Design system: Swiss-alpine contemporary, dark — grid,
   restraint, near-black surfaces with a single red accent
   (Swiss flag red), photographic hero.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --color-bg: #101113;
  --color-bg-alt: #1b1c1f;
  --color-bg-raised: #202226;
  --color-ink: #f2f2f0;
  --color-ink-soft: #a8a8a8;
  --color-red: #e2323a;      /* Swiss flag red, brightened for a dark ground */
  --color-red-dark: #a3141a;
  --color-border: #2c2d30;

  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 1040px;
  --radius: 0px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding-top: 4px; /* clears the fixed red stripe below */
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Thin flag-red stripe pinned to the very top of every page. */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--color-red);
  z-index: 1000;
}

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

a {
  color: var(--color-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--color-red); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-top: 0;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); }

h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

h3 { font-size: 1.15rem; font-weight: 700; }

h3.subhead-gap { margin-top: 2.25rem; }

p { margin: 0 0 1.1em; }

ul {
  margin: 0 0 1.1em;
  padding-left: 1.3em;
}

li { margin-bottom: 0.5em; }
li:last-child { margin-bottom: 0; }

li::marker { color: var(--color-red); }

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

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-red);
  margin-bottom: 0.75rem;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-red);
  flex-shrink: 0;
}

/* ---------- Site header / nav ---------- */

.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 1360px;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex: 1 0 100%;
  text-decoration: none;
}

.brand .brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-ink);
}

.brand-flags {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-flags svg {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand .brand-year {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--color-red);
  color: #fff;
  padding: 0.15rem 0.4rem;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  flex: 0 1 auto;
  flex-wrap: wrap;
  min-width: 0;
  font-family: var(--font-ui);
  font-size: 0.8rem;
}

.main-nav a {
  color: var(--color-ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-red);
  border-bottom-color: var(--color-red);
}

.lang-switch {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: 0.75rem;
  font-family: var(--font-ui);
}

.lang-switch a {
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--color-ink);
  padding: 0.2rem 0.5rem;
}

.lang-switch a[aria-current="true"] {
  background: var(--color-red);
  border-color: var(--color-red);
  color: #fff;
}

/* ---------- Hero (full-bleed photo: Rheinfall) ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 42vh;
  padding: 3rem 0;
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.25) 0%, rgba(16, 17, 19, 0.55) 55%, rgba(16, 17, 19, 0.96) 100%),
    url('/assets/img/hero-rheinfall.jpg');
  background-size: cover;
  background-position: center 65%;
  background-repeat: no-repeat;
}

.hero.hero--home {
  min-height: 74vh;
  align-items: flex-start;
  padding-top: 5.5rem;
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.8) 0%, rgba(16, 17, 19, 0.35) 30%, rgba(16, 17, 19, 0.55) 70%, rgba(16, 17, 19, 0.97) 100%),
    url('/assets/img/hero-rheinfall.jpg');
}

.hero.hero--regiao {
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.25) 0%, rgba(16, 17, 19, 0.55) 55%, rgba(16, 17, 19, 0.96) 100%),
    url('/assets/img/hero-wildensbuch.jpg');
}

.hero.hero--galeria {
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.25) 0%, rgba(16, 17, 19, 0.55) 55%, rgba(16, 17, 19, 0.96) 100%),
    url('/assets/img/hero-galeria.jpg');
}

.hero.hero--curiosidades {
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.25) 0%, rgba(16, 17, 19, 0.55) 55%, rgba(16, 17, 19, 0.96) 100%),
    url('/assets/img/hero-curiosidades.jpg');
}

.hero.hero--arvore {
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.25) 0%, rgba(16, 17, 19, 0.55) 55%, rgba(16, 17, 19, 0.96) 100%),
    url('/assets/img/hero-arvore.jpg');
}

.hero.hero--autor {
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.25) 0%, rgba(16, 17, 19, 0.55) 55%, rgba(16, 17, 19, 0.96) 100%),
    url('/assets/img/hero-autor.jpg');
  background-position: center 30%;
}

.hero.hero--chegada {
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.25) 0%, rgba(16, 17, 19, 0.55) 55%, rgba(16, 17, 19, 0.96) 100%),
    url('/assets/img/hero-santos.jpg');
  background-position: center 40%;
}

.hero.hero--jornada {
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.25) 0%, rgba(16, 17, 19, 0.55) 55%, rgba(16, 17, 19, 0.96) 100%),
    url('/assets/img/hero-oceano.jpg');
  background-position: center 70%;
}

.hero.hero--sobrenome {
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.25) 0%, rgba(16, 17, 19, 0.55) 55%, rgba(16, 17, 19, 0.96) 100%),
    url('/assets/img/hero-sobrenome.jpg');
}

.hero.hero--depois {
  background-image:
    linear-gradient(180deg, rgba(16, 17, 19, 0.25) 0%, rgba(16, 17, 19, 0.55) 55%, rgba(16, 17, 19, 0.96) 100%),
    url('/assets/img/hero-depois.jpg');
}

.hero.hero--compact {
  min-height: 0;
  padding-bottom: 2rem;
}

.hero .container { width: 100%; }

.hero .eyebrow { color: #ffd9da; }
.hero .eyebrow::before { background: var(--color-red); }

/* For bare heroes (just eyebrow/h1/lede, nothing embedded): keeps the hero's
   own height and gradient untouched, but pulls the page content up over the
   hero's already near-solid-dark lower portion, closing the dead gap below
   short lede text without shrinking the photo. */
.hero--tight + .container {
  position: relative;
  z-index: 2;
  margin-top: -9rem;
}

.hero .fact-grid--hero {
  margin: 2rem 0 0;
  background: rgba(16, 17, 19, 0.5);
  border-color: rgba(255, 255, 255, 0.15);
}

.hero .fact-grid--hero .fact-card {
  background: rgba(16, 17, 19, 0.55);
}

.hero .fact-grid--hero .fact-sub { color: #d8d8d6; }

.hero .map-embed {
  aspect-ratio: 16 / 6;
  margin: 2rem 0 0.6rem;
  border-color: rgba(255, 255, 255, 0.25);
}

.hero .map-caption { color: #d8d8d6; margin-bottom: 0; }

/* Pulls "Explore a história" up so it overlaps the home hero photo. */
.home-explore {
  position: relative;
  z-index: 2;
  margin-top: clamp(-15rem, -20vh, -2rem);
}

.home-explore h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  color: #fff;
}

.hero h1 { color: #fff; }

.hero p.lede {
  font-size: 1.15rem;
  color: #e6e6e6;
  max-width: 640px;
}

/* ---------- Draft / placeholder banner ---------- */

.draft-banner {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-red);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2.25rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--color-ink-soft);
}

.draft-banner strong { color: var(--color-ink); }

/* ---------- Content sections ---------- */

.page-content { padding: 2.5rem 0 4rem; }

.section-block { margin-bottom: 2.75rem; }

.section-block.historical {
  background: var(--color-bg-alt);
  border-left: 3px solid var(--color-ink);
  padding: 1.5rem 1.75rem;
}

.section-block.family {
  border-top: 1px solid var(--color-border);
  padding-top: 1.75rem;
}

.pull-fact {
  border-left: 3px solid var(--color-red);
  background: var(--color-bg-alt);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-weight: 600;
  color: var(--color-ink);
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  margin: 2rem 0;
}

.fact-card {
  background: var(--color-bg-alt);
  padding: 1.25rem;
}

.fact-card .fact-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-red);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.fact-card .fact-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-ink);
}

.fact-card .fact-sub {
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  margin-top: 0.2rem;
}

/* ---------- Name evolution (3-step spelling cards) ---------- */

.name-evolution {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 2rem 0 2.5rem;
  flex-wrap: wrap;
}

.name-step {
  position: relative;
  flex: 1 1 220px;
  background: linear-gradient(160deg, var(--color-bg-alt) 0%, var(--color-bg-raised) 100%);
  border: 1px solid var(--color-border);
  padding: 2.1rem 1.5rem 1.85rem;
  text-align: center;
  overflow: hidden;
}

.name-step::before {
  content: attr(data-step);
  position: absolute;
  top: -0.5rem;
  right: 0.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 4.2rem;
  line-height: 1;
  color: var(--color-border);
  z-index: 0;
}

.name-flag,
.name-step-value,
.name-step-sub {
  position: relative;
  z-index: 1;
}

.name-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  margin-bottom: 1.15rem;
}

.name-flag svg {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.name-step-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  margin-bottom: 0.65rem;
}

.name-step-sub {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--color-ink-soft);
}

.name-step-sub em {
  color: var(--color-ink);
  font-style: normal;
  font-weight: 600;
}

.name-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-red);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 -1px;
  z-index: 2;
}

@media (max-width: 720px) {
  .name-evolution { flex-direction: column; }
  .name-step { width: 100%; }
  .name-arrow { transform: rotate(90deg); margin: -1px auto; }
}

/* ---------- Timeline ---------- */

.timeline {
  position: relative;
  margin: 2.5rem 0;
  padding-left: 1.75rem;
  border-left: 2px solid var(--color-border);
}

.timeline-item { position: relative; padding-bottom: 2.25rem; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  background: var(--color-red);
}

.timeline-item .tl-date {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--color-red);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.timeline-item h3 { margin: 0.3rem 0 0.4rem; }

/* ---------- Card grid (navigation cards on homepage) ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
  margin: 2.25rem 0;
}

.topic-card {
  display: block;
  text-decoration: none;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.topic-card:hover {
  background: var(--color-red);
  border-color: var(--color-red);
  transform: translateY(-3px);
}

.topic-card .topic-media { aspect-ratio: 4 / 3; overflow: hidden; }

.topic-card .topic-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topic-card .topic-body { padding: 1.1rem 1.25rem 1.4rem; }

.topic-card h3 {
  color: var(--color-ink);
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  transition: color 0.15s ease;
}

.topic-card p {
  color: var(--color-ink-soft);
  font-size: 0.9rem;
  margin: 0;
  transition: color 0.15s ease;
}

.topic-card:hover h3,
.topic-card:hover p { color: #fff; }

/* ---------- Media placeholders ---------- */

.media-placeholder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  color: var(--color-ink-soft);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 1rem;
}

.media-placeholder::before,
.media-placeholder::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-red);
}

.media-placeholder::before {
  top: 8px; left: 8px;
  border-right: none;
  border-bottom: none;
}

.media-placeholder::after {
  bottom: 8px; right: 8px;
  border-left: none;
  border-top: none;
}

.media-placeholder .ph-caption { max-width: 220px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  margin: 2rem 0;
}

.gallery-item { background: var(--color-bg-alt); }

.gallery-item .media-placeholder { aspect-ratio: 4 / 3; min-height: 0; border: none; }

.gallery-item .gallery-photo { aspect-ratio: 4 / 3; overflow: hidden; cursor: zoom-in; }

.gallery-item .gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.gallery-item .gallery-photo:hover img { transform: scale(1.04); }

/* ---------- Carousel (one photo at a time, prev/next) ---------- */

.gallery-title {
  margin: 2rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-red);
}

.carousel {
  margin: 0 0 2rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.carousel-stage {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg-raised);
}

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.carousel-bar {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--color-border);
  min-height: 56px;
}

.carousel-caption {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-ink-soft);
}

.carousel-caption a,
.lightbox-caption a {
  color: var(--color-red);
  font-weight: 700;
  margin-left: 0.4em;
}

.carousel-caption a:hover,
.lightbox-caption a:hover {
  text-decoration: none;
}

.carousel-controls { display: flex; flex-shrink: 0; }

.carousel-btn {
  width: 56px;
  border: none;
  border-left: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-ink);
  font-size: 1.2rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.carousel-btn:hover { background: var(--color-red); color: #fff; }

@media (max-width: 560px) {
  .carousel-stage { aspect-ratio: 4 / 3; }
  .carousel-bar { flex-direction: column; min-height: 0; }
  .carousel-caption { border-bottom: 1px solid var(--color-border); }
  .carousel-controls { width: 100%; }
  .carousel-btn { flex: 1; padding: 0.6rem 0; }
}

.carousel-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
  overflow-x: auto;
}

.carousel-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  background: var(--color-bg-raised);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-thumb:hover { opacity: 0.9; }

.carousel-thumb.active {
  opacity: 1;
  border-color: var(--color-red);
}

/* ---------- Lightbox (gallery click-through) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 10, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 3.5rem 1.5rem;
}

.lightbox[hidden] { display: none; }

.lightbox-content {
  max-width: 88vw;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.lightbox-img {
  max-width: 88vw;
  max-height: 74vh;
  object-fit: contain;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.lightbox-caption {
  margin-top: 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  text-align: center;
  max-width: 70ch;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: rgba(16, 17, 19, 0.7);
  border: 1px solid var(--color-border);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  border-color: var(--color-red);
  color: var(--color-red);
}

.lightbox-close {
  top: 1.25rem;
  right: 1.25rem;
  width: 42px;
  height: 42px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 1.8rem;
}

.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }

@media (max-width: 640px) {
  .lightbox { padding: 2.5rem 1rem; }
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1.3rem; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .lightbox-close { width: 36px; height: 36px; font-size: 1.2rem; top: 0.75rem; right: 0.75rem; }
}

.gallery-item .gallery-caption {
  padding: 0.75rem 0.9rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  border-top: 1px solid var(--color-border);
}

.gallery-caption a {
  color: var(--color-red);
  font-weight: 700;
  margin-left: 0.4em;
}

.gallery-caption a:hover {
  text-decoration: none;
}

/* ---------- Curiosity cards (photo + fact) ---------- */

.curio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin: 2.25rem 0;
}

.curio-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.curio-card:hover {
  border-color: var(--color-red);
  transform: translateY(-3px);
}

.curio-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-raised);
}

.curio-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.curio-media--logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f2ea;
  padding: 1.5rem;
}

.curio-media--logo.curio-media--white { background: #fff; }

.curio-media--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.curio-media.media-placeholder { aspect-ratio: 4 / 3; min-height: 0; border: none; }

.curio-map { width: 100%; height: 100%; background: var(--color-bg-raised); }

.curio-body { padding: 1.25rem; }
.curio-body .fact-value { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }

.curio-label {
  padding: 0.3rem 0.5rem 0;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-ink-soft);
  text-align: center;
}

.curio-credit {
  margin-top: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--color-ink-soft);
}

@media (max-width: 820px) {
  .curio-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .curio-grid { grid-template-columns: 1fr; }
}

/* ---------- Map placeholder ---------- */

.map-placeholder { aspect-ratio: 16/8; margin: 1.5rem 0; }

.map-embed {
  aspect-ratio: 16 / 8;
  margin: 1.5rem 0 0.6rem;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: invert(92%) hue-rotate(180deg) contrast(90%);
}

/* ---------- Video embed (YouTube etc.) ---------- */

.video-embed {
  aspect-ratio: 16 / 9;
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: #000;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-caption {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-ink-soft);
  margin: 0 0 1.5rem;
}

.map-caption {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-ink-soft);
  margin: 0 0 1.5rem;
}

.leaflet-tile-pane {
  filter: invert(90%) hue-rotate(180deg) contrast(85%) brightness(0.95);
}

.family-map-marker span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-red);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--color-bg-alt);
  color: var(--color-ink);
}

.leaflet-popup-content {
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.leaflet-control-attribution {
  background: rgba(16, 17, 19, 0.7) !important;
  color: var(--color-ink-soft) !important;
}

.family-map-label {
  background: rgba(16, 17, 19, 0.88) !important;
  border: none !important;
  color: #fff !important;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.05rem 0.3rem !important;
  box-shadow: none !important;
  text-align: center;
}

.family-map-label::before { display: none; }

.family-map-label-sub {
  display: block;
  font-weight: 400;
  opacity: 0.75;
  font-size: 0.95em;
}

.family-map-distance {
  background: var(--color-red) !important;
  border: none !important;
  color: #fff !important;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.4rem !important;
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgba(16, 17, 19, 0.88) !important;
}

.family-map-distance::before { display: none; }

.leaflet-control-attribution a { color: var(--color-ink) !important; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--color-bg-alt);
  color: var(--color-ink-soft);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 4px solid var(--color-red);
}

.site-footer a { color: var(--color-ink); text-decoration: none; }
.site-footer a:hover { color: var(--color-red); }

.site-footer .footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- Mobile nav toggle ---------- */

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-ink);
  color: var(--color-ink);
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  font-family: var(--font-ui);
  font-weight: 600;
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
  }
  .main-nav.open { display: flex; }
  .site-header .container { flex-direction: column; align-items: stretch; }
  .lang-switch { order: -1; align-self: flex-end; }
}

/* ---------- Scanned document figure ---------- */

.doc-figure {
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  background: #fff;
}

.doc-figure img {
  width: 100%;
  display: block;
}

.doc-figure figcaption {
  padding: 0.75rem 1rem;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-ink-soft);
}

/* ---------- Document translation toggle (DE handwriting -> PT) ---------- */

.doc-figure.has-translation { position: relative; }

.doc-translate-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--color-red);
  border: 1px solid var(--color-red);
  border-radius: 4px;
  padding: 0.6rem 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.doc-translate-btn:hover {
  background: var(--color-red-dark);
  border-color: var(--color-red-dark);
}

.doc-media-wrap { position: relative; }

.doc-translation {
  position: absolute;
  inset: 0;
  background: rgba(16, 17, 19, 0.55);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 1px 12px rgba(0, 0, 0, 0.6);
  padding: 2.75rem 1.25rem 1.25rem;
  overflow-y: auto;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  line-height: 1.55;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}

.doc-figure.show-translation .doc-translation {
  opacity: 1;
  visibility: visible;
}

.doc-translation h4 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffb3b6;
}

.doc-translation p { margin: 0 0 0.75rem; }
.doc-translation p:last-child { margin-bottom: 0; }
.doc-translation dl { margin: 0; }
.doc-translation dt { color: #d8d8d6; font-size: 0.72rem; margin-top: 0.6rem; }
.doc-translation dt:first-child { margin-top: 0; }
.doc-translation dd { margin: 0.1rem 0 0; }

.doc-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
}

.doc-line:last-child { border-bottom: none; }

.doc-line-orig {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  color: #d8d8d6;
}

.doc-line-arrow { color: #ffb3b6; }

.doc-line-pt { font-weight: 600; color: #fff; }

/* ---------- Source document download link ---------- */

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.25rem 0 1.5rem;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-ink);
  transition: border-color 0.15s ease;
}

.doc-link:hover {
  border-color: var(--color-red);
  color: var(--color-ink);
}

.doc-link .doc-tag {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--color-red);
  padding: 0.2rem 0.45rem;
}

/* ---------- FamilySearch reference tag ---------- */

.fs-tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-ink-soft);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.12rem 0.4rem;
  margin-left: 0.5rem;
  text-decoration: none;
  vertical-align: middle;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.fs-tag:hover {
  color: var(--color-red);
  border-color: var(--color-red);
}

/* ---------- Utility ---------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 700;
  text-decoration: none;
  padding: 0.65rem 1.3rem;
  background: var(--color-red);
  color: #fff !important;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.btn:hover { background: var(--color-ink); color: var(--color-bg) !important; }

/* ---------- Family tree (paternal line) ---------- */

.family-tree {
  margin: 2.5rem 0;
}

.tree-gen {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 1rem;
}

.tree-connector {
  width: 2px;
  height: 2.5rem;
  background: var(--color-border);
  margin: 0 auto;
}

.tree-connector::after {
  content: '';
  display: block;
}

.tree-siblings {
  max-width: 560px;
  margin: 0.5rem auto 0;
  padding: 0 1rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--color-ink-soft);
  text-align: center;
  opacity: 0.8;
}

.tree-siblings strong { font-weight: 600; color: var(--color-ink-soft); }

.tree-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-red);
  padding: 0 0.25rem;
}

.tree-person {
  flex: 1 1 260px;
  max-width: 320px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  text-align: center;
}

.tree-person.spouse { border-left: 3px solid var(--color-red); }

.tree-person-flag {
  display: flex;
  justify-content: center;
  margin-bottom: 0.6rem;
}

.tree-person-flag svg { display: block; border: 1px solid rgba(255, 255, 255, 0.15); }

.tree-person-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-ink);
}

.tree-person-years {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-ink-soft);
  margin-top: 0.3rem;
}

.tree-person-place {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-ink-soft);
  margin-top: 0.15rem;
}

.tree-person .fs-tag { margin: 0.6rem 0 0; }

.tree-gen-children {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.tree-gen-children .tree-person {
  flex: 1 1 180px;
  max-width: 220px;
  padding: 1rem;
}

.tree-gen-children .tree-person-name { font-size: 0.95rem; }

@media (max-width: 640px) {
  .tree-gen { flex-direction: column; align-items: center; }
  .tree-sep { padding: 0.25rem 0; }
}
