/* Architecture Walk — Old City Philadelphia
   Mobile-first PWA styles · v1.0.0
   Fonts: Mercure (Regular, Italic, Transcript)
   Transcript variant: ALLCAPS / small-caps only */

/* ── Fonts ── */
@font-face {
  font-family: 'Mercure';
  src: url('/fonts/Mercure-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Mercure';
  src: url('/fonts/Mercure-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Mercure Transcript';
  src: url('/fonts/Mercure-Transcript.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:      #FAF8F5;
  --ink:        #2D3436;
  --ink-light:  #636E72;
  --coral:      #C75B3F;
  --coral-light:#E8856E;
  --teal:       #5EC4B6;
  --slate:      #3D4F5F;
  --warm-gray:  #E8E4DF;
  --card-bg:    #FFFFFF;
  --shadow:     0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:  0 2px 12px rgba(0,0,0,0.10);
  --radius:     10px;
  --gap:        1rem;
}

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

body {
  font-family: 'Mercure', Georgia, 'Times New Roman', serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Transcript utility (allcaps only) ── */
.transcript {
  font-family: 'Mercure Transcript', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.transcript-sc {
  font-family: 'Mercure Transcript', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

/* ── Header ── */
.header {
  padding: 2rem var(--gap) 1rem;
  text-align: center;
}
.header h1 {
  font-family: 'Mercure', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}
.header .subtitle {
  font-size: 0.7rem;
  color: var(--ink-light);
  margin-bottom: 0.15rem;
}
.header .date {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--coral);
}
.booklet-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--ink-light);
  text-decoration: none;
  border-bottom: 1px solid var(--warm-gray);
  transition: color 0.15s, border-color 0.15s;
}
.booklet-link:active {
  color: var(--coral);
  border-color: var(--coral-light);
}

/* ── Map ── */
.map-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-top: 1px solid var(--warm-gray);
  border-bottom: 1px solid var(--warm-gray);
  background: var(--cream);
}
.map-img {
  display: block;
  width: 100%;
  height: auto;
}
.map-hotspot {
  position: absolute;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  margin-top: -18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: transparent;
  font-size: 0;
  -webkit-tap-highlight-color: rgba(199, 91, 63, 0.2);
  cursor: pointer;
  z-index: 2;
}
@media (min-width: 480px) {
  .map-hotspot {
    width: 44px;
    height: 44px;
    margin-left: -22px;
    margin-top: -22px;
  }
}

/* ── Stop pills (horizontal scroll) ── */
.stop-nav {
  display: flex;
  gap: 8px;
  padding: 12px var(--gap);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--warm-gray);
  background: var(--card-bg);
  position: sticky;
  top: 0;
  z-index: 10;
  justify-content: center;
}
.stop-nav::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 8px;
  border-radius: 20px;
  border: 1.5px solid var(--warm-gray);
  background: var(--card-bg);
  color: var(--ink);
  font-size: 0.78rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.pill:active,
.pill.active {
  border-color: var(--coral);
  background: rgba(199, 91, 63, 0.06);
}
.pill .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 400;
}
.pill.finale .num {
  background: var(--teal);
  font-size: 0.65rem;
}
.pill .label {
  font-style: italic;
  font-size: 0.78rem;
}

/* ── Main content ── */
.main {
  padding: var(--gap);
  padding-bottom: 6rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Stop card ── */
.stop-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.stop-card:target,
.stop-card.highlight {
  box-shadow: var(--shadow-md);
}

.stop-card__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 1rem 1rem 0.5rem;
}
.stop-card__number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.stop-card.finale .stop-card__number {
  background: var(--teal);
  font-size: 0.9rem;
}
.stop-card__title {
  flex: 1;
}
.stop-card__name {
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.25;
}
.stop-card__meta {
  font-style: italic;
  font-size: 0.78rem;
  color: var(--ink-light);
  margin-top: 2px;
}

.stop-card__body {
  padding: 0 1rem 0.75rem;
}
.stop-card__desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink);
  margin-top: 0.25rem;
}

.stop-card__actions {
  display: flex;
  gap: 8px;
  padding: 0 1rem 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-family: 'Mercure', Georgia, serif;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-directions {
  background: var(--coral);
  color: #fff;
}
.btn-directions:active { opacity: 0.8; }


/* ── Leg (between-stops) card ── */
.leg-card {
  display: flex;
  gap: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: var(--gap);
  font-size: 0.82rem;
  color: var(--ink-light);
  position: relative;
}
.leg-card::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--warm-gray);
}
.leg-card__icon {
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}
.leg-card__text {
  flex: 1;
  line-height: 1.5;
}
.leg-card__stats {
  font-size: 0.7rem;
  margin-top: 4px;
}
.leg-card__fork {
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(94,196,182,0.08);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--slate);
}
.leg-card__fork strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 400;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 2rem var(--gap) 3rem;
  font-style: italic;
  font-size: 0.78rem;
  color: var(--ink-light);
}

/* ── Responsive ── */
@media (min-width: 480px) {
  .header h1 { font-size: 2rem; }
  #map { height: 50vh; max-height: 500px; }
}
@media (min-width: 768px) {
  .main { padding: 1.5rem; }
  .stop-card__header { padding: 1.25rem 1.25rem 0.75rem; }
  .stop-card__body { padding: 0 1.25rem 1rem; }
  .stop-card__actions { padding: 0 1.25rem 1.25rem; }
}

/* ── Print ── */
@media print {
  .map-wrap, .stop-nav, .btn-directions, .footer { display: none; }
  .stop-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* ── Safe area (notch) ── */
@supports (padding-top: env(safe-area-inset-top)) {
  .header { padding-top: calc(1.5rem + env(safe-area-inset-top)); }
  .main { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
}
