/*
Theme Name: Sparapan Canvas
Theme URI: https://alessandrosparapan.it
Author: Alessandro Sparapan
Description: Tema B&W minimalista per architetto. Ispirato a Girolimini Architect.
Version: 5.0
License: GNU General Public License v2 or later
Text Domain: sp-canvas
*/

/* ─────────────────────────────────────────────────────
   VARIABILI — paletta B&W pura
───────────────────────────────────────────────────── */
:root {
  --bg:       #ffffff;
  --ink:      #111111;
  --warm:     #666666;
  --line:     rgba(0,0,0,.1);
  --font:     'Barlow', sans-serif;
}

/* ─────────────────────────────────────────────────────
   RESET
───────────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family: var(--font);
  font-weight: 300;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img  { display:block; max-width:100%; height:auto; }
a    { text-decoration:none; color:inherit; }
ul   { list-style:none; }
input, textarea, select, button { font-family:var(--font); }

/* ─────────────────────────────────────────────────────
   HOME — nessuno scroll, pagina statica 100vh
   Il body sulla home non deve poter scorrere.
───────────────────────────────────────────────────── */
body.home,
body.home.page {
  overflow: hidden;
  height: 100vh;
}
/* Nasconde il footer sulla home */
body.home .sp-footer { display: none !important; }

/* ─────────────────────────────────────────────────────
   ELEMENTOR compat
───────────────────────────────────────────────────── */
.site-main, .page-content, .entry-content, .post-content {
  padding: 0 !important; margin: 0 !important;
}
.elementor-section.elementor-section-boxed > .elementor-container,
.elementor-container { max-width: 100% !important; }
.elementor-widget:not(:last-child) { margin-bottom: 0; }

/* ─────────────────────────────────────────────────────
   HEADER
   Logo: NOME bold + ARCHITECT light — esattamente come Girolimini
───────────────────────────────────────────────────── */
.sp-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: transparent;
  /* Nessuna transizione opaca — rimane sempre trasparente,
     diventa bianco solo su pagine non-hero */
}
/* Sulle pagine interne (About, Contact, Progetti) l'header è bianco */
body:not(.home) .sp-header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
/* Sulla home: header trasparente, testo bianco */
body.home .sp-header .sp-logo,
body.home .sp-header .sp-nav a { color: #ffffff; }
/* Quando si scrolla e diventa solid (solo per pagine interne, non ha effetto sulla home) */
.sp-header.sp-solid {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

/* Logo stile Girolimini: NOME grassetto + ARCHITECT leggero */
.sp-logo {
  font-family: var(--font);
  font-size: .82rem;
  color: var(--ink);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sp-logo strong {
  font-weight: 700;
}
.sp-logo em {
  font-weight: 300;
  font-style: normal;
  margin-left: 6px;
}

/* Nav */
.sp-nav {
  display: flex;
  gap: 48px;
}
.sp-nav a {
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  transition: opacity .2s;
}
.sp-nav a:hover { opacity: .5; }
.sp-nav a.sp-current { opacity: .5; }

/* Hamburger mobile */
.sp-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
}
.sp-hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: background .2s;
}
body.home .sp-hamburger span { background: #ffffff; }

/* ─────────────────────────────────────────────────────
   MOBILE MENU
───────────────────────────────────────────────────── */
.sp-mobile-nav {
  position: fixed; inset: 0;
  background: #ffffff;
  z-index: 900;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 36px;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.sp-mobile-nav.sp-open { transform: translateX(0); }
.sp-mobile-nav a {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  transition: opacity .2s;
}
.sp-mobile-nav a:hover { opacity: .45; }
.sp-mobile-close {
  position: absolute; top: 20px; right: 28px;
  font-size: .65rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--warm);
  background: none; border: none;
  cursor: pointer; font-family: var(--font);
}

/* ─────────────────────────────────────────────────────
   FOOTER — solo sulle pagine interne
───────────────────────────────────────────────────── */
.sp-footer {
  height: 52px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}
.sp-footer span {
  font-size: .6rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--warm);
  font-weight: 300;
}

/* ─────────────────────────────────────────────────────
   HOME HERO — Girolimini style
   Foto a tutto schermo, header trasparente, nessun testo
───────────────────────────────────────────────────── */
.sp-home-hero-wrap,
.sp-hero-fullscreen {
  position: fixed;          /* fixed = rimane fermo, non scorribile */
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
}
/* L'Elementor section su home */
body.home .elementor-section:first-child {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  margin: 0 !important;
}
body.home .elementor-section:first-child .elementor-background-overlay,
body.home .elementor-section:first-child img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
body.home .elementor-section:first-child .elementor-container,
body.home .elementor-section:first-child .elementor-row,
body.home .elementor-section:first-child .elementor-column {
  height: 100% !important;
}
/* Il main su home non ha altezza propria */
body.home .sp-main { position: static; height: 100vh; }

/* ─────────────────────────────────────────────────────
   PAGINA ABOUT — layout Girolimini
───────────────────────────────────────────────────── */
.sp-page-about {
  padding-top: 60px; /* compensa header */
  background: #ffffff;
  min-height: 100vh;
}
/* Titolo pagina centrato */
.sp-page-title {
  text-align: center;
  padding: 64px 32px 56px;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink);
}
/* Layout 2 colonne: foto sinistra, testo destra */
.sp-about-body {
  display: grid;
  grid-template-columns: 45% 1fr;
  gap: 0 80px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 100px;
  align-items: start;
}
.sp-about-photo img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(100%) contrast(1.02);
}
.sp-about-text { padding-top: 8px; }
.sp-about-section { margin-bottom: 56px; }
.sp-about-section-title {
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 20px;
}
.sp-about-section-body {
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--ink);
}
.sp-about-section-body p { margin-bottom: .9em; }
/* Timeline */
.sp-timeline { margin-top: 0; }
.sp-timeline-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.sp-timeline-year {
  font-size: .65rem;
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--warm);
  padding-top: 2px;
}
.sp-timeline-role {
  font-size: .82rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 3px;
}
.sp-timeline-desc {
  font-size: .75rem;
  font-weight: 300;
  color: var(--warm);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .sp-about-body { grid-template-columns: 1fr; gap: 40px 0; }
  .sp-about-photo { max-width: 480px; }
}
@media (max-width: 600px) {
  .sp-about-body { padding: 0 20px 80px; }
  .sp-page-title { padding: 48px 20px 40px; }
}

/* ─────────────────────────────────────────────────────
   PAGINA CONTATTI — layout Girolimini
───────────────────────────────────────────────────── */
.sp-page-contact {
  padding-top: 60px;
  background: #ffffff;
  min-height: 100vh;
}
.sp-contact-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px 100px;
}

/* Form stile Girolimini — solo underline, nessun bordo */
.sp-contact-form { width: 100%; }
.sp-contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
  margin-bottom: 0;
}
.sp-contact-field {
  margin-bottom: 48px;
}
.sp-contact-field--full {
  grid-column: 1 / -1;
}
.sp-contact-label {
  display: block;
  font-size: .78rem;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: .02em;
}
.sp-contact-input,
.sp-contact-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,.25);
  padding: 8px 0 12px;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 300;
  color: var(--ink);
  outline: none;
  transition: border-color .2s;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.sp-contact-input:focus,
.sp-contact-textarea:focus { border-bottom-color: var(--ink); }
.sp-contact-textarea {
  resize: none;
  min-height: 80px;
}
.sp-contact-submit-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}
.sp-contact-submit {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 300;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: .04em;
  padding: 0;
  transition: opacity .2s;
}
.sp-contact-submit:hover { opacity: .5; }

/* WPForms override per stile Girolimini */
.sp-contact-body .wpforms-form .wpforms-field { margin-bottom: 40px !important; padding: 0 !important; }
.sp-contact-body .wpforms-form .wpforms-field-label {
  font-family: var(--font) !important;
  font-size: .78rem !important;
  font-weight: 300 !important;
  color: var(--ink) !important;
  letter-spacing: .02em !important;
  text-transform: none !important;
  margin-bottom: 10px !important;
}
.sp-contact-body .wpforms-form input:not([type=radio]):not([type=checkbox]):not([type=submit]),
.sp-contact-body .wpforms-form textarea {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(0,0,0,.25) !important;
  border-radius: 0 !important;
  padding: 8px 0 12px !important;
  font-family: var(--font) !important;
  font-size: .88rem !important;
  font-weight: 300 !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  transition: border-color .2s !important;
}
.sp-contact-body .wpforms-form input:focus,
.sp-contact-body .wpforms-form textarea:focus {
  border-bottom-color: var(--ink) !important;
  outline: none !important;
}
.sp-contact-body .wpforms-form .wpforms-field-row { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 0 40px !important; }
.sp-contact-body .wpforms-form button[type=submit],
.sp-contact-body .wpforms-form input[type=submit] {
  background: none !important;
  border: none !important;
  font-family: var(--font) !important;
  font-size: .88rem !important;
  font-weight: 300 !important;
  color: var(--ink) !important;
  padding: 0 !important;
  letter-spacing: .04em !important;
  cursor: pointer !important;
  float: right !important;
  margin-top: 16px !important;
  transition: opacity .2s !important;
  text-transform: none !important;
}
.sp-contact-body .wpforms-form button[type=submit]:hover { opacity: .5 !important; }

@media (max-width: 600px) {
  .sp-contact-body { padding: 0 20px 80px; }
  .sp-contact-row { grid-template-columns: 1fr; }
  .sp-contact-body .wpforms-form .wpforms-field-row { grid-template-columns: 1fr !important; }
}

/* ─────────────────────────────────────────────────────
   GALLERIA PROGETTI
───────────────────────────────────────────────────── */
.sp-page-progetti {
  padding-top: 60px;
  background: #ffffff;
  min-height: 100vh;
}
.sp-page-progetti__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
/* Barra filtri */
.sp-filtri {
  display: flex;
  flex-wrap: wrap;
  gap: 0 36px;
  margin-bottom: 40px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.sp-filtri__btn {
  background: none; border: none;
  font-family: var(--font);
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--warm);
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.sp-filtri__btn:hover { color: var(--ink); }
.sp-filtri__btn--active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
/* Mosaico */
.sp-galleria-mosaic {
  columns: 2 380px;
  column-gap: 12px;
}
.sp-galleria-mosaic__item {
  display: block;
  break-inside: avoid;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  background: #f0f0f0;
  cursor: pointer;
  transition: opacity .3s;
}
.sp-galleria-mosaic__item.sp-hidden { display: none; }
.sp-galleria-mosaic__img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(15%);
  transition: transform .9s cubic-bezier(.4,0,.2,1), filter .5s;
}
.sp-galleria-mosaic__item:hover .sp-galleria-mosaic__img {
  transform: scale(1.025);
  filter: grayscale(0%);
}
.sp-galleria-mosaic__info {
  padding: 8px 0 4px;
}
.sp-galleria-mosaic__title {
  font-size: .8rem;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 2px;
  letter-spacing: .02em;
}
.sp-galleria-mosaic__meta {
  font-size: .65rem;
  font-weight: 300;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--warm);
  margin: 0;
}
@media (max-width: 640px) {
  .sp-page-progetti__inner { padding: 24px 20px 60px; }
  .sp-galleria-mosaic { columns: 1; }
}

/* ─────────────────────────────────────────────────────
   PAGINA SINGOLA PROGETTO
───────────────────────────────────────────────────── */
.sp-progetto-single {
  padding-top: 60px;
  background: #ffffff;
}
.sp-proj-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 100px;
}
.sp-proj-header {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}
.sp-proj-h1 {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.05;
}
.sp-proj-top {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0 56px;
  align-items: start;
  margin-bottom: 48px;
}
.sp-proj-hero-img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(10%);
}
.sp-proj-hero-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: #f0f0f0;
}
.sp-proj-data { position: sticky; top: 76px; padding-top: 2px; }
.sp-proj-data__row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.sp-proj-data__label {
  display: block;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 4px;
}
.sp-proj-data__value {
  display: block;
  font-size: .85rem;
  font-weight: 300;
  color: var(--warm);
  line-height: 1.5;
}
.sp-proj-back { margin-top: 28px; }
.sp-proj-back a {
  font-size: .62rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--warm);
  transition: color .2s;
}
.sp-proj-back a:hover { color: var(--ink); }
.sp-proj-text-wrap {
  padding-right: calc(260px + 56px);
  margin-bottom: 64px;
}
.sp-proj-content {
  font-size: .95rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--ink);
  max-width: 680px;
}
.sp-proj-content p { margin-bottom: 1.4em; }
/* Foto impilate */
.sp-proj-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.sp-proj-stack__item { overflow: hidden; cursor: zoom-in; background: #f0f0f0; }
.sp-proj-stack__img {
  width: 100%; height: auto; display: block;
  filter: grayscale(10%);
  transition: transform .9s cubic-bezier(.4,0,.2,1), filter .5s;
}
.sp-proj-stack__item:hover .sp-proj-stack__img {
  transform: scale(1.02);
  filter: grayscale(0%);
}
.sp-proj-credits {
  font-size: .6rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--warm);
  font-weight: 300; margin: 16px 0 48px;
}
.sp-proj-nav {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 24px;
  padding: 40px 0; border-top: 1px solid var(--line);
}
.sp-proj-nav__item a {
  display: flex; flex-direction: column; gap: 6px;
}
.sp-proj-nav__item--right a { align-items: flex-end; text-align: right; }
.sp-proj-nav__dir {
  font-size: .6rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--warm);
  font-weight: 400; transition: color .2s;
}
.sp-proj-nav__name {
  font-size: .9rem; font-weight: 300;
  color: var(--ink); transition: opacity .2s;
}
.sp-proj-nav__item a:hover .sp-proj-nav__name { opacity: .5; }
.sp-proj-nav__all {
  font-size: .6rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--warm);
  font-weight: 400; text-align: center;
  white-space: nowrap; transition: color .2s;
}
.sp-proj-nav__all:hover { color: var(--ink); }

@media (max-width: 900px) {
  .sp-proj-wrap { padding: 0 20px 80px; }
  .sp-proj-top { grid-template-columns: 1fr; gap: 36px 0; }
  .sp-proj-data { position: static; }
  .sp-proj-text-wrap { padding-right: 0; }
}
@media (max-width: 560px) {
  .sp-proj-nav { grid-template-columns: 1fr; gap: 16px; }
  .sp-proj-nav__item--right a { align-items: flex-start; text-align: left; }
  .sp-proj-nav__all { order: -1; }
}

/* ─────────────────────────────────────────────────────
   LIGHTBOX
───────────────────────────────────────────────────── */
.sp-lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.sp-lightbox.sp-lb-open { opacity: 1; pointer-events: all; }
.sp-lightbox__img-wrap { max-width: 92vw; max-height: 90vh; display: flex; }
.sp-lightbox__img {
  max-width: 92vw; max-height: 90vh;
  width: auto; height: auto; object-fit: contain; display: block;
  transform: scale(.96); transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.sp-lightbox.sp-lb-open .sp-lightbox__img { transform: scale(1); }
.sp-lightbox__close {
  position: fixed; top: 24px; right: 28px;
  font-size: .65rem; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.5); background: none; border: none;
  cursor: pointer; font-family: var(--font); transition: color .2s; z-index: 9001;
}
.sp-lightbox__close:hover { color: #fff; }
.sp-lightbox__arrow {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.4); font-size: 1.4rem;
  padding: 16px; transition: color .2s; z-index: 9001;
  font-weight: 300; line-height: 1; user-select: none;
}
.sp-lightbox__arrow:hover { color: #fff; }
.sp-lightbox__arrow--prev { left: 16px; }
.sp-lightbox__arrow--next { right: 16px; }
.sp-lightbox__counter {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: .58rem; letter-spacing: .28em;
  color: rgba(255,255,255,.3); font-weight: 300; white-space: nowrap;
}
@media (max-width: 560px) { .sp-lightbox__arrow { display: none; } }

/* ─────────────────────────────────────────────────────
   RESPONSIVE GLOBALE
───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sp-header { padding: 0 20px; }
  .sp-nav { display: none; }
  .sp-hamburger { display: flex; }
  .sp-footer { padding: 0 20px; }
}
@media (max-width: 480px) {
  .sp-footer { flex-direction: column; height: auto; padding: 14px 20px; gap: 3px; text-align: center; }
}
