/* =================================================================
   CHIROFIT & REHAB — Custom theme
   Estetica: editorial wellness · sabbia / panna / oro · Fraunces + Inter
   ================================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Brand */
  --sand:      #C2B49C;   /* principale */
  --gold:      #B28B1A;   /* secondario / accenti */
  --gold-deep: #8c6c12;
  --ink:       #1a1714;   /* testo (nero ammorbidito) */
  --ink-soft:  #5d574e;
  --cream:     #FEF9F0;   /* sfondo chiaro */
  --paper:     #FFFFFF;
  --mist:      #DFE0DF;   /* grigio */
  --sand-tint: #efe8db;
  --sand-wash: #f6f1e7;

  /* Tipografia */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Scala fluida */
  --step--1: clamp(0.83rem, 0.78rem + 0.2vw, 0.95rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2:  clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --step-3:  clamp(1.9rem, 1.55rem + 1.6vw, 2.9rem);
  --step-4:  clamp(2.4rem, 1.9rem + 2.6vw, 4.2rem);
  --step-5:  clamp(3rem, 2.2rem + 4vw, 6rem);

  /* Spazi */
  --space-xs: 0.5rem;
  --space-s:  1rem;
  --space-m:  2rem;
  --space-l:  4rem;
  --space-xl: 6rem;
  --space-2xl: clamp(5rem, 10vw, 9rem);

  --radius: 4px;
  --radius-lg: 18px;
  --radius-xl: 32px;
  --maxw: 1240px;
  --measure: 68ch;

  --shadow-sm: 0 1px 3px rgba(26,23,20,.06), 0 8px 24px -12px rgba(26,23,20,.12);
  --shadow-md: 0 4px 12px rgba(26,23,20,.08), 0 24px 60px -24px rgba(26,23,20,.22);
  --shadow-gold: 0 14px 40px -18px rgba(178,139,26,.55);

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.72;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* grana sottile su tutto il sito per dare materia */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-deep); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 .5em;
  font-optical-sizing: auto;
}
h1 { font-size: var(--step-4); font-weight: 380; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p  { margin: 0 0 1.1em; max-width: var(--measure); }
strong { font-weight: 600; color: var(--ink); }

::selection { background: var(--gold); color: var(--cream); }

/* ---------- Layout helpers ---------- */
.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.container--narrow { width: min(100% - 2.5rem, 820px); margin-inline: auto; }
.section { padding-block: var(--space-2xl); position: relative; }
.section--cream { background: var(--cream); }
.section--sand  { background: var(--sand-wash); }
.section--ink   { background: var(--ink); color: var(--cream); }
.section--ink h1,.section--ink h2,.section--ink h3 { color: var(--cream); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--body);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1.2rem;
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px; background: var(--gold);
}
.section--ink .eyebrow { color: var(--sand); }
.lead { font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--cream);
  display: inline-flex; align-items: center; gap: .6rem;
  padding: 1rem 1.8rem;
  background: var(--bg); color: var(--fg);
  font-family: var(--body); font-weight: 600; font-size: .92rem;
  letter-spacing: .02em;
  border: 1px solid var(--bg); border-radius: 100px;
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.btn svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--fg); }
.btn:hover svg { transform: translateX(4px); }
.btn--gold { --bg: var(--gold); --fg: var(--cream); }
.btn--gold:hover { box-shadow: var(--shadow-gold); }
.btn--ghost { --bg: transparent; --fg: var(--ink); border-color: rgba(26,23,20,.25); }
.btn--ghost:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.section--ink .btn--ghost { --fg: var(--cream); border-color: rgba(254,249,240,.3); }
.section--ink .btn--ghost:hover { background: var(--cream); color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(254,249,240,.85);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  padding-block: .9rem;
  box-shadow: 0 1px 0 rgba(26,23,20,.06);
}
.brand { display: flex; align-items: baseline; gap: .5rem; font-family: var(--display); font-size: 1.35rem; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
.brand b { font-weight: 600; }
.brand .amp { color: var(--gold); }
.brand small { font-family: var(--body); font-size: .6rem; letter-spacing: .25em; text-transform: uppercase; color: var(--ink-soft); align-self: center; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.2rem); }
/* wp_nav_menu() avvolge i link in <ul class="menu"><li>: la rendiamo orizzontale e senza pallini */
.nav .menu { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.2rem); list-style: none; margin: 0; padding: 0; }
.nav li { list-style: none; margin: 0; }
.nav a { font-family: var(--body); font-weight: 500; font-size: .92rem; color: var(--ink); position: relative; }
.nav a::after { content:""; position:absolute; left:0; bottom:-6px; width:0; height:2px; background: var(--gold); transition: width .3s var(--ease); }
.nav a:hover::after, .nav .current-menu-item > a::after { width: 100%; }
.nav .btn { padding: .7rem 1.3rem; }
.nav .btn::after { display: none; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 30px; height: 22px; position: relative; }
.nav-toggle span { position: absolute; left: 0; width: 100%; height: 2px; background: var(--ink); transition: .3s var(--ease); }
.nav-toggle span:nth-child(1){ top: 0; } .nav-toggle span:nth-child(2){ top: 10px; } .nav-toggle span:nth-child(3){ top: 20px; }
.nav-open .nav-toggle span:nth-child(1){ top:10px; transform: rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2){ opacity:0; }
.nav-open .nav-toggle span:nth-child(3){ top:10px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(8rem,16vh,12rem) 0 var(--space-2xl); overflow: hidden; }
.hero::before {
  content:""; position:absolute; top:-20%; right:-10%; width:55vw; height:55vw; max-width:760px; max-height:760px;
  background: radial-gradient(circle at 30% 30%, rgba(194,180,156,.55), rgba(194,180,156,0) 70%);
  border-radius: 50%; z-index:0;
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem,5vw,5rem); align-items: center; }
.hero h1 { font-size: var(--step-5); }
.hero h1 em { font-style: italic; color: var(--gold-deep); }
.hero-lead { margin-top: 1.5rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }
.hero-points { list-style: none; margin: 2.6rem 0 0; padding: 0; display: grid; gap: .9rem; }
.hero-points li { display: flex; gap: .8rem; align-items: flex-start; font-size: .98rem; color: var(--ink-soft); }
.hero-points svg { flex: none; width: 22px; height: 22px; color: var(--gold); margin-top: 1px; }
.hero-visual { position: relative; }
.hero-visual .ph { aspect-ratio: 4/5; border-radius: var(--radius-xl); }
.hero-visual .badge {
  position: absolute; bottom: -28px; left: -28px;
  background: var(--paper); border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: .9rem; max-width: 230px;
}
.hero-visual .badge .num { font-family: var(--display); font-size: 2.2rem; color: var(--gold-deep); line-height: 1; }
.hero-visual .badge span { font-size: .8rem; color: var(--ink-soft); line-height: 1.3; }

/* ---------- Placeholder immagini ---------- */
.ph {
  position: relative; overflow: hidden;
  background:
    linear-gradient(135deg, var(--sand-tint), var(--sand) 120%);
  display: grid; place-items: center;
  color: var(--gold-deep);
  border-radius: var(--radius-lg);
  isolation: isolate;
}
.ph::after {
  content:""; position:absolute; inset:0; z-index:-1; opacity:.5;
  background-image: radial-gradient(rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 14px 14px;
}
.ph__label {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-family: var(--body); font-size: .72rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; opacity: .7;
}
.ph__label svg { width: 30px; height: 30px; }
.ph--wide { aspect-ratio: 16/10; }
.ph--square { aspect-ratio: 1; }
.ph--tall { aspect-ratio: 4/5; }

/* Foto reali dentro i box dei placeholder */
figure.ph { margin: 0; }
.ph--img::after { content: none; }
.ph--img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}

/* ---------- Steps (metodo) ---------- */
.steps { display: grid; gap: clamp(3rem,6vw,5.5rem); margin-top: var(--space-l); }
.step { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,4.5rem); align-items: center; }
.step:nth-child(even) .step__media { order: 2; }
.step__index { font-family: var(--display); font-size: clamp(3rem,6vw,5rem); color: var(--sand); line-height: 1; display:block; margin-bottom: .5rem; }
.step__media .ph { aspect-ratio: 5/4; }
.step h3 { font-size: var(--step-2); }

/* ---------- Cards / servizi ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 1.5rem; margin-top: var(--space-l); }
.card {
  background: var(--paper); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.card .ph { aspect-ratio: 16/11; border-radius: 0; }
.card__body { padding: 1.8rem; flex: 1; display: flex; flex-direction: column; }
.card__body h3 { font-size: 1.5rem; }
.card__body p { font-size: .95rem; color: var(--ink-soft); }
.card__link { margin-top: auto; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .4rem; color: var(--gold-deep); }
.card__link svg { width: 18px; height: 18px; flex: none; transition: transform .3s var(--ease); }
.card:hover .card__link { gap: .8rem; }

/* ---------- Testimonials ---------- */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 1.5rem; margin-top: var(--space-l); }
.quote {
  background: var(--paper); border-radius: var(--radius-lg);
  padding: 2rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 1rem;
}
.quote__mark { font-family: var(--display); font-size: 3.5rem; line-height: .6; color: var(--sand); }
.quote p { font-size: .96rem; color: var(--ink-soft); margin: 0; }
.quote__author { margin-top: auto; display: flex; align-items: center; gap: .8rem; font-weight: 600; }
.quote__author .av { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg,var(--sand),var(--gold)); display:grid; place-items:center; color:var(--cream); font-family:var(--display); }
.stars { color: var(--gold); letter-spacing: 2px; font-size: .9rem; }

/* ---------- CTA band ---------- */
.cta-band { position: relative; overflow: hidden; text-align: center; }
.cta-band::before { content:""; position:absolute; inset:0; background: radial-gradient(circle at 50% -20%, rgba(178,139,26,.25), transparent 60%); }
.cta-band .container { position: relative; }
.cta-band h2 { font-size: var(--step-4); max-width: 16ch; margin-inline: auto; }
.cta-band .btn { margin-top: 1.5rem; }

/* ---------- Split feature (partner) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,4rem); align-items: center; }
.split__media .ph { aspect-ratio: 4/3; }

/* ---------- Page hero (interne) ---------- */
.page-hero { padding: clamp(9rem,18vh,13rem) 0 var(--space-xl); background: var(--sand-wash); position: relative; overflow:hidden; }
.page-hero::before { content:""; position:absolute; right:-8%; top:-30%; width:40vw; height:40vw; max-width:560px; max-height:560px; background: radial-gradient(circle,rgba(194,180,156,.5),transparent 70%); border-radius:50%; }
.page-hero .container { position: relative; }
.page-hero h1 { max-width: 18ch; }
.page-hero .lead { margin-top: 1rem; }

/* contenuto editoriale (pagine) */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.5rem; font-size: var(--step-2); }
.prose h3 { margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }
.prose blockquote { border-left: 3px solid var(--gold); padding-left: 1.4rem; margin: 2rem 0; font-style: italic; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--sand); padding-block: var(--space-xl) var(--space-m); }
.site-footer a { color: var(--sand); }
.site-footer a:hover { color: var(--cream); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.footer-grid h4 { font-family: var(--body); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--sand); opacity: .7; margin-bottom: 1.2rem; }
.footer-brand .brand { color: var(--cream); margin-bottom: 1rem; }
.footer-brand p { color: rgba(254,249,240,.6); font-size: .92rem; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; font-size: .95rem; }
.footer-contact { display: grid; gap: .7rem; font-size: .95rem; }
.footer-contact span { display:flex; gap:.6rem; align-items:flex-start; color: rgba(254,249,240,.8); }
.footer-contact svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.footer-bottom { margin-top: var(--space-l); padding-top: var(--space-m); border-top: 1px solid rgba(254,249,240,.12); display:flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .82rem; color: rgba(254,249,240,.5); }

/* ---------- Scroll reveal (solo con JS attivo) ---------- */
.has-js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"]{ transition-delay:.08s; }
.reveal[data-delay="2"]{ transition-delay:.16s; }
.reveal[data-delay="3"]{ transition-delay:.24s; }
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1; transform:none; transition:none; }
  html{ scroll-behavior:auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .nav { position: fixed; inset: 0 0 0 auto; width: min(82vw,360px); flex-direction: column; align-items: flex-start; justify-content: center; gap: 1.6rem; padding: 3rem; background: var(--cream); box-shadow: var(--shadow-md); transform: translateX(100%); transition: transform .4s var(--ease); }
  .nav .menu { flex-direction: column; align-items: flex-start; gap: 1.6rem; }
  .nav a { font-size: 1.3rem; font-family: var(--display); }
  .nav-open .nav { transform: none; }
  .nav-toggle { display: block; z-index: 1; }
  .hero .container, .step, .split, .footer-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .step:nth-child(even) .step__media { order: 0; }
  .hero-visual .badge { left: 0; }
}
@media (max-width: 560px){
  .footer-bottom{ flex-direction: column; }
}
