.gallery-page {
  background: #DCE8E4;
  color: #172B3A;
}

.gallery-page .site-header .site-brand {
  color: #F7F5F0;
}

.gallery-hero {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(220,232,228, 0.22), transparent 30%),
    radial-gradient(circle at 86% 68%, rgba(198,166,117, 0.16), transparent 30%),
    linear-gradient(135deg, #172B3A, #172B3A 58%, #172B3A);
  color: #F7F5F0;
}

.gallery-hero::after {
  position: absolute;
  inset: auto -10% -180px 38%;
  height: 360px;
  border: 1px solid rgba(198,166,117, 0.14);
  border-radius: 50%;
  content: "";
  transform: rotate(-8deg);
}

.gallery-hero-grid,
.gallery-section-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(247,245,240, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247,245,240, 0.032) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
  pointer-events: none;
}

.gallery-hero-glow {
  position: absolute;
  top: -220px;
  right: -160px;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(247,245,240, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgba(247,245,240, 0.018), 0 0 0 160px rgba(247,245,240, 0.012);
}

.gallery-hero-container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(470px, 0.82fr);
  align-items: center;
  gap: clamp(60px, 8vw, 135px);
  min-height: 650px;
  padding-top: 130px;
  padding-bottom: 58px;
}

.gallery-breadcrumb {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 27px;
  color: rgba(247,245,240, 0.56);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-breadcrumb a { transition: color 0.25s ease; }
.gallery-breadcrumb a:hover { color: var(--yellow-bright); }
.gallery-breadcrumb span:last-child { color: var(--yellow-bright); }

.gallery-kicker,
.gallery-section-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--yellow-bright);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.gallery-kicker::before,
.gallery-section-label::before {
  width: 31px;
  height: 1px;
  background: currentColor;
  content: "";
}

.gallery-hero-copy h1 {
  max-width: 770px;
  margin: 17px 0 20px;
  font-family: "Bitter", serif;
  font-size: clamp(4rem, 5vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.01;
}

.gallery-hero-copy h1 em,
.gallery-heading h2 em {
  color: transparent;
  background: linear-gradient(95deg, var(--yellow-bright), var(--orange-bright));
  background-clip: text;
  -webkit-background-clip: text;
  font-style: normal;
}

.gallery-hero-copy > p {
  max-width: 660px;
  margin: 0;
  color: rgba(247,245,240, 0.68);
  font-size: 16px;
  line-height: 1.8;
}

.gallery-hero-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  color: var(--yellow-bright);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gallery-hero-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 0.3s var(--ease);
}

.gallery-hero-link:hover svg { transform: translateY(4px); }

.gallery-hero-collage {
  position: relative;
  min-height: 430px;
}

.collage-card {
  position: absolute;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(247,245,240, 0.18);
  background: #172B3A;
  box-shadow: 0 30px 80px rgba(23,43,58, 0.36);
}

.collage-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(23,43,58, 0.9));
  content: "";
}

.collage-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage-card-main {
  inset: 15px 45px 5px 0;
  border-radius: 34px;
  transform: rotate(-2.2deg);
}

.collage-card figcaption {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 22px;
  left: 24px;
}

.collage-card-main figcaption span {
  display: block;
  color: var(--yellow-bright);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.collage-card-main figcaption strong {
  display: block;
  margin-top: 5px;
  font-family: "Bitter", serif;
  font-size: 1.28rem;
}

.collage-card-small {
  width: 170px;
  height: 145px;
  border-radius: 22px;
}

.collage-card-small figcaption {
  right: 15px;
  bottom: 13px;
  left: 15px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.collage-card-award { top: -12px; right: -34px; transform: rotate(4deg); }
.collage-card-social { right: -4px; bottom: -26px; transform: rotate(-3deg); }

.collage-accent {
  position: absolute;
  z-index: 4;
  bottom: 24px;
  left: -43px;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 176px;
  border: 1px solid rgba(198,166,117, 0.34);
  border-radius: 20px;
  background: rgba(23,43,58, 0.88);
  padding: 17px 19px;
  box-shadow: 0 20px 55px rgba(23,43,58, 0.34);
  backdrop-filter: blur(16px);
}

.collage-accent strong { color: var(--yellow-bright); font-family: "Bitter", serif; font-size: 2rem; line-height: 1; }
.collage-accent span { color: rgba(247,245,240, 0.68); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; line-height: 1.4; text-transform: uppercase; }

.portfolio-gallery {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 3% 14%, rgba(220,232,228, 0.1), transparent 23%),
    radial-gradient(circle at 98% 5%, rgba(198,166,117, 0.09), transparent 20%),
    #DCE8E4;
  padding: 50px 0;
}

.gallery-section-pattern {
  background-image:
    linear-gradient(rgba(23,43,58, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,43,58, 0.038) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, black, transparent 42%);
}

.gallery-container { position: relative; z-index: 2; }

.gallery-heading {
  max-width: 1040px;
  margin-inline: auto;
  text-align: center;
}

.gallery-section-label { color: #C6A675; }
.gallery-section-label::after { width: 31px; height: 1px; background: currentColor; content: ""; }

.gallery-heading h2 {
  margin: 14px 0 0;
  color: #172B3A;
  font-family: "Bitter", serif;
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.052em;
  line-height: 1.05;
}

.gallery-heading p {
  max-width: 820px;
  margin: 17px auto 0;
  color: #172B3A;
  font-size: 16px;
  line-height: 1.75;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 38px 0 24px;
  border-top: 1px solid rgba(23,43,58, 0.14);
  border-bottom: 1px solid rgba(23,43,58, 0.14);
  padding: 13px 0;
}

.gallery-filters {
  display: flex;
  align-items: center;
  gap: 9px;
}

.gallery-filter {
  border: 1px solid rgba(23,43,58, 0.18);
  border-radius: 0;
  background: rgba(247,245,240, 0.62);
  padding: 13px 17px;
  color: #172B3A;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.28s ease, background 0.28s ease, border-color 0.28s ease, transform 0.28s var(--ease);
}

.gallery-filter:hover { border-color: #172B3A; transform: translateY(-2px); }
.gallery-filter.is-active { border-color: #172B3A; background: #172B3A; color: #F7F5F0; box-shadow: 0 12px 28px rgba(23,43,58, 0.16); }

.gallery-result-count { flex: 0 0 auto; margin: 0; color: #172B3A; font-size: 0.73rem; letter-spacing: 0.05em; text-transform: uppercase; }
.gallery-result-count strong { color: #172B3A; font-family: "Bitter", serif; font-size: 1rem; }

.gallery-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-auto-rows: 155px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.gallery-card {
  position: relative;
  grid-row: span 2;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: #DCE8E4;
  padding: 0;
  color: #F7F5F0;
  cursor: zoom-in;
  text-align: left;
  box-shadow: 0 14px 35px rgba(23,43,58, 0.08);
  transition: opacity 0.24s ease, transform 0.45s var(--ease), box-shadow 0.45s ease;
}

.gallery-card-wide { grid-column: span 2; }
.gallery-card-tall { grid-row: span 3; }
.gallery-card[hidden] { display: none; }

.gallery-card::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(23,43,58, 0.88));
  content: "";
  transition: background 0.35s ease;
}

.gallery-card::after {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(247,245,240, 0.36);
  border-radius: 50%;
  background: rgba(23,43,58, 0.46);
  color: #F7F5F0;
  content: "+";
  font-size: 1.35rem;
  font-weight: 300;
  opacity: 0;
  transform: scale(0.75) rotate(-35deg);
  transition: opacity 0.32s ease, transform 0.4s var(--ease);
  backdrop-filter: blur(10px);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.75s var(--ease), filter 0.45s ease;
}

.gallery-card-overlay {
  position: absolute;
  z-index: 4;
  right: 21px;
  bottom: 20px;
  left: 21px;
  display: block;
  transform: translateY(3px);
  transition: transform 0.4s var(--ease);
}

.gallery-card-overlay small { display: block; margin-bottom: 5px; color: var(--yellow-bright); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.gallery-card-overlay strong { display: block; font-family: "Bitter", serif; font-size: clamp(1.02rem, 1.3vw, 1.34rem); line-height: 1.2; }

.gallery-card:hover,
.gallery-card:focus-visible { outline: none; box-shadow: 0 24px 54px rgba(23,43,58, 0.17); transform: translateY(-6px); }
.gallery-card:hover img,
.gallery-card:focus-visible img { filter: saturate(1.04); transform: scale(1.055); }
.gallery-card:hover::after,
.gallery-card:focus-visible::after { opacity: 1; transform: none; }
.gallery-card:hover .gallery-card-overlay,
.gallery-card:focus-visible .gallery-card-overlay { transform: none; }

.gallery-lightbox {
  width: min(1100px, calc(100% - 36px));
  max-width: none;
  max-height: calc(100vh - 36px);
  overflow: visible;
  border: 0;
  background: transparent;
  padding: 0;
  color: #F7F5F0;
}

.gallery-lightbox::backdrop { background: rgba(23,43,58, 0.9); backdrop-filter: blur(12px); }
.lightbox-shell { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; gap: 18px; }
.lightbox-figure { overflow: hidden; margin: 0; border: 1px solid rgba(247,245,240, 0.16); border-radius: 26px; background: #172B3A; box-shadow: 0 35px 100px rgba(0, 0, 0, 0.42); }
.lightbox-figure img { display: block; width: 100%; max-height: calc(100vh - 150px); object-fit: contain; background: #172B3A; }
.lightbox-figure figcaption { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 21px; }
.lightbox-figure figcaption span { color: var(--yellow-bright); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.lightbox-figure figcaption strong { font-family: "Bitter", serif; font-size: 1rem; }
.lightbox-close,
.lightbox-nav { border: 1px solid rgba(247,245,240, 0.22); border-radius: 50%; background: rgba(247,245,240, 0.08); color: #F7F5F0; transition: background 0.25s ease, color 0.25s ease, transform 0.25s var(--ease); }
.lightbox-close:hover,
.lightbox-nav:hover { background: var(--yellow-bright); color: #172B3A; transform: scale(1.06); }
.lightbox-nav { display: grid; place-items: center; width: 52px; height: 52px; font-size: 1.25rem; }
.lightbox-close { position: absolute; z-index: 3; top: -14px; right: 38px; width: 42px; height: 42px; font-size: 1.7rem; line-height: 1; }

@media (max-width: 1199px) {
  .gallery-hero-container { grid-template-columns: minmax(0, 1fr) minmax(390px, 0.78fr); gap: 70px; }
  .gallery-hero-copy h1 { font-size: clamp(3.7rem, 5.3vw, 4.7rem); }
  .gallery-grid { grid-auto-rows: 145px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-heading h2 { font-size: 56px; }
  .gallery-toolbar { align-items: flex-end; flex-direction: column; }
  .gallery-filters { width: 100%; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
}

@media (max-width: 991px) {
  .gallery-hero { min-height: auto; }
  .gallery-hero-container { grid-template-columns: 1fr; gap: 48px; min-height: auto; padding-top: 150px; padding-bottom: 70px; }
  .gallery-hero-copy { max-width: 760px; }
  .gallery-hero-collage { width: min(100%, 650px); min-height: 440px; margin-inline: auto; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .gallery-hero-container { padding-top: 130px; }
  .gallery-hero-copy h1 { font-size: clamp(3rem, 12vw, 4rem); }
  .gallery-heading h2 { font-size: clamp(2.55rem, 10vw, 3.65rem); }
  .gallery-hero-collage { min-height: 380px; }
  .collage-card-main { right: 20px; }
  .collage-card-small { width: 135px; height: 115px; }
  .collage-card-award { right: -7px; }
  .collage-accent { left: 6px; bottom: 9px; }
  .gallery-grid { grid-auto-rows: 140px; }
  .gallery-card-wide { grid-column: span 2; }
  .lightbox-shell { grid-template-columns: 1fr; }
  .lightbox-nav { position: absolute; z-index: 3; bottom: 66px; }
  .lightbox-prev { left: 13px; }
  .lightbox-next { right: 13px; }
  .lightbox-close { top: -13px; right: -7px; }
  .lightbox-figure figcaption { align-items: flex-start; flex-direction: column; gap: 5px; padding-right: 80px; }
}

@media (max-width: 575px) {
  .gallery-hero-container { padding-right: 20px; padding-left: 20px; }
  .gallery-hero-copy h1 {
    max-width: 100%;
    font-size: clamp(2.35rem, 11.4vw, 3.15rem);
  }
  .gallery-hero-collage { min-height: 330px; }
  .collage-card-main { inset: 12px 12px 0 0; }
  .collage-card-social { display: none; }
  .collage-accent { min-width: 155px; padding: 14px 16px; }
  .gallery-heading h2 { font-size: clamp(2.2rem, 11vw, 3rem); }
  .gallery-filter { flex: 0 0 auto; padding: 12px 15px; }
  .gallery-result-count { align-self: flex-start; }
  .gallery-grid { grid-auto-rows: auto; grid-template-columns: 1fr; gap: 13px; }
  .gallery-card,
  .gallery-card-wide,
  .gallery-card-tall { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 3; }
  .gallery-card:nth-child(3n + 1) { aspect-ratio: 3 / 4; }
  .gallery-lightbox { width: calc(100% - 22px); }
  .lightbox-figure img { max-height: calc(100vh - 190px); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-card img,
  .gallery-card::after,
  .gallery-hero-link svg { transition: none; }
  .gallery-card:hover,
  .gallery-card:focus-visible { transform: none; }
}
