/* Shared shell — header/footer chrome, sidebar, map overlay, Pannellum
   overrides. One copy, used by every project. Per-project content (scene
   config, sidebar groups, map image/markers, header title/subtitle text)
   lives in that project's own tour.js/index.html — nothing in this file is
   project-specific. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow: hidden; }

:root {
  --white: #ffffff;
  --dark: #1c1c1c;
  --accent: #005baa;
  --accent-tint: #eef4fb;
  --muted: #666666;
  --border: #e0e0e0;
  --marker: #2e7d32;
  --marker-hover: #1b5e20;
  /* #sidebar, #map-view and #debug-tip all measure their own top/bottom
     offset against these two, rather than the viewport directly, so the
     footer/header can resize without hunting down every dependent rule. */
  --header-h: 56px;
  --footer-h: 22px;
}

body {
  background: var(--white);
  font-family: 'Lato', Arial, sans-serif;
  color: var(--dark);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  padding: 0 2rem;
  height: var(--header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  z-index: 50;
}

header .title-group {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  white-space: nowrap;
}

header h1 {
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--dark);
}

header span {
  font-size: 1.2rem;
  line-height: 1;
  color: var(--dark);
  letter-spacing: 0.02em;
  font-weight: 300;
}

header .spacer { flex: 1; }

header .ode-logo {
  height: 38px;
  width: auto;
  display: block;
}

/* Narrow viewports (phones): the single-row title + subtitle + logo no
   longer fit on one line, so stack the title and shrink both lines
   instead of letting the row overflow. */
@media (max-width: 600px) {
  header {
    padding: 0 1rem;
    gap: 0.5rem;
  }

  header .title-group {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.15rem;
  }

  header h1 {
    font-size: 1.15rem;
  }

  header span {
    font-size: 0.85rem;
  }
}

#panorama {
  flex: 1;
  width: 100%;
}

.pnlm-panorama-info {
  bottom: 12px !important;
}

.pnlm-title-box {
  font-family: 'Lato', Arial, sans-serif !important;
  padding: 8px 14px !important;
}
.pnlm-title {
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  display: block !important;
}
.pnlm-author { display: none !important; }

#sidebar {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: var(--footer-h);
  width: 220px;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

#sidebar.collapsed {
  transform: translateX(220px);
}

#sidebar-inner {
  height: 100%;
  background: var(--white);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

#sidebar-list {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#sidebar-tab {
  position: absolute;
  top: min(72px, calc(100% - 60px));
  right: 100%;
  width: 30px;
  height: 60px;
  border: 1px solid #c9ccd0;
  border-right: 0;
  border-radius: 6px 0 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--dark);
  cursor: pointer;
  appearance: none;
  padding: 0;
  pointer-events: auto;
}

#sidebar-tab:hover { background: #f5f6f7; }

#sidebar-tab svg {
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

#sidebar.collapsed #sidebar-tab svg {
  transform: rotate(180deg);
}

.scene-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
}

.scene-item:hover { background: #f5f5f5; }

.scene-item.active {
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 600;
}

.scene-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.scene-item.active .scene-dot { background: var(--accent); }

.scene-group-header {
  padding: 10px 16px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f9f9f9;
  border-bottom: 1px solid var(--border);
}

#debug-tip {
  position: fixed;
  bottom: calc(var(--footer-h) + 20px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,28,0.85);
  color: #fff;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 4px;
  z-index: 300;
  pointer-events: none;
  display: none;
  letter-spacing: 0.03em;
}

#map-view {
  position: fixed;
  top: var(--header-h); left: 0; right: 0; bottom: var(--footer-h);
  background: var(--white);
  display: none;
  z-index: 10;
  overflow: hidden;
  cursor: grab;
}
#map-view.visible { display: block; }
#map-view:active  { cursor: grabbing; }

#map-inner {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
}

#map-img {
  display: block;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 9px 20px;
  font-family: 'Lato', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  pointer-events: auto;
}
.map-marker:hover { filter: brightness(0.85); }

/* Marker variants — opt in per marker via `cssClass: 'map-marker--green'` etc.
   in a project's tour.js. `--green` is the original marker color, kept as a
   variant for ebenfurth/ rather than the default. No dedicated hover token
   for these (unlike --accent, which is the default), so hover darkens via
   filter instead of a second color. */
.map-marker--green { background: var(--marker); }
.map-marker--green:hover { background: var(--marker-hover); }
.map-marker--muted { background: var(--muted); }
.map-marker--muted:hover { filter: brightness(0.85); }

/* Legal notice — always on screen on the outer page, independent of
   sidebar/map state, so it never depends on the visitor opening
   anything. Dedicated layout space (not an overlay), so it can't cover
   Pannellum's own bottom-anchored zoom/fullscreen controls or the
   panorama title box. Three-column layout mirrors ode.or.at's own site
   footer: copyright / legal / contact. Fixed height (not padding-driven)
   because #sidebar, #map-view and #debug-tip all measure their own
   bottom offset against --footer-h. */
footer {
  flex-shrink: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--white);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 50;
}
footer nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
footer a {
  color: var(--muted);
  text-decoration: none;
}
footer a:hover {
  color: var(--dark);
  text-decoration: underline;
}

@media (max-width: 600px) {
  footer {
    padding: 0 0.75rem;
    gap: 6px;
    font-size: 8px;
  }
}
