/* Pasticceria C. & P. – foglio di stile unico del sito statico */

:root {
  --rosso: #d23726;
  --arancio: #ed7941;
  --testo: #1b1a1a;
  --link: #d53e29;
  --icona: #ff5600;
  --grad: linear-gradient(0deg, #d23726 4%, #ed7941 100%);
  --font: Mulish, Muli, Arial, Helvetica, sans-serif;
  --serif: Caudex, Georgia, "Times New Roman", serif;
  --larghezza: 960px;
  --gutter: 40px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font: 400 16px/1.5 var(--font);
  color: var(--testo);
  background: #fff;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, address { margin: 0; font-style: normal; }

.container { width: min(100% - 2 * var(--gutter), var(--larghezza)); margin-inline: auto; }
.container--text { max-width: 920px; }
.center { text-align: center; }

.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

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

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 280px; min-height: 47px; padding: 10px 24px;
  background: var(--rosso); color: #fff; border: 0; border-radius: 0;
  font: 400 16px/1.2 var(--font); text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color .25s, color .25s;
}
.btn:hover { background: var(--arancio); }
.btn--wide { min-width: 287px; min-height: 52px; }
.btn--dark { background: var(--testo); }
.btn--dark:hover { background: #000; }
.btn--ghost { background: transparent; color: var(--rosso); box-shadow: inset 0 0 0 2px var(--rosso); }
.btn--ghost:hover { background: var(--rosso); color: #fff; }

/* Testata */
.site-header { background: #fff; }
.topbar { display: grid; grid-template-columns: 160px 1fr auto; align-items: center; gap: 0 20px; padding-block: 15px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { width: 176px; height: 176px; object-fit: contain; }
.brand__name { font: 700 24px/1.3 var(--serif); color: var(--testo); }

.social { display: flex; gap: 19px; }
.social__link { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; transition: transform .2s; }
.social__link svg { width: 60%; height: 60%; }
.social__link--fb { background: #5f82ce; }
.social__link--wa { background: #25d366; }
.social__link:hover { transform: scale(.9); }
.social--lg { justify-content: center; margin-top: 18px; }
.social--lg .social__link { width: 44px; height: 44px; }

.btn-call { min-width: 199px; min-height: 57px; position: relative; overflow: hidden; }
.btn-call__num { position: absolute; inset: 0; display: grid; place-items: center; background: var(--arancio); opacity: 0; transition: opacity .25s; }
.btn-call:hover .btn-call__num, .btn-call:focus-visible .btn-call__num { opacity: 1; }

.main-nav { background: linear-gradient(#d23726, #ed7941); }
.main-nav__list { display: flex; flex-wrap: wrap; justify-content: center; list-style: none; margin: 0; padding: 12px var(--gutter); }
.main-nav__list a { display: block; padding: 0 15px; color: #fff; font-size: 15px; line-height: 30px; text-decoration: none; }
.main-nav__list span { display: block; border-block: 2px solid transparent; transition: border-color .2s; }
.main-nav__list a:hover span, .main-nav__list a[aria-current] span { border-color: #fff; }
.nav-toggle { display: none; }

/* Hero */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 200px var(--gutter);
  background: #5a4a42 center / cover no-repeat;
  color: #fff; text-align: center;
}
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(27, 26, 26, .5); }
.hero__video { position: absolute; z-index: -2; top: 50%; left: 50%; width: 100vw; height: 56.25vw; min-height: 100%; min-width: 177.78vh; transform: translate(-50%, -50%); border: 0; pointer-events: none; }
.hero__inner { max-width: 800px; margin-inline: auto; }
.hero__title { font: 400 clamp(30px, 5.2vw, 50px)/1.5 var(--serif); text-shadow: 2px 2px 4px #000; margin-bottom: 20px; }

.wave {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 100px;
  display: flex; justify-content: center; align-items: flex-end;
  background: url("../img/onda.png") center top / cover no-repeat;
}
.wave img { width: 54px; height: auto; }

/* Sezioni */
.section { padding: 70px 0; }
.section--intro { padding: 30px 0 70px; }
.section--page-title { padding-top: 70px; }
.section--grad { background: var(--grad); color: #fff; }
.section--media { padding: 70px 0; }

.h2 { font: 700 24px/1.5 var(--font); margin-bottom: 15px; }
.h2--serif { font: 400 36px/1.6 var(--serif); margin: 14px 0 8px; }
.h2--serif:first-child { margin-top: 0; }
.page-title { font: 400 clamp(32px, 5vw, 48px)/1.3 var(--serif); margin-bottom: 30px; }

.rich p { margin-bottom: 24px; }
.rich p:last-child { margin-bottom: 0; }
.rich a { color: var(--link); font-weight: 700; }
.section--grad .rich a { color: #fff; }
address.rich p { margin-bottom: 0; }
.ph { opacity: .55; font-style: italic; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; }
.split__img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; background: rgba(0, 0, 0, .08); }

/* Home: riquadri servizi */
.services { position: relative; isolation: isolate; padding: 150px 0; background: #f3ece6 center / cover no-repeat; }
.services::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .8); }
.services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 21px; }
.service { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; }
.service .btn { width: 100%; min-width: 0; }
.service:hover .btn { background: var(--arancio); }
.service__icon { display: block; width: 90px; height: 90px; transition: transform .3s; }
.service__icon svg { width: 100%; height: 100%; fill: var(--icona); }
.service:hover .service__icon { transform: translateY(-8px); }

.feature { display: grid; grid-template-columns: 1fr 2fr; gap: 28px; align-items: center; }
.feature__head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.feature__title { font: 700 clamp(32px, 4.4vw, 48px)/1.2 var(--font); color: var(--rosso); }

.promo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: center; gap: 0 113px; background: linear-gradient(0deg, #d23726 30%, #d9d9d9 100%) fixed; color: #fff; }
.promo__img { width: 100%; max-height: 487px; margin-block: -70px; object-fit: contain; object-position: left center; position: relative; }
.promo__body { padding: 70px var(--gutter) 70px 0; }
.promo__body .h2 { max-width: 440px; font: 400 36px/1.5 var(--serif); }

.cta { position: relative; isolation: isolate; padding: 180px var(--gutter); background: #f1e7df center / cover no-repeat; text-align: center; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #ec7036 60%, #d9d9d9 100%); opacity: .5; }
.cta--big { padding-block: 200px; }
.cta__title { font: 400 28px/1.5 "Open Sans", var(--font); text-shadow: 2px 2px 4px rgba(0, 0, 0, .45); margin-bottom: 14px; }
.cta--light .cta__title { font: 400 30px/1.6 var(--serif); color: #fff; text-shadow: 2px 2px 4px #000; }
.cta--big .cta__title { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.4; }

.reviews { text-align: center; }
.reviews__title { font: 400 28px/1.3 "Open Sans", var(--font); margin-bottom: 24px; }

/* Gallerie + lightbox */
.gallery-wrap { padding: 0 10px 20px; }
.gallery { display: grid; grid-template-columns: repeat(var(--cols, 6), 1fr); }
.gallery:empty { min-height: 120px; background: rgba(0, 0, 0, .06); }
.gallery:empty::before { content: "Galleria da importare (vedi LEGGIMI.md)"; grid-column: 1 / -1; align-self: center; text-align: center; opacity: .55; font-style: italic; }
.gallery a { display: block; aspect-ratio: 1; overflow: hidden; }
.gallery a[hidden] { display: none; }
.gallery__more { display: flex; margin: 20px auto 0; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform .4s; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1); }

.media-row { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; align-items: start; padding-inline: 10px; }

.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0, 0, 0, .9); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.lightbox button { position: absolute; width: 48px; height: 48px; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: var(--rosso); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 16px; top: 50%; translate: 0 -50%; }
.lightbox__next { right: 16px; top: 50%; translate: 0 -50%; }
.lightbox__count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }

/* Contenuti esterni caricati su richiesta (YouTube, Google Maps) */
.embed { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; background: #2b2523; color: #fff; text-align: center; }
.embed--video { aspect-ratio: 16 / 9; max-width: 640px; width: 100%; margin-inline: auto; }
.embed--map { min-height: 450px; background: #e9e4df; color: var(--testo); }
.embed.is-loaded { padding: 0; }
.embed iframe { width: 100%; height: 100%; min-height: inherit; border: 0; display: block; }

/* Contatti */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.hours { display: grid; gap: 4px; max-width: 272px; }
.hours div { display: flex; justify-content: space-between; gap: 20px; }
.form-note { margin-bottom: 10px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.form__field { display: grid; gap: 4px; }
.form__field--full { grid-column: 1 / -1; }
.form input[type="text"], .form input[type="email"], .form input[type="tel"], .form textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #fff; border-radius: 0; background: rgba(255, 255, 255, .92);
  font: inherit; color: var(--testo);
}
.form textarea { resize: vertical; }
.form [aria-invalid="true"] { outline: 3px solid var(--testo); }
.form__check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.form__check input { margin-top: 4px; }
.form__msg:empty { display: none; }
.form__msg { font-weight: 700; }
.form .btn { justify-self: start; }

/* Pagine legali */
.legal { overflow-wrap: anywhere; }
.legal .page-title { text-align: center; }
.legal__index { text-align: center; margin-bottom: 40px; }
.legal article + article { margin-top: 60px; padding-top: 50px; border-top: 1px solid rgba(27, 26, 26, .2); }
.legal h2 { font: 400 clamp(24px, 3.4vw, 32px)/1.3 var(--serif); margin-bottom: 20px; }
.legal h3 { font: 700 20px/1.4 var(--font); margin: 32px 0 10px; }
.legal h4 { font: 700 16px/1.5 var(--font); margin: 20px 0 6px; }
.legal p { margin-bottom: 14px; }
.legal ol, .legal ul { margin: 0 0 14px; padding-left: 24px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--link); }
.legal__date { margin-top: 30px; font-style: italic; }

/* Piè di pagina */
.site-footer { padding: 25px 0 22px; background: #fff right top / cover no-repeat; text-align: center; }
.site-footer__name { display: inline-block; font: 700 22px/1.3 var(--font); color: var(--arancio); text-decoration: none; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__mail { color: var(--link); font-weight: 700; }

/* Comparsa allo scroll (solo con JS attivo) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s ease-in-out, transform 1s ease-out; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .gallery img, .service__icon { transition: none; }
}

/* Tablet */
@media (max-width: 1024px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .brand img { width: 110px; height: 110px; }
  .hero { padding-block: 150px 170px; }
  .services { padding: 90px 0; }
  .gallery { grid-template-columns: repeat(min(var(--cols, 6), 4), 1fr); }
  .promo { gap: 0 40px; }
}

/* Smartphone */
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .topbar { grid-template-columns: 1fr auto; row-gap: 10px; }
  .topbar .social { grid-column: 1 / -1; justify-content: center; order: 3; }
  .brand img { width: 72px; height: 72px; }
  .brand__name { font-size: 18px; }
  .btn { min-width: 0; }
  .btn-call { min-width: 0; min-height: 44px; padding-inline: 16px; }

  .nav-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px var(--gutter); border: 0; background: none; color: #fff; font: 700 15px/1 var(--font); cursor: pointer; }
  .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 22px; height: 2px; background: #fff; }
  .nav-toggle__bars { position: relative; }
  .nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -7px; }
  .nav-toggle__bars::after { top: 7px; }
  .js .main-nav__list { display: none; }
  .js .main-nav__list.is-open { display: block; }
  .main-nav__list { padding-top: 0; }
  .main-nav__list a { padding: 6px 0; }
  .main-nav__list span { display: inline-block; }

  .hero { padding-block: 90px 150px; }
  .section, .section--media { padding: 50px 0; }
  .section--intro { padding: 24px 0 50px; }
  .split, .feature, .contact, .media-row, .form { grid-template-columns: 1fr; }
  .split--reverse .split__img { order: -1; }
  .split__img { min-height: 220px; max-height: 360px; }
  .services { padding: 60px 0; }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .promo { grid-template-columns: 1fr; }
  .promo__img { margin: 0; max-height: 220px; }
  .promo__body { padding: 30px var(--gutter) 50px; }
  .cta, .cta--big { padding-block: 110px 150px; }
  .promo { background-attachment: scroll; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .h2--serif { font-size: 28px; }
  .embed--map { min-height: 340px; }
}
