:root {
  --gallery-ink: #25302b;
  --gallery-muted: #69756e;
  --gallery-paper: #f5f4ef;
  --gallery-sage: #a7c4a0;
  --gallery-clay: #d1bfa7;
  --gallery-line: rgba(37, 48, 43, 0.14);
}

body.gallery-page {
  background: var(--gallery-paper);
  color: var(--gallery-ink);
  font-family: 'Inter', sans-serif;
}

.gallery-page .BookingButton {
  z-index: 20;
}

.gallery-page header {
  position: relative;
  z-index: 10;
}

.gallery-page header > nav {
  position: fixed;
  top: 20px;
  left: 50%;
  right: auto;
  width: fit-content;
  max-width: calc(100% - 48px);
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(250, 250, 247, 0.82);
  box-shadow: 0 14px 40px rgba(37, 48, 43, 0.08);
  transform: translateX(-50%);
}

.gallery-page header > nav > a img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  margin-right: 0;
}

.gallery-page header > nav ul {
  margin: 0 auto;
}

.gallery-page header > nav li {
  color: var(--gallery-ink);
  font-size: 15px;
  margin: 0 17px;
}

.gallery-page header > nav li::before {
  background: var(--gallery-sage);
}

.gallery-page .hamburger span {
  background: var(--gallery-ink);
}

.gallery-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 64vh;
  padding: 170px 6vw 90px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(135deg, #dfe9df 0%, #f5f4ef 53%, #eadfce 100%);
}

.gallery-hero::before,
.gallery-hero::after {
  position: absolute;
  content: '';
  border: 1px solid rgba(37, 48, 43, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.gallery-hero::before {
  width: 46vw;
  height: 46vw;
  min-width: 360px;
  min-height: 360px;
  right: -16vw;
  top: -24vw;
}

.gallery-hero::after {
  width: 28vw;
  height: 28vw;
  left: -14vw;
  bottom: -15vw;
}

.gallery-hero-content {
  max-width: 780px;
}

.gallery-kicker {
  margin-bottom: 20px;
  color: #687e6d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.gallery-hero h1,
.gallery-section h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
}

.gallery-hero h1 {
  margin-bottom: 22px;
  color: var(--gallery-ink);
  font-size: clamp(3.5rem, 8vw, 7.4rem);
  line-height: 0.94;
}

.gallery-hero p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--gallery-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.gallery-nav {
  position: absolute;
  top: auto;
  right: 24px;
  bottom: 96px;
  left: 24px;
  width: auto;
  max-width: none;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  transform: none;
}

.gallery-nav a {
  padding: 8px 14px;
  border: 1px solid var(--gallery-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(8px);
  color: var(--gallery-ink);
  font-size: 0.75rem;
  font-weight: 600;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.gallery-nav a:hover,
.gallery-nav a:focus-visible {
  border-color: var(--gallery-ink);
  background: rgba(255, 255, 255, 0.68);
  transform: translateY(-2px);
}

.gallery-content {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: 100px 0 0;
}

.gallery-section {
  scroll-margin-top: 110px;
  margin-bottom: 108px;
}

.gallery-section:last-child {
  margin-bottom: 0;
}

.gallery-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--gallery-line);
}

.gallery-section-label {
  margin-bottom: 8px;
  color: #78917a;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-section h2 {
  color: var(--gallery-ink);
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1;
}

.gallery-section-description {
  max-width: 360px;
  color: var(--gallery-muted);
  font-size: 0.9rem;
  line-height: 1.65;
  text-align: right;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.gallery-card {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #dfe4de;
  animation: galleryReveal 700ms both;
  animation-timeline: view();
  animation-range: entry 0% cover 28%;
}

.gallery-card button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  background: transparent;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 600ms ease;
}

.gallery-card button::after {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: white;
  content: '\2197';
  font-size: 1.2rem;
  line-height: 31px;
  opacity: 0;
  text-align: center;
  transform: translateY(6px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.gallery-card:hover img,
.gallery-card:focus-within img {
  filter: brightness(0.82);
  transform: scale(1.06);
}

.gallery-card:hover button::after,
.gallery-card:focus-within button::after {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card figcaption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  color: white;
  font-size: 0.74rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.gallery-card:hover figcaption,
.gallery-card:focus-within figcaption {
  opacity: 1;
  transform: translateY(0);
}

.gallery-page .site-footer {
  margin-top: 0;
}

.gallery-page .contattaci {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 128px;
  text-align: center;
}

.gallery-page .contattaci .form-container {
  margin-top: 2rem;
  margin-bottom: 0;
}

@keyframes galleryReveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-card img,
  .gallery-card figcaption,
  .gallery-card button::after { animation: none; transition: none; }
}

@media (max-width: 1250px) {
  .gallery-page header > nav { top: 10px; right: 10px; left: 10px; width: auto; max-width: none; transform: none; }
  .gallery-page header > nav > a img { width: 50px; height: 50px; }
  .gallery-page header > nav ul { margin: 0; }
  .gallery-page header > nav li { margin: 0; }
}

@media (max-width: 700px) {
  .gallery-hero {
    min-height: 72vh;
    padding: 130px 24px 70px;
  }

  .gallery-hero h1 { font-size: clamp(3.1rem, 18vw, 5rem); }
  .gallery-hero p { font-size: 0.94rem; }
  .gallery-nav { right: 16px; bottom: 92px; left: 16px; gap: 6px; }
  .gallery-nav a { padding: 7px 11px; font-size: 0.7rem; }
  .gallery-content { width: min(100% - 32px, 560px); padding: 68px 0 0; }
  .gallery-section { margin-bottom: 76px; }
  .gallery-section-heading { display: block; }
  .gallery-section-description { margin-top: 14px; text-align: left; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gallery-page .contattaci { width: min(100% - 32px, 560px); padding: 40px 0 96px; }
  .gallery-card figcaption,
  .gallery-card button::after { display: none; }
}
