/*
 * The Trail Lights map band. Looks like the rest of the Trail Lights page:
 * its font (inherited) and its white buttons, on the dark green of the forest
 * at the picture's edge, so the map blends into the band.
 *
 * Two layouts, chosen in trail-map.js:
 *   .tlm--pop  a mouse on a wide screen: a card opens beside the stop
 *   .tlm--row  touch or a narrow screen: the cards sit in a row under the map
 * With no script at all the cards are a plain row, so nothing is lost.
 *
 * Every rule starts at .tlm and resets what the theme does to buttons,
 * headings and lists, so the band looks the same wherever it is placed.
 */

.tlm {
  --tlm-gold: #ffcf6b;
  --tlm-ink: #1c1c1c;
  background: #0a1612;
  color: #fff;
  padding: 56px 0 60px;
}
.tlm *, .tlm *::before, .tlm *::after { box-sizing: border-box; }
.tlm-inner { max-width: 1232px; margin: 0 auto; padding: 0 16px; }

/* ── Heading ─────────────────────────────────────────────────────────── */
.tlm-head { text-align: center; max-width: 720px; margin: 0 auto 26px; }
.tlm .tlm-title { margin: 0 0 10px; font-size: 28px; line-height: 1.3; font-weight: 700; color: #fff; text-wrap: balance; }
.tlm .tlm-intro { margin: 0; font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .88); }
.tlm .tlm-facts { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; }
.tlm .tlm-facts li { margin: 0; padding: 5px 13px; border: 1px solid rgba(255, 207, 107, .55); border-radius: 999px; font-size: 13px; line-height: 1.3; font-weight: 700; color: var(--tlm-gold); }

/* ── The picture and its labels ──────────────────────────────────────── */
.tlm-stage { position: relative; }
.tlm-map { position: relative; container-type: inline-size; border-radius: 6px; overflow: hidden; box-shadow: 0 6px 30px rgba(0, 0, 0, .55); background: #0b1410; }
.tlm .tlm-pic { display: block; width: 100%; height: auto; max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }

.tlm .tlm-spot {
  position: absolute; z-index: 2; display: block; margin: 0; padding: 0; min-width: 0; min-height: 0;
  background: none; border: 0; border-radius: 1.1cqw; box-shadow: none; color: inherit; font: inherit; line-height: 1;
  cursor: pointer; -webkit-tap-highlight-color: transparent; appearance: none; text-shadow: none; transition: none;
}
.tlm .tlm-spot:hover, .tlm .tlm-spot:focus { background: none; border: 0; box-shadow: none; color: inherit; outline: none; }
/* A phone's finger is wider than a label: the hit area reaches a little past it. */
.tlm .tlm-spot::before { content: ''; position: absolute; inset: -0.9cqw; }
/* The ring. Showpieces glow all the time; the rest light up when pointed at or open. */
.tlm .tlm-spot::after {
  content: ''; position: absolute; inset: -0.35cqw; border-radius: 1.3cqw; pointer-events: none;
  border: max(1.5px, .22cqw) solid var(--tlm-gold); opacity: 0;
  box-shadow: 0 0 1.6cqw .3cqw rgba(255, 207, 107, .75), inset 0 0 .8cqw rgba(255, 207, 107, .35);
  transition: opacity .18s ease;
}
.tlm .tlm-spot--showpiece::after { opacity: .9; animation: tlm-glow 2.4s ease-in-out infinite; }
.tlm .tlm-spot:hover::after, .tlm .tlm-spot:focus-visible::after, .tlm .tlm-spot.is-active::after { opacity: 1; animation: none; border-color: #fff; box-shadow: 0 0 2.2cqw .6cqw rgba(255, 221, 150, .95), inset 0 0 1cqw rgba(255, 255, 255, .5); }
@keyframes tlm-glow { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* The thing a label points at. Invisible; pointing at it opens the same card. */
.tlm .tlm-area { position: absolute; z-index: 1; border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* "It is here": a ring on the feature of the stop that is open. */
.tlm .tlm-here {
  position: absolute; z-index: 1; left: 0; top: 0; width: 7cqw; height: 7cqw; margin: -3.5cqw 0 0 -3.5cqw; border-radius: 50%;
  border: max(2px, .25cqw) solid #fff; box-shadow: 0 0 1.4cqw rgba(255, 255, 255, .8), inset 0 0 1.4cqw rgba(255, 255, 255, .35);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, left .35s ease, top .35s ease;
}
.tlm--has-active .tlm-here { opacity: .9; animation: tlm-here 1.8s ease-in-out infinite; }
@keyframes tlm-here { 0%, 100% { transform: scale(.82); } 50% { transform: scale(1.08); } }

/* Our own label over a painted one, for a spot with "relabel" in map.json (none since 11/13). */
.tlm .tlm-relabel {
  position: absolute; inset: -0.25cqw -1.1cqw; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 0 .5cqw; border-radius: 1.1cqw; border: max(1px, .16cqw) solid #e3b85c;
  background: linear-gradient(#131a2b, #0a0f1c); color: #f7e8c3;
  font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 1.12cqw; line-height: 1.18; letter-spacing: .05em; text-transform: uppercase;
}

.tlm .tlm-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.tlm .tlm-card {
  position: relative; background: #fff; color: var(--tlm-ink); border-radius: 6px; overflow: hidden; text-align: left;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .35);
}
.tlm .tlm-card-media { background: #0b1410; aspect-ratio: 3 / 2; overflow: hidden; }
.tlm .tlm-card-media--photo { aspect-ratio: 1 / 1; } /* a real photo: square, see class-map.php */
.tlm .tlm-card-pic { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.tlm .tlm-card-body { padding: 14px 16px 16px; }
.tlm .tlm-tag { margin: 0 0 4px; font-size: 11px; line-height: 1.3; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #6b6b6b; }
.tlm .tlm-card--showpiece .tlm-tag { color: #b3540a; }
.tlm .tlm-card-name { margin: 0 0 6px; padding: 0; font-size: 20px; line-height: 1.25; font-weight: 700; color: var(--tlm-ink); letter-spacing: 0; text-transform: none; }
.tlm .tlm-card--poi .tlm-card-name { font-size: 17px; }
.tlm .tlm-card-line { margin: 0; font-size: 15px; line-height: 1.5; color: #2c2c2c; }
.tlm .tlm-card--poi .tlm-card-line { font-size: 14px; }
.tlm .tlm-note { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: #5c5c5c; }
.tlm .tlm-close {
  display: none; position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; margin: 0; padding: 0; min-width: 0;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; font: 700 20px/30px Arial, sans-serif; text-align: center;
  cursor: pointer; box-shadow: none; appearance: none; text-shadow: none;
}
.tlm .tlm-close:hover, .tlm .tlm-close:focus { background: #000; color: #fff; border: 0; box-shadow: none; }

/* Row layout: touch, narrow screens, and no script. */
.tlm .tlm-cards {
  display: flex; align-items: flex-start; gap: 12px; margin: 14px -16px 0; padding: 4px 16px 14px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-left: 16px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .35) transparent;
}
.tlm .tlm-cards::after { content: ''; flex: 0 0 calc(100% - 262px); } /* lets the last card reach the left edge */
.tlm .tlm-cards > .tlm-card { flex: 0 0 min(300px, 80vw); scroll-snap-align: start; border-top: 4px solid transparent; }
.tlm .tlm-cards > .tlm-card--poi { flex-basis: min(230px, 64vw); }
.tlm--row .tlm-card.is-open { border-top-color: var(--tlm-gold); box-shadow: 0 0 0 2px var(--tlm-gold), 0 3px 14px rgba(0, 0, 0, .35); }

/* Card beside the stop: a mouse on a wide screen. */
.tlm--pop .tlm-cards { display: block; margin: 0; padding: 0; overflow: visible; }
.tlm--pop .tlm-cards::after { content: none; }
.tlm--pop .tlm-cards > .tlm-card { display: none; position: absolute; z-index: 5; width: 300px; border-top: 0; box-shadow: 0 10px 40px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .2); }
.tlm--pop .tlm-cards > .tlm-card--poi { width: 256px; }
.tlm--pop .tlm-card-media--crop { display: none; } /* it would repeat the map beside it */
.tlm--pop .tlm-cards > .tlm-card.is-open { display: block; animation: tlm-pop .16s ease-out; }
.tlm--pop.tlm--pinned .tlm-card.is-open .tlm-close { display: block; }
@keyframes tlm-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Foot: what's included, and the way to buy ───────────────────────── */
.tlm-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 24px; margin-top: 26px; text-align: center; }
.tlm--row .tlm-foot { margin-top: 12px; }
.tlm .tlm-footnote { margin: 0; font-size: 16px; line-height: 1.5; color: #fff; }
.tlm .tlm-button {
  display: inline-block; padding: .62em 1.1em; border: 0; border-radius: .35em; background: #fff; color: #000;
  font-size: 16px; line-height: 1; font-weight: 700; text-decoration: none; box-shadow: 0 .15em .65em rgba(0, 0, 0, .25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tlm .tlm-button:hover, .tlm .tlm-button:focus { background: #fff; color: #000; text-decoration: none; transform: translateY(-1px); box-shadow: 0 .3em 1em rgba(0, 0, 0, .4); }

/* A photo map.json names is missing from map/img/: shown above the band to staff who can edit pages. */
.tlm-staff-note { margin: 0; padding: 12px 16px; background: #fff4d6; color: #3a2a00; border-left: 5px solid #d98200; font-size: 15px; line-height: 1.5; }

/* ── Placing stops: add ?tlm_debug to the page address to see every hit area ── */
.tlm--debug .tlm-spot { outline: 2px solid #f0f; }
.tlm--debug .tlm-area { outline: 2px solid #0ff; }

@media (max-width: 600px) {
  .tlm { padding: 40px 0 44px; }
  .tlm .tlm-title { font-size: 24px; }
  .tlm .tlm-intro, .tlm .tlm-footnote { font-size: 15px; }
  .tlm-inner { padding: 0 10px; }
  .tlm .tlm-cards { margin: 12px -10px 0; padding: 4px 10px 12px; scroll-padding-left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .tlm .tlm-spot--showpiece::after, .tlm--has-active .tlm-here, .tlm--pop .tlm-cards > .tlm-card.is-open { animation: none; }
  .tlm .tlm-here { transition: opacity .2s ease; }
  .tlm .tlm-cards { scroll-behavior: auto; }
}
