.gallery-page,
.gallery-page *,
.gallery-page *::before,
.gallery-page *::after {
  box-sizing: border-box;
}

.gallery-page {
  scroll-behavior: auto;
}

.gallery-page body {
  margin: 0;
  background: var(--delsur-paper);
  color: var(--delsur-blue);
  font: 400 1rem/1.5 Inter, system-ui, sans-serif;
}

:where(.gallery-page) a { color: inherit; text-decoration: none; }
:where(.gallery-page) button { font: inherit; }
:where(.gallery-page) img { display: block; }
.gallery-page [hidden] { display: none !important; }

.gallery-header {
  position: sticky;
  top: 0;
  z-index: 10;
}

.gallery-header__row {
  display: flex;
  min-height: 5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gallery-header__logo img {
  width: clamp(7.5rem, 11vw, 9.5rem);
  height: auto;
}

.gallery-header .delsur-header__link[aria-current="page"] {
  box-shadow: inset 0 -2px #f97316;
  color: var(--delsur-blue);
}

.gallery-header .delsur-header__toggle { border: 0; background: transparent; cursor: pointer; }
.gallery-header .delsur-header__toggle:is(:hover, [aria-expanded="true"]) { background: var(--delsur-paper); }

@media (max-width: 55.999rem) {
  .gallery-header__row:has([data-gallery-menu-controls][hidden]) {
    flex-wrap: wrap;
    padding-block: 0.75rem;
  }
  .gallery-header__row:has([data-gallery-menu-controls][hidden]) .delsur-header__links {
    display: flex;
    flex-wrap: wrap;
    white-space: normal;
  }
}

.gallery-banner {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(12rem, 17.5vw, 16.5rem);
  overflow: hidden;
  background: var(--delsur-blue);
  color: #fffaf3;
}

.gallery-banner__photo,
.gallery-banner::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery-banner__photo {
  inset-inline-start: 24%;
  width: 76%;
  object-fit: cover;
  object-position: center 43%;
}

.gallery-banner::after {
  background: linear-gradient(90deg, #1e2952 24%, #1e2952ee 34%, #1e2952b3 48%, #1e295226 78%);
  content: "";
}

.gallery-banner__copy { padding-block: clamp(1.75rem, 4vw, 3.25rem); }

.gallery-banner h1 {
  margin: 0;
  font: 600 clamp(2.65rem, 5.25vw, 4.75rem)/1.02 var(--delsur-title-font);
  letter-spacing: -0.045em;
}

.gallery-banner h1 span { color: #f97316; }
.gallery-banner p { margin: 0.625rem 0 0; color: #edf0fa; font-size: clamp(1rem, 1.55vw, 1.25rem); }

.gallery-catalog { padding-block: clamp(1.25rem, 3vw, 2.25rem) clamp(3rem, 6vw, 5rem); }

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-block-end: clamp(1.2rem, 3vw, 2rem);
}

.gallery-filters button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem clamp(0.625rem, 1.5vw, 1rem);
  border: 1px solid #c7c4be;
  border-radius: 0.25rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 600 0.9375rem/1.15 var(--delsur-title-font);
}

.gallery-filters button span { color: #46516a; font-variant-numeric: tabular-nums; }
.gallery-filters button:hover { border-color: var(--delsur-blue); }
.gallery-filters button[aria-pressed="true"] { background: var(--delsur-blue); border-color: var(--delsur-blue); color: #fffaf3; }
.gallery-filters button[aria-pressed="true"] span { color: #e1e6f2; }

.gallery-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.gallery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 3.8vw, 3rem) clamp(1rem, 2.2vw, 1.65rem);
}

.gallery-card { position: relative; min-width: 0; }

.gallery-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.6;
  border-radius: 0.375rem;
  background: #dfd9ce;
}

.gallery-card__media img { width: 100%; height: 100%; object-fit: cover; }

.gallery-card__category {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  max-width: calc(100% - 1.5rem);
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.25rem;
  background: #192443ef;
  color: #fffaf3;
  font: 600 0.8125rem/1.2 var(--delsur-title-font);
}

.gallery-card__caption { padding: 0.75rem 3.25rem 0.15rem 0.125rem; }
.gallery-card__caption h2 {
  margin: 0;
  font: 600 clamp(1.35rem, 2.15vw, 1.875rem)/1.15 var(--delsur-title-font);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.gallery-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.875rem;
  margin: 0.375rem 0 0;
  color: #46516a;
  font-size: 0.875rem;
}

.gallery-card__facts span { display: inline-flex; align-items: center; gap: 0.3rem; }
.gallery-card__facts i { color: #1e2952; }
.gallery-card__open {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--delsur-blue);
  cursor: pointer;
}

.gallery-card__arrow {
  position: absolute;
  right: 0.125rem;
  bottom: 0.25rem;
  display: grid;
  width: 2.5rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 0.25rem;
  font-size: 1.2rem;
}

.gallery-card__open:is(:hover, :focus-visible) .gallery-card__arrow {
  border-color: var(--delsur-blue);
  background: var(--delsur-blue);
  color: #fffaf3;
}

.gallery-filters button:focus-visible,
.gallery-card__open:focus-visible { outline: 2px solid #a74705; outline-offset: 3px; }
.gallery-empty { margin: 0; }

.gallery-page :is(.project-sheet, .project-sheet-zoom) :is(h2, h3, h4, p, dd, ul) {
  margin-inline: 0;
}
.gallery-page .project-sheet h2 { margin-block: 0; }
.gallery-page .project-sheet__category { margin-block-start: 0; }
.gallery-page .project-sheet__facts { margin-inline: 0; }
.gallery-page .project-sheet__description h3 { margin: 0; }
.gallery-page .project-sheet__description h4 { margin-block-end: 0; }
.gallery-page .project-sheet__features { padding-inline-start: 0; list-style: none; }
.gallery-page .project-sheet__thumbs button { padding: 0; }

@media (min-width: 36rem) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 60rem) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 36rem) {
  .gallery-banner__photo { inset-inline-start: 0; width: 100%; object-position: 64% center; }
  .gallery-banner::after { background: linear-gradient(90deg, #1e2952f5, #1e2952c9 58%, #1e295265); }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .gallery-card__media img { transition: transform 220ms ease-out; }
  .gallery-card:has(.gallery-card__open:hover) img { transform: scale(1.025); }
}
