/* ==========================================================
   TABÙ — Chalet sul mare di Fermo
   Tema: giallo sole + azzurro mare (palette dal logo)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700;9..144,900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Sfondi */
  --bg:        #fffaeb;       /* crema chiara, base sole */
  --bg-warm:   #fff3cc;
  --paper:    #ffffff;
  --ink:      #1f2a3a;        /* blu notte profondo */
  --ink-soft: #5b6779;
  --line:     #e6dcc0;

  /* Colori brand TABÙ */
  --sun:      #ffce30;        /* giallo logo */
  --sun-d:    #e6a800;
  --sun-l:    #ffe680;
  --sea:      #4cc6e0;        /* azzurro logo */
  --sea-d:    #1d8aa3;
  --sea-l:    #b8e8f2;

  /* Accenti caldi (tramonto) */
  --coral:    #f57b3a;
  --coral-d:  #c4501a;

  --r-sm: 6px;
  --r-md: 14px;
  --r-lg: 24px;

  --shadow-1: 0 2px 10px rgba(31, 42, 58, .08);
  --shadow-2: 0 12px 40px rgba(31, 42, 58, .14);
  --shadow-3: 0 24px 80px rgba(31, 42, 58, .22);

  --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;

  --header-h: 78px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--sea-d); text-decoration: none; transition: color .15s; }
a:hover { color: var(--coral-d); }

.container {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
}
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.1;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--sea-d);
  margin-bottom: 14px;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 auto;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  background: var(--paper);
  color: var(--ink);
  transition: transform .12s, box-shadow .15s, background .15s, color .15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--sun);
  color: var(--ink);
  border-color: var(--sun);
}
.btn-primary:hover { background: var(--sun-d); border-color: var(--sun-d); color: #fff; }
.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,.7);
  color: #fff;
}
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }

/* ==========================================================
   HEADER + NAV
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 250, 235, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  border: 2px solid #fff;
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: -.02em;
  display: flex;
  flex-direction: column;
  color: var(--ink);
}
.logo-text span {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: .7rem;
  color: var(--sea-d);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-top: 4px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .95rem;
  transition: all .15s;
}
.site-nav a:hover { color: var(--ink); background: var(--bg-warm); }
.site-nav a.active { color: var(--sea-d); background: var(--sea-l); }
.site-nav a.nav-cta {
  background: var(--sun);
  color: var(--ink);
  margin-left: 8px;
}
.site-nav a.nav-cta:hover { background: var(--sun-d); color: #fff; }

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 10px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================
   HERO con foto
   ========================================================== */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
}
.hero-photo {
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center;
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(31,42,58,.05) 0%, rgba(31,42,58,.5) 70%, rgba(31,42,58,.7) 100%);
  z-index: 0;
}
.hero-waves {
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 90px;
  z-index: 1;
}
.hero-waves svg { width: 100%; height: 100%; display: block; }

.hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 60px 0 140px;
  max-width: 800px;
}
.hero-eyebrow {
  display: inline-block;
  background: rgba(255, 206, 48, .92);
  color: var(--ink);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 4px 30px rgba(0,0,0,.5);
  margin-bottom: 24px;
}
.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--sun-l);
}
.hero-lede {
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 640px;
  margin: 0 auto 36px;
  color: rgba(255,255,255,.95);
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================================
   PAGE HEAD
   ========================================================== */
.page-head {
  background:
    radial-gradient(800px 300px at 80% -50%, rgba(255,206,48,.25), transparent 70%),
    radial-gradient(600px 300px at 10% 100%, rgba(76,198,224,.18), transparent 70%),
    var(--bg);
  padding: 80px 0 60px;
  text-align: center;
}
.page-head h1 { margin-bottom: 16px; }

/* ==========================================================
   SECTIONS
   ========================================================== */
.section {
  padding: 80px 0;
}
.section-intro { background: var(--paper); }

.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}
.intro-text p { font-size: 1.05rem; color: var(--ink-soft); }
.intro-text p strong { color: var(--ink); }

.intro-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.intro-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  padding: 20px;
  background: var(--bg-warm);
  border-radius: var(--r-md);
  border-left: 4px solid var(--sun);
  transition: transform .2s, box-shadow .2s;
}
.intro-card:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-1);
}
.intro-icon {
  font-size: 2rem;
  grid-row: 1 / 3;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.15));
}
.intro-card h3 { margin-bottom: 4px; }
.intro-card p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* CTA strip */
.section-cta {
  background: linear-gradient(135deg, var(--sea) 0%, var(--sea-d) 100%);
  color: #fff;
  text-align: center;
  padding: 60px 0;
}
.section-cta h2 { color: #fff; }
.section-cta p { color: rgba(255,255,255,.9); margin-bottom: 24px; }
.cta-inner { max-width: 600px; }
.cta-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.section-cta .btn-primary {
  background: var(--sun);
  color: var(--ink);
  border-color: var(--sun);
}
.section-cta .btn-primary:hover {
  background: #fff; border-color: #fff; color: var(--sea-d);
}
.section-cta .btn-ghost {
  border-color: rgba(255,255,255,.85);
}

/* ==========================================================
   SERVICES
   ========================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.service-card {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 32px 28px;
  box-shadow: var(--shadow-1);
  transition: transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--sun), var(--coral), var(--sea));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-2);
}
.service-card:hover::before { transform: scaleX(1); }
.service-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.1));
}
.service-card h2 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.service-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .95rem;
}

.service-cta {
  text-align: center;
  margin-top: 60px;
  padding: 40px 20px;
  background: var(--paper);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.service-cta h3 { margin-bottom: 20px; }

/* ==========================================================
   GALLERY
   ========================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.gallery-item {
  display: block;
  position: relative;
  border: none;
  background: none;
  padding: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-1);
  transition: transform .25s, box-shadow .25s;
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s;
}
.gallery-item:hover img { transform: scale(1.06); }

.empty-gallery {
  text-align: center;
  padding: 80px 20px;
  background: var(--paper);
  border-radius: var(--r-md);
  border: 2px dashed var(--line);
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(20, 25, 35, .94);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  animation: fadeIn .25s;
}
.lightbox[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-figure {
  margin: 0;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: var(--shadow-3);
  animation: zoomIn .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes zoomIn {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.lightbox-figure figcaption {
  color: rgba(255,255,255,.85);
  font-style: italic;
  text-align: center;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 1.6rem;
  display: grid;
  place-items: center;
  transition: background .2s, transform .15s;
  backdrop-filter: blur(8px);
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,.25);
  transform: scale(1.06);
}
.lightbox-close { top: 24px; right: 24px; font-size: 2rem; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.1); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.1); }

/* ==========================================================
   CONTACT
   ========================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 48px;
  align-items: start;
}

.contact-info {
  background: var(--paper);
  padding: 32px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--line);
}
.contact-info h2 { margin-bottom: 24px; }

.contact-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.contact-block:last-child { border-bottom: none; }
.contact-block strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-weight: 700;
}
.contact-block address,
.contact-block p {
  font-style: normal;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}
.contact-icon {
  font-size: 1.4rem;
  width: 40px; height: 40px;
  background: var(--sun-l);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* Mappa */
.contact-map {
  margin-top: 20px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
}
.contact-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Form */
.contact-form {
  background: var(--paper);
  padding: 32px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--line);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field span em { color: var(--coral); font-style: normal; }
.field input,
.field textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 400;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(76, 198, 224, .2);
}
.field textarea { resize: vertical; min-height: 140px; }
.form-note { font-size: .85rem; color: var(--ink-soft); margin: 0; }
.form-note em { color: var(--coral); font-style: normal; }

/* Captcha */
.captcha-block {
  background: var(--bg-warm);
  padding: 14px 16px;
  border-radius: var(--r-sm);
  border-left: 4px solid var(--sun);
}
.captcha-field span {
  font-weight: 600;
  color: var(--ink);
}
.captcha-field span small {
  font-weight: 400;
  font-size: .9rem;
  color: var(--ink-soft);
}
.captcha-field span small strong {
  font-size: 1.1rem;
  color: var(--sea-d);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.captcha-input {
  max-width: 140px;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
}

/* Honeypot */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: var(--r-md);
  margin-bottom: 18px;
}
.alert ul { margin: 6px 0 0; padding-left: 22px; }
.alert-success {
  background: #e3f1d6;
  color: #2e5215;
  border-left: 4px solid #4a7c2a;
}
.alert-error {
  background: #fbe8e3;
  color: #8e2615;
  border-left: 4px solid var(--coral);
}

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
  background: linear-gradient(180deg, #1d8aa3 0%, #15677a 100%);
  color: rgba(255,255,255,.9);
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  padding: 60px 0 40px;
}
.footer-col h4 {
  color: var(--sun);
  margin-bottom: 14px;
  font-size: 1.05rem;
}
.footer-col p,
.footer-col address {
  font-style: normal;
  color: rgba(255,255,255,.85);
  font-size: .92rem;
  line-height: 1.7;
  margin: 0;
}
.footer-col .muted { color: rgba(255,255,255,.65); }
.footer-col a { color: rgba(255,255,255,.95); }
.footer-col a:hover { color: var(--sun); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 18px 0;
  font-size: .82rem;
  color: rgba(255,255,255,.65);
  text-align: center;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%; right: 0; left: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    padding: 12px 20px 24px;
    box-shadow: var(--shadow-2);
    border-bottom: 1px solid var(--line);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s, opacity .25s;
  }
  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .site-nav a {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border-radius: var(--r-sm);
  }
  .site-nav a.nav-cta { margin-left: 0; margin-top: 8px; }

  .intro-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
}

@media (max-width: 600px) {
  :root { --header-h: 70px; }
  .logo-img { width: 42px; height: 42px; }
  .logo-text { font-size: 1.4rem; }
  .hero-content { padding: 40px 0 100px; }
  .lightbox-close { top: 12px; right: 12px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .footer-grid { padding: 40px 0 30px; gap: 30px; }
  .contact-form, .contact-info { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
