.gallery-page {
  background: var(--cream);
  color: var(--pine);
}

.gallery-page .site-header {
  background: rgba(43, 47, 38, .97);
  border-bottom-color: rgba(245, 243, 236, .12);
}

.gallery-main { overflow: hidden; }
.gallery-page-wrap {
  width: min(1440px, calc(100vw - 80px));
  margin-inline: auto;
}

.gallery-masthead {
  padding: 176px 0 32px;
  background: var(--cream);
  border-bottom: 1px solid var(--line-light);
}
.gallery-masthead .eyebrow { margin-bottom: 38px; }
.gallery-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 56px;
}
.gallery-title-row h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(76px, 12vw, 174px);
  font-weight: 400;
  letter-spacing: -.075em;
  line-height: .78;
}
.gallery-title-row > p {
  margin: 0 0 7px;
  color: #526159;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.8;
  text-align: right;
  text-transform: uppercase;
}
.gallery-title-row > p span { color: #899188; font-size: 11px; }

.gallery-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 68px;
  padding-top: 22px;
  border-top: 1px solid var(--line-light);
}
.gallery-filter {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 0;
  color: #657169;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.gallery-filter:hover { color: var(--ink); border-color: rgba(43, 47, 38, .22); }
.gallery-filter.is-active {
  color: var(--cream);
  background: var(--ink);
  border-color: var(--ink);
}

.gallery-journal-section {
  padding: clamp(24px, 3vw, 44px) 0 clamp(110px, 12vw, 180px);
  background: var(--cream);
}
.gallery-journal {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: 78px;
  gap: clamp(16px, 1.7vw, 26px);
  align-items: stretch;
}
.journal-entry {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 11px;
  min-width: 0;
  margin: 0;
}
.journal-entry[hidden] { display: none !important; }
.journal-entry--feature { grid-column: span 8; grid-row: span 6; }
.journal-entry--portrait { grid-column: span 4; grid-row: span 7; }
.journal-entry--portrait-wide { grid-column: span 5; grid-row: span 7; }
.journal-entry--landscape { grid-column: span 6; grid-row: span 4; }
.journal-entry--wide { grid-column: span 8; grid-row: span 5; }
.journal-entry--square { grid-column: span 4; grid-row: span 5; }
.journal-entry--slim { grid-column: span 3; grid-row: span 6; }
.journal-entry--full { grid-column: 1 / -1; grid-row: span 7; }
.journal-entry--natural-landscape { grid-column: span 6; grid-row: span 5; }
.journal-entry--natural-feature { grid-column: span 8; grid-row: span 6; }

.journal-photo {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #d9d1c4;
  cursor: zoom-in;
}
.journal-photo::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(245, 243, 236, .76);
  border-radius: 50%;
  color: var(--cream);
  background: rgba(43, 47, 38, .3);
  backdrop-filter: blur(6px);
  font-size: 20px;
  font-weight: 300;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.journal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .75s cubic-bezier(.2, .6, .2, 1);
}
.journal-entry--feature .journal-photo img,
.journal-entry--full .journal-photo img { object-position: center; }
.journal-photo:hover::after,
.journal-photo:focus-visible::after { opacity: 1; transform: translateY(0); }
.journal-photo:hover img { transform: scale(1.018); }
.journal-entry figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: #34423b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.45;
  text-transform: uppercase;
}
.journal-entry figcaption small {
  color: #899188;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-align: right;
  white-space: nowrap;
}
.gallery-empty {
  margin: 60px 0 0;
  color: #67736c;
  font-family: var(--serif);
  font-size: 24px;
  text-align: center;
}

.gallery-footer-shell { background: var(--ink); }

.gallery-lightbox {
  width: min(1180px, calc(100vw - 72px));
  max-width: none;
  height: min(860px, calc(100vh - 72px));
  max-height: none;
  padding: 34px 76px 24px;
  border: 0;
  color: var(--cream);
  background: #1c201a;
  box-shadow: 0 40px 110px rgba(0, 0, 0, .62);
}
.gallery-lightbox[open] { display: grid; grid-template-columns: 1fr; }
.gallery-lightbox::backdrop { background: rgba(10, 13, 10, .88); backdrop-filter: blur(10px); }
.gallery-lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 17px;
  min-height: 0;
  margin: 0;
}
.gallery-lightbox figure > img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
.gallery-lightbox figcaption {
  color: rgba(245, 243, 236, .72);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(245, 243, 236, .34);
  border-radius: 50%;
  color: var(--cream);
  background: rgba(28, 32, 26, .78);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover { border-color: var(--copper-light); background: var(--ink); }
.lightbox-close { right: 18px; top: 18px; font-size: 25px; }
.lightbox-nav { top: 50%; font-size: 20px; transform: translateY(-50%); }
.lightbox-nav--previous { left: 18px; }
.lightbox-nav--next { right: 18px; }

@media (max-width: 920px) {
  .gallery-page-wrap { width: min(780px, calc(100vw - 40px)); }
  .gallery-masthead { padding-top: 146px; }
  .gallery-title-row h1 { font-size: clamp(76px, 16vw, 128px); }
  .gallery-filters { overflow-x: auto; padding-bottom: 6px; }
  .gallery-filter { flex: 0 0 auto; }
  .gallery-journal { grid-template-columns: repeat(8, minmax(0, 1fr)); grid-auto-rows: 72px; }
  .journal-entry--feature,
  .journal-entry--wide,
  .journal-entry--full,
  .journal-entry--natural-landscape,
  .journal-entry--natural-feature { grid-column: span 8; }
  .journal-entry--natural-landscape,
  .journal-entry--natural-feature { grid-row: span 7; }
  .journal-entry--portrait,
  .journal-entry--portrait-wide,
  .journal-entry--square { grid-column: span 4; }
  .journal-entry--landscape { grid-column: span 5; }
  .journal-entry--slim { grid-column: span 3; }
}

@media (max-width: 620px) {
  .gallery-page-wrap { width: calc(100vw - 32px); }
  .gallery-masthead { padding: 126px 0 24px; }
  .gallery-masthead .eyebrow { margin-bottom: 27px; }
  .gallery-title-row { display: block; }
  .gallery-title-row h1 { font-size: clamp(68px, 23vw, 94px); line-height: .84; }
  .gallery-title-row > p { margin: 28px 0 0; font-size: 12px; text-align: left; }
  .gallery-filters { margin-top: 38px; }
  .gallery-filter { min-height: 40px; padding-inline: 12px; font-size: 11px; }
  .gallery-journal-section { padding: 28px 0 100px; }
  .gallery-journal {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 74px;
    gap: 14px;
  }
  .journal-entry--feature,
  .journal-entry--wide,
  .journal-entry--full,
  .journal-entry--landscape,
  .journal-entry--natural-landscape,
  .journal-entry--natural-feature { grid-column: span 2; }
  .journal-entry--portrait,
  .journal-entry--portrait-wide,
  .journal-entry--square,
  .journal-entry--slim { grid-column: span 1; }
  .journal-entry--feature { grid-row: span 4; }
  .journal-entry--portrait,
  .journal-entry--portrait-wide { grid-row: span 5; }
  .journal-entry--wide,
  .journal-entry--landscape { grid-row: span 3; }
  .journal-entry--square { grid-row: span 3; }
  .journal-entry--slim { grid-row: span 4; }
  .journal-entry--full { grid-row: span 4; }
  .journal-entry--natural-landscape,
  .journal-entry--natural-feature { grid-row: span 5; }
  .journal-entry figcaption {
    display: grid;
    gap: 2px;
    font-size: 10px;
    letter-spacing: .06em;
  }
  .journal-entry figcaption small { font-size: 8px; text-align: left; white-space: normal; }
  .journal-photo::after { display: none; }
  .gallery-lightbox {
    width: calc(100vw - 22px);
    height: calc(100vh - 22px);
    padding: 60px 18px 22px;
  }
  .lightbox-close { right: 12px; top: 10px; }
  .lightbox-nav { top: auto; bottom: 9px; }
  .lightbox-nav--previous { left: 12px; }
  .lightbox-nav--next { right: 12px; }
  .gallery-lightbox figcaption { padding-inline: 52px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .journal-photo img { transition: none; }
}
