/* Site-wide branding, driven by Settings > Appearance. Colors come from
   /css/theme.css, a Bootstrap build compiled server-side from the admin's chosen
   theme (see src/services/themeBuilder.js) — every Bootstrap component already
   picks up the right palette and dark-mode variant, so only font vars live here. */
body {
  font-family: var(--site-font-family, inherit);
  font-size: var(--site-font-size, 1rem);
}

.navbar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

/* Responsive image containers: keep a consistent, non-panoramic ratio at
   every viewport instead of clipping a fixed pixel height off tall photos. */
.site-banner {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 576px) {
  .site-banner {
    aspect-ratio: 4 / 3;
  }
}

/* When .site-banner sits on a Bootstrap carousel wrapper (carousel/news-slider
   banner modes) rather than directly on an <img>, the ratio has to be pushed
   down onto each slide's image instead of the wrapper itself. */
.site-banner.carousel {
  aspect-ratio: auto;
}

.site-banner.carousel .carousel-item img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 576px) {
  .site-banner.carousel .carousel-item img {
    aspect-ratio: 4 / 3;
  }
}

.news-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

.news-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-tertiary-bg);
  color: var(--bs-secondary-color);
}

.news-card-placeholder svg {
  width: 20%;
  height: 20%;
}

/* Page/News photo gallery — thumbnail grid + click-to-enlarge lightbox
   (public/js/media-lightbox.js). Same aspect-ratio/object-fit treatment as
   .news-card-thumb so mixed-orientation uploads crop consistently. */
.media-gallery-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
}

.media-gallery-thumb-btn {
  cursor: zoom-in;
}

.media-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  padding: 2rem;
}

body.media-lightbox-open {
  overflow: hidden;
}

.media-lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.media-lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 0.375rem;
}

.media-lightbox-caption {
  color: #fff;
  margin-top: 0.75rem;
}

.media-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
