/* Trailscape Explorer — front-end styles. All classes are prefixed with .tse- */
.tse-explorer {
  --tse-accent: #1f6f5c;
  --tse-ink: #17322b;
  --tse-muted: #5d6f69;
  --tse-card: rgba(255, 255, 255, 0.94);
  --tse-line: rgba(23, 50, 43, 0.12);
  --tse-radius: 18px;
  --tse-height: 680px;
  --tse-shadow: 0 10px 30px -12px rgba(16, 40, 34, 0.35), 0 2px 6px rgba(16, 40, 34, 0.08);
  position: relative;
  width: 100%;
  height: var(--tse-height);
  min-height: 420px;
  border-radius: var(--tse-radius);
  overflow: hidden;
  color: var(--tse-ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
  text-align: left;
  container: tse / inline-size;
  isolation: isolate;
  background: radial-gradient(120% 90% at 50% 0%, #f4fbff 0%, #cfe9f7 45%, #a9d3ea 100%);
  transition: background 0.8s ease;
}
.tse-explorer.is-golden { background: radial-gradient(120% 90% at 30% 10%, #fff2d9 0%, #ffd2a6 40%, #e9a08c 100%); }
.tse-explorer *, .tse-explorer *::before, .tse-explorer *::after { box-sizing: border-box; }
.tse-explorer :where(button) { font-family: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; letter-spacing: normal; text-transform: none; color: inherit; cursor: pointer; margin: 0; min-height: 0; }
.tse-explorer :where(h2, h3, h4, p, ul) { font-family: inherit; }
.tse-explorer svg { width: 1em; height: 1em; flex: none; }
.tse-explorer :focus-visible { outline: 3px solid var(--tse-accent); outline-offset: 2px; }
.tse-explorer:fullscreen { --tse-height: 100vh; border-radius: 0; }

/* SEO / no-JS fallback list (rendered by PHP) */
.tse-fallback { padding: 28px; height: 100%; overflow: auto; }
.tse-fallback h2 { margin: 0 0 16px; }
.tse-fallback ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tse-fallback li { background: var(--tse-card); border-radius: 14px; padding: 16px; box-shadow: var(--tse-shadow); }
.tse-fallback a { color: var(--tse-accent); font-weight: 600; }
.tse-ready:not(.tse-nogl) .tse-fallback { display: none; }

.tse-stage { position: absolute; inset: 0; }
.tse-canvas, .tse-canvas canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.tse-canvas canvas { cursor: grab; }
.tse-canvas canvas:active { cursor: grabbing; }

/* header + filters */
.tse-head { position: absolute; top: 22px; left: 24px; max-width: min(420px, 60%); pointer-events: none; z-index: 1200;
  opacity: 0; transform: translateY(-8px); transition: opacity .8s ease .4s, transform .8s ease .4s; }
.tse-in .tse-head { opacity: 1; transform: none; }
.tse-title { margin: 0; text-shadow: 0 0 18px rgba(255,255,255,.9); font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.1; letter-spacing: -0.02em; font-weight: 750; color: var(--tse-ink); }
.tse-sub { margin: 6px 0 0; font-size: .95rem; color: var(--tse-muted); }

.tse-filters { position: absolute; top: 20px; right: 20px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 55%; z-index: 1200;
  opacity: 0; transition: opacity .8s ease .7s; }
.tse-in .tse-filters { opacity: 1; }
.tse-filters, .tse-controls { transition: opacity .8s ease .7s, right .45s cubic-bezier(.2,.8,.2,1); }
.has-panel .tse-controls { right: 414px; }
.has-panel .tse-filters { opacity: 0 !important; pointer-events: none; }
.has-panel .tse-head { opacity: 0; }
.tse-filters button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--tse-line); background: var(--tse-card); backdrop-filter: blur(8px);
  padding: 7px 13px; border-radius: 999px; font-size: .84rem; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: background .2s, color .2s, transform .2s; }
.tse-filters button i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tse-filters button:hover { transform: translateY(-1px); }
.tse-filters button[aria-pressed="true"] { background: var(--tse-ink); color: #fff; border-color: var(--tse-ink); }

/* pins */
.tse-pins { position: absolute; inset: 0; pointer-events: none; }
.tse-pin { position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; background: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; transform-origin: 50% 100%; will-change: transform;
  translate: -50% -100%; opacity: 0; transition: opacity .35s ease, filter .3s ease; }
.tse-in .tse-pin { opacity: 1; transition-delay: calc(1.1s + var(--i) * 90ms), 0s; }
.tse-settled .tse-pin { transition-delay: 0s !important; }
.tse-pin.is-off { opacity: 0 !important; pointer-events: none; }
.tse-pin.is-dim { opacity: .28 !important; filter: grayscale(.8); transition-delay: 0s; }
.tse-pin-dot { width: 38px; height: 38px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--pin); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 14px -4px rgba(0,0,0,.45), inset 0 0 0 2.5px rgba(255,255,255,.9);
  transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.tse-pin-dot svg { transform: rotate(45deg); font-size: 19px; }
.tse-in .tse-pin .tse-pin-dot { animation: tse-drop .7s cubic-bezier(.3,1.5,.5,1) both; animation-delay: calc(1.1s + var(--i) * 90ms); }
@keyframes tse-drop { from { transform: rotate(-45deg) translate(14px,-14px) scale(.3); opacity: 0; } to { transform: rotate(-45deg); opacity: 1; } }
.tse-pin:hover .tse-pin-dot, .tse-pin:focus-visible .tse-pin-dot, .tse-pin.is-active .tse-pin-dot { transform: rotate(-45deg) scale(1.16); }
.tse-pin.is-active .tse-pin-dot { box-shadow: 0 0 0 6px color-mix(in srgb, var(--pin) 30%, transparent), 0 6px 14px -4px rgba(0,0,0,.45), inset 0 0 0 2.5px #fff; }
.tse-pin-label { margin-top: 8px; background: rgba(23,50,43,.86); color: #fff; font-size: .74rem; font-weight: 650; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; pointer-events: none; }
.tse-pin:hover .tse-pin-label, .tse-pin:focus-visible .tse-pin-label, .tse-pin.is-active .tse-pin-label { opacity: 1; transform: none; }
.tse-pin:focus-visible { outline: none; }
.tse-pin:focus-visible .tse-pin-dot { outline: 3px solid #fff; outline-offset: 3px; }

/* tooltip */
.tse-tooltip { position: absolute; left: 0; top: 0; z-index: 1500; width: 260px; display: flex; gap: 10px; padding: 9px; pointer-events: none;
  background: var(--tse-card); backdrop-filter: blur(10px); border-radius: 14px; box-shadow: var(--tse-shadow); opacity: 0; transition: opacity .18s; }
.tse-tooltip.show { opacity: 1; }
.tse-tooltip img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; }
.tse-tooltip small { color: var(--tse-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.tse-tooltip strong { display: block; font-size: .92rem; line-height: 1.2; margin: 1px 0 3px; }
.tse-tooltip p { margin: 0 0 4px; font-size: .78rem; color: var(--tse-muted); line-height: 1.3; }
.tse-tooltip span { font-size: .8rem; }
.tse-tooltip b { color: var(--tse-accent); }

/* hint */
.tse-hint { position: absolute; left: 50%; bottom: 26px; translate: -50% 0; z-index: 1300; background: rgba(23,50,43,.86); color: #fff;
  padding: 8px 16px; border-radius: 999px; font-size: .85rem; font-weight: 600; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
.tse-hint.show { opacity: 1; }

/* buttons */
.tse-icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--tse-line);
  background: var(--tse-card); backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(0,0,0,.07); font-size: 18px; transition: transform .15s, background .15s; }
.tse-icon-btn:hover { transform: translateY(-1px); background: #fff; }
.tse-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--tse-line); background: var(--tse-card); backdrop-filter: blur(8px);
  padding: 9px 15px; border-radius: 12px; font-weight: 650; font-size: .9rem; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.tse-btn svg { font-size: 18px; color: var(--tse-accent); }
.tse-btn[aria-expanded="true"] { background: var(--tse-ink); color: #fff; }
.tse-btn[aria-expanded="true"] svg { color: #fff; }

.tse-controls { position: absolute; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 6px; z-index: 1200; opacity: 0; transition: opacity .8s ease .9s; }
.tse-in .tse-controls, .tse-in .tse-bottom-left { opacity: 1; }

/* routes / trail map */
.tse-bottom-left { position: absolute; left: 20px; bottom: 20px; z-index: 1250; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px; opacity: 0; transition: opacity .8s ease .9s; max-width: calc(100% - 100px); }
.tse-routes { width: 300px; max-width: 100%; background: var(--tse-card); backdrop-filter: blur(12px); border-radius: 16px; box-shadow: var(--tse-shadow); padding: 12px; }
.tse-routes-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 8px; }
.tse-routes-head .tse-icon-btn { width: 30px; height: 30px; font-size: 15px; box-shadow: none; }
.tse-routes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tse-routes li button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 1px solid transparent; border-radius: 11px; padding: 8px; transition: background .15s; }
.tse-routes li button:hover { background: rgba(23,50,43,.05); }
.tse-routes li button[aria-pressed="true"] { background: #fff; border-color: var(--tse-line); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.tse-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--tse-line); }
.tse-rt-main { display: flex; flex-direction: column; }
.tse-rt-main strong { font-size: .9rem; }
.tse-rt-main small { color: var(--tse-muted); font-size: .76rem; }
.tse-route-desc { margin: 8px 4px 2px; font-size: .82rem; color: var(--tse-muted); }
.tse-route-desc:empty { display: none; }

/* panel */
.tse-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(390px, calc(100% - 24px)); z-index: 1400;
  background: #fff; border-radius: 20px; box-shadow: 0 24px 60px -20px rgba(10,30,25,.5); overflow: hidden auto; overscroll-behavior: contain;
  transform: translateX(calc(100% + 24px)); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.tse-panel.open { transform: none; }
.tse-close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.tse-gallery { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #e8eef0; touch-action: pan-y; }
.tse-slides { display: flex; height: 100%; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.tse-slides img { width: 100%; height: 100%; flex: none; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.tse-g-prev, .tse-g-next { position: absolute; top: 50%; translate: 0 -50%; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); display: grid; place-items: center; font-size: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.tse-g-prev { left: 10px; } .tse-g-next { right: 10px; }
.tse-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.tse-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); transition: width .2s, background .2s; }
.tse-dots span.on { width: 18px; border-radius: 4px; background: #fff; }
.tse-body { padding: 18px 20px 22px; }
.tse-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
  color: var(--pin); background: color-mix(in srgb, var(--pin) 12%, #fff); padding: 4px 10px; border-radius: 999px; }
.tse-body h3 { margin: 10px 0 10px; font-size: 1.45rem; line-height: 1.15; letter-spacing: -0.015em; color: var(--tse-ink); }
.tse-facts { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tse-facts li { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; background: #f2f5f4; padding: 5px 10px; border-radius: 9px; }
.tse-facts svg { color: var(--tse-accent); }
.tse-desc { font-size: .92rem; color: #33463f; }
.tse-desc p { margin: 0 0 10px; }
.tse-hl { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 6px; }
.tse-hl li { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; }
.tse-hl svg { color: var(--tse-accent); margin-top: 3px; }
.tse-link { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 0; color: var(--tse-accent); font-size: .88rem; text-align: left; }
.tse-link svg { font-size: 17px; }
.tse-link:hover span { text-decoration: underline; }

.tse-book { margin-top: 16px; border-top: 1px solid var(--tse-line); padding-top: 14px; }
.tse-book h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: .95rem; }
.tse-book h4 svg { color: var(--tse-accent); }
.tse-days { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.tse-days-loading { font-size: .85rem; color: var(--tse-muted); padding: 18px 0; }
.tse-day { flex: none; width: 62px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 4px 8px;
  border: 1.5px solid var(--tse-line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s, transform .15s; }
.tse-day small { font-size: .68rem; color: var(--tse-muted); text-transform: uppercase; letter-spacing: .04em; }
.tse-day b { font-size: 1.1rem; line-height: 1.1; }
.tse-day em { font-style: normal; font-size: .66rem; font-weight: 700; margin-top: 3px; color: #2e9a63; }
.tse-day.is-low em { color: #d9822b; }
.tse-day.is-full em, .tse-day.is-closed em { color: #a0a8a5; }
.tse-day:disabled { opacity: .55; cursor: not-allowed; background: #f6f7f7; }
.tse-day:not(:disabled):hover { transform: translateY(-1px); border-color: var(--tse-accent); }
.tse-day[aria-checked="true"] { border-color: var(--tse-accent); background: color-mix(in srgb, var(--tse-accent) 9%, #fff); box-shadow: 0 0 0 1px var(--tse-accent) inset; }
.tse-qty { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; font-weight: 600; font-size: .9rem; }
.tse-stepper { display: flex; align-items: center; gap: 4px; border: 1px solid var(--tse-line); border-radius: 12px; padding: 3px; }
.tse-stepper button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: #f2f5f4; display: grid; place-items: center; font-size: 15px; }
.tse-stepper output { min-width: 28px; text-align: center; font-weight: 700; }
.tse-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px; background: #f4f7f6; border-radius: 14px; }
.tse-total small { display: block; color: var(--tse-muted); font-size: .76rem; }
.tse-total strong { font-size: 1.3rem; letter-spacing: -0.01em; }
.tse-cta { font-size: 15px; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; padding: 12px 20px; border-radius: 12px; background: var(--tse-accent); color: #fff !important;
  font-weight: 700; text-decoration: none !important; white-space: nowrap; box-shadow: 0 8px 18px -8px var(--tse-accent); transition: transform .15s, filter .15s; }
.tse-cta:hover { transform: translateY(-1px); filter: brightness(1.08); }
.tse-cta.is-disabled { background: #b9c4c0; box-shadow: none; cursor: not-allowed; transform: none; }

/* mobile */
@container tse (max-width: 720px) {
  .has-panel .tse-controls { right: 10px; }
  .tse-head { top: 14px; left: 14px; max-width: calc(100% - 28px); }
  .tse-sub { display: none; }
  .tse-filters { top: auto; bottom: 66px; left: 10px; right: 10px; max-width: none; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; padding: 2px; }
  .tse-filters button { flex: none; }
  .tse-controls { right: 10px; bottom: 10px; flex-direction: row; }
  .tse-controls [data-act="zoom-in"], .tse-controls [data-act="zoom-out"], .tse-controls [data-act="full"] { display: none; }
  .tse-bottom-left { left: 10px; bottom: 10px; }
  .tse-routes { position: absolute; bottom: 48px; left: 0; width: min(300px, calc(100vw - 40px)); }
  .tse-btn span { display: none; }
  .tse-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 82%; transform: translateY(calc(100% + 20px)); border-radius: 18px; }
  .tse-pin-dot { width: 32px; height: 32px; }
  .tse-tooltip { display: none; }
  .tse-hint { bottom: auto; top: 58px; white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 28px); }
}
@media (prefers-reduced-motion: reduce) {
  .tse-explorer *, .tse-explorer *::before, .tse-explorer *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; animation-delay: 0s !important; }
}
