/* ==========================================================================
   BAPARY — Foglio di stile globale
   Colori fissi, tipografia, layout, componenti condivisi.
   Modificabili anche via Tweaks (variabili --bp-*).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Palette (da brief) */
  --bp-bg: #F7F3EC;
  --bp-text: #201B16;
  --bp-accent: #8B5E3C;
  --bp-accent-2: #5A4632;
  --bp-dark: #14110D;
  --bp-whatsapp: #25D366;

  /* Derivati */
  --bp-bg-alt: #EEE7DA;
  --bp-line: rgba(32, 27, 22, 0.14);
  --bp-muted: rgba(32, 27, 22, 0.62);
  --bp-on-dark: #E9E1D2;
  --bp-on-dark-muted: rgba(233, 225, 210, 0.66);

  /* Tipografia */
  --bp-serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --bp-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Ritmo */
  --bp-container: 1240px;
  --bp-container-narrow: 780px;
  --bp-gutter: clamp(20px, 4vw, 48px);
  --bp-section-y: clamp(72px, 10vw, 140px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bp-bg);
  color: var(--bp-text);
  font-family: var(--bp-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Selezione */
::selection { background: var(--bp-accent); color: var(--bp-bg); }

/* ===================== TIPOGRAFIA ===================== */

h1, h2, h3, h4, h5 {
  font-family: var(--bp-serif);
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--bp-text);
  margin: 0 0 0.4em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.02; }
h2 { font-size: clamp(1.8rem, 4vw, 3.1rem); line-height: 1.1; }
h3 { font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.2; }
h4 { font-size: 1.25rem; line-height: 1.3; }

p { margin: 0 0 1em; text-wrap: pretty; max-width: 62ch; }

/* Eyebrow: più discreto, meno spaziato, meno colorato */
.eyebrow {
  font-family: var(--bp-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--bp-muted);
  margin: 0 0 1em;
  display: inline-block;
}

.lead {
  font-family: var(--bp-serif);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.4;
  font-weight: 400;
  color: var(--bp-text);
  max-width: 32ch;
}

/* Small-caps rimosso — usare .eyebrow o testo normale */
.small-caps {
  font-family: var(--bp-sans);
  font-size: 0.85rem;
  color: var(--bp-muted);
}

/* ===================== LAYOUT ===================== */

.container {
  max-width: var(--bp-container);
  margin: 0 auto;
  padding: 0 var(--bp-gutter);
}

.container-narrow {
  max-width: var(--bp-container-narrow);
  margin: 0 auto;
  padding: 0 var(--bp-gutter);
}

section { padding: var(--bp-section-y) 0; }

.section-dark {
  background: var(--bp-dark);
  color: var(--bp-on-dark);
}
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: var(--bp-on-dark); }
.section-dark .eyebrow { color: #C8A57F; }

.section-alt { background: var(--bp-bg-alt); }

/* ===================== NAV ===================== */

/* Nav: layout a due righe — logo centrale grande sopra, menu sotto */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 243, 236, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--bp-line);
}

.site-nav-inner {
  max-width: var(--bp-container);
  margin: 0 auto;
  padding: 24px var(--bp-gutter) 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
}

/* Brand: badge nero grande, centrato */
.site-nav .brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 22px 40px;
  background: var(--bp-dark);
  line-height: 0;
  transition: transform .3s ease;
}
.site-nav .brand:hover { transform: translateY(-1px); }
.site-nav .brand img {
  height: clamp(48px, 8vw, 80px);
  width: auto;
  display: block;
}

/* Toggle mobile: posizionato in alto a destra assoluto */
.nav-toggle {
  position: absolute;
  right: var(--bp-gutter);
  top: 24px;
}

@media (max-width: 860px) {
  .site-nav-inner { padding: 18px var(--bp-gutter) 14px; }
  .site-nav .brand { padding: 14px 24px; }
  .site-nav .brand img { height: 40px; }
  .nav-toggle { top: 18px; }
}

/* Fallback testuale (se l'immagine non carica) */
.site-nav .brand .brand-text {
  font-family: var(--bp-sans);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--bp-bg);
  line-height: 1;
}

/* Brand nel footer: badge più grande */
.site-footer .brand {
  display: inline-flex;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(233, 225, 210, 0.14);
  margin-bottom: 20px;
  line-height: 0;
}
.site-footer .brand img { height: 28px; width: auto; display: block; }

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: clamp(18px, 3vw, 40px);
}

.site-nav a {
  font-size: 0.92rem;
  color: var(--bp-text);
  position: relative;
  padding: 6px 0;
  transition: color .25s ease;
}
.site-nav a:hover { color: var(--bp-accent); }
.site-nav a[aria-current="page"] { color: var(--bp-accent); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--bp-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 22px;
  color: var(--bp-text);
  cursor: pointer;
  padding: 4px 8px;
}

@media (max-width: 860px) {
  .site-nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bp-bg);
    flex-direction: column;
    gap: 0;
    padding: 12px 0 20px;
    border-bottom: 1px solid var(--bp-line);
  }
  .site-nav ul.open { display: flex; }
  .site-nav ul li {
    padding: 12px var(--bp-gutter);
    border-top: 1px solid var(--bp-line);
    text-align: center;
  }
  .nav-toggle { display: block; }
}

/* ===================== BOTTONI ===================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid var(--bp-text);
  border-radius: 0;
  font-family: var(--bp-sans);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--bp-text);
  background: transparent;
  cursor: pointer;
  transition: background .3s ease, color .3s ease, border-color .3s ease, transform .2s ease;
}
.btn:hover { background: var(--bp-text); color: var(--bp-bg); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--bp-text);
  color: var(--bp-bg);
}
.btn-primary:hover { background: var(--bp-accent); border-color: var(--bp-accent); }

.btn-accent {
  background: var(--bp-accent);
  color: var(--bp-bg);
  border-color: var(--bp-accent);
}
.btn-accent:hover { background: var(--bp-accent-2); border-color: var(--bp-accent-2); color: var(--bp-bg); }

.btn-light {
  border-color: var(--bp-on-dark);
  color: var(--bp-on-dark);
}
.btn-light:hover { background: var(--bp-on-dark); color: var(--bp-dark); }

.btn-ghost {
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding-bottom: 6px;
}
.btn-ghost:hover { background: transparent; color: var(--bp-accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ===================== PLACEHOLDER FOTO ===================== */

.photo {
  position: relative;
  background: var(--bp-accent);
  color: var(--bp-bg);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  isolation: isolate;
}

.photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 400px at 30% 20%, rgba(255,255,255,0.10), transparent 60%),
    linear-gradient(160deg, rgba(255,255,255,0.06), rgba(0,0,0,0.28));
  z-index: -1;
}

.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 8px);
  z-index: -1;
  mix-blend-mode: overlay;
}

.photo .photo-num {
  font-family: var(--bp-serif);
  font-size: 3.2rem;
  line-height: 1;
  font-weight: 300;
  opacity: 0.28;
  position: absolute;
  top: 20px;
  left: 24px;
  letter-spacing: -0.02em;
}

.photo .photo-label {
  font-family: var(--bp-sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.9;
  max-width: 70%;
  line-height: 1.4;
}

.photo.square { aspect-ratio: 1 / 1; }
.photo.wide { aspect-ratio: 16 / 9; }
.photo.tall { aspect-ratio: 3 / 4; }
.photo.portrait { aspect-ratio: 3 / 4; }
.photo.hero { aspect-ratio: 16 / 10; min-height: 520px; }
/* Hero adatto a foto verticali di persona intera */
.photo.hero-portrait { aspect-ratio: 3 / 4; min-height: 520px; }

/* Varianti tonali per rompere la monotonia */
.photo.tone-2 { background: var(--bp-accent-2); }
.photo.tone-3 { background: var(--bp-dark); }
.photo.tone-4 { background: #6E5033; }
.photo.tone-5 { background: #3B2E23; }

/* Se contiene una vera <img>, la immagine copre tutto lo spazio.
   object-position: top center → la testa del modello resta sempre visibile
   nelle foto verticali con persona intera. */
.photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  z-index: 0;
}
/* Override per foto paesaggio (Sorrento, vicolo): centrate */
.photo.wide > img,
.photo.landscape > img {
  object-position: center center;
}
/* Nasconde il numero/label del placeholder quando c'è un'immagine vera */
.photo:has(> img) .photo-num,
.photo:has(> img) .photo-label { display: none; }
.photo:has(> img)::before,
.photo:has(> img)::after { display: none; }

/* ===================== HERO ===================== */

.hero {
  padding: clamp(60px, 8vw, 100px) 0 var(--bp-section-y);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.hero-copy .payoff {
  font-family: var(--bp-serif);
  font-weight: 400;
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  color: var(--bp-text);
  margin-bottom: 0.4em;
  opacity: 0.8;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ===================== CARD MODELLO ===================== */

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 48px);
}

.model-grid.two { grid-template-columns: repeat(2, 1fr); }
.model-grid.four { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 980px) {
  .model-grid, .model-grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .model-grid, .model-grid.two, .model-grid.four { grid-template-columns: 1fr; }
}

.model-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.model-card:hover { transform: translateY(-4px); }

.model-card .photo { transition: filter .5s ease; }
.model-card:hover .photo { filter: brightness(0.94); }

.model-card h3 {
  margin: 22px 0 4px;
  font-size: 1.7rem;
  letter-spacing: 0.05em;
}

.model-card .territory {
  color: var(--bp-muted);
  font-size: 0.95rem;
  margin: 0 0 12px;
  font-style: italic;
  font-family: var(--bp-serif);
}

.model-card .arrow {
  font-size: 0.95rem;
  color: var(--bp-accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.model-card .arrow::after {
  content: "→";
  transition: transform .3s ease;
}
.model-card:hover .arrow::after { transform: translateX(4px); }

/* ===================== BLOCCHI TESTUALI ===================== */

.block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}

.block.reverse { direction: rtl; }
.block.reverse > * { direction: ltr; }

.block.text-left { grid-template-columns: 5fr 6fr; }
.block.text-right { grid-template-columns: 6fr 5fr; }

@media (max-width: 860px) {
  .block, .block.text-left, .block.text-right { grid-template-columns: 1fr; }
}

.block .copy h2 { margin-bottom: 0.4em; }

/* Centered narrative */
.narrative {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.narrative p { margin-left: auto; margin-right: auto; }

/* Pull-quote / manifesto */
.manifesto-quote {
  font-family: var(--bp-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.35;
  color: var(--bp-text);
  max-width: 32ch;
  text-wrap: balance;
}

.section-dark .manifesto-quote { color: var(--bp-on-dark); }

/* ===================== FOOTER ===================== */

.site-footer {
  background: var(--bp-dark);
  color: var(--bp-on-dark);
  padding: 90px 0 40px;
  margin-top: 0;
}

.site-footer .footer-payoff {
  font-family: var(--bp-serif);
  font-style: italic;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--bp-on-dark);
  margin-bottom: 60px;
  max-width: 20ch;
  line-height: 1.2;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  border-top: 1px solid rgba(233, 225, 210, 0.12);
  padding-top: 50px;
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-grid h5 {
  font-family: var(--bp-serif);
  font-size: 1.1rem;
  color: var(--bp-on-dark);
  margin: 0 0 16px;
  font-weight: 400;
}

.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a {
  color: var(--bp-on-dark);
  font-size: 0.94rem;
  transition: color .25s ease;
}
.footer-grid a:hover { color: #C8A57F; }

.site-footer .footer-bottom {
  border-top: 1px solid rgba(233, 225, 210, 0.12);
  margin-top: 60px;
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.8rem;
  color: var(--bp-on-dark-muted);
}

/* ===================== WHATSAPP FLOATING ===================== */

.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bp-whatsapp);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.14);
  z-index: 60;
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 30px; height: 30px; }

@media (max-width: 620px) {
  .wa-float { bottom: 18px; right: 18px; width: 54px; height: 54px; }
  .wa-float svg { width: 26px; height: 26px; }
}

/* ===================== FADE-IN ON SCROLL =====================
   Nota: applichiamo l'opacity:0 iniziale SOLO se il body ha la classe .js
   (aggiunta subito dal script). In assenza di JS, tutto è visibile.
*/
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.js .reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===================== TABELLE MISURE ===================== */

.size-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--bp-sans);
  font-size: 0.95rem;
  margin: 24px 0;
}
.size-table th, .size-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--bp-line);
}
.size-table th {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--bp-muted);
}

/* Numero ordinale decorativo (steps) — più discreto */
.step-num {
  font-family: var(--bp-serif);
  font-size: 1.6rem;
  color: var(--bp-accent);
  line-height: 1;
  font-weight: 400;
}
.step-num.large {
  font-size: 2rem;
}

/* ===================== FAQ / ACCORDIONS ===================== */

.faq-item {
  border-top: 1px solid var(--bp-line);
  padding: 24px 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--bp-line); }
.faq-item summary {
  cursor: pointer;
  font-family: var(--bp-serif);
  font-size: 1.3rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  transition: color .25s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--bp-serif);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--bp-accent);
  transition: transform .3s ease;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:hover { color: var(--bp-accent); }
.faq-item .faq-body { padding-top: 14px; color: var(--bp-muted); max-width: 60ch; }

/* ===================== ARTICLES ===================== */

.article-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--bp-gutter);
}
.article-body h2 {
  margin-top: 2em;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
}
.article-body p { max-width: none; margin-bottom: 1.4em; }

.article-hero {
  padding: clamp(80px, 12vw, 140px) 0 clamp(48px, 8vw, 80px);
  text-align: center;
}
.article-hero h1 {
  max-width: 22ch;
  margin: 0 auto 24px;
  font-style: italic;
  font-weight: 300;
}
.article-hero .category-tag {
  color: var(--bp-accent);
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 30px;
  display: inline-block;
}

.article-cta {
  border-top: 1px solid var(--bp-line);
  margin-top: 60px;
  padding-top: 40px;
  text-align: center;
}
.article-cta .btn-row { justify-content: center; }

/* ===================== UTILITIES ===================== */

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 1em; }
.mt-2 { margin-top: 2em; }
.mt-3 { margin-top: 3em; }
.hairline {
  height: 1px;
  background: var(--bp-line);
  border: 0;
  margin: 60px 0;
  max-width: 200px;
}
.hairline.center { margin-left: auto; margin-right: auto; }

.pill {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--bp-line);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--bp-muted);
  transition: color .2s ease, border-color .2s ease;
}
.pill:hover { color: var(--bp-accent); border-color: var(--bp-accent); }

/* ===================== TAGLIE DISPONIBILI ===================== */
.size-chips { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 560px; }
.size-chips li { min-width: 56px; padding: 12px 0; text-align: center; border: 1px solid rgba(139, 94, 60, 0.35); color: var(--bp-text, #201B16); font-family: var(--bp-serif); font-size: 1.15rem; letter-spacing: 0.04em; transition: border-color .3s, background .3s; }
.size-chips li:hover { border-color: var(--bp-accent); background: rgba(139, 94, 60, 0.06); }
