/* Revision 3 — editorial air, less dashboard */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.home-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.5rem; align-items: start; margin: 1rem 0 2rem; }
.home-copy h1 { font-family: var(--font-display); font-size: clamp(2rem, 4.5vw, 3rem); margin: 0 0 0.75rem; line-height: 1.08; }
.home-copy .lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 36rem; }
.home-copy .support { color: var(--muted); max-width: 36rem; margin: 0.75rem 0 1.25rem; }
.home-search { display: flex; gap: 0.4rem; max-width: 28rem; }
.home-search input { flex: 1; }

/* Global header neighbourhood search — compact so nav stays one row */
.header-search {
  position: relative;
  flex: 0 0 auto;
  width: 9.5rem;
  min-width: 0;
  max-width: 9.5rem;
  margin-left: auto;
}
.header-search input[type="search"] {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  min-height: 2rem;
}
.header-search input[type="search"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.header-search-results {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  z-index: 1200;
  margin: 0;
  padding: 0.3rem 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(20, 30, 25, 0.12);
  max-height: min(60vh, 22rem);
  overflow: auto;
  min-width: 16rem;
}
.header-search-option,
.header-search-empty {
  display: block;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.header-search-empty {
  cursor: default;
  color: var(--muted);
  font-size: 0.85rem;
}
.header-search-option:hover,
.header-search-option.is-active {
  background: var(--accent-soft, #e7f3ec);
  color: var(--accent);
}
@media (max-width: 900px) {
  .header-search {
    order: 4;
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }
  .header-search-results {
    left: 0;
    right: 0;
    min-width: 0;
  }
}
.home-map-el { height: min(52vh, 420px); min-height: 280px; border-radius: var(--radius); border: 1px solid var(--line); }
.map-fallback { margin-top: 0.4rem; }
.home-section { margin: 2.5rem 0; }
.home-section h2 { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 1rem; }
.clue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.85rem; }
.clue-card { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.clue-card h3 { font-family: var(--font-ui); font-size: 1rem; margin: 0 0 0.4rem; }
.clue-card:hover { border-color: var(--accent); }
.clue-where { font-family: var(--font-ui); font-size: 0.78rem; color: var(--accent); }
.unexpected-card { background: var(--card); border-left: 4px solid var(--accent-2); padding: 1.25rem 1.5rem; border-radius: 0 var(--radius) var(--radius) 0; }
.unexpected-card h3 { font-family: var(--font-display); font-size: 1.5rem; margin: 0.25rem 0 0.5rem; }
.unexpected-card h3 a { color: inherit; text-decoration: none; }
.more { margin-top: 0.75rem; }
.nb-card.soft { box-shadow: none; }
.all-list { columns: 2; font-family: var(--font-ui); font-size: 0.9rem; }
.profile { max-width: 52rem; }
.profile-main h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 3.5vw, 2.7rem); margin: 0.2rem 0 0.5rem; }
.identity { font-size: 1.15rem; color: var(--ink-soft); }
.clue { margin: 1rem 0 1.25rem; }
.intro-prose { font-size: 1.08rem; line-height: 1.7; max-width: 40rem; margin-bottom: 1.75rem; }
.profile-geo { display: grid; grid-template-columns: 1.4fr 0.7fr; gap: 1rem; margin: 1.5rem 0 2rem; align-items: start; }
.profile-map { height: 240px; border-radius: var(--radius); border: 1px solid var(--line); }
.stats-quiet { font-family: var(--font-ui); font-size: 0.85rem; display: grid; gap: 0.55rem; }
.stats-quiet > div { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.stats-quiet .g-label { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stats-quiet .g-value { font-weight: 600; }
.long-section { margin: 2rem 0; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.long-section h2 { font-family: var(--font-display); font-size: 1.35rem; margin: 0 0 0.75rem; }
.timeline-clean { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--accent-soft); }
.timeline-clean li { padding: 0.35rem 0 0.65rem 1rem; position: relative; }
.timeline-clean li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: absolute; left: -5px; top: 0.65rem; }
.timeline-clean .year { font-family: var(--font-ui); font-weight: 600; color: var(--accent); margin-right: 0.35rem; }

/* Walk route map + stop rhythm */
.walk-map { max-width: 40rem; }
.walk-stop {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.65rem 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  max-width: 40rem;
}
.walk-stop:last-child { border-bottom: 0; }
.walk-num {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: var(--accent);
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  margin-top: 0.1rem;
}
.walk-marker {
  background: transparent;
  border: 0;
}
.walk-marker-num {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: #c45c26;
  color: #fff;
  font: 700 0.78rem/1 var(--font-ui, system-ui, sans-serif);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  border: 2px solid #fff;
}
.long-section { margin: 2.35rem 0; }

/* Historic map figures */
.hist-map-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.hist-home {
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.hist-home-lead {
  max-width: 40rem;
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.98rem;
}
.hist-home .hist-map-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}
@media (max-width: 800px) {
  .hist-home .hist-map-gallery {
    grid-template-columns: 1fr;
  }
}
.hist-map {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow, 0 1px 0 rgba(0,0,0,0.04));
}
.hist-map img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  object-position: center;
  background: #e8e2d6;
}
.hist-home .hist-map img {
  max-height: 200px;
}
.essay-page .hist-map-gallery {
  grid-template-columns: 1fr;
  max-width: 40rem;
}
.essay-page .hist-map img { max-height: 360px; object-fit: contain; background: #f3efe6; }
.hist-map figcaption {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  padding: 0.55rem 0.75rem 0.6rem;
}
.hist-map-title { color: var(--ink-soft); font-weight: 600; }
.hist-map-credit {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.65rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--muted);
  opacity: 0.85;
}
.hist-map-credit a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.hist-map-credit a:hover { text-decoration: underline; }
.cite { color: var(--accent); text-decoration: none; font-weight: 600; }
.cite:hover, .cite:focus { color: var(--accent-2); outline: none; }
.sources-lead { color: var(--muted); font-size: 0.95rem; }
.biblio { font-family: var(--font-ui); font-size: 0.88rem; }
.biblio .src-num { color: var(--accent); font-weight: 600; margin-right: 0.25rem; }
.last-reviewed { font-family: var(--font-ui); font-size: 0.82rem; color: var(--muted); margin: 2.5rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.dir-list { list-style: none; padding: 0; }
.dir-item { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.dir-item a { text-decoration: none; color: inherit; }
.dir-item a:hover { color: var(--accent); }
.atlas-map { height: min(60vh, 480px); margin: 1rem 0; border-radius: var(--radius); border: 1px solid var(--line); }
.atlas-list { font-size: 0.95rem; }
.longform { max-width: 44rem; }
.longform .lede { font-size: 1.12rem; color: var(--ink-soft); }
.item-card.soft { background: transparent; box-shadow: none; }
.breadcrumbs { font-family: var(--font-ui); font-size: 0.82rem; color: var(--muted); margin: 0.75rem auto 0; max-width: var(--max); padding: 0 1rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.home-hero > *, .profile-geo > *, .grid-auto > *, .header-inner > * { min-width: 0; }
.lang-switch a {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.3rem 0.48rem;
  text-decoration: none;
}
.lang-switch a[aria-current="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
@media (max-width: 900px) {
  .home-hero, .profile-geo { grid-template-columns: 1fr; }
  .all-list { columns: 1; }
  .home-map-el { height: 42vh; min-height: 240px; }
}

/* Revision 4 — functional repairs only */
.nav-details { display: none; }
.nav-toggle {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.nav-toggle::-webkit-details-marker { display: none; }
.nav-details .nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0;
}
.static-map {
  width: 100%;
  height: 100%;
  min-height: 160px;
  border-radius: inherit;
  overflow: hidden;
}
.static-map svg { display: block; width: 100%; height: 100%; min-height: 160px; }
.return-top {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  margin: 2rem 0 1rem;
  text-align: right;
}
.return-top a { color: var(--accent); text-decoration: none; }
.return-top a:hover { text-decoration: underline; }
.badge-prep {
  display: inline-block;
  margin-left: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  vertical-align: middle;
}
.badge-prep-block {
  font-family: var(--font-ui);
  background: var(--paper-2, #f0ebe3);
  border-left: 3px solid var(--accent-2);
  padding: 0.65rem 0.9rem;
  margin: 0.75rem 0 1.25rem;
}
.essay-card.prep { opacity: 0.92; }
.essay-body { font-size: 1.05rem; line-height: 1.75; max-width: 40rem; }
.essay-body p { margin: 0 0 1.05rem; }
.essay-body h2 { font-size: 1.28rem; margin: 1.75rem 0 0.75rem; line-height: 1.3; }
.essay-body h3 { font-size: 1.1rem; margin: 1.4rem 0 0.6rem; line-height: 1.35; }
.essay-body .cite { text-decoration: none; color: var(--accent); white-space: nowrap; }
.essay-body .cite:hover { text-decoration: underline; }
.essay-deck { font-size: 1.12rem; color: var(--ink-soft); max-width: 40rem; margin: 0.35rem 0 1.4rem; }
.essay-related { max-width: 40rem; }
.essay-page .sources-list { max-width: 40rem; }
.essay-map { max-width: 40rem; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; align-items: center; }
.footer-meta a { color: var(--accent); text-decoration: none; }
.footer-meta a:hover { text-decoration: underline; }
.site-footer a { color: var(--accent); }
.dir-search { margin: 1rem 0 1.25rem; }
.search-status { margin: 0.5rem 0 1rem; }
.compare-out { margin: 1rem 0; }
@media (max-width: 900px) {
  .nav-desktop { display: none !important; }
  .nav-details { display: block; margin-left: auto; order: 2; }
  .header-inner { flex-wrap: wrap; }
  .lang-switch { order: 3; }
  .header-search { order: 4; flex: 1 1 100%; max-width: none; margin-left: 0; }
  .nav-details[open] { width: 100%; order: 5; }
  .nav-details[open] .nav { display: flex; }
}
@media (min-width: 901px) {
  .nav-details { display: none !important; }
  .nav-desktop { display: flex !important; }
  .header-inner { flex-wrap: nowrap; }
  .nav-desktop { flex-wrap: nowrap; white-space: nowrap; }
}

/* Retina laptops often expose a 1024–1180 CSS-pixel viewport. Keep the full
   desktop header on one line there without shrinking the reading typography. */
@media (min-width: 901px) and (max-width: 1180px) {
  .header-inner { gap: 0.35rem; padding-left: 0.65rem; padding-right: 0.65rem; }
  .brand { min-width: 9.25rem; }
  .brand-title { font-size: 1rem; }
  .brand-sub { font-size: 0.64rem; }
  .nav-desktop { gap: 0.05rem; font-size: 0.74rem; }
  .nav-desktop a { padding: 0.3rem 0.28rem; }
  .header-search { width: 7rem; max-width: 7rem; }
  .header-search input[type="search"] { font-size: 0.74rem; padding-left: 0.45rem; padding-right: 0.45rem; }
  .lang-switch { gap: 0.08rem; font-size: 0.72rem; }
  .lang-switch a { padding: 0.27rem 0.42rem; }
}

/* Batch 1 — Raval longform rhythm */
.profile-full .intro-prose { font-size: 1.08rem; line-height: 1.75; max-width: 40rem; }
.profile-full .intro-prose p { margin: 0 0 1rem; }
.profile-toc { font-family: var(--font-ui); font-size: 0.88rem; margin: 1.5rem 0 2rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); max-width: 28rem; }
.profile-toc .g-label { margin: 0 0 0.4rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem; }
.profile-toc ol { margin: 0; padding-left: 1.1rem; }
.profile-toc a { color: var(--ink-soft); text-decoration: none; }
.profile-toc a:hover { color: var(--accent); }
.profile-full .long-section p { max-width: 40rem; line-height: 1.7; }
.profile-full .profile-map { min-height: 260px; }
@media (max-width: 600px) {
  .wrap { padding-left: 0.75rem; padding-right: 0.75rem; }
  .wrap .wrap { padding-left: 0; padding-right: 0; }
  .brand { min-width: 0; flex: 1 1 11rem; }
  .lang-switch { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .home-search { width: 100%; }
  .home-search input { min-width: 0; }
  .grid-auto, .clue-grid, .hist-map-gallery { grid-template-columns: minmax(0, 1fr); }
  .profile-main h1, .home-copy h1 { overflow-wrap: normal; word-break: normal; hyphens: auto; }
  .profile-full .profile-geo { gap: 0.75rem; }
  .profile-toc { max-width: none; }
}
