/* 1.28.306.42049 — Layout Fix v0.1
   Fix: homepage hero title overlapping route constellation card
*/

/* 兜底：超长项目名不允许硬溢出到右边卡片 */
.hero h1 {
  overflow-wrap: anywhere;
}

/* 中等宽度提前变单栏，避开 Georgia 字宽 + Windows 滚动条造成的死区 */
@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-map {
    min-height: 360px;
  }
}

/* 桌面两栏时，把标题收进左栏，留真正呼吸空间 */
@media (min-width: 1081px) {
  .hero h1 {
    font-size: clamp(2.6rem, 4.4vw, 3.9rem);
    letter-spacing: -0.035em;
    max-width: 100%;
  }
}

/* Atlas v0.1 — Country Memory Index */
.atlas-grid {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto 80px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.atlas-card {
  border: 1px solid rgba(37, 33, 27, 0.16);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(216, 201, 173, 0.25)),
    var(--paper);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.atlas-card-head {
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(37, 33, 27, 0.12);
}

.atlas-card-head h2 {
  margin: 0.2rem 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.atlas-card-head p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

.atlas-list {
  display: grid;
}

.atlas-item {
  display: grid;
  gap: 4px;
  padding: 16px 24px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid rgba(37, 33, 27, 0.08);
}

.atlas-item:last-child {
  border-bottom: 0;
}

.atlas-item:hover {
  background: rgba(255, 159, 28, 0.10);
}

.atlas-title {
  font-weight: 700;
}

.atlas-meta {
  font-size: 0.92rem;
  color: var(--muted);
}

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

/* Video embed */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius-lg) - 10px);
  overflow: hidden;
  border: 1px solid rgba(37, 33, 27, 0.14);
  box-shadow: var(--shadow-soft);
  background: rgba(37, 33, 27, 0.08);
  margin: 18px 0;
}

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

/* Home v1 — emotional entrance */
.home-hero {
  width: min(1120px, calc(100% - 32px));
  margin: 54px auto 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 28px;
  align-items: stretch;
}

.home-hero h1 {
  font-size: clamp(3.2rem, 8vw, 6.8rem);
  line-height: 0.9;
  margin: 0.2rem 0 1rem;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
}

.home-hero p {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 780px;
}

.home-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(37, 33, 27, 0.22);
}

.home-route-card {
  border: 1px solid rgba(37, 33, 27, 0.16);
  border-radius: var(--radius-lg);
  padding: 26px;
  background:
    radial-gradient(circle at top right, rgba(255,159,28,0.18), transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,0.46), rgba(216,201,173,0.28)),
    var(--paper);
  box-shadow: var(--shadow-soft);
}

.home-route-card h2 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.route-stats {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.route-stats span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(37, 33, 27, 0.12);
}

.home-section {
  width: min(1120px, calc(100% - 32px));
  margin: 48px auto;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  max-width: 820px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.featured-card {
  display: grid;
  grid-template-rows: 210px auto;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid rgba(37, 33, 27, 0.14);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255,255,255,0.28);
  box-shadow: var(--shadow-soft);
}

.featured-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: rgba(37, 33, 27, 0.08);
}

.featured-card > div {
  padding: 18px;
}

.featured-card h3 {
  margin: 0.2rem 0 0.55rem;
  font-size: 1.25rem;
}

.featured-card p {
  color: var(--muted);
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.mini-tags span {
  font-size: 0.78rem;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,159,28,0.13);
  color: var(--ink);
}

.split-memory {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  gap: 24px;
  align-items: start;
}

.memory-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.memory-guide article,
.country-chip {
  border: 1px solid rgba(37, 33, 27, 0.14);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: rgba(255,255,255,0.25);
}

.memory-guide h3 {
  margin-top: 0;
}

.memory-guide p {
  color: var(--muted);
  margin-bottom: 0;
}

.country-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.country-chip {
  display: grid;
  gap: 4px;
  min-width: 170px;
  text-decoration: none;
  color: var(--ink);
}

.country-chip span {
  color: var(--muted);
}

/* Stories v1 — full archive timeline */
.timeline-tools {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(37, 33, 27, 0.14);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: rgba(255,255,255,0.25);
}

.timeline-tools h2 {
  margin: 0.2rem 0 0;
}

.timeline-note {
  max-width: 420px;
  color: var(--muted);
}

.story-index {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto 80px;
  display: grid;
  gap: 14px;
}

.story-row-card {
  display: grid;
  grid-template-columns: 54px 150px minmax(0, 1fr) minmax(140px, 220px);
  gap: 18px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid rgba(37, 33, 27, 0.14);
  border-radius: var(--radius-lg);
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.38), rgba(216,201,173,0.18)),
    var(--paper);
  box-shadow: var(--shadow-soft);
}

.story-number {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  color: var(--muted);
  text-align: center;
}

.story-row-card img {
  width: 150px;
  height: 104px;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 12px);
  background: rgba(37, 33, 27, 0.08);
}

.story-row-body h2 {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.35rem;
}

.story-row-body p {
  color: var(--muted);
  margin: 0;
}

.story-phase {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

@media (max-width: 980px) {
  .home-hero,
  .split-memory {
    grid-template-columns: 1fr;
  }

  .featured-grid,
  .memory-guide {
    grid-template-columns: 1fr 1fr;
  }

  .story-row-card {
    grid-template-columns: 42px 120px minmax(0, 1fr);
  }

  .story-row-card img {
    width: 120px;
    height: 90px;
  }

  .story-phase {
    grid-column: 3;
    text-align: left;
  }
}

@media (max-width: 680px) {
  .featured-grid,
  .memory-guide {
    grid-template-columns: 1fr;
  }

  .timeline-tools {
    display: grid;
  }

  .story-row-card {
    grid-template-columns: 1fr;
  }

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

  .story-row-card img {
    width: 100%;
    height: 190px;
  }

  .story-phase {
    grid-column: auto;
  }
}

/* Field Notes index */
.field-note-grid {
  width: min(1120px, calc(100% - 32px));
  margin: 34px auto 80px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.field-note-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 260px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid rgba(37, 33, 27, 0.14);
  border-radius: var(--radius-lg);
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.42), rgba(216,201,173,0.22)),
    var(--paper);
  box-shadow: var(--shadow-soft);
}

.field-note-card h2 {
  margin: 0.2rem 0 0.4rem;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.field-note-card p {
  color: var(--muted);
}

.field-note-card.placeholder {
  opacity: 0.72;
}

@media (max-width: 900px) {
  .field-note-grid {
    grid-template-columns: 1fr;
  }
}

/* Gallery */
.gallery-section {
  width: min(1120px, calc(100% - 32px));
  margin: 42px auto 80px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.gallery-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: start;
  border: 1px solid rgba(37, 33, 27, 0.14);
  border-radius: var(--radius-lg);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.42), rgba(216,201,173,0.22)),
    var(--paper);
  box-shadow: var(--shadow-soft);
}

.gallery-card figure {
  margin: 0;
}

.gallery-card video,
.gallery-card img {
  width: 100%;
  display: block;
  border-radius: calc(var(--radius-lg) - 10px);
  background: rgba(37, 33, 27, 0.08);
}

.gallery-card h3 {
  margin: 0.2rem 0 0.7rem;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.gallery-card p {
  color: var(--muted);
}

@media (max-width: 820px) {
  .gallery-card {
    grid-template-columns: 1fr;
  }
}

/* Mobile fix — Home featured cards: image above, text below */
@media (max-width: 820px) {
  .featured-grid {
    grid-template-columns: 1fr !important;
  }

  .featured-card {
    display: grid !important;
    grid-template-rows: auto auto !important;
    min-height: auto !important;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.34) !important;
  }

  .featured-card img {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 280px !important;
    min-height: 280px !important;
    max-height: 280px !important;
    object-fit: cover !important;
    display: block !important;
    opacity: 1 !important;
  }

  .featured-card > div {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 18px !important;
    background: rgba(244, 234, 216, 0.96) !important;
    color: var(--ink) !important;
    z-index: 2 !important;
  }

  .featured-card .kicker {
    color: var(--ink) !important;
  }

  .featured-card h3 {
    color: var(--ink) !important;
    font-size: 1.45rem !important;
    line-height: 1.15 !important;
    margin: 0.25rem 0 0.7rem !important;
  }

  .featured-card p {
    color: var(--muted) !important;
    font-size: 1rem !important;
    line-height: 1.55 !important;
  }

  .featured-card .mini-tags {
    position: relative !important;
    margin-top: 12px !important;
  }
}

/* Reading page exit button */
.archive-exit {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(37, 33, 27, 0.88);
  color: #f4ead8;
  text-decoration: none;
  font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(37, 33, 27, 0.22);
  backdrop-filter: blur(8px);
}

.archive-exit span {
  font-size: 1.1rem;
}

.archive-exit:hover {
  background: rgba(37, 33, 27, 0.96);
}

@media (max-width: 640px) {
  .archive-exit {
    left: 14px;
    right: 14px;
    bottom: 14px;
    justify-content: center;
    padding: 12px 14px;
  }
}


/* Home: move Current Country Chambers into a lighter bottom-right status block */
.home-country-chambers {
  max-width: 760px;
  margin-left: auto;
  margin-right: 0;
  padding-top: clamp(1.5rem, 3vw, 3rem);
}

.home-country-chambers > h2 {
  max-width: 680px;
}

.home-country-chambers .country-grid,
.home-country-chambers .chamber-grid,
.home-country-chambers .country-chambers-grid {
  justify-content: flex-end;
}

@media (max-width: 820px) {
  .home-country-chambers {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .home-country-chambers .country-grid,
  .home-country-chambers .chamber-grid,
  .home-country-chambers .country-chambers-grid {
    justify-content: flex-start;
  }
}


/* Field Notes card image guard */
.field-note-grid img,
.field-note-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}


/* Field Notes visual card guard */
.field-note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.field-note-card {
  overflow: hidden;
}

.field-note-card > img,
.field-note-grid > a > img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}


/* Field Notes thumbnail consistency */
.field-note-grid {
  align-items: stretch;
}

.field-note-card > img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  margin-bottom: 1rem;
}

/* Responsive embedded video */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 18px;
  background: #111;
}

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


/* Story media consistency */
.archive-image video {
  width: 100%;
  max-width: 100%;
  display: block;
  border-radius: 18px;
  background: #111;
}

/* Home featured country opener titles: Pakistan / Iran / Armenia */
.featured-memories > h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.9rem) !important;
  line-height: 1.05 !important;
  max-width: 680px !important;
  margin-bottom: 1rem !important;
}

.featured-memories .featured-card {
  max-width: 340px;
}


.flag-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1em;
  padding: 0.12em 0.38em;
  margin-right: 0.28em;
  border: 1px solid rgba(26, 26, 26, 0.18);
  border-radius: 999px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.38em;
  font-weight: 800;
  letter-spacing: 0.12em;
  vertical-align: middle;
}


.route-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 0.08em 0.24em;
  align-items: baseline;
}

.route-chain span:not(:last-child)::after {
  content: "→";
  margin-left: 0.24em;
}

@media (max-width: 640px) {
  .route-chain {
    display: block;
  }

  .route-chain span {
    display: block;
    line-height: 0.95;
  }

  .route-chain span:not(:last-child)::after {
    content: "↓";
    display: block;
    margin: 0.06em 0 0.12em;
    font-size: 0.72em;
    line-height: 1;
  }
}
