/* =========================================================
   Haus Schieferstein – 360°-Rundgang (Pannellum-Integration)
   Nutzt die Custom Properties aus style.css
   ========================================================= */

.tour {
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.tour-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  background: var(--color-brown-dark);
  overflow: hidden;
}

.tour-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease, opacity 0.4s ease;
}

.tour:not(.is-active) .tour-stage:hover .tour-poster { transform: scale(1.04); }

.tour-start {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  background: linear-gradient(to top, rgba(30, 18, 6, 0.55), rgba(30, 18, 6, 0.15));
  color: var(--color-creme);
  transition: background var(--transition);
}

.tour-start:hover { background: linear-gradient(to top, rgba(30, 18, 6, 0.62), rgba(30, 18, 6, 0.25)); }
.tour-start:focus-visible { outline: 3px solid var(--color-copper-light); outline-offset: -3px; }

.tour-start-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid rgba(245, 240, 232, 0.85);
  background: rgba(156, 96, 53, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 0 10px rgba(245, 240, 232, 0.18);
  transition: transform var(--transition), box-shadow var(--transition);
}

.tour-start:hover .tour-start-icon {
  transform: scale(1.06);
  box-shadow: 0 0 0 16px rgba(245, 240, 232, 0.12);
}

.tour-start-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tour-start-hint {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  opacity: 0.85;
}

.tour-viewer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.tour.is-active .tour-start,
.tour.is-active .tour-poster { display: none; }

.tour-caption {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  padding: 7px 14px;
  border-radius: 2px;
  background: rgba(30, 18, 6, 0.65);
  color: var(--color-creme);
  font-family: var(--font-serif);
  font-size: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.tour.is-active .tour-caption { opacity: 1; }

/* Szenen-Leiste */
.tour-scenes {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-top: 1px solid rgba(107, 76, 42, 0.15);
  scrollbar-width: thin;
}

.tour-scene {
  flex: 1 0 auto;
  min-width: 150px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-right: 1px solid rgba(107, 76, 42, 0.12);
  color: var(--color-text);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.tour-scene:last-child { border-right: 0; }
.tour-scene:hover { background: rgba(156, 96, 53, 0.08); }
.tour-scene:focus-visible { outline: 2px solid var(--color-copper); outline-offset: -2px; }
.tour-scene.is-current { background: var(--color-brown-dark); color: var(--color-creme); }

.tour-scene img {
  width: 56px;
  height: 36px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Pannellum-Anpassungen */
.tour .pnlm-container { font-family: var(--font-sans); background: var(--color-brown-dark); }
.tour .pnlm-load-box { background: rgba(30, 18, 6, 0.75); border-radius: var(--radius); font-family: var(--font-sans); }
.tour .pnlm-load-box p { font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; }
.tour .pnlm-lbar { border-color: var(--color-creme); }
.tour .pnlm-lbar-fill { background: var(--color-copper-light); }
.tour .pnlm-panorama-info { display: none !important; }
.tour .pnlm-controls { border-color: rgba(30, 18, 6, 0.4); }
.tour .pnlm-control { background-color: rgba(245, 240, 232, 0.9); }
.tour .pnlm-control:hover { background-color: var(--color-white); }
.tour .pnlm-tooltip span {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background: var(--color-brown-dark);
  border-radius: 2px;
  padding: 6px 12px;
  white-space: nowrap;
}
.tour .pnlm-tooltip span::after { border-top-color: var(--color-brown-dark); }

.tour-hs {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--color-creme);
  background: rgba(156, 96, 53, 0.88);
  box-shadow: 0 0 0 6px rgba(245, 240, 232, 0.25);
  cursor: pointer;
  animation: tour-pulse 2.6s ease-in-out infinite;
}

.tour-hs::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border-top: 3px solid var(--color-creme);
  border-right: 3px solid var(--color-creme);
  transform: translate(-62%, -42%) rotate(45deg);
}

@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(245, 240, 232, 0.25); }
  50%      { box-shadow: 0 0 0 13px rgba(245, 240, 232, 0.08); }
}

@media (prefers-reduced-motion: reduce) {
  .tour-hs { animation: none; }
  .tour-poster { transition: none; }
}

/* Rundgang-Karten (Galerie / Startseite) */
.tour-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.tour-card {
  position: relative;
  display: block;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 16 / 10;
  background: var(--color-brown-dark);
}

.tour-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.tour-card:hover img { transform: scale(1.05); }

.tour-card-body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 48px 20px 18px;
  background: linear-gradient(to top, rgba(30, 18, 6, 0.85), rgba(30, 18, 6, 0));
  color: var(--color-creme);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.tour-card-body h3 { color: var(--color-creme); font-size: 1.15rem; margin: 0; }
.tour-card-body small { display: block; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; margin-bottom: 4px; }

.tour-card-badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(245, 240, 232, 0.8);
  background: rgba(156, 96, 53, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

@media (min-width: 768px) {
  .tour-cards { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .tour-cards.tour-cards-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Auf dem Handy etwas höher, damit der Rundgang nicht zum Briefschlitz wird */
@media (max-width: 767px) {
  .tour-stage { aspect-ratio: 4 / 3; }
  .tour-scene { min-width: 130px; font-size: 0.82rem; }
}

/* Galerie-Raster: grosses erstes Bild exakt so hoch wie zwei Reihen,
   damit keine Luecken rechts entstehen (Hochformat-/4:3-Fotos) */
@media (min-width: 768px) {
  .gallery-item:first-child { min-height: 240px; }
  .gallery-item:first-child img { position: absolute; inset: 0; width: 100%; height: 100%; }
}

/* Handy (2 Spalten, erstes Bild volle Breite): letztes Bild nicht allein in der Zeile */
@media (max-width: 767px) {
  .gallery-grid .gallery-item:last-child:nth-child(even) { grid-column: span 2; }
  .gallery-grid .gallery-item:last-child:nth-child(even) img { height: 260px; }
}

/* Einzelfoto in Seiten ohne Bildbereich (Kontakt/Anfahrt, Jobs) */
.anfahrt-foto { margin: 0 0 32px; }
.anfahrt-foto img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
}
.anfahrt-foto figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}
@media (max-width: 767px) { .anfahrt-foto img { height: 240px; } }

/* F-21: Szenenleiste auf schmalen Displays umbrechen statt abschneiden (Audit 30.09.2026) */
@media (max-width: 480px) {
  .tour-scenes { flex-wrap: wrap; overflow-x: visible; }
  .tour-scene {
    flex: 1 1 40%;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 10px 6px;
    text-align: center;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(107, 76, 42, 0.12);
  }
  .tour-scene img { width: 64px; height: 40px; }
}
