/* v5-ssr scope: reference gallery, lightbox & legal readability (unified font stack). */
:root {
  --fb5-blue: #24458c;
  --fb5-dark: #162b60;
  --fb5-sand: #c7a082;
  --fb5-ink: #162330;
  --fb5-font: Lato, 'Segoe UI', Arial, Helvetica, sans-serif;
}

html.fb-v5,
html.fb-v5 body {
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--fb5-font);
  color: var(--fb5-ink);
}

html.fb-v5 main :is(h1, h2, h3, h4) {
  font-family: var(--fb5-font) !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.22;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

html.fb-v5 main :is(p, li) {
  line-height: 1.66;
}

html.fb-v5-legal main {
  background: #fff;
}

html.fb-v5-legal main :is(p, li, dd) {
  overflow-wrap: anywhere;
}

/* Server-rendered, accessible gallery with large photos and no visible captions */
.fb-gallery {
  background: #fff;
  color: var(--fb5-ink);
  padding: 20px 0 28px !important;
  width: 100%;
  box-sizing: border-box;
}

.fb-gallery *,
.fb-gallery *::before,
.fb-gallery *::after {
  box-sizing: border-box;
}

.fb-gallery-heading {
  text-align: left;
  margin-bottom: 22px;
}

.fb-gallery-heading .fb-gallery-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--fb5-blue);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.fb-gallery-heading h2 {
  margin: 0 0 8px !important;
  color: var(--fb5-blue) !important;
  font: 700 clamp(23px, 2.6vw, 36px)/1.2 var(--fb5-font) !important;
}

.fb-gallery-heading h2::after {
  display: none !important;
  content: none !important;
}

.fb-gallery-heading > p:last-child {
  margin: 0;
  color: #475569;
  font-size: 15px;
}

.fb-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.9vw, 24px);
  margin-top: 22px;
}

.fb-gallery-item {
  margin: 0;
  padding: 0;
  min-width: 0;
}

.fb-gallery-item a {
  display: block;
  border-radius: 4px;
  overflow: hidden;
  background: #e7edf3;
  aspect-ratio: 4 / 3;
  outline-offset: 3px;
}

.fb-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.22s ease;
}

.fb-gallery-item a:hover img {
  transform: scale(1.03);
}

.fb-gallery-item a:focus-visible {
  outline: 3px solid var(--fb5-blue);
}

.fb-v5-lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  max-width: 95vw;
  max-height: 95dvh;
}

.fb-v5-lightbox::backdrop {
  background: rgba(9, 16, 28, 0.92);
}

.fb-v5-lightbox-surface {
  width: min(95vw, 1200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
}

.fb-v5-lightbox img {
  width: auto;
  max-width: 100%;
  max-height: 76dvh;
  object-fit: contain;
}

.fb-v5-lightbox button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 5px;
  font: 700 18px/1 var(--fb5-font);
  cursor: pointer;
}

.fb-v5-lightbox button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.fb-v5-lightbox-close {
  align-self: flex-end;
  font-size: 14px !important;
  padding: 7px 14px;
}

.fb-v5-lightbox-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  width: 100%;
  padding: 10px 0;
}

.fb-v5-lightbox-caption {
  margin: 0;
  max-width: 80%;
  font-size: 13px;
  text-align: center;
  line-height: 1.35;
}

.fb-v5-contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.fb-v5-contact-link:hover {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .fb-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .fb-gallery-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .fb-gallery-item a {
    aspect-ratio: 16 / 10;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fb-gallery-item img {
    transition: none !important;
  }
}
