/* Original event photography and the leader composition. Load after styles.css. */

.leader-card {
  overflow: hidden;
  width: 100%;
  background: #fff;
  border: 1px solid #e6e3d9;
  border-radius: 22px;
  box-shadow: 0 18px 44px #26372b12;
}

.leader-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--cream);
}

img.leader-composition {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 800 / 650;
  object-fit: contain;
}

.leader-context-label {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1;
  max-width: calc(100% - 40px);
  padding: 7px 12px;
  border: 1px solid #dce4d9;
  border-radius: 6px;
  background: #fffef9f5;
  color: #315243;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.leader-nameplate {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px 21px;
  border-top: 1px solid #e3e9df;
  background: #fff;
}

.leader-nameplate strong {
  display: block;
  color: var(--ink);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.7px;
  line-height: 1.3;
}

.leader-nameplate span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.leader-nameplate a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  border: 1px solid #e2e6de;
  border-radius: 50%;
  color: var(--red);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.leader-nameplate a .icon { width: 18px; height: 18px; }

.event-gallery-section {
  background: #fff;
  border-top: 1px solid var(--line);
}

.event-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.event-gallery-card {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-width: 0;
  min-height: 400px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 18px;
  background: #203b31;
  color: #fff;
  box-shadow: 0 10px 28px #16372612;
}

.event-gallery-card > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .45s ease;
}

.gallery-image-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #11271b00 12%, #11271b24 36%, #11271bf0 79%, #11271b 100%);
  pointer-events: none;
}

.gallery-expand {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #ffffff70;
  border-radius: 50%;
  background: #173225db;
  color: #fff;
  pointer-events: none;
  transition: background .2s ease;
}

.gallery-expand .icon { width: 22px; height: 22px; }

.gallery-image-caption {
  position: relative;
  min-width: 0;
  padding: 85px 30px 29px;
}

.gallery-image-caption > span {
  display: block;
  margin-bottom: 11px;
  color: #e6eddf;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.7;
}

.gallery-image-caption h3 {
  max-width: 480px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.65px;
  line-height: 1.3;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.gallery-image-caption p {
  max-width: 500px;
  margin-top: 11px;
  color: #edf2e9;
  font-size: 17px;
  line-height: 1.75;
}

.event-gallery-card:focus-visible {
  outline: 4px solid #1688c8;
  outline-offset: 5px;
}

.event-gallery-card:focus-visible .gallery-expand { background: var(--red); }

@media (hover: hover) and (pointer: fine) {
  .event-gallery-card:hover > img { transform: scale(1.025); }
  .event-gallery-card:hover .gallery-expand { background: var(--red); }
}

.event-gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  margin-top: 30px;
}

.event-gallery-footer p {
  max-width: 700px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.event-gallery-footer .text-link {
  flex-shrink: 0;
  min-height: 44px;
  color: var(--red);
  font-size: 17px;
}

/* Native dialog: controls remain outside the uncropped original photograph. */
.photo-dialog {
  width: min(1200px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #ffffff24;
  border-radius: 18px;
  background: #111f19;
  color: #fff;
  box-shadow: 0 30px 100px #0008;
}

.photo-dialog::backdrop { background: #07130dea; }

.photo-dialog-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 23px;
  border-bottom: 1px solid #ffffff25;
  background: #111f19;
}

.photo-dialog-header > div { min-width: 0; }

.photo-counter {
  display: block;
  margin-bottom: 4px;
  color: #ccdbc9;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  line-height: 1.5;
}

.photo-dialog-header h2 {
  font-size: 25px;
  letter-spacing: -.5px;
  line-height: 1.3;
}

.photo-dialog-close,
.photo-prev,
.photo-next {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #8a9d8c;
  border-radius: 50%;
  background: #263c30;
  color: #fff;
  transition: background .2s ease, border-color .2s ease;
}

.photo-dialog-close:hover,
.photo-prev:hover,
.photo-next:hover { border-color: #fff; background: var(--red); }

.photo-dialog button:focus-visible,
.photo-dialog a:focus-visible { outline: 3px solid #ffd380; outline-offset: 4px; }

.photo-viewer {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  background: #0a1510;
}

.photo-viewer > img {
  grid-column: 2;
  grid-row: 1;
  display: block;
  width: 100%;
  height: min(62vh, 720px);
  height: min(62dvh, 720px);
  min-height: 180px;
  object-fit: contain;
  object-position: center;
}

.photo-prev { grid-column: 1; grid-row: 1; }
.photo-next { grid-column: 3; grid-row: 1; }
.photo-prev .icon { transform: rotate(180deg); }

.photo-dialog-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 24px;
  padding: 20px 25px 22px;
  border-top: 1px solid #ffffff25;
}

.photo-dialog-footer p {
  grid-column: 1;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.7;
}

.photo-dialog-footer > span {
  grid-column: 1;
  color: #c8d5c5;
  font-size: 16px;
  line-height: 1.8;
}

.photo-dialog-footer a {
  grid-column: 2;
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  min-height: 44px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.photo-dialog-footer a .icon { width: 19px; height: 19px; }

@media (min-width: 1051px) {
  .desktop-nav { gap: 18px; }
}

@media (min-width: 1051px) and (max-width: 1180px) {
  .header-inner { gap: 20px; }
  .desktop-nav { gap: 14px; font-size: 14px; }
}

@media (max-width: 1050px) {
  .event-gallery-grid { gap: 24px; }
  .event-gallery-card { min-height: 365px; aspect-ratio: 4 / 3; }
  .gallery-image-caption { padding: 82px 24px 25px; }
  .gallery-image-caption h3 { font-size: 25px; }
  .gallery-image-caption p { font-size: 16px; }
  .event-gallery-footer { flex-direction: column; align-items: flex-start; gap: 14px; }
  .leader-nameplate { padding: 21px 23px 18px; }
  .leader-nameplate strong { font-size: 25px; }
}

@media (max-width: 760px) {
  .event-gallery-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .event-gallery-card { display: block; aspect-ratio: auto; min-height: 0; }
  .event-gallery-card > img {
    position: relative;
    z-index: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 1280 / 853;
    object-fit: contain;
    transform: none;
  }
  .event-gallery-card:hover > img { transform: none; }
  .gallery-image-shade { display: none; }
  .gallery-image-caption {
    z-index: 1;
    margin-top: -58px;
    padding: 70px 24px 26px;
    background: linear-gradient(180deg, #203b3100 0, #203b31 56px, #203b31 100%);
  }
  .gallery-image-caption h3 { max-width: 560px; font-size: 27px; }
  .gallery-image-caption p { font-size: 17px; }
  .gallery-expand { z-index: 2; top: 16px; right: 16px; }
  .photo-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 13px; }
  .photo-dialog-header { padding: 15px 17px; }
  .photo-dialog-header h2 { font-size: 23px; }
  .photo-viewer { grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px 12px 17px; }
  .photo-viewer > img {
    grid-column: 1 / -1;
    grid-row: 1;
    height: auto;
    min-height: 0;
    max-height: 56vh;
    max-height: 56dvh;
    aspect-ratio: 1280 / 853;
    object-fit: contain;
  }
  .photo-prev { grid-column: 1; grid-row: 2; justify-self: end; margin-right: 8px; }
  .photo-next { grid-column: 2; grid-row: 2; justify-self: start; margin-left: 8px; }
  .photo-dialog-footer { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 17px 19px 20px; }
  .photo-dialog-footer p { font-size: 17px; }
  .photo-dialog-footer a { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 3px; }
}

@media (max-width: 560px) {
  .leader-card { border-radius: 16px; }
  .leader-context-label { top: 14px; right: 14px; max-width: calc(100% - 28px); font-size: 12px; padding: 6px 9px; }
  .leader-nameplate { padding: 21px 22px 18px; }
  .leader-nameplate strong { font-size: 25px; }
  .leader-nameplate span { font-size: 16px; }
  .leader-nameplate a { font-size: 15px; }
  .event-gallery-card { border-radius: 15px; }
  .gallery-image-caption { padding: 69px 22px 25px; }
  .gallery-image-caption > span { font-size: 12px; letter-spacing: .7px; }
  .gallery-image-caption h3 { font-size: 25px; }
  .gallery-image-caption p { font-size: 16px; }
  .event-gallery-footer { margin-top: 24px; }
  .event-gallery-footer p, .event-gallery-footer .text-link { font-size: 16px; }
}

@media (max-width: 370px) {
  .leader-nameplate { padding-inline: 19px; }
  .leader-nameplate strong { font-size: 24px; }
  .gallery-image-caption { padding-inline: 19px; }
  .gallery-image-caption h3 { font-size: 24px; }
  .photo-dialog-header { gap: 10px; padding-inline: 13px; }
  .photo-dialog-header h2 { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .event-gallery-card > img, .gallery-expand, .photo-dialog button { transition: none; }
  .event-gallery-card:hover > img { transform: none; }
}

@media print {
  .photo-dialog, .gallery-expand { display: none !important; }
  .event-gallery-grid { display: block; }
  .event-gallery-card { display: block; min-height: 0; aspect-ratio: auto; margin-bottom: 20px; break-inside: avoid; background: #fff; color: #111; }
  .event-gallery-card > img { position: static; width: 100%; height: auto; object-fit: contain; transform: none; }
  .gallery-image-shade { display: none; }
  .gallery-image-caption { margin: 0; padding: 14px; background: #fff; }
  .gallery-image-caption > span, .gallery-image-caption p { color: #333; }
}
