/* Gallery magazine: page-specific editorial layout */
.gallery-magazine {
  max-width: 1080px;
  padding-top: 34px;
  padding-bottom: 90px;
}

.mag-issue-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  padding: 10px 2px 9px;
  border-top: 3px double #1b2025;
  border-bottom: 1px solid #9ba4ac;
  color: #48525b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mag-cover {
  display: grid;
  grid-template-columns: minmax(330px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(38px, 7vw, 84px);
  align-items: center;
  padding-bottom: 76px;
}

.mag-cover-image {
  position: relative;
  margin: 0;
}

.mag-cover-image::before {
  position: absolute;
  z-index: -1;
  top: 18px;
  right: -18px;
  bottom: -18px;
  left: 18px;
  border: 1px solid #b9cbd7;
  content: '';
}

.mag-cover-image .mag-shot-button {
  aspect-ratio: 3 / 4;
}

.mag-cover-image figcaption,
.mag-shot figcaption {
  margin-top: 9px;
  color: #77818a;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-transform: uppercase;
}

.mag-kicker,
.mag-section-label {
  color: #2f6f9f;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mag-cover-copy h1 {
  margin: 15px 0 24px;
  color: #171b1f;
  font-family: 'Roboto Slab', serif;
  font-size: clamp(3.6rem, 7.4vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.mag-cover-copy h1 em {
  color: #2f6f9f;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.78em;
  font-weight: 400;
}

.mag-deck {
  color: #3e464d;
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.7;
}

.mag-cover-rule {
  width: 72px;
  height: 2px;
  margin: 28px 0 22px;
  background: #2f6f9f;
}

.mag-cover-note {
  max-width: 570px;
  color: #68727b;
  font-size: 0.86rem;
  line-height: 1.8;
}

.mag-contents {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1.58fr);
  gap: clamp(32px, 6vw, 72px);
  margin: 0 0 48px;
  padding: 34px 0 38px;
  border-top: 3px double #1b2025;
  border-bottom: 1px solid #cbd3d9;
}

.mag-contents-kicker {
  margin-bottom: 8px;
  color: #2f6f9f;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mag-contents h2 {
  color: #1b2025;
  font-family: 'Roboto Slab', serif;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.mag-contents-note {
  margin-top: 14px;
  color: #7a858e;
  font-size: 0.76rem;
  line-height: 1.65;
}

.mag-contents-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mag-contents-list li {
  border-top: 1px solid #d7dee3;
}

.mag-contents-list a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 74px;
  padding: 13px 0 11px;
  color: #242b30;
}

.mag-contents-list a:hover strong,
.mag-contents-list a:focus-visible strong {
  color: #2f6f9f;
}

.mag-contents-index {
  color: #9abdd2;
  font-family: 'Roboto Slab', serif;
  font-size: 0.76rem;
  font-weight: 700;
}

.mag-contents-list strong,
.mag-contents-list small {
  display: block;
}

.mag-contents-list strong {
  font-family: 'Roboto Slab', serif;
  font-size: 0.84rem;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.mag-contents-list small {
  margin-top: 4px;
  color: #7a858e;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.4;
  text-transform: uppercase;
}

.mag-year-nav {
  position: sticky;
  z-index: 20;
  top: 58px;
  display: flex;
  gap: 32px;
  justify-content: center;
  margin: 0 0 88px;
  padding: 12px 20px;
  border-top: 1px solid #d6dde2;
  border-bottom: 1px solid #d6dde2;
  background: rgba(247, 250, 252, 0.9);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.mag-year-nav a {
  color: #68737c;
  font-family: 'Roboto Slab', serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.mag-year-nav a:hover {
  color: #2f6f9f;
}

.mag-year {
  scroll-margin-top: 126px;
}

.mag-story[id] {
  scroll-margin-top: 126px;
}

.mag-year-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 46px;
  align-items: end;
  margin-bottom: 6px;
  padding-bottom: 23px;
  border-bottom: 3px solid #1b2025;
}

.mag-year-number {
  color: #d2e4ef;
  font-family: 'Roboto Slab', serif;
  font-size: clamp(4.5rem, 10vw, 8.5rem);
  font-weight: 700;
  line-height: 0.75;
  letter-spacing: -0.08em;
}

.mag-year-head p {
  max-width: 620px;
  color: #56616a;
  font-family: 'Lora', Georgia, serif;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.7;
}

.mag-story {
  padding: 72px 0 82px;
  border-bottom: 1px solid #dce2e7;
}

.mag-story-head {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  margin-bottom: 24px;
}

.mag-story-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding-top: 3px;
  color: #88939c;
}

.mag-story-meta span {
  color: #b8d5e7;
  font-family: 'Roboto Slab', serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.mag-story-meta small {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.45;
  text-transform: uppercase;
}

.mag-story h2 {
  max-width: 720px;
  margin-top: 7px;
  color: #1b2025;
  font-family: 'Roboto Slab', serif;
  font-size: clamp(2rem, 4.5vw, 3.65rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
}

.mag-story-lede {
  max-width: 780px;
  margin: 0 0 40px 206px;
  color: #465058;
  font-family: 'Lora', Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.9;
}

.mag-story-lede::first-letter {
  color: #2f6f9f;
  font-family: 'Roboto Slab', serif;
  font-size: 2.65rem;
  font-weight: 700;
  line-height: 0;
}

.mag-photo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.75fr);
  grid-template-rows: repeat(2, minmax(218px, 1fr));
  gap: 14px;
}

.mag-photo-grid--reverse {
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.45fr);
}

.mag-photo-grid .mag-shot--main {
  grid-row: 1 / 3;
}

.mag-photo-grid--reverse .mag-shot--main {
  grid-column: 2;
}

.mag-photo-grid--reverse .mag-shot:not(.mag-shot--main) {
  grid-column: 1;
}

.mag-shot {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-direction: column;
}

.mag-shot-button {
  display: block;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #e8edf0;
  cursor: zoom-in;
}

.mag-shot-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.3s ease;
}

.mag-shot-button:hover img,
.mag-shot-button:focus-visible img {
  filter: saturate(1.04) contrast(1.02);
  transform: scale(1.025);
}

.mag-shot-button:focus-visible {
  outline: 3px solid #2f6f9f;
  outline-offset: 3px;
}

.mag-duo {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 14px;
}

.mag-duo .mag-shot-button {
  aspect-ratio: 16 / 10;
}

.mag-interlude {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  margin: 90px 0 100px;
  padding: clamp(42px, 7vw, 74px);
  color: #f4f8fb;
  background: #15364d;
  box-shadow: 14px 14px 0 #d7e7f0;
}

.mag-interlude span {
  color: #8fcaed;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mag-interlude blockquote {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.35rem, 3.4vw, 2.35rem);
  font-style: italic;
  line-height: 1.5;
}

.mag-endnote {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 46px;
  margin-top: 84px;
  padding-top: 24px;
  border-top: 3px double #1b2025;
}

.mag-endnote span {
  color: #2f6f9f;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.mag-endnote p {
  color: #465058;
  font-family: 'Lora', Georgia, serif;
  font-size: 1.1rem;
  font-style: italic;
}

body.lightbox-open {
  overflow: hidden;
}

.mag-lightbox {
  width: min(1120px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  overflow: visible;
  padding: 18px 18px 14px;
  border: 0;
  color: #eaf2f7;
  background: #0c151c;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

.mag-lightbox::backdrop {
  background: rgba(5, 11, 16, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mag-lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 112px);
  object-fit: contain;
}

.mag-lightbox p {
  margin: 11px 42px 0 2px;
  color: #bac8d1;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mag-lightbox-close {
  position: absolute;
  z-index: 2;
  top: -14px;
  right: -14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #5d7584;
  border-radius: 50%;
  color: #ffffff;
  background: #15364d;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

[data-theme="dark"] .mag-issue-bar,
[data-theme="dark"] .mag-year-head,
[data-theme="dark"] .mag-endnote {
  border-color: #607583;
}

[data-theme="dark"] .mag-cover-copy h1,
[data-theme="dark"] .mag-story h2,
[data-theme="dark"] .mag-contents h2 {
  color: #f2f5f7;
}

[data-theme="dark"] .mag-deck,
[data-theme="dark"] .mag-story-lede,
[data-theme="dark"] .mag-endnote p {
  color: #c3cbd1;
}

[data-theme="dark"] .mag-cover-note,
[data-theme="dark"] .mag-year-head p,
[data-theme="dark"] .mag-story-meta,
[data-theme="dark"] .mag-shot figcaption,
[data-theme="dark"] .mag-cover-image figcaption {
  color: #93a2ad;
}

[data-theme="dark"] .mag-year-nav {
  border-color: #294253;
  background: rgba(13, 23, 33, 0.9);
}

[data-theme="dark"] .mag-year-number {
  color: #294e65;
}

[data-theme="dark"] .mag-story {
  border-color: #263c4b;
}

[data-theme="dark"] .mag-contents {
  border-color: #607583;
}

[data-theme="dark"] .mag-contents-list li {
  border-color: #294253;
}

[data-theme="dark"] .mag-contents-list a {
  color: #dbe3e8;
}

[data-theme="dark"] .mag-shot-button {
  background: #142531;
}

[data-theme="dark"] .mag-cover-image::before {
  border-color: #365c73;
}

[data-theme="dark"] .mag-interlude {
  background: #102c3e;
  box-shadow: 14px 14px 0 #213d4f;
}

@media (max-width: 780px) {
  .gallery-magazine {
    padding-top: 24px;
  }

  .mag-cover {
    grid-template-columns: 1fr;
    gap: 42px;
    padding-bottom: 60px;
  }

  .mag-cover-image {
    width: min(86%, 480px);
    margin: 0 auto;
  }

  .mag-cover-copy {
    text-align: center;
  }

  .mag-cover-rule {
    margin-right: auto;
    margin-left: auto;
  }

  .mag-cover-note {
    margin: 0 auto;
  }

  .mag-contents {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .mag-contents-header {
    max-width: 520px;
  }

  .mag-year-nav {
    top: 56px;
    margin-bottom: 70px;
  }

  .mag-year-head,
  .mag-story-head,
  .mag-endnote {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .mag-year-number {
    font-size: 5.5rem;
  }

  .mag-story {
    padding: 58px 0 66px;
  }

  .mag-story-meta {
    justify-content: space-between;
    border-bottom: 1px solid #d7dfe4;
    padding-bottom: 10px;
  }

  .mag-story-lede {
    margin-left: 0;
  }

  .mag-photo-grid,
  .mag-photo-grid--reverse {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 360px 190px;
  }

  .mag-photo-grid .mag-shot--main,
  .mag-photo-grid--reverse .mag-shot--main {
    grid-row: 1;
    grid-column: 1 / 3;
  }

  .mag-photo-grid--reverse .mag-shot:not(.mag-shot--main) {
    grid-column: auto;
  }

  .mag-duo {
    grid-template-columns: 1fr;
  }

  .mag-interlude {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 70px 0 80px;
    box-shadow: 8px 8px 0 #d7e7f0;
  }
}

@media (max-width: 480px) {
  .mag-issue-bar {
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }

  .mag-cover-copy h1 {
    font-size: 3.45rem;
  }

  .mag-year-nav {
    gap: 24px;
  }

  .mag-contents-list {
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
  }

  .mag-contents-list a {
    min-height: 70px;
  }

  .mag-photo-grid,
  .mag-photo-grid--reverse {
    grid-template-rows: 300px 140px;
    gap: 8px;
  }

  .mag-shot figcaption {
    font-size: 0.56rem;
  }

  .mag-interlude {
    padding: 36px 26px;
  }

  .mag-lightbox {
    width: calc(100vw - 20px);
    padding: 10px 10px 12px;
  }

  .mag-lightbox-close {
    top: 6px;
    right: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mag-shot-button img {
    transition: none;
  }
}
