/* Puglia House Farm
   Palette: calce (whitewash), pietra (limestone), ulivo (olive wood), ink.
   Type: Marcellus (inscriptional display) + Jost (text). */

@font-face {
  font-family: 'Marcellus';
  src: url('/fonts/marcellus-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Jost';
  src: url('/fonts/jost-latin.woff2') format('woff2');
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Jost';
  src: url('/fonts/jost-italic-latin.woff2') format('woff2');
  font-weight: 300 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --calce: #f7f7f3;
  --white: #ffffff;
  --pietra: #e9e3d6;
  --pietra-deep: #d9d0bd;
  --ulivo: #2d3627;
  --ulivo-2: #3d4935;
  --ink: #1e211b;
  --muted: #5b6152;
  --line: rgba(30, 33, 27, 0.14);
  --line-strong: rgba(30, 33, 27, 0.28);
  --error: #8a2c1f;

  --serif: 'Marcellus', 'Iowan Old Style', Palatino, Georgia, serif;
  --sans: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;

  --header-h: 4.25rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 82rem;
  --section: clamp(4rem, 9vw, 8rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --focus: var(--ulivo);
}

@media (min-width: 60em) {
  :root { --header-h: 4.75rem; }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  background: var(--calce);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 48em) {
  body { font-size: 1.125rem; }
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
em { font-style: italic; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
main:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ulivo);
  color: var(--calce);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }

/* ---------- Type ---------- */

.display,
.h2,
.h3,
.section-head__title,
.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.75rem, 6.2vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.h2,
.section-head__title {
  font-size: clamp(1.875rem, 3.6vw, 3rem);
  line-height: 1.1;
}
.h3 {
  font-size: clamp(1.5rem, 2.3vw, 1.875rem);
  line-height: 1.15;
}

.lead {
  font-size: clamp(1.1875rem, 1.6vw, 1.375rem);
  line-height: 1.55;
}

.prose { max-width: 64ch; }
.prose p + p { margin-top: 1.1em; }
.prose a,
.lead a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 1px;
}
.text-link:hover { text-decoration-thickness: 2px; }
.text-link--button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 0.9375rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--ulivo);
  border-radius: 3px;
  background: var(--ulivo);
  color: var(--calce);
  font: 500 0.9375rem/1.2 var(--sans);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--ulivo-2); border-color: var(--ulivo-2); }
.btn--ghost {
  background: transparent;
  color: var(--ulivo);
}
.btn--ghost:hover { background: var(--ulivo); color: var(--calce); }
.btn--block { width: 100%; }

/* ---------- Bands ---------- */

.band-stone { background: var(--pietra); }

.band-olive {
  --focus: var(--calce);
  --muted: #c3c8b8;
  --line: rgba(247, 247, 243, 0.18);
  background: var(--ulivo);
  color: var(--calce);
}
.band-olive .btn:not(.btn--ghost) { background: var(--calce); border-color: var(--calce); color: var(--ulivo); }
.band-olive .btn--ghost { color: var(--calce); border-color: var(--calce); }

/* ---------- Vault (the lamia ceiling shape used on house imagery) ---------- */

.vault {
  border-radius: 50% 50% 0 0 / 15% 15% 0 0;
  overflow: hidden;
}

/* ---------- Header ---------- */

.site-header {
  --focus: var(--ulivo);
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--calce);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.site-header--overlay {
  --focus: var(--white);
  position: fixed;
  inset-inline: 0;
  background: transparent;
  color: var(--white);
  border-bottom-color: transparent;
}
.site-header--overlay.is-solid {
  --focus: var(--ulivo);
  background: var(--calce);
  color: var(--ink);
  border-bottom-color: var(--line);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--header-h);
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  margin-right: auto;
  font-family: var(--serif);
  font-size: clamp(1rem, 5vw, 1.25rem);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav { display: none; }
.main-nav__list { display: flex; align-items: center; gap: 0.25rem; }

.main-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: none;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}
.main-nav__link:hover,
.main-nav__link.is-current {
  text-decoration: underline;
  text-underline-offset: 0.45em;
  text-decoration-thickness: 1px;
}
.main-nav__link svg { transition: transform 0.25s var(--ease); }
.main-nav__link[aria-expanded='true'] svg { transform: rotate(180deg); }

.site-header__social { display: none; gap: 0.25rem; }
.icon-link {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}
.icon-link:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

.menu-toggle {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  border: 0;
  background: none;
  cursor: pointer;
}
.menu-toggle__close { display: none; }
.menu-toggle[aria-expanded='true'] .menu-toggle__open { display: none; }
.menu-toggle[aria-expanded='true'] .menu-toggle__close { display: block; }

@media (min-width: 60em) {
  .brand { font-size: clamp(1.25rem, 2vw, 1.5rem); }
  .main-nav { display: block; }
  .site-header__social { display: flex; }
  .menu-toggle { display: none; }
}

/* Stays dropdown */

.stays-menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  width: min(46rem, calc(100vw - 2 * var(--gutter)));
  transform: translateX(-50%);
  background: var(--calce);
  color: var(--ink);
  border: 1px solid var(--line);
  border-top: 0;
  box-shadow: 0 24px 48px -24px rgba(30, 33, 27, 0.35);
  --focus: var(--ulivo);
}
.stays-menu__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1.75rem;
}
.stays-menu__label {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}
.stays-menu__list { display: grid; gap: 0.25rem; }
.stays-menu__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  margin-inline: -0.5rem;
  border-radius: 3px;
  text-decoration: none;
}
.stays-menu__item:hover { background: var(--pietra); }
.stays-menu__thumb {
  flex: none;
  width: 3.5rem;
  height: 4rem;
  object-fit: cover;
  border-radius: 50% 50% 0 0 / 18% 18% 0 0;
}
.stays-menu__name {
  display: block;
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.2;
}
.stays-menu__meta {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.35;
}
.stays-menu__all {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.stays-menu__all:hover { background: var(--pietra); }
.stays-menu__all:focus-visible { outline-offset: -3px; }
.stays-menu__all svg { transition: transform 0.25s var(--ease); }
.stays-menu__all:hover svg { transform: translateX(3px); }

/* Mobile nav */

.mobile-nav {
  --focus: var(--calce);
  --muted: #c3c8b8;
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 49;
  overflow-y: auto;
  padding: 2rem var(--gutter) 3rem;
  background: var(--ulivo);
  color: var(--calce);
}
.mobile-nav a { text-decoration: none; }
.mobile-nav__primary li a {
  display: block;
  padding-block: 0.35rem;
  font-family: var(--serif);
  font-size: 2.25rem;
  line-height: 1.2;
}
.mobile-nav__group { margin-top: 2rem; }
.mobile-nav__label {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}
.mobile-nav__group li a {
  display: block;
  padding-block: 0.3rem;
  font-family: var(--serif);
  font-size: 1.5rem;
}
.mobile-nav__contact { margin-top: 2.5rem; color: var(--muted); }
.mobile-nav ul { list-style: none; padding: 0; }

.nav-open .site-header,
.nav-open .site-header--overlay {
  --focus: var(--calce);
  background: var(--ulivo);
  color: var(--calce);
  border-bottom-color: rgba(247, 247, 243, 0.12);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: 100svh;
  color: var(--white);
  overflow: hidden;
  --focus: var(--white);
}
.hero--home { min-height: max(34rem, 100svh); }
.hero--stay { min-height: max(32rem, 88svh); }
.hero--page { min-height: max(28rem, 78svh); }
.hero--short { min-height: max(22rem, 56svh); }

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ulivo);
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(18, 22, 15, 0.45) 0%, rgba(18, 22, 15, 0) 22%),
    linear-gradient(to top, rgba(18, 22, 15, 0.7) 0%, rgba(18, 22, 15, 0.28) 38%, rgba(18, 22, 15, 0) 62%);
}

.hero__content {
  padding-top: calc(var(--header-h) + 2rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.hero__title {
  max-width: 13ch;
  font-size: clamp(3rem, 8.4vw, 7.5rem);
  line-height: 0.96;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 30px rgba(0, 0, 0, 0.15);
}
.hero__title--name {
  max-width: none;
  font-size: clamp(3.5rem, 12vw, 10.5rem);
  line-height: 0.9;
}

.hero__intro {
  max-width: 34ch;
  margin-top: 1.25rem;
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  font-weight: 300;
  line-height: 1.4;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin-top: 2rem;
  font-weight: 500;
}
.hero__links a {
  text-decoration: underline;
  text-underline-offset: 0.35em;
  text-decoration-thickness: 1px;
}
.hero__links a:hover { text-decoration-thickness: 2px; }

.hero__crumb {
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
}
.hero__crumb a { text-decoration: none; }
.hero__crumb a:hover { text-decoration: underline; text-underline-offset: 0.3em; }

@media (prefers-reduced-motion: no-preference) {
  .hero__media img { animation: settle 2.2s var(--ease) both; }
  .hero__content > * { animation: rise 1s var(--ease) both; }
  .hero__content > :nth-child(2) { animation-delay: 0.12s; }
  .hero__content > :nth-child(3) { animation-delay: 0.24s; }
  .hero__content > :nth-child(4) { animation-delay: 0.36s; }
}
@keyframes settle {
  from { transform: scale(1.06); }
  to { transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Section heads ---------- */

.section-head {
  display: grid;
  gap: 0.75rem;
  max-width: 44rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.section-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  max-width: none;
}
.section-head__intro { color: var(--muted); font-size: 1.125rem; }
.section-head__meta { color: var(--muted); font-size: 0.9375rem; max-width: 40ch; }

/* ---------- Collection / stay cards ---------- */

.collection__grid { display: grid; gap: 3rem clamp(1.5rem, 3vw, 2.5rem); }

@media (min-width: 40em) {
  .collection__grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem clamp(2rem, 5vw, 4.5rem); }
  .collection__grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64em) {
  .collection__grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stay__link {
  display: block;
  text-decoration: none;
}
.stay__media {
  aspect-ratio: 4 / 5;
  background: var(--pietra-deep);
}
.stay--large .stay__media { aspect-ratio: 1 / 1.08; }
.stay__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.stay__link:hover .stay__media img { transform: scale(1.035); }

.stay__name {
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.625rem;
  line-height: 1.15;
}
.stay--large .stay__name { font-size: clamp(2rem, 3.2vw, 2.75rem); }
.stay--small .stay__name { margin-top: 1rem; font-size: 1.3125rem; }
.stay__link:hover .stay__name {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.stay__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.875rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}
.stay__facts span + span::before {
  content: '';
  display: inline-block;
  width: 1px;
  height: 0.85em;
  margin-right: 0.875rem;
  background: currentColor;
  opacity: 0.45;
  vertical-align: -0.08em;
}
.stay--medium .stay__facts,
.stay--small .stay__facts { flex-direction: column; gap: 0.1rem; }
.stay--medium .stay__facts span + span::before,
.stay--small .stay__facts span + span::before { display: none; }
.stay__summary {
  max-width: 52ch;
  margin-top: 0.875rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* ---------- Quotes ---------- */

.quotes {
  display: grid;
  gap: 2.5rem clamp(2rem, 4vw, 4rem);
  margin-top: clamp(2rem, 4vw, 3.5rem);
}
@media (min-width: 48em) {
  .quotes { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
}
.quote blockquote p {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  line-height: 1.4;
}
.quote blockquote p::before { content: '\201C'; }
.quote blockquote p::after { content: '\201D'; }
.quote figcaption {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.quote figcaption::before {
  content: '';
  display: block;
  width: 2rem;
  height: 1px;
  margin-bottom: 0.875rem;
  background: currentColor;
  opacity: 0.6;
}

/* ---------- Instagram grid ---------- */

.insta__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
@media (min-width: 48em) {
  .insta__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.insta__grid .lb-trigger { aspect-ratio: 1; }

/* ---------- Lightbox triggers ---------- */

.lb-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--pietra-deep);
  overflow: hidden;
  cursor: zoom-in;
}
.lb-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease), opacity 0.3s;
}
.lb-trigger:hover img { transform: scale(1.03); }

/* ---------- Property detail ---------- */

.stay-detail__grid {
  display: grid;
  gap: 3rem;
}
@media (min-width: 60em) {
  .stay-detail__grid {
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: clamp(3rem, 6vw, 6rem);
    align-items: start;
  }
}
@media (max-width: 59.99em) {
  .booking { order: -1; }
}

.stay-detail__more { margin-top: 1.1em; }
.stay-detail__more:focus { outline: none; }
.stay-detail__toggle { margin-top: 1.75rem; }

.stay-detail__subhead {
  margin-top: 3.5rem;
  margin-bottom: 1rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.75rem;
}

.amenities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2rem;
}
@media (min-width: 48em) {
  .amenities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.amenities li {
  padding-block: 0.7rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

/* Every amenity, grouped: a centred panel, full screen on phones. */
.amenities-dialog {
  width: min(44rem, 100% - 2rem);
  max-height: min(52rem, 100dvh - 3rem);
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--calce);
  color: var(--ink);
  box-shadow: 0 1.5rem 4rem rgba(20, 23, 17, 0.25);
  overflow: hidden;
}
.amenities-dialog[open] { display: flex; flex-direction: column; }
.amenities-dialog::backdrop { background: rgba(20, 23, 17, 0.55); }
@media (max-width: 39.99em) {
  .amenities-dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .amenities-dialog[open] { animation: rise 0.3s var(--ease) both; }
  .amenities-dialog[open]::backdrop { animation: fade 0.3s ease both; }
}
.amenities-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 0.875rem 0.875rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.amenities-dialog__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.2;
}
.amenities-dialog__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.amenities-dialog__close:hover { background: var(--pietra); }
.amenities-dialog__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 1.5rem 2rem;
}
.amenities-dialog__group { margin-top: 1.75rem; }
.amenities-dialog__group-title {
  margin-bottom: 0.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
}
.amenities-dialog .amenities { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.booking { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.booking__card {
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--pietra);
  border-radius: 3px;
}
.booking__name {
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1.15;
}
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.65rem;
  border-top: 1px solid var(--line-strong);
  font-size: 0.9375rem;
}
.facts div:last-child { border-bottom: 1px solid var(--line-strong); }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; font-weight: 500; }
.booking__facts { margin-block: 1.25rem 1.5rem; }
.booking__actions { display: grid; gap: 0.75rem; }
.booking__ask { margin-top: 1.25rem; font-size: 0.9375rem; }

@media (max-width: 59.99em) {
  .booking { position: static; }
}

/* ---------- Gallery ---------- */

.gallery { padding-top: 0; }
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
@media (min-width: 48em) {
  .gallery__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery__item--feature { grid-row: span 2; }
}
.gallery__item { aspect-ratio: 1; }
.gallery__item .lb-trigger { height: 100%; }
.gallery__item--feature { grid-column: span 2; }
.gallery__more { margin-top: 2rem; text-align: center; }

/* ---------- More stays row ---------- */

.more-stays { border-top: 1px solid var(--line); }
.more-stays__row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(13rem, 62%);
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
}
.more-stays__row > * { scroll-snap-align: start; }
@media (min-width: 40em) {
  .more-stays__row { grid-auto-columns: minmax(13rem, 34%); }
}
@media (min-width: 64em) {
  .more-stays__row {
    grid-auto-flow: row;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  .more-stays__row--six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ---------- Stays: one house per row ---------- */

/* Title beside the intro on wide screens */
.stays-head__grid { display: grid; gap: 1.25rem clamp(2rem, 5vw, 5rem); align-items: end; }
/* Two classes, to outrank the shared .page-head spacing defined further down */
.page-head.stays-head { padding-top: clamp(2.5rem, 5vw, 4.5rem); }
.stays-head .lead { max-width: 40ch; margin-top: 0; }
@media (min-width: 56em) {
  .stays-head__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The first group follows the page head closely; the town houses sit on stone, as on the home page */
.stays-head + .stays-group { padding-top: clamp(2rem, 4vw, 3.5rem); }
.stays-group .section-head { margin-bottom: clamp(1rem, 2vw, 1.5rem); }

.stay-rows { border-bottom: 1px solid var(--line); }

/* Phones: photo on top, details underneath */
.stay-row {
  position: relative;
  display: grid;
  gap: 1.25rem;
  padding-block: 1.75rem 2rem;
  border-top: 1px solid var(--line);
}
.stay-row__media { aspect-ratio: 3 / 2; background: var(--pietra-deep); }
.stay-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.stay-row__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.875rem, 3vw, 2.625rem);
  line-height: 1.1;
}
.stay-row__link { text-decoration: none; }
.stay-row__link::after { content: ''; position: absolute; inset: 0; }
.stay-row__tagline { margin-top: 0.35rem; color: var(--muted); }
.stay-row__summary { max-width: 56ch; margin-top: 1rem; font-size: 1rem; line-height: 1.6; }

.stay-row__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.stay-row__fact dt { font-size: 0.8125rem; color: var(--muted); }
.stay-row__fact dd { margin-top: 0.2rem; font-size: 0.9375rem; font-weight: 500; line-height: 1.4; }
.stay-row__fact--num dd { font-size: 1.75rem; font-weight: 300; line-height: 1.1; }
.stay-row__fact--wide { grid-column: span 2; }

.stay-row__cta { margin-top: 1.75rem; }

/* The whole row is the link: pointing anywhere in it fills the button and draws in the photo */
@media (hover: hover) {
  .stay-row:hover .stay-row__media img { transform: scale(1.035); }
  .stay-row:hover .stay-row__link {
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 1px;
  }
  .stay-row:hover .stay-row__cta { background: var(--ulivo); color: var(--calce); }
}

/* Keyboard focus outlines the whole row, since the whole row is the link */
@supports selector(:has(a)) {
  .stay-row__link:focus-visible { outline: none; }
  .stay-row:has(.stay-row__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 0.5rem; }
}

/* Tablets: photo beside the details */
@media (min-width: 48em) {
  .stay-row {
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    padding-block: 2.5rem;
  }
  .stay-row__media { aspect-ratio: 4 / 5; }
}

/* Desktop: a larger photo, and the facts on one line with the same spacing on every row */
@media (min-width: 64em) {
  .stay-row { grid-template-columns: minmax(0, 19rem) minmax(0, 1fr); padding-block: 3rem; }
  .stay-row__facts {
    grid-template-columns: repeat(3, 5rem) minmax(0, 1fr);
    column-gap: clamp(1.25rem, 2vw, 2.5rem);
  }
  .stay-row__fact--wide { grid-column: auto; }
}

/* ---------- About ---------- */

/* One grid for the whole page: stacked on small screens, two equal halves from 56em. */
.about-grid { display: grid; gap: 1.5rem clamp(2rem, 5vw, 5rem); }
@media (min-width: 56em) {
  .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.about-hero { padding-top: clamp(3.5rem, 8vw, 7rem); }
.about-hero__text { align-items: end; }
.about-hero__text .display { font-size: clamp(2.5rem, 5.4vw, 4.5rem); }
.about-hero__text .lead { max-width: 38ch; color: var(--muted); }
@media (min-width: 56em) {
  .about-hero__text { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
.about-hero__media {
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--pietra-deep);
}
.about-hero__media img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 48em) {
  .about-hero__media { aspect-ratio: 2.2 / 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .about-hero__text > * { animation: rise 1s var(--ease) both; }
  .about-hero__text > :nth-child(2) { animation-delay: 0.12s; }
  .about-hero__media img { animation: settle 2.2s var(--ease) both; }
}

/* Section opening: title on the left, intro on the right */
.about-head { align-items: end; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.about-head__intro { max-width: 42ch; font-size: 1.125rem; line-height: 1.6; color: var(--muted); }

/* Photo cards */
.about-cards { row-gap: 3.5rem; }
.about-card { display: flex; flex-direction: column; align-items: flex-start; }
.about-card__media { width: 100%; aspect-ratio: 3 / 2; overflow: hidden; background: var(--pietra-deep); }
.about-card__media img { width: 100%; height: 100%; object-fit: cover; }
.about-card__title { margin-top: 1.75rem; }
.about-card p { max-width: 46ch; margin-top: 0.75rem; font-size: 1rem; }
.about-card .text-link { margin-top: auto; padding-top: 1.25rem; font-size: 0.9375rem; }

/* Photo beside a short list */
.about-split { row-gap: 2.5rem; align-items: start; }
.about-split__media { aspect-ratio: 1; overflow: hidden; background: var(--pietra-deep); }
.about-split__media img { width: 100%; height: 100%; object-fit: cover; }
/* Side by side, the photo runs the full height of the list beside it */
@media (min-width: 56em) {
  .about-split { align-items: stretch; }
  .about-split__media { position: relative; aspect-ratio: auto; min-height: 28rem; }
  .about-split__media img { position: absolute; inset: 0; }
}
.about-points li + li { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.about-points__title { font-family: var(--serif); font-weight: 400; font-size: 1.375rem; line-height: 1.25; }
.about-points p { max-width: 48ch; margin-top: 0.5rem; font-size: 1rem; }
.about-points p a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.about-points p a:hover { text-decoration-thickness: 2px; }

.about-closing { align-items: center; }
.about-closing .btn { margin-top: 2rem; }

/* ---------- Closing call to action (About, Ostuni, Experiences) ---------- */

.closing__inner {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}
.closing__inner p { margin-block: 1.25rem 2rem; }

/* ---------- Ostuni guide ---------- */

.guide-intro { padding-bottom: 0; }
.guide-intro__grid { display: grid; gap: 2.5rem; }
@media (min-width: 56em) {
  .guide-intro__grid { grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); gap: clamp(3rem, 7vw, 7rem); }
}
.guide-intro .lead { max-width: 52ch; }
.toc__label { margin-bottom: 0.75rem; font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.toc li a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 1.1875rem;
  text-decoration: none;
}
.toc li a:hover { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

/* Section numbers shared by the contents list and the section headings */
.toc__num,
.guide__num {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* Each section: a rule, then heading beside text, then its photos.
   Margin (not padding) above, so contents links land on the rule rather than empty space. */
.guide { margin-top: clamp(3.5rem, 7vw, 6rem); }
.guide + .closing { margin-top: var(--section); }
.guide__head {
  display: grid;
  gap: 1.25rem 3rem;
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--line);
}
.guide__num { display: block; margin-bottom: 0.75rem; }
@media (min-width: 56em) {
  .guide__head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(3rem, 6vw, 6rem); }
}

.guide__images { display: grid; gap: 0.5rem; margin-top: clamp(2rem, 4vw, 3rem); }
.guide__images .lb-trigger { aspect-ratio: 4 / 3; }
.guide__images figcaption {
  margin-top: 0.75rem;
  font-family: var(--serif);
  font-size: 1.125rem;
}
/* Phones: two or three photos become a swipeable row, with the next one peeking in */
@media (max-width: 47.99em) {
  .guide__images--two,
  .guide__images--three {
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    padding-bottom: 0.5rem;
    scroll-padding-inline: var(--gutter);
  }
  .guide__images > * { scroll-snap-align: start; }
}
@media (min-width: 48em) {
  .guide__images--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide__images--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .guide__images--wide .lb-trigger { aspect-ratio: 21 / 8; }
}

/* Where to eat: each area beside its places, on the same columns as the heading and text above */
.guide__groups { margin-top: clamp(2.5rem, 5vw, 4rem); }
.guide__group {
  display: grid;
  gap: 1.5rem 3rem;
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--line);
}
.guide__group + .guide__group { margin-top: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 56em) {
  .guide__group { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(3rem, 6vw, 6rem); }
}
.places li + li { margin-top: 2rem; }
.places__name { font-family: var(--serif); font-weight: 400; font-size: 1.375rem; line-height: 1.25; }
.places__town { margin-top: 0.25rem; font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.places p:last-child { max-width: 60ch; margin-top: 0.5rem; font-size: 1rem; }

/* ---------- Page head (no hero) ---------- */

.page-head { padding-block: clamp(3.5rem, 8vw, 7rem) clamp(1rem, 3vw, 2rem); }
.page-head .lead { max-width: 46ch; margin-top: 1.5rem; color: var(--muted); }
.page-head--center { text-align: center; }
.page-head--center .display,
.page-head--center .lead { margin-inline: auto; max-width: 22ch; }
.page-head--center .lead { max-width: 46ch; }

/* ---------- Experiences ---------- */

.experiences { padding-top: clamp(2rem, 4vw, 3rem); }
.experiences__grid { display: grid; gap: 3.5rem 2rem; }
.experience { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
/* overflow: hidden holds the 4:3 frame; without it a portrait photo stretches its card taller */
.experience__media { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--pietra-deep); }
.experience__media img { width: 100%; height: 100%; object-fit: cover; }
.experience .h3 { margin-top: 0.75rem; }
.experience p { max-width: 52ch; font-size: 1rem; }
.experience .text-link { margin-top: auto; padding-top: 0.5rem; font-size: 0.9375rem; }

/* Tablet: one experience per row, photo beside text, so an odd count never leaves a gap */
@media (min-width: 40em) and (max-width: 59.99em) {
  .experience {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: auto auto 1fr;
    gap: 0.75rem clamp(1.5rem, 4vw, 2.5rem);
    justify-items: start;
  }
  .experience__media { grid-row: 1 / -1; }
  .experience > :not(.experience__media) { grid-column: 2; }
  .experience .h3 { margin-top: 0; }
  .experience .text-link { margin-top: 0; }
}

/* Desktop: three columns sharing one set of rows, so photos, titles, text and links line up */
@media (min-width: 60em) {
  .experiences__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3.5rem clamp(2rem, 4vw, 3.5rem); }
  @supports (grid-template-rows: subgrid) {
    .experience { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 1rem; justify-items: start; }
  }
}

/* ---------- Contact ---------- */

.contact__grid { display: grid; gap: 3.5rem; align-items: start; }
@media (min-width: 60em) {
  .contact__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(3.5rem, 6vw, 6rem); }
  .contact__card { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}

/* Stone card under a vaulted top; the top padding clears the curve */
.contact__card {
  padding: clamp(4rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem) clamp(1.75rem, 3vw, 2.5rem);
  background: var(--pietra);
}
.contact__email {
  margin-block: 1.25rem 0.5rem;
  font-family: var(--serif);
  /* 5.4vw keeps the address on one line on the narrowest phones */
  font-size: min(5.4vw, clamp(1.1875rem, 1.6vw, 1.5rem));
  overflow-wrap: anywhere;
}
.contact__email a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.contact__copied { font-size: 0.875rem; color: var(--muted); margin-left: 0.5rem; }
.contact__facts { margin-top: 2rem; }
.contact__facts .text-link { font-weight: inherit; }

.form { display: grid; gap: 2.5rem; }
.form > .h3 { margin-bottom: -0.5rem; }
.form__group { min-width: 0; margin: 0; padding: 0; border: 0; }
.form__legend {
  width: 100%;
  padding: 0 0 0.65rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-strong);
  font-weight: 500;
}
.form__fields { display: grid; gap: 1.5rem; }
.form__row { display: grid; gap: 1.5rem; }
@media (min-width: 24em) {
  .form__row--stay { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 36em) {
  .form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form__row--stay { grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 0.6fr); }
}
.field { display: grid; gap: 0.5rem; }
.field label { font-size: 0.9375rem; font-weight: 500; }
.field__opt { font-weight: 400; color: var(--muted); margin-left: 0.25rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3.125rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--white);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.field textarea { min-height: 10rem; resize: vertical; }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--muted); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--ulivo); outline-offset: 0; border-color: var(--ulivo); }
.field [aria-invalid='true'] { border-color: var(--error); }
.field__msg { font-size: 0.875rem; color: var(--error); }

.form__error { color: var(--error); font-size: 0.9375rem; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form__hint { font-size: 0.875rem; color: var(--muted); max-width: 38ch; }
.form__done {
  padding: 1rem 1.25rem;
  background: var(--pietra);
  border-radius: 3px;
}

/* ---------- Footer ---------- */

.site-footer {
  --focus: var(--calce);
  --muted: #c3c8b8;
  padding-block: clamp(3.5rem, 7vw, 5.5rem) 2rem;
  background: var(--ulivo);
  color: var(--calce);
  font-size: 0.9375rem;
}
.site-footer__grid { display: grid; gap: 2.5rem 2rem; }
@media (min-width: 36em) {
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (min-width: 64em) {
  .site-footer__grid { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 0.9fr)) minmax(0, 1.25fr); }
  .site-footer__brand { grid-column: auto; }
}
.site-footer__name {
  margin-bottom: 0.75rem;
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1.1;
}
.site-footer__brand p:last-child { max-width: 30ch; color: var(--muted); }
.site-footer h2 {
  margin-bottom: 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}
.site-footer ul { display: grid; gap: 0.4rem; list-style: none; padding: 0; }
.site-footer a { text-decoration: none; overflow-wrap: anywhere; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.site-footer__base {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  font-size: 0.8125rem;
  color: var(--muted);
}
.site-footer__base-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(247, 247, 243, 0.16);
}
.site-footer__base a { text-decoration: underline; text-underline-offset: 0.25em; }

/* ---------- Lightbox ---------- */

.lightbox {
  --focus: var(--calce);
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #141711;
  color: var(--calce);
  overflow: hidden;
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: fade 0.25s ease both; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox__stage {
  position: absolute;
  inset: 4rem 1rem 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
@media (min-width: 48em) {
  .lightbox__stage { inset: 4.5rem 5.5rem 4.5rem; }
}
.lightbox__img {
  flex: none;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  user-select: none;
  transition: opacity 0.2s;
}
.lightbox__img.is-loading { opacity: 0.35; }

.lightbox__caption {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  width: min(40rem, calc(100% - 9rem));
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.875rem;
  color: #c3c8b8;
}
.lightbox__count { white-space: nowrap; margin-left: 0.5rem; opacity: 0.8; }

.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(247, 247, 243, 0.25);
  border-radius: 50%;
  background: rgba(20, 23, 17, 0.5);
  color: var(--calce);
  cursor: pointer;
}
.lightbox__btn:hover { background: rgba(247, 247, 243, 0.12); }
.lightbox__btn--close { top: 0.75rem; right: 0.75rem; border-color: transparent; }
.lightbox__btn--prev { left: 1rem; bottom: 1rem; }
.lightbox__btn--next { right: 1rem; bottom: 1rem; }
@media (min-width: 48em) {
  .lightbox__btn--prev,
  .lightbox__btn--next { top: 50%; bottom: auto; transform: translateY(-50%); }
  .lightbox__btn--prev { left: 1.25rem; }
  .lightbox__btn--next { right: 1.25rem; }
  .lightbox__btn--close { top: 1rem; right: 1.25rem; }
}
.lightbox.is-single .lightbox__btn--prev,
.lightbox.is-single .lightbox__btn--next { display: none; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
