/* An archival tabletop composition using the original historical photographs. */
.gallery-intro {
  isolation: isolate;
  padding: clamp(12rem, 14vw, 15rem) 0 clamp(4rem, 6vw, 7rem);
  background: radial-gradient(ellipse at 70% 45%, #454034 0, #242820 42%, #111813 80%);
  color: var(--brand-ivory);
}

.gallery-intro__grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(8rem, .32fr);
  gap: clamp(1.5rem, 3vw, 3.5rem);
  align-items: center;
}

.gallery-intro__copy { position: relative; z-index: 3; }
.gallery-intro__copy .eyebrow { color: #c8d8bd; }
.gallery-intro h1 {
  margin: 1.5rem 0 2rem;
  color: var(--brand-ivory);
  font-size: clamp(3.2rem, 6.1vw, 7.5rem);
  line-height: .96;
  letter-spacing: -.055em;
}
.gallery-intro h1 em { color: var(--brand-lime); }
.gallery-intro__copy .lead {
  max-width: 33ch;
  color: #e2e2d5;
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  line-height: 1.65;
}
.gallery-intro__copy .text-link {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.6rem;
  padding: .95rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand-ivory);
  color: var(--brand-turquoise-deep);
}
.gallery-intro__copy .text-link:hover { background: var(--brand-lime); }

.gallery-intro__photos {
  position: relative;
  min-width: 0;
  height: clamp(25rem, 34vw, 37rem);
}
.gallery-intro__print {
  position: absolute;
  margin: 0;
  padding: clamp(.5rem, 1vw, 1rem);
  padding-bottom: clamp(1.5rem, 3vw, 3rem);
  background: #e4ddcd;
  box-shadow: 0 1.2rem 2.5rem #0008;
}
.gallery-intro__print img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.04);
}
.gallery-intro__print--back { width: 72%; top: -3%; right: -1%; transform: rotate(12deg); }
.gallery-intro__print--front { z-index: 2; width: 94%; top: 19%; left: -4%; transform: rotate(-9deg); }
.gallery-intro__print--bottom { width: 66%; bottom: -3%; right: -3%; transform: rotate(8deg); }
.gallery-intro__aside { position: relative; z-index: 3; color: #e2e2d5; padding: 0; }
.gallery-intro__mark {
  display: grid;
  place-items: center;
  width: min(100%, 9rem);
  aspect-ratio: 1;
  margin-bottom: 2rem;
  border: 1px solid #e2e2d580;
  outline: 1px solid #e2e2d530;
  outline-offset: -.5rem;
  border-radius: 50%;
  color: var(--brand-ivory);
  font-size: clamp(2rem, 3vw, 3.5rem);
  letter-spacing: -.04em;
}
.gallery-intro__aside p { margin: 0; font: italic 1.15rem/1.5 var(--font-display); }
.gallery-intro__branch { z-index: 2; right: -2rem; bottom: -5rem; opacity: .25; pointer-events: none; }

@media (max-width: 1100px) {
  .gallery-intro__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gallery-intro__aside { grid-column: 1 / -1; display: flex; align-items: center; gap: 1.5rem; max-width: none; }
  .gallery-intro__mark { flex: 0 0 5rem; margin: 0; font-size: 2rem; }
  .gallery-intro__aside p { max-width: 32ch; }
}
@media (max-width: 900px) {
  .gallery-intro { padding-top: 8rem; padding-bottom: 4rem; }
}
@media (max-width: 620px) {
  .gallery-intro { padding-top: 7rem; }
  .gallery-intro__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .gallery-intro__photos { grid-row: 1; height: clamp(19rem, 83vw, 30rem); margin-inline: 1rem; }
  .gallery-intro__copy { grid-row: 2; }
  .gallery-intro h1 { font-size: clamp(3.3rem, 14vw, 5rem); }
  .gallery-intro__aside { grid-row: 3; }
  .gallery-intro__branch { width: 22rem; opacity: .14; }
}

/* Photo albums: preserve the photographs rather than forcing mosaic crops.
   Scoped to these two albums so the moments gallery keeps its existing layout. */
.gallery-mosaic--history,
.gallery-mosaic--factory {
  display: block;
  columns: 3;
  column-gap: clamp(1.25rem, 2.2vw, 2rem);
}

.gallery-mosaic--history .gallery-tile,
.gallery-mosaic--factory .gallery-tile {
  display: inline-flex;
  flex-direction: column;
  vertical-align: top;
  width: 100%;
  margin: 0 0 clamp(1.25rem, 2.2vw, 2rem);
  break-inside: avoid;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.gallery-mosaic--history .gallery-tile img,
.gallery-mosaic--factory .gallery-tile img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  transform: none;
}

.gallery-mosaic--history .gallery-tile::before,
.gallery-mosaic--factory .gallery-tile::before {
  content: attr(data-caption);
  display: block;
  padding: .9rem 2.75rem .2rem 0;
  color: var(--brand-turquoise-deep);
  font: 500 .85rem/1.5 var(--font-body);
}

/* Keep the image first and its caption in normal flow beneath it. */
.gallery-mosaic--history .gallery-tile::before,
.gallery-mosaic--factory .gallery-tile::before { order: 1; }

.gallery-mosaic--factory .gallery-tile::before { color: var(--brand-ivory); }

.gallery-mosaic--history .gallery-tile::after,
.gallery-mosaic--factory .gallery-tile::after {
  right: .15rem;
  bottom: .05rem;
  width: 1.9rem;
  height: 1.9rem;
  background: transparent;
  border-color: currentColor;
  color: var(--brand-turquoise-mid);
  opacity: 1;
  transform: none;
}

.gallery-mosaic--factory .gallery-tile::after { color: var(--brand-lime); }

@media (max-width: 1000px) {
  .gallery-mosaic--history,
  .gallery-mosaic--factory { columns: 2; }
}

@media (max-width: 560px) {
  .gallery-mosaic--history,
  .gallery-mosaic--factory { columns: 1; }

  .gallery-mosaic--history .gallery-tile,
  .gallery-mosaic--factory .gallery-tile { margin-bottom: 1.75rem; }
}
