/* ============================================================
   Trullo Serra — palette "Sabbia Calda" + tipografia luxury serif
   ============================================================ */
:root {
  --background: oklch(0.985 0.005 80);
  --background-confirmed: oklch(0.59 0.14 141.84);
  --background-attesa: oklch(0.74 0.14 110.8);
  --background-rifiutato: oklch(0.56 0.16 21.49);
  --foreground: oklch(0.28 0.025 55);
  --secondary: oklch(0.955 0.012 75);
  --muted-foreground: oklch(0.5 0.02 60);
  --border: oklch(0.88 0.015 75);
  --stone: oklch(0.78 0.045 78);
  --clay: oklch(0.62 0.06 55);
  --ink: oklch(0.28 0.025 55);
  --destructive: oklch(0.55 0.15 30);

  --font-serif: "Cormorant Garamond", ui-serif, Georgia, serif;
  --font-sans: "Karla", ui-sans-serif, system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(oklch(0.28 0.025 55 / 0.025) 1px, transparent 1px);
  background-size: 3px 3px;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul { list-style: none; }

/* ---------- utilities ---------- */
.serif-display { font-family: var(--font-serif); font-weight: 300; letter-spacing: -0.02em; line-height: 1.05; }
.italic { font-style: italic; }
.clay { color: var(--clay); }
.muted { color: oklch(0.28 0.025 55 / 0.6); }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 1rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--clay);
  font-weight: 500;
}
.eyebrow--light { color: oklch(0.95 0.02 80); }

.hairline {
  height: 1px;
  max-width: 6rem;
  margin: 2rem 0;
  background: linear-gradient(90deg, transparent, var(--stone), transparent);
}
.hairline--full { max-width: none; margin: 0; }
.hairline--center { margin: 2.5rem auto; }

.container { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 80rem; text-align: center; }
.body { font-size: 15px; line-height: 1.7; color: oklch(0.28 0.025 55 / 0.75); }

/* ---------- header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  transition: background-color .5s, border-color .5s, backdrop-filter .5s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: oklch(0.985 0.005 80 / 0.85);
  backdrop-filter: blur(12px);
  border-bottom-color: oklch(0.88 0.015 75 / 0.6);
}
.header-inner {
  max-width: 80rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.5rem 1.5rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  width: 3rem;
  flex: 0 0 auto;
}
.logo img { width: 100%; height: auto; }
.header:not(.is-scrolled) .logo,
.header:not(.is-scrolled) .nav a,
.header:not(.is-scrolled) .lang button { color: oklch(0.98 0.005 80); }

.nav { display: none; gap: 2.5rem; }
.nav a { font-size: 0.875rem; opacity: .8; transition: opacity .3s; }
.nav a:hover { opacity: 1; }

.lang { display: flex; align-items: center; gap: .25rem; font-size: .75rem; letter-spacing: .18em; color: var(--muted-foreground); }
.lang button { padding: .25rem .375rem; transition: opacity .3s; opacity: .6; }
.lang button.is-active, .lang button:hover { opacity: 1; }

/* ---------- carousel ---------- */
.carousel { position: relative; overflow: hidden; background: var(--secondary); }
.carousel .slides { position: absolute; inset: 0; }
.carousel img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; pointer-events: none; transition: opacity 1s ease;
}
.carousel img.is-active { opacity: 1; pointer-events: auto; }
.carousel[data-lightbox] img { cursor: zoom-in; }

.carousel--hero { height: clamp(34rem, 78svh, 44rem); }

.carousel--fill { height: 100%; min-height: 420px; }

.car-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 3.5rem; height: 3.5rem; display: flex; align-items: center; justify-content: center;
  color: var(--background); opacity: .78; transition: opacity .3s; z-index: 2;
}
.car-btn:hover { opacity: 1; }
.car-btn svg { width: 3rem; height: 3rem; filter: drop-shadow(0 2px 8px oklch(0.28 0.025 55 / .65)); }
.car-btn--prev { left: .0rem; }
.car-btn--next { right: .0rem; }
.car-dots { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; gap: .375rem; z-index: 2; }
.car-dots button { height: 2px; width: 1rem; background: oklch(0.985 0.005 80 / 0.5); transition: all .3s; }
.car-dots button.is-active { width: 2rem; background: var(--background); }

/* ---------- hero ---------- */
.hero { position: relative; }
.hero-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, oklch(0.28 0.025 55 / .3), transparent 45%, oklch(0.28 0.025 55 / .5));
}
.hero-content { position: absolute; inset: 0; display: flex; align-items: flex-end; pointer-events: none; }
.hero-content .container { width: 100%; padding-bottom: 3rem; }
.hero-title {
  margin-top: 1rem; max-width: 48rem; font-size: clamp(2.15rem, 10vw, 3rem);
  white-space: pre-line; color: oklch(0.98 0.005 80);
}
.hero-sub {
  margin-top: 1rem; max-width: 32rem; font-size: 14px; line-height: 1.55;
  color: oklch(0.95 0.01 80 / 0.9);
}

/* ---------- feature sections ---------- */
.feature { padding: 5rem 0; overflow: hidden; }
.feature-grid { display: grid; gap: 2.5rem; }
.feature-media { min-height: 420px; }
.feature-text { display: flex; align-items: center; padding: 0 1.5rem; }
.feature-text > div { max-width: 28rem; margin: 0 auto; }
.feature-text h2 { margin-top: 1.25rem; font-size: 1.875rem; white-space: pre-line; }
.features { display:none!important; margin-top: 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.5rem; max-width: 28rem; }
.features li {
  font-size: .75rem; letter-spacing: .15em; text-transform: uppercase;
  color: oklch(0.28 0.025 55 / 0.6); border-top: 1px solid var(--border); padding-top: .75rem;
}

/* ---------- servizi ---------- */
.services { padding: 6rem 0; }
.section-head { max-width: 42rem; margin: 0 auto; text-align: center; }
.section-head h2 { margin-top: 1.5rem; font-size: 2.25rem; white-space: pre-line; }
.section-head .body { margin-top: 1.5rem; }
.services-grid { margin-top: 4rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1.5rem; }
.service { display: flex; flex-direction: column; align-items: center; text-align: center; }
.service-icon {
  width: 3.5rem; height: 3.5rem; border-radius: 999px;
  border: 1px solid var(--border); background: oklch(0.955 0.012 75 / 0.5);
  display: flex; align-items: center; justify-content: center; color: oklch(0.28 0.025 55 / 0.8);
}
.service-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.5; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.service p { margin-top: 1rem; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: oklch(0.28 0.025 55 / 0.8); }

/* ---------- storia ---------- */
.story { background: var(--secondary); padding: 6rem 0; }
.story-title { margin-top: 1.5rem; font-size: clamp(2.25rem, 5vw, 3.75rem); }
.story-body, .story-restoration{ font-size: 16px; line-height: 1.85; color: oklch(0.28 0.025 55 / 0.75); }
.story-img { margin-top: 3.5rem;  margin-bottom: 3.5rem; }
.story-img img { width: 100%; margin: 0 auto; }

/* ---------- contatti ---------- */
.contact { padding: 6rem 0; }
.contact-grid { display: grid; gap: 3.5rem; }
.contact-title { margin-top: 1.5rem; font-size: clamp(2.25rem, 5vw, 3.75rem); white-space: pre-line; }
.contact-info { display: grid; gap: 1.5rem; font-size: 15px; line-height: 1.7; color: oklch(0.28 0.025 55 / 0.8); }
.contact-info p { white-space: pre-line; }
.contact-info a:hover { color: var(--foreground); text-decoration: underline; }
.map { position: relative; background: var(--secondary); overflow: hidden; aspect-ratio: 1 / 1; }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1); }
.map-link { position: absolute; inset: 0; z-index: 1; cursor: pointer; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 2.5rem 0; }
.footer-inner {
  display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center;
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-foreground);
}
.footer-logo { font-size: 1rem; letter-spacing: normal; text-transform: none; color: var(--foreground); }

/* ---------- floating book button ---------- */
.fab {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 45;
  border: 1px solid var(--foreground); background: var(--foreground); color: var(--background);
  padding: .875rem 1.5rem; font-size: .75rem; letter-spacing: .25em; text-transform: uppercase;
  box-shadow: 0 10px 30px oklch(0.28 0.025 55 / .25); transition: all .4s;
}
.fab:hover { background: transparent; color: var(--foreground); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: oklch(0.28 0.025 55 / .9); backdrop-filter: blur(4px); padding: 1.5rem 1.5rem 6rem;
}
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; }
.lightbox-close, .modal-close {
  position: absolute; right: 1.5rem; top: 1.5rem; font-size: 1.75rem; line-height: 1;
  width: 2.5rem; height: 2.5rem; color: var(--background);
}
.lightbox-nav {
  position: absolute; bottom: 1.5rem;
  width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center;
  background: oklch(0.985 0.005 80 / .16); color: var(--background);
  border: 1px solid oklch(0.985 0.005 80 / .28); backdrop-filter: blur(4px);
  transition: background-color .3s, border-color .3s;
}
.lightbox-nav:hover {
  background: oklch(0.985 0.005 80 / .28);
  border-color: oklch(0.985 0.005 80 / .48);
}
.lightbox-nav--prev { left: calc(50% - 5rem); }
.lightbox-nav--next { right: calc(50% - 5rem); }
.lightbox-count {
  position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  height: 3rem; display: flex; align-items: center;
  font-size: .75rem; letter-spacing: .18em; color: var(--background);
}
.modal-close { color: oklch(0.28 0.025 55 / .6); right: 1rem; top: .75rem; }
.modal-close:hover { color: var(--foreground); }

/* ---------- modal form ---------- */
.modal {
  position: fixed; inset: 0; z-index: 55; display: flex; align-items: center; justify-content: center;
  background: oklch(0.28 0.025 55 / .7); backdrop-filter: blur(4px); padding: 1rem;
}
.modal-card {
  position: relative; width: 100%; max-width: 70rem; max-height: 92vh; overflow-y: auto;
  background: var(--background); padding: 2rem;
}
.modal-title { margin-top: .75rem; font-size: 1.875rem; }
.field { display: block; margin-bottom: 1.25rem; }
.field label { display: block; margin-bottom: .5rem; }
.field input, .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent;
  padding: .5rem 0; font-size: 15px; font-family: var(--font-sans); color: var(--foreground); resize: none;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--foreground); }
.field-hint { margin-top: .5rem; font-size: .75rem; color: oklch(0.28 0.025 55 / .6); }
.field.is-invalid label { color: var(--destructive); }
.field.is-invalid input, .field.is-invalid textarea { border-bottom-color: var(--destructive); }
.field.is-invalid input:focus, .field.is-invalid textarea:focus { border-bottom-color: var(--destructive); }
.field.is-invalid .field-hint { color: var(--destructive); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-solid {
  margin-top: .5rem; width: 100%; border: 1px solid var(--foreground); background: var(--foreground);
  color: var(--background); padding: .875rem 1.5rem; font-size: .75rem; letter-spacing: .25em;
  text-transform: uppercase; transition: all .3s;
}
.btn-solid:hover { background: transparent; color: var(--foreground); }
.form-error { color: var(--destructive); font-size: .875rem; margin-bottom: .75rem; }
.form-success { padding: 2rem 0; font-size: 15px; line-height: 1.7; color: oklch(0.28 0.025 55 / .8); }

[hidden] { display: none !important; }

/* ---------- calendario disponibilità ---------- */
.cal { border: 1px solid var(--border); padding: .75rem; }
.field.is-invalid .cal { border-color: var(--destructive); }
.field.is-invalid .cal-hint { color: var(--destructive); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.cal-month { font-size: .95rem; text-transform: capitalize; letter-spacing: .02em; }
.cal-nav {
  border: 1px solid var(--border); background: transparent; width: 1.9rem; height: 1.9rem;
  line-height: 1; cursor: pointer; color: var(--foreground);
}
.cal-nav:hover { border-color: var(--foreground); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow {
  text-align: center; font-size: .65rem; letter-spacing: .12em; text-transform: uppercase;
  color: oklch(0.28 0.025 55 / .5); padding: .35rem 0;
}
.cal-day {
  border: 0; background: transparent; padding: .45rem 0; font-size: .85rem; cursor: pointer;
  color: var(--foreground); font-family: inherit;
}
.cal-day:hover:not(:disabled) { background: var(--secondary); }
.cal-day.is-occupied { text-decoration: line-through; opacity: .35; cursor: not-allowed; }
.cal-day.is-past { opacity: .3; cursor: not-allowed; }
.cal-day.is-edge { background: var(--foreground); color: var(--background); }
.cal-day.is-in-range { background: var(--secondary); }
.cal-hint { margin-top: .5rem; font-size: .75rem; color: oklch(0.28 0.025 55 / .6); }

/* ---------- responsive ---------- */
@media (max-width: 767px) {
  .car-btn { display: none; }

  .hero .eyebrow { font-size: 0.75rem; letter-spacing: 0.22em; }
  .hero-content .container { padding-bottom: 2.5rem; }

  .lightbox { padding: 4rem 1rem 5rem; }
  .lightbox-nav {
    bottom: 1rem;
    width: 2.75rem; height: 2.75rem;
  }
  .lightbox-nav--prev { left: 1rem; }
  .lightbox-nav--next { right: 1rem; }
  .lightbox-count { bottom: 1rem; height: 2.75rem; }
}

@media (min-width: 640px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .container { padding: 0 2.5rem; }

  .nav { display: flex; }
  .header-inner { padding: 0.5rem 2.5rem; }
  .logo { width: 3rem; }

  .carousel--hero { height: clamp(36rem, 72svh, 44rem); }
  .carousel--fill { min-height: 560px; }

  .hero-content .container { padding-bottom: 6rem; }
  .hero-title { margin-top: 1.25rem; font-size: clamp(2.75rem, 7vw, 4.5rem); }
  .hero-sub { margin-top: 1.5rem; max-width: 36rem; font-size: 15px; line-height: 1.7; }

  .feature { padding: 8rem 0; }
  .feature-grid { grid-template-columns: repeat(12, 1fr); gap: 0; align-items: stretch; }
  .feature-media { grid-column: span 8; }
  .feature-text { grid-column: span 4; padding: 0 2.5rem; }
  .feature-text > div { margin: 0; }
  .feature-text h2 { font-size: 2.25rem; }
  .feature-grid--reverse .feature-media { order: 2; }
  .feature-grid--reverse .feature-text { order: 1; }

  .services { padding: 9rem 0; }
  .services-grid { grid-template-columns: repeat(4, 1fr); }

  .story { padding: 9rem 0; }

  .contact { padding: 9rem 0; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .map { aspect-ratio: auto; min-height: 420px; }

  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }

  .fab { right: 2rem; bottom: 2rem; }

  .modal-card { padding: 2.5rem; }
}

@media (min-width: 768px) and (max-width: 1150px) {
  .hero-content .container { padding-bottom: 4rem; }
  .hero .eyebrow { font-size: 0.875rem; letter-spacing: 0.24em; }
  .hero-title { margin-top: 1rem; font-size: clamp(2.5rem, 5.5vw, 3.5rem); }
  .hero-sub { margin-top: 1.125rem; max-width: 32rem; font-size: 14px; line-height: 1.6; }
}

@media (min-width: 1024px) {
  .carousel--fill { min-height: 640px; }
}

@media (min-width: 1151px) {
  .carousel--hero { height: auto; aspect-ratio: 21 / 9; }
}
