html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
/* 360° orbit viewer */
.plot-orbit-viewer {
  position: relative;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  background: #f0f0f0;
}

.plot-orbit-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y; /* allow vertical page scroll; we handle horizontal drag */
  -webkit-user-select: none;
  user-select: none;
}

.plot-orbit-stage:active {
  cursor: grabbing;
}

.plot-orbit-frame {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

.plot-orbit-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem;
  border-radius: 1rem;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.plot-orbit-viewer.interacted .plot-orbit-hint {
  opacity: 0;
}

.plot-orbit-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
}

.plot-orbit-progress-bar {
  height: 100%;
  width: 0%;
  background: #007bff;
  transition: width 200ms ease;
}

/* Progress bar fades out only once every frame has settled (100%), so the user can watch it fill.
   Interaction itself is gated separately by the .ready class (added at 12 frames). */
.plot-orbit-viewer.loaded .plot-orbit-progress {
  opacity: 0;
  transition: opacity 500ms ease;
}

/* Public /plots list/map toggle + marker popup */
.plots-view-toggle {
  margin-bottom: 1rem;
}

.plots-map-popup-thumb {
  display: block;
  width: 120px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 0.25rem;
  margin-bottom: 4px;
}

.plots-map-popup-placeholder {
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 0.75rem;
}

.plots-map-popup-body {
  font-size: 0.875rem;
  line-height: 1.3;
}

.plots-map-popup-body > * {
  margin-bottom: 2px;
}

/* Public plot gallery — thumbnail grid + lightbox */
.plot-gallery {
  margin: 1.5rem 0;
}
.plot-gallery h3 {
  margin-bottom: 0.75rem;
}
.plot-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.plot-gallery-thumb {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  border-radius: 0.375rem;
  aspect-ratio: 1 / 1;
  display: block;
  width: 100%;
}
.plot-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 200ms ease;
}
.plot-gallery-thumb:hover img {
  transform: scale(1.03);
}

.plot-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1080; /* above Bootstrap modal-backdrop default; well above nav */
  align-items: center;
  justify-content: center;
}
.plot-lightbox.open {
  display: flex;
}
.plot-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}
.plot-lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plot-lightbox button:hover {
  background: rgba(255, 255, 255, 0.3);
}
.plot-lightbox-close {
  top: 16px;
  right: 16px;
}
.plot-lightbox-prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.plot-lightbox-next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.plot-lightbox-caption {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.875rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
}

body.lightbox-open {
  overflow: hidden;
}
