/* ArchWorld scene carousel + point cloud viewer */

.aw-scenes {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 1rem;
  margin: 1.5rem 0 0.75rem;
  /* Break out of the narrow text column: up to 1200px wide, centered on the
     column, but never wider than the viewport minus a 16px gutter each side. */
  box-sizing: border-box;
  width: min(1200px, calc(100vw - 32px));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* Region slider */
.aw-region-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.aw-region-arrow { flex: none; }
.aw-region-track {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.aw-region-track::-webkit-scrollbar { display: none; }
.aw-region {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  border: none;
  background: none;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #4b5563;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s;
}
.aw-region:hover { color: #1f2937; }
.aw-region.is-active { color: #fff; font-weight: 600; }
.aw-region-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: 999px;
  background: #363636;   /* same as the Paper/Code/arXiv buttons (Bulma .button.is-dark) */
  transition: transform 0.3s ease, width 0.3s ease;
}

/* Scene title + candidate chips */
.aw-scene-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.aw-scene-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #1f2937;
}
.aw-candidates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
}
.aw-candidates-label { color: #9ca3af; margin-right: 0.15rem; }
.aw-chip {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  color: #4b5563;
  cursor: pointer;
}
.aw-chip:hover { border-color: #9ca3af; }
.aw-chip.is-active {
  border-color: #1f2937;
  background: #1f2937;
  color: #fff;
}

/* Layout */
.aw-scene-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
  gap: 1rem;
}
@media (max-width: 768px) {
  .aw-scene-grid { grid-template-columns: 1fr; }
}

/* Viewer */
.aw-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f4;
}
@media (max-width: 768px) {
  .aw-viewer { aspect-ratio: 4 / 3; }
}
.aw-viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
.aw-viewer-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 0.9rem;
  pointer-events: none;
}
.aw-viewer-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.aw-measure-label {
  position: absolute;
  left: 0;
  top: 0;
  background: #dc2626;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.aw-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.aw-viewer-toolbar .button.is-active {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.aw-viewer-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.4rem;
}

/* Metadata */
.aw-meta {
  width: 100%;
  font-size: 0.88rem;
  border-collapse: collapse;
}
.aw-meta th,
.aw-meta td {
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
  text-align: left;
}
.aw-meta th {
  color: #6b7280;
  font-weight: 500;
  width: 45%;
}
.aw-meta td { color: #1f2937; font-weight: 600; }
.aw-meta-sub { font-weight: 400; font-size: 0.75rem; }

.aw-readout {
  margin-top: 1rem;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}
.aw-readout-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 0.3rem;
}
.aw-readout ol { list-style: none; margin: 0 !important; padding: 0; }
.aw-readout li {
  display: flex;
  justify-content: space-between;
  margin: 0 !important;
  font-variant-numeric: tabular-nums;
}
.aw-readout li strong { color: #dc2626; }
.aw-muted { color: #9ca3af; }

/* Photos */
.aw-thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}
@media (max-width: 768px) {
  .aw-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.aw-thumb {
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
}
.aw-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.aw-thumb:hover img { transform: scale(1.05); }

.aw-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  padding: 1rem;
}
.aw-lightbox.is-open { display: flex; }
.aw-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
}

/* Before-segmentation / landmark-only slider switch */
.aw-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-right: 0.6rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.8rem;
}
.aw-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.aw-switch-label { color: #9ca3af; transition: color 0.15s; }
.aw-switch-label.is-active { color: #1f2937; font-weight: 600; }
.aw-switch-track {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 10px;
  background: #d1d5db;
  transition: background 0.15s;
  flex: none;
}
.aw-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.aw-switch input:checked + .aw-switch-track { background: #1f2937; }
.aw-switch input:checked + .aw-switch-track .aw-switch-thumb { transform: translateX(18px); }
.aw-switch input:focus-visible + .aw-switch-track { outline: 2px solid #9a3412; outline-offset: 2px; }


/* Extent box */
.aw-extent-label { background: #2563eb; }
.aw-viewer-toolbar .aw-box-btn.is-active { background: #2563eb; border-color: #2563eb; color: #fff; }

/* Paragraph under the carousel: normal body text, with room before the next section */
.aw-scenes-text { margin-top: 1rem; margin-bottom: 3rem !important; }
