:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --text: #1f2428;
  --muted: #68706f;
  --line: rgba(31, 36, 40, 0.14);
  --panel: #fffaf3;
  --accent: #176d77;
  --accent-dark: #0f4f56;
  --shadow: 0 24px 70px rgba(31, 36, 40, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 34px;
}

.event-date {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.35rem, 5vw, 5.6rem);
  line-height: 0.95;
  font-weight: 850;
}

.intro {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
}

.download-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 0.96rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 14px 26px rgba(23, 109, 119, 0.22);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.download-all:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(23, 109, 119, 0.26);
}

main {
  padding-bottom: 48px;
}

.gallery-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.76);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.photo-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #d8d1c8;
  cursor: zoom-in;
  box-shadow: none;
  padding: 0;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 220ms ease, filter 220ms ease;
}

.photo-card::after {
  content: attr(data-number);
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 30px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: white;
  font-size: 0.78rem;
  font-weight: 750;
}

.photo-card:hover img,
.photo-card:focus-visible img {
  transform: scale(1.035);
  filter: saturate(1.08);
}

.photo-card:focus-visible,
.download-all:focus-visible,
.lightbox-button:focus-visible {
  outline: 3px solid rgba(23, 109, 119, 0.4);
  outline-offset: 3px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(54px, 96px) minmax(0, 1fr) minmax(54px, 96px);
  align-items: center;
  justify-items: center;
  gap: 8px;
  padding: 28px;
  background: rgba(10, 13, 15, 0.94);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 170ms ease, visibility 170ms ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.lightbox-figure {
  display: grid;
  gap: 12px;
  justify-items: center;
  max-width: 100%;
  margin: 0;
}

.lightbox img {
  display: block;
  max-width: min(100%, 1400px);
  max-height: calc(100vh - 112px);
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.lightbox figcaption {
  min-height: 22px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.96rem;
}

.lightbox-button {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  font-family: inherit;
  transition: background 160ms ease, transform 160ms ease;
}

.lightbox-button:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.close-button {
  position: fixed;
  top: 18px;
  right: 18px;
  font-size: 2rem;
  line-height: 1;
}

.nav-button {
  font-size: 3rem;
  line-height: 1;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .site-header {
    display: grid;
    align-items: start;
    gap: 22px;
    padding-top: 34px;
  }

  .download-all {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .gallery-shell {
    padding: 14px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

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

  .lightbox {
    grid-template-columns: 1fr;
    padding: 18px 12px 74px;
  }

  .lightbox img {
    max-height: calc(100vh - 148px);
  }

  .nav-button {
    position: fixed;
    bottom: 16px;
  }

  .prev-button {
    left: calc(50% - 62px);
  }

  .next-button {
    right: calc(50% - 62px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
