/*
Theme Name: SMC Breathe
Description: Tema custom per smcconsapevolmente.com — campo generativo "respiro", card vetro, editoriale anni '90 reinterpretato.
Version: 0.1.0
Author: Anthilla per SMC Consapevolmente
Text Domain: smc-breathe
*/

/* ============ Design tokens ============ */
:root {
  --deep: #0a1f1c;
  --teal: #1f6f66;
  --amber: #d8a24a;
  --violet: #5a3d6e;
  --bone: #efe9dd;
  --bone-dim: rgba(239, 233, 221, .68);
  --sage: #9aa398; /* dal logo ufficiale: grigio salvia spirale */
  --veil: rgba(18, 46, 42, .82);
  --line: rgba(239, 233, 221, .14);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Archivo", "Inter", system-ui, sans-serif;
  --space: clamp(4rem, 10vh, 8rem);
  --maxw: 1180px;
  --radius: 18px;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--deep);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--bone); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
/* Nel prose la sottolineatura è informativa, ma discreta */
.entry-content a { text-decoration: underline; text-decoration-color: rgba(216,162,74,.45); text-underline-offset: .2em; }
.entry-content a:hover { text-decoration-color: currentColor; }
.card-glass, .spiral-card, .btn, .smc-btn, .site-logo, .main-nav a, .site-footer a { text-decoration: none !important; }
.card-glass:hover, .spiral-card:hover { text-decoration: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

/* Grana filmica su tutto il sito */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* Canvas campo "respiro" — dietro tutto */
#smc-field { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; }
.no-canvas body, body.no-canvas {
  background:
    radial-gradient(60vw 80vh at 20% 10%, rgba(31,111,102,.5), transparent 70%),
    radial-gradient(50vw 70vh at 85% 80%, rgba(90,61,110,.4), transparent 70%),
    var(--deep);
}

/* ============ Tipografia ============ */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.08; margin: 0 0 .5em; }
h1 { font-size: clamp(2.6rem, 6vw, 5rem); letter-spacing: .01em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.35rem; }
.eyebrow {
  font-family: var(--font-body); font-size: .78rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--amber); margin-bottom: 1rem;
}
.lead { font-size: 1.2rem; color: var(--bone-dim); max-width: 46ch; }

/* ============ Layout ============ */
.wrap { width: min(var(--maxw), calc(100% - 3rem)); margin-inline: auto; }
section, .section { padding-block: var(--space); position: relative; }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: linear-gradient(rgba(10,31,28,.85), transparent);
}
.site-logo { display: flex; align-items: center; gap: .65rem; font-family: var(--font-display); font-size: 1.05rem; color: var(--bone); text-decoration: none; letter-spacing: .04em; }
.site-logo-img { border-radius: 50%; display: block; width: 60px; height: 60px; }
.site-logo { font-size: 1.15rem; }
.site-logo-text > span { color: var(--amber); }
.main-nav ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.main-nav a { color: var(--bone-dim); text-decoration: none; font-size: .95rem; }
.main-nav a:hover { color: var(--bone); }
.nav-cta { border: 1px solid var(--amber); border-radius: 999px; padding: .45em 1.2em; color: var(--amber) !important; }
.nav-cta:hover { background: var(--amber); color: var(--deep) !important; }

/* Hero */
.hero { min-height: 100vh; display: grid; place-items: center; text-align: center; padding-top: 6rem; position: relative; overflow: hidden; }
.hero-inner { max-width: 60rem; position: relative; z-index: 2; }
.hero p { color: var(--bone-dim); max-width: 52ch; margin-inline: auto; }
.hero-cta { display: inline-flex; gap: 1rem; margin-top: 2.2rem; flex-wrap: wrap; justify-content: center; }

/* Spirali — watermark hero + galleria "Le forme del respiro" (S45-41) */
.spiral-watermark {
  position: absolute; right: -12%; top: 50%; transform: translateY(-50%);
  width: min(46vw, 560px); opacity: .16; pointer-events: none; z-index: 1;
}
.spiral-gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.2rem; align-items: stretch; }
.spiral-card {
  border-radius: 18px; overflow: hidden; background: var(--bone);
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(6,20,17,.25);
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
}
.spiral-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(6,20,17,.35); }
.spiral-card img { width: 100%; height: auto; display: block; }
.spiral-card figcaption { padding: .8rem 1rem 1rem; font-size: .82rem; color: var(--bone-dim); }
.spiral-card figcaption strong { display: block; color: var(--bone); font-size: .92rem; margin-bottom: .2rem; }
.sp-a { grid-column: span 5; }   /* pietre in prato — grande */
.sp-b { grid-column: span 4; }   /* fibonacci */
.sp-c { grid-column: span 3; }   /* respiro */
.sp-d { grid-column: span 4; }   /* archimedea */
.sp-e { grid-column: span 8; }   /* phyllotaxis — larga */
@media (max-width: 768px) {
  .sp-a,.sp-b,.sp-c,.sp-d,.sp-e { grid-column: span 12; }
  .spiral-watermark { opacity: .10; width: 70vw; }
}

/* CTA buttons */
.smc-btn, .btn {
  display: inline-block; padding: .85em 2.2em; border-radius: 999px;
  font-family: var(--font-body); font-size: 1rem; cursor: pointer;
  text-decoration: none; transition: transform .3s ease, background .3s ease, color .3s;
}
.btn-primary, .smc-btn { background: var(--amber); color: var(--deep); border: 1px solid var(--amber); font-weight: 600; }
.btn-primary:hover, .smc-btn:hover { transform: scale(1.04); color: var(--deep); }
.btn-ghost { background: transparent; color: var(--bone); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

/* Card vetro */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.card-glass {
  background: linear-gradient(160deg, rgba(239,233,221,.09), rgba(239,233,221,.035) 55%), var(--veil);
  border: 1px solid rgba(239,233,221,.16); border-radius: var(--radius);
  padding: 2rem; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(4,14,12,.35), inset 0 1px 0 rgba(239,233,221,.10);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.card-glass:hover { transform: translateY(-6px); border-color: rgba(216,162,74,.45); box-shadow: 0 22px 50px rgba(4,14,12,.45), inset 0 1px 0 rgba(239,233,221,.12); }
.card-glass h3 { margin-top: 0; color: var(--bone); }
.card-glass p { color: var(--bone-dim); margin-bottom: 0; }
.card-icon { width: 44px; height: 44px; margin-bottom: 1.2rem; stroke: var(--amber); fill: none; stroke-width: 1.4; }

/* Archivio editoriale (CPT) */
.archive-hero { padding-top: 10rem; padding-bottom: 1rem; }
.archive-hero h1 { margin-bottom: .3em; }
.archive-desc { color: var(--bone-dim); max-width: 58ch; font-size: 1.12rem; }
.archive-count {
  display: inline-flex; align-items: center; gap: .5em; margin-top: 1.4rem;
  font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--sage);
  border: 1px solid var(--line); border-radius: 999px; padding: .45em 1.1em;
}

/* Prose (pagine e singoli) */
.entry-content { max-width: 62ch; font-size: 1.08rem; }
.entry-content p { margin: 0 0 1.1em; }
.entry-content h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 2em 0 .5em; }
.entry-content h3 { font-size: 1.3rem; margin: 1.6em 0 .4em; }
.entry-content ul { list-style: none; padding: 0; margin: 0 0 1.2em; }
.entry-content ul li { position: relative; padding-left: 1.5em; margin-bottom: .55em; }
.entry-content ul li::before {
  content: ''; position: absolute; left: 0; top: .62em;
  width: .55em; height: .55em; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--amber), rgba(216,162,74,.4));
}
.entry-content strong { color: var(--bone); }
.entry-content em { color: var(--sage); }

/* Sezioni alternate */
.surface-bone { background: var(--bone); color: var(--deep); }
.surface-bone .eyebrow { color: var(--teal); }
.surface-bone a { color: var(--teal); }
.surface-bone .card-glass { background: rgba(10,31,28,.05); border-color: rgba(10,31,28,.12); backdrop-filter: none; }
.surface-bone .card-glass p { color: rgba(10,31,28,.7); }

/* Booking form */
.smc-booking { max-width: 640px; }
.smc-booking .smc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.smc-booking label { display: block; font-size: .9rem; color: var(--bone-dim); }
.smc-booking .smc-full { grid-column: 1 / -1; }
.smc-booking input, .smc-booking select, .smc-booking textarea {
  width: 100%; margin-top: .4rem; padding: .7em .9em;
  background: rgba(239,233,221,.06); border: 1px solid var(--line);
  border-radius: 10px; color: var(--bone); font: inherit;
}
.smc-booking input:focus, .smc-booking select:focus, .smc-booking textarea:focus {
  border-color: var(--amber); outline: none;
}
.smc-booking .smc-btn { margin-top: 1.5rem; border: none; }
.smc-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.smc-note { padding: .9em 1.2em; border-radius: 10px; margin-bottom: 1.2rem; }
.smc-ok { background: rgba(31,111,102,.25); border: 1px solid var(--teal); }
.smc-err { background: rgba(216,80,60,.15); border: 1px solid #b0503c; }
.smc-consent { font-size: .85rem; display: flex; gap: .6rem; align-items: flex-start; }
.smc-consent input { width: auto; margin-top: .2em; }

/* Presenza cam — pannello consenso */
.presence-panel {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 60;
  background: var(--veil); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.4rem; max-width: 300px; backdrop-filter: blur(14px);
  font-size: .9rem; color: var(--bone-dim); display: none;
}
.presence-panel.open { display: block; }
.presence-panel p { margin: 0 0 .8rem; }
.presence-panel .row { display: flex; gap: .6rem; }
.presence-toggle {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 55;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--veil); border: 1px solid var(--line); color: var(--amber);
  cursor: pointer; backdrop-filter: blur(14px); font-size: 1.2rem;
}
.presence-toggle:hover { border-color: var(--amber); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 3rem 0 2rem; font-size: .9rem; color: var(--bone-dim); }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer a { color: var(--bone-dim); }
.site-footer .legal { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .8rem; }

/* Overlay prospettici — il JS anima data-depth */
[data-depth] { will-change: transform; }

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .site-header { padding: .7rem 1rem; gap: .8rem; }
  .site-logo { gap: .55rem; }
  .site-logo-img { width: 44px; height: 44px; }
  .site-logo-text { display: none; }   /* solo mark su mobile — il nome è nel title/hero */
  .main-nav { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav ul { gap: 1.1rem; font-size: .88rem; white-space: nowrap; }
  .nav-cta { padding: .4em 1em; }
  .smc-booking .smc-grid { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .presence-toggle { display: none; }   /* cam off su mobile */
  .presence-panel { left: 1rem; right: 1rem; max-width: none; }
  .archive-hero { padding-top: 7.5rem; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  [data-depth] { transform: none !important; }
}
