/* Course photographs supplied by Royal Tactical. */
.course-gallery-section {
  background: #17191d;
  color: #fff;
  scroll-margin-top: 24px;
}
.gallery-heading { margin-bottom: 36px; }
.gallery-heading .eyebrow { color: #c8b779; font-size: 14px; }
.gallery-heading h2 { color: #fff; }
.gallery-heading .heading-description,
.gallery-intro { color: #c9cdd2; font-size: 16px; line-height: 1.75; }
.course-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 20px;
}
.course-gallery-card { min-width: 0; margin: 0; }
.course-gallery-card[hidden] { display: none; }
.course-gallery-card > a {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 5px;
  background: #292c31;
}
.course-gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.course-gallery-card > a:hover img { transform: scale(1.025); }
.course-gallery-card > a:focus-visible,
.gallery-toggle:focus-visible,
.photo-dialog button:focus-visible { outline: 3px solid #d6c487; outline-offset: 5px; }
.course-gallery-card figcaption { padding-top: 12px; font-size: 14px; line-height: 1.5; color: #e4e6e8; }
.course-gallery-card figcaption strong { display: block; font-weight: 500; }
.course-gallery-card figcaption span { display: block; margin-top: 3px; color: #b5bdc7; font-size: 14px; }
.gallery-enlarge { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid #ffffff80; border-radius: 3px; background: #17191de6; color: #fff; font-size: 14px; line-height: 1.4; }
.gallery-enlarge svg { width: 18px; height: 18px; }
.course-gallery-card .photo-expand { width: 38px; height: 38px; border-color: #ffffffb3; }
.gallery-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 34px; }
#gallery-count { margin: 0; color: #c9cdd2; font-size: 14px; }
.gallery-toggle {
  min-height: 48px;
  border: 1px solid #ddd5bc;
  border-radius: 3px;
  padding: 12px 24px;
  background: #f5f1e7;
  color: #17191d;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.gallery-toggle:hover { background: #e5ddc7; }
.gallery-toggle[hidden] { display: none; }
html.photo-open { overflow: hidden; }
.photo-dialog {
  width: min(980px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  padding: 16px 20px 20px;
  border-radius: 6px;
  background: #17191d;
  color: #f5f6f8;
}
.photo-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.photo-dialog .photo-position { margin: 0; color: #c9cdd2; font-size: 14px; }
.photo-dialog .dialog-close {
  position: static;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #78818c;
  border-radius: 3px;
  background: #292d34;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.photo-dialog > img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 250px);
  object-fit: contain;
  margin: 0 auto;
  touch-action: pan-y pinch-zoom;
}
.photo-navigation { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
.photo-navigation[hidden] { display: none; }
.photo-navigation button {
  min-width: 110px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #78818c;
  border-radius: 3px;
  background: #292d34;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.photo-navigation button:hover, .photo-dialog .dialog-close:hover { background: #3a414b; }
.photo-dialog #photo-caption { max-width: 800px; margin: 16px auto 0; color: #d1d7df; font-size: 14px; line-height: 1.6; }
@media (max-width: 940px) {
  .course-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 18px; }
}
@media (max-width: 600px) {
  .gallery-heading { margin-bottom: 28px; }
  .gallery-heading .eyebrow { font-size: 14px; }
  .gallery-heading .heading-description { margin-top: 20px; }
  .course-gallery-grid { gap: 24px 12px; }
  .course-gallery-card figcaption { font-size: 14px; }
  .course-gallery-card .photo-expand { width: 30px; height: 30px; right: 8px; bottom: 8px; }
  .photo-dialog { padding: 12px; width: calc(100vw - 20px); max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .photo-dialog > img { max-height: calc(100dvh - 260px); }
  .photo-dialog #photo-caption { margin-top: 12px; }
  .photo-navigation { gap: 12px; margin-top: 12px; }
  .photo-navigation button { min-width: 0; flex: 1; }
  .gallery-toggle { width: 100%; max-width: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  .course-gallery-card img { transition: none; }
}
