/* ============================================================
   Redwater & District Museum — Virtual Museum Styles
   ============================================================ */

/* ---------- Virtual Museum Hero ---------- */
.vm-hero {
  position: relative;
  min-height: 46vh;
  display: flex; align-items: center;
  background:
    url('../img/banner.jpg') center / cover no-repeat,
    linear-gradient(160deg, #050805, #0e1f12 45%, #123320);
  color: #fff;
}
.vm-hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(11, 13, 11, 0.78), rgba(11, 13, 11, 0.35)),
    linear-gradient(to bottom, rgba(11, 13, 11, 0.15), rgba(11, 13, 11, 0.55));
}
.vm-hero-content { position: relative; padding: 70px 20px; max-width: 760px; }
.vm-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 14px; color: #f2f7f3;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.vm-hero p { font-size: 1.1rem; opacity: 0.95; max-width: 600px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }

/* ---------- Mode Tabs ---------- */
.vm-modes { background: var(--bg-card); border-bottom: 1px solid var(--line); padding: 18px 0; }
.vm-tabs { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.vm-tab {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 12px 24px; font-family: var(--font-body); font-size: 0.98rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.vm-tab:hover { border-color: var(--green); }
.vm-tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.vm-tab-icon { font-size: 1.1rem; }

.vm-section { padding: 70px 0; }
.vm-panel-head { text-align: center; max-width: 680px; margin: 0 auto 42px; }
.vm-panel-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin-bottom: 12px; }
.vm-panel-head p:not(.eyebrow) { color: var(--muted); }

/* ---------- Gallery Filters ---------- */
.vm-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 34px; }
.vm-chip {
  background: var(--bg-surface); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 18px; font-family: var(--font-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; transition: all 0.15s ease;
}
.vm-chip:hover { color: var(--ink); border-color: var(--green); }
.vm-chip.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- Gallery Grid ---------- */
.vm-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.vm-photo {
  position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #0e110e; padding: 0; cursor: pointer; aspect-ratio: 4 / 3;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.vm-photo:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55); border-color: var(--green); }
.vm-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vm-photo-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  color: #fff; font-size: 0.82rem; font-weight: 600; text-align: left;
}

/* ---------- Tour: Hall ---------- */
.tour-hall { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.tour-room-card {
  text-align: left; background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; cursor: pointer; padding: 0;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.tour-room-card:hover { transform: translateY(-5px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6); border-color: var(--room-color, var(--green)); }
.tour-room-img { height: 160px; background: #0e110e; display: block; overflow: hidden; }
.tour-room-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tour-room-body { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.tour-room-cat {
  align-self: flex-start; font-size: 0.7rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent); background: rgba(46, 125, 63, 0.2);
  padding: 3px 10px; border-radius: 999px;
}
.tour-room-body strong { font-family: var(--font-display); font-size: 1.15rem; color: #f2f7f3; }
.tour-room-meta { font-size: 0.82rem; color: var(--muted); }

/* ---------- Tour: Room Viewer ---------- */
.tour-viewer {
  position: fixed; inset: 0; background: rgba(5, 8, 5, 0.97); z-index: 120;
  display: flex; flex-direction: column; padding: 20px;
}
.tour-viewer[hidden] { display: none; }
.tour-room-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.tour-back { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 8px 16px; cursor: pointer; font-family: var(--font-body); }
.tour-back:hover { border-color: var(--accent); color: var(--accent); }
.tour-room-title { font-family: var(--font-display); font-size: 1.4rem; color: #f2f7f3; }
.tour-close {
  position: absolute; top: 14px; right: 20px; background: none; border: none;
  font-size: 2.2rem; color: var(--muted); cursor: pointer; line-height: 1; z-index: 5;
}
.tour-close:hover { color: var(--accent); }
.tour-stage { display: flex; align-items: center; justify-content: center; gap: 14px; flex: 1; min-height: 0; }
.tour-frame { flex: 1; max-width: 900px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.tour-frame img { max-width: 100%; max-height: 62vh; width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.tour-frame figcaption { color: var(--muted); font-style: italic; text-align: center; margin-top: 14px; max-width: 760px; }
.tour-nav {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.tour-nav:hover { background: var(--green); color: #fff; }
.tour-nav:disabled { opacity: 0.25; cursor: default; }
.tour-progress { display: flex; gap: 8px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
.tour-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); cursor: pointer; transition: background 0.15s ease, transform 0.15s ease; }
.tour-dot:hover { background: rgba(255, 255, 255, 0.4); }
.tour-dot.active { background: var(--accent); transform: scale(1.25); }
.tour-room-nav { display: flex; justify-content: space-between; gap: 12px; }

/* ---------- Timeline ---------- */
.vm-timeline { position: relative; max-width: 760px; margin: 0 auto; padding-left: 24px; }
.vm-timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(to bottom, var(--green), var(--green-deep));
  border-radius: 3px;
}
.tl-item { position: relative; margin-bottom: 34px; }
.tl-marker {
  position: absolute; left: -24px; top: 6px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--bg-surface); border: 3px solid var(--accent); box-shadow: 0 0 0 4px rgba(94, 222, 131, 0.15);
}
.tl-marker span {
  position: absolute; left: 30px; top: -2px; white-space: nowrap;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent);
}
.tl-card {
  background: var(--bg-surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 26px 28px; box-shadow: var(--shadow); margin-top: 8px;
  transition: border-color 0.2s ease;
}
.tl-card:hover { border-color: var(--green); }
.tl-card h3 { font-size: 1.35rem; margin-bottom: 10px; color: #f2f7f3; }
.tl-card p { color: var(--muted); margin-bottom: 16px; }
.tl-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tl-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); transition: transform 0.15s ease; }
.tl-photos img:hover { transform: scale(1.03); }

/* ---------- Lightbox ---------- */
.vm-lightbox {
  position: fixed; inset: 0; background: rgba(3, 5, 3, 0.97); z-index: 130;
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 20px;
}
.vm-lightbox[hidden] { display: none; }
.lightbox-frame { flex: 1; max-width: 1000px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.lightbox-frame img { max-width: 100%; max-height: 76vh; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.lightbox-frame figcaption { color: var(--muted); font-style: italic; text-align: center; margin-top: 14px; max-width: 800px; }
.lightbox-counter { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 0.9rem; }
.lightbox-prev { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Walkthrough ---------- */
.walk-wrap {
  position: relative; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; background: #060906; box-shadow: var(--shadow);
}
.walk-canvas {
  width: 100%; height: 62vh; min-height: 380px; cursor: grab; outline: none; position: relative;
}
.walk-canvas canvas { display: block; width: 100%; height: 100%; }
.walk-hud {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; z-index: 5;
  background: rgba(11, 13, 11, 0.8); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 12px; max-width: 92%;
}
.walk-room-label {
  font-family: var(--font-display); font-size: 0.95rem; color: #f2f7f3;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw;
}
.walk-btn {
  background: var(--green); color: #fff; border: none; border-radius: 999px;
  padding: 7px 14px; font-family: var(--font-body); font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease;
}
.walk-btn:hover { background: var(--accent); color: #0b0d0b; }
.walk-controls {
  position: absolute; right: 18px; bottom: 18px; z-index: 5;
  display: none; flex-direction: column; gap: 10px; align-items: center;
}
.walk-dpad {
  display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(2, 52px);
  gap: 8px; justify-items: center; align-items: center;
}
.wc-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(21, 24, 21, 0.85); color: var(--ink); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); touch-action: none;
}
.wc-btn:active { background: var(--green); color: #fff; }
.walk-dpad .wc-btn[data-dir="forward"] { grid-column: 2; grid-row: 1; }
.walk-dpad .wc-btn[data-dir="left"]   { grid-column: 1; grid-row: 2; }
.walk-dpad .wc-btn[data-dir="backward"]{ grid-column: 2; grid-row: 2; }
.walk-dpad .wc-btn[data-dir="right"]  { grid-column: 3; grid-row: 2; }
.walk-tip {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 5; font-size: 0.78rem; color: var(--muted);
  background: rgba(11, 13, 11, 0.75); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px; white-space: nowrap; max-width: 94%; overflow: hidden; text-overflow: ellipsis;
}
.walk-toast {
  position: absolute; top: 70px; left: 50%; transform: translateX(-50%); z-index: 6;
  background: var(--green); color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.walk-note { text-align: center; color: var(--muted); margin-top: 16px; font-size: 0.9rem; }
.walk-note a { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .vm-hero { min-height: 40vh; }
  .vm-hero-content { padding: 50px 16px; }
  .vm-section { padding: 50px 0; }
  .vm-tabs { flex-direction: column; align-items: stretch; }
  .vm-tab { justify-content: center; }

  .vm-gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .vm-photo { aspect-ratio: 4 / 3; }
  .vm-filters { gap: 8px; margin-bottom: 26px; }
  .vm-chip { padding: 7px 14px; font-size: 0.82rem; }

  .tour-hall { grid-template-columns: 1fr; gap: 16px; }
  .tour-viewer { padding: 12px; }
  .tour-close { top: 10px; right: 14px; }
  .tour-room-head { gap: 10px; }
  .tour-room-title { font-size: 1.1rem; }
  .tour-stage { flex-direction: column; gap: 10px; }
  .tour-frame img { max-height: 52vh; }
  .tour-nav { width: 44px; height: 44px; font-size: 1rem; }
  .tour-prev, .tour-next { position: static; }
  .tour-progress { margin: 10px 0; }
  .tour-room-nav { flex-wrap: wrap; justify-content: center; gap: 8px; }

  .vm-timeline { padding-left: 18px; }
  .vm-timeline::before { left: 6px; }
  .tl-item { margin-bottom: 28px; }
  .tl-marker { left: -18px; width: 15px; height: 15px; top: 8px; }
  .tl-marker span {
    position: static; display: inline-block; margin: 0 0 8px 26px;
    white-space: normal; font-size: 0.72rem;
  }
  .tl-card { padding: 20px 18px; margin-top: 4px; }
  .tl-card h3 { font-size: 1.2rem; }
  .tl-photos { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  .lightbox-frame img { max-height: 62vh; }
  .lightbox-prev { left: 6px; top: auto; bottom: 70px; transform: none; }
  .lightbox-next { right: 6px; top: auto; bottom: 70px; transform: none; }
  .lightbox-counter { bottom: 14px; }

  .walk-canvas { height: 52vh; min-height: 320px; }
  .walk-hud { top: 10px; padding: 6px 10px; }
  .walk-room-label { font-size: 0.82rem; max-width: 40vw; }
  .walk-btn { padding: 6px 10px; font-size: 0.75rem; }
  .walk-controls { right: 10px; bottom: 10px; }
  .walk-tip { font-size: 0.7rem; padding: 5px 10px; bottom: 10px; }
}

/* Small phones */
@media (max-width: 400px) {
  .vm-gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .vm-photo-cap { font-size: 0.72rem; padding: 14px 8px 6px; }
  .tl-photos { grid-template-columns: 1fr 1fr; }
}
