/* Kathrine's Tour & Travels — Explore the World atlas (explore.html) */

.atlas {
  --navy: #0a131e;
  --navy-2: #0f1b29;
  --charcoal: #141c26;
  --land: #1a2735;
  --land-edge: #2b3d51;
  --atlas-ink: #f2ede4;
  --atlas-muted: rgba(242, 237, 228, 0.64);
  --atlas-line: rgba(242, 237, 228, 0.12);
  --teal: #8fd3cc;
  --teal-deep: #1d5b58;
  --gold-bright: #d6ad62;

  background:
    radial-gradient(120% 80% at 80% 0%, rgba(29, 91, 88, 0.28), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--atlas-ink);
  padding: clamp(2.25rem, 4.5vw, 3.25rem) 0 0;
}
.atlas .eyebrow { color: var(--teal); margin-bottom: 0.75rem; }
.atlas h1 { font-size: clamp(2.4rem, 4.6vw, 3.9rem); margin-bottom: 0.35em; }
.atlas h1 em { color: var(--gold-bright); }
.atlas .lead { color: var(--atlas-muted); font-size: 1.05rem; margin: 0; }

.atlas-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.atlas-legend { list-style: none; margin: 0; padding: 1rem 1.25rem; display: grid; gap: 0.55rem; border: 1px solid var(--atlas-line); border-radius: var(--radius); font-size: 0.85rem; color: var(--atlas-muted); }
.atlas-legend li { display: flex; align-items: center; gap: 0.75rem; }
.atlas-legend b { margin-left: auto; padding-left: 1.5rem; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; color: var(--atlas-ink); }

/* Markers (also used in the legend, search and index) */
.pin { position: relative; display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; }
.pin--visited { background: var(--teal); box-shadow: 0 0 0 3px rgba(143, 211, 204, 0.22), 0 0 14px rgba(143, 211, 204, 0.55); }
.pin--guide { background: var(--gold-bright); box-shadow: 0 0 0 3px var(--navy), 0 0 0 4.5px var(--gold-bright), 0 0 18px rgba(214, 173, 98, 0.6); }
.pin--soon, .pin--coming-soon { background: transparent; border: 1.5px solid rgba(242, 237, 228, 0.78); width: 10px; height: 10px; }
.pin--now::after {
  content: ''; position: absolute; inset: -9px; border-radius: 50%;
  border: 1px solid var(--gold-bright); animation: atlas-pulse 2.4s ease-out infinite;
}
@keyframes atlas-pulse { from { transform: scale(0.5); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }

/* Toolbar: search + filters */
.atlas-toolbar { display: flex; gap: 1.25rem 2rem; align-items: start; flex-wrap: wrap; margin-bottom: 1.25rem; }
.atlas-search { position: relative; z-index: 10; flex: 1 1 260px; max-width: 360px; }
.atlas-search input {
  width: 100%; padding: 0.85rem 1rem 0.85rem 2.6rem;
  font: inherit; font-size: 0.95rem; color: var(--atlas-ink);
  background: rgba(242, 237, 228, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23f2ede4' stroke-opacity='.6' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='5.5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 1rem center;
  border: 1px solid var(--atlas-line); border-radius: var(--radius);
}
.atlas-search input::placeholder { color: rgba(242, 237, 228, 0.5); }
.atlas-search input:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: transparent; }
.atlas-search-results {
  position: absolute; z-index: 1100; top: calc(100% + 6px); left: 0; right: 0;
  list-style: none; margin: 0; padding: 0.35rem;
  background: var(--charcoal); border: 1px solid var(--atlas-line); border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.atlas-search-results li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.1rem 0.75rem; padding: 0.6rem 0.7rem; border-radius: 3px; cursor: pointer; font-size: 0.92rem; }
.atlas-search-results li small { grid-column: 2; color: var(--atlas-muted); font-size: 0.78rem; }
.atlas-search-results li[aria-selected="true"], .atlas-search-results li:hover { background: rgba(143, 211, 204, 0.12); }
.atlas-search-results li.is-empty { display: block; cursor: default; color: var(--atlas-muted); background: none; }
.flag { display: inline-block; width: 18px; height: auto; margin-right: 0.45rem; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }

.atlas-filters { display: grid; gap: 0.6rem; flex: 1 1 520px; }
.chip-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chip {
  padding: 0.5rem 0.95rem; border-radius: 999px;
  font: 500 0.82rem var(--sans); color: var(--atlas-muted);
  background: transparent; border: 1px solid var(--atlas-line); cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.chip:hover { color: var(--atlas-ink); border-color: rgba(242, 237, 228, 0.35); }
.chip[aria-pressed="true"] { color: var(--navy); background: var(--atlas-ink); border-color: var(--atlas-ink); }
.chip:focus-visible, .atlas-controls button:focus-visible, .atlas-panel :focus-visible { outline-color: var(--teal); }

/* Stage: the globe, its controls, states and the panel */
.atlas-stage {
  position: relative; z-index: 0; isolation: isolate;
  height: min(76vh, 760px); min-height: 520px; overflow: hidden;
  border-top: 1px solid var(--atlas-line);
  /* a faint starfield behind the globe */
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(242, 237, 228, 0.5), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(242, 237, 228, 0.4), transparent 60%),
    radial-gradient(1.2px 1.2px at 88% 64%, rgba(242, 237, 228, 0.45), transparent 60%),
    radial-gradient(1px 1px at 22% 78%, rgba(242, 237, 228, 0.35), transparent 60%),
    radial-gradient(1px 1px at 52% 8%, rgba(242, 237, 228, 0.3), transparent 60%),
    radial-gradient(1px 1px at 6% 52%, rgba(242, 237, 228, 0.3), transparent 60%),
    radial-gradient(1.2px 1.2px at 64% 92%, rgba(242, 237, 228, 0.35), transparent 60%),
    radial-gradient(1px 1px at 94% 34%, rgba(242, 237, 228, 0.3), transparent 60%),
    radial-gradient(70% 60% at 50% 50%, rgba(29, 91, 88, 0.16), transparent 70%);
}
.atlas-globe { position: absolute; inset: 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.atlas-globe.is-dragging { cursor: grabbing; }
.atlas-globe:focus-visible { outline: 2px solid var(--teal); outline-offset: -4px; }
.atlas-globe canvas { position: absolute; inset: 0; display: block; }
.globe-markers { position: absolute; inset: 0; pointer-events: none; }

.globe-marker {
  position: absolute; z-index: 1; left: -12px; top: -12px; width: 24px; height: 24px;
  display: grid; place-items: center; padding: 0;
  background: none; border: 0; border-radius: 50%; cursor: pointer; pointer-events: auto;
  will-change: transform;
}
.globe-marker[data-kind="visited"] { z-index: 2; }
.globe-marker[data-kind="guide"] { z-index: 3; }
.globe-marker.is-selected { z-index: 4; }
.globe-marker:hover, .globe-marker:focus-visible { z-index: 5; }
.globe-marker.is-behind, .globe-marker.is-filtered { visibility: hidden; pointer-events: none; }
.globe-marker.is-filtered { display: none; }
.globe-marker .pin { transition: transform 0.25s ease; }
.globe-marker:hover .pin, .globe-marker:focus-visible .pin, .globe-marker.is-selected .pin { transform: scale(1.5); }
.globe-marker:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.globe-marker.is-selected .pin--coming-soon { background: var(--atlas-ink); }
.atlas-globe.is-dragging .globe-marker { pointer-events: none; }

.globe-tooltip {
  position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none;
  display: grid; gap: 0.1rem; padding: 0.55rem 0.8rem; white-space: nowrap;
  background: rgba(15, 27, 41, 0.96); color: var(--atlas-ink);
  border: 1px solid var(--atlas-line); border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.globe-tooltip[hidden] { display: none; }
.globe-tooltip-place { font-family: var(--serif); font-size: 1.2rem; line-height: 1.1; }
.globe-tooltip-meta { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--atlas-muted); }

.atlas-credit { position: absolute; z-index: 4; right: 0.9rem; bottom: 0.6rem; margin: 0; font-size: 0.68rem; color: rgba(242, 237, 228, 0.45); }
.atlas-credit a { color: rgba(242, 237, 228, 0.7); }

.atlas-controls { position: absolute; z-index: 1000; left: 1.25rem; top: 1.25rem; display: grid; gap: 0.4rem; }
.atlas-controls button {
  min-width: 42px; height: 42px; padding: 0 0.8rem;
  font: 500 1.15rem var(--sans); color: var(--atlas-ink);
  background: rgba(15, 27, 41, 0.88); border: 1px solid var(--atlas-line); border-radius: var(--radius);
  cursor: pointer; backdrop-filter: blur(6px);
}
.atlas-controls button[data-action="reset"] { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.atlas-controls button:hover { border-color: var(--teal); color: var(--teal); }

.atlas-count { position: absolute; z-index: 1000; left: 1.25rem; bottom: 1rem; margin: 0; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--atlas-muted); pointer-events: none; }

.atlas-state { position: absolute; inset: 0; z-index: 1001; display: grid; place-content: center; justify-items: center; gap: 1rem; text-align: center; color: var(--atlas-muted); background: rgba(10, 19, 30, 0.6); }
.atlas-state[hidden] { display: none; }
.atlas-state p { margin: 0; max-width: 28rem; padding: 0 1.5rem; }
.atlas-state strong { color: var(--atlas-ink); font-family: var(--serif); font-size: 1.5rem; font-weight: 500; }
.atlas-spinner { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(242, 237, 228, 0.15); border-top-color: var(--gold-bright); animation: atlas-spin 0.9s linear infinite; }
@keyframes atlas-spin { to { transform: rotate(360deg); } }
.atlas-stage.is-error .atlas-controls, .atlas-stage.is-error .atlas-count { display: none; }

/* Destination panel: a side sheet on desktop, a bottom sheet on phones */
.atlas-panel {
  position: absolute; z-index: 1100; top: 1rem; right: 1rem; bottom: 1rem;
  width: min(400px, calc(100% - 2rem)); overflow-y: auto; overscroll-behavior: contain;
  background: #0d1621; border: 1px solid var(--atlas-line); border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: atlas-panel-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.atlas-panel[hidden] { display: none; }
@keyframes atlas-panel-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.atlas-panel-close {
  position: absolute; z-index: 2; top: 0.75rem; right: 0.75rem;
  width: 38px; height: 38px; border-radius: 50%;
  font: 400 1.5rem/1 var(--sans); color: var(--atlas-ink);
  background: rgba(10, 19, 30, 0.7); border: 1px solid rgba(242, 237, 228, 0.25); cursor: pointer;
}
.atlas-panel-close:hover { background: var(--atlas-ink); color: var(--navy); }

.ap-media { margin: 0; position: relative; }
.ap-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ap-media::after { content: ''; position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(180deg, transparent, rgba(13, 22, 33, 0.97)); pointer-events: none; }
.ap-media--type {
  display: grid; place-content: center; text-align: center; gap: 0.4rem; aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(90deg, rgba(242, 237, 228, 0.04) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgba(242, 237, 228, 0.04) 0 1px, transparent 1px 48px),
    radial-gradient(circle at 50% 40%, rgba(29, 91, 88, 0.55), transparent 70%),
    var(--navy);
}
.ap-media--type span { font-family: var(--serif); font-style: italic; font-size: 2.6rem; line-height: 1; color: var(--atlas-ink); }
.ap-media--type small { font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-bright); }
.ap-media--type::after { display: none; }

.ap-content { padding: 0.5rem 1.6rem 1.8rem; }
.ap-place { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.4rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal); }
.ap-flag { width: 24px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); }
.ap-title { font-size: 2.6rem; margin: 0 0 0.75rem; color: var(--atlas-ink); }
.ap-title:focus { outline: none; }
.ap-badges { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 1rem; }
.atlas .badge { background: var(--teal-deep); }
.atlas .badge--soon { background: #8a6326; }
.atlas .badge--outline { background: transparent; color: var(--atlas-ink); border: 1px solid rgba(242, 237, 228, 0.35); }
.ap-desc { color: rgba(242, 237, 228, 0.82); font-size: 0.98rem; }
.ap-facts { display: grid; gap: 0.5rem; margin: 1.25rem 0 0; padding: 1rem 0; border-top: 1px solid var(--atlas-line); border-bottom: 1px solid var(--atlas-line); font-size: 0.88rem; }
.ap-facts div { display: flex; justify-content: space-between; gap: 1rem; }
.ap-facts dt { color: var(--atlas-muted); }
.ap-facts dd { margin: 0; text-align: right; }
.ap-heading { margin: 1.5rem 0 0.6rem; font-family: var(--sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-bright); }
.ap-note { margin: 0 0 0.6rem; font-size: 0.9rem; color: var(--atlas-muted); }
.ap-note a { color: var(--atlas-ink); }
.ap-guide {
  display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 1rem; align-items: center;
  padding: 0.9rem 1rem; text-decoration: none;
  font-family: var(--serif); font-size: 1.3rem; color: var(--atlas-ink);
  border: 1px solid rgba(214, 173, 98, 0.45); border-radius: var(--radius);
  transition: background 0.2s, border-color 0.2s;
}
.ap-guide:hover { background: rgba(214, 173, 98, 0.1); border-color: var(--gold-bright); }
.ap-guide-kicker { grid-column: 1; font-family: var(--sans); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-bright); }
.ap-arrow { grid-column: 2; grid-row: 1 / span 2; font-family: var(--sans); color: var(--gold-bright); }
.ap-videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 0.75rem; }
.ap-videos figure { margin: 0; }
.ap-videos video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 3px; background: #000; }
.ap-videos figcaption { margin-top: 0.3rem; font-size: 0.72rem; color: var(--atlas-muted); }
.ap-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.5rem; }
.ap-actions .btn { flex: 1 1 auto; padding: 0.85rem 1.1rem; font-size: 0.74rem; }
.btn--gold { background: var(--gold-bright); border-color: var(--gold-bright); color: var(--navy); }
.btn--gold:hover { background: var(--atlas-ink); border-color: var(--atlas-ink); color: var(--navy); }
.btn--line { background: transparent; border-color: rgba(242, 237, 228, 0.4); color: var(--atlas-ink); }
.btn--line:hover { background: var(--atlas-ink); border-color: var(--atlas-ink); color: var(--navy); }

/* Atlas index (below the map) */
.atlas-index-section { background: var(--paper); }
.atlas-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem 2.5rem; }
.atlas-index-group h3 { padding-bottom: 0.6rem; border-bottom: 2px solid var(--ink); }
.atlas-index-group ul { list-style: none; margin: 0; padding: 0; }
.atlas-index-item {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.85rem;
  padding: 0.8rem 0.25rem; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.atlas-index-item:hover .atlas-index-name { color: var(--accent); }
.atlas-index-name { font-family: var(--serif); font-size: 1.3rem; line-height: 1.15; }
.atlas-index-name small { display: block; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.atlas-index-status { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: right; }
/* Index pins sit on paper, so give them light-background versions */
.atlas-index .pin--visited { background: var(--accent); box-shadow: 0 0 0 3px rgba(29, 91, 88, 0.15); }
.atlas-index .pin--guide { background: var(--gold); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--gold); }
.atlas-index .pin--soon, .atlas-index .pin--coming-soon { border-color: var(--muted); }

/* Tablet */
@media (max-width: 1000px) {
  .atlas-search { max-width: none; flex-basis: 100%; }
  .atlas-panel { width: min(360px, calc(100% - 2rem)); }
}

/* Phone: the panel becomes a bottom sheet so the map stays visible above it */
@media (max-width: 760px) {
  .atlas-legend { width: 100%; }
  .chip-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; margin: 0 -1.5rem; padding-inline: 1.5rem; scrollbar-width: none; }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .atlas-stage { height: 78vh; min-height: 480px; }
  .atlas-controls { left: 0.75rem; top: 0.75rem; }
  .atlas-count { left: 0.75rem; bottom: 0.6rem; }
  .atlas-stage.has-panel .atlas-count { display: none; }
  .atlas-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 58%;
    border-radius: 14px 14px 0 0; border-bottom: 0;
    animation-name: atlas-sheet-in;
  }
  .atlas-panel::before { content: ''; position: sticky; top: 0; display: block; width: 44px; height: 4px; margin: 8px auto -12px; border-radius: 4px; background: rgba(242, 237, 228, 0.3); z-index: 3; }
  .ap-media img { aspect-ratio: 5 / 2; object-position: center 30%; }
  .ap-media--type { aspect-ratio: 3 / 1; }
  .ap-media--type span { font-size: 2rem; }
  .ap-title { font-size: 2.1rem; }
  .ap-content { padding: 0.25rem 1.25rem 1.5rem; }
  .atlas-index-status { display: none; }
}
@keyframes atlas-sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .pin--now::after, .atlas-spinner { animation: none; }
  .atlas-panel { animation: none; }
}
