/*
Theme Name: Rocco Natale Studio Tecnico
Theme URI: https://rocconatale.it/
Author: Studio Tecnico Geometra Natale Rocco
Description: Tema su misura per lo studio tecnico NRG: apertura fotografica, servizi, portfolio dei cantieri con galleria e confronto prima/dopo.
Version: 2.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: rocconatale
*/

@font-face { font-family: "Manrope"; src: url("fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --ocra: #d9a441;        /* il giallo-ocra delle facciate storiche torinesi */
  --ocra-chiaro: #f1d9a6;
  --notte: #0f1216;
  --notte-2: #181c22;
  --carta: #f4f2ee;
  --testo: #16191e;
  --grigio: #5d636b;
  --linea: #e2ded6;
  --raggio: 20px;
  --larghezza: 1240px;
  --margine: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Manrope", system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.6; color: var(--testo); background: var(--carta); }
body.bloccato { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--ocra); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; }
h2 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.02em; line-height: 1.2; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* Pulsanti */
.bottone { display: inline-flex; align-items: center; justify-content: center; padding: 14px 24px; border-radius: 999px; font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; border: 1.5px solid transparent; transition: background-color .2s, color .2s, border-color .2s; }
.bottone.pieno { background: var(--ocra); color: var(--notte); }
.bottone.pieno:hover { background: #e7b65a; }
.bottone.vuoto { border-color: rgba(255,255,255,.4); color: #fff; backdrop-filter: blur(8px); }
.bottone.vuoto:hover { border-color: #fff; }
.bottone.scuro { background: var(--testo); color: #fff; }
.bottone.scuro:hover { background: #000; }
.bottone.chiaro { border-color: rgba(255,255,255,.35); color: #fff; }
.bottone.chiaro:hover { background: #fff; color: var(--notte); }
.azioni { display: flex; flex-wrap: wrap; gap: 12px; }

/* Testata */
.testata { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px var(--margine); color: #fff; background: rgba(15,18,22,.92); backdrop-filter: blur(12px); transition: background-color .3s, padding .3s; }
.home .testata { background: transparent; backdrop-filter: none; padding-top: 28px; }
.home .testata.solida { background: rgba(15,18,22,.92); backdrop-filter: blur(12px); padding-top: 16px; padding-bottom: 16px; }
.marchio img { height: 40px; width: auto; }
.testata nav { display: flex; align-items: center; gap: 32px; font-weight: 500; font-size: .97rem; }
.testata nav li { list-style: none; display: inline; }
.testata nav a { text-decoration: none; opacity: .92; }
.testata nav a:hover { opacity: 1; color: var(--ocra); }
.testata-tel { background: var(--ocra); color: var(--notte) !important; padding: 11px 20px; border-radius: 999px; font-weight: 700; opacity: 1 !important; }
.testata-tel:hover { background: #e7b65a; }
body:not(.home) main { padding-top: 86px; }

/* Apertura */
.apertura { position: relative; min-height: max(100vh, 760px); overflow: hidden; color: #fff; background: radial-gradient(ellipse at 70% 30%, #2a3240, var(--notte) 70%); display: flex; flex-direction: column; justify-content: center; padding: 150px var(--margine) 190px; }
.apertura-sfondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; animation: respiro 18s ease-out both; }
.apertura::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(12,14,18,.92) 0%, rgba(12,14,18,.7) 42%, rgba(12,14,18,.12) 78%), linear-gradient(0deg, rgba(12,14,18,.9), transparent 42%); }
@keyframes respiro { from { transform: scale(1.07); } to { transform: scale(1); } }
.apertura-testo { position: relative; z-index: 2; max-width: 800px; animation: entra .9s cubic-bezier(.2,.7,.2,1) .15s both; }
@keyframes entra { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.etichetta { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: .9rem; font-weight: 600; color: var(--ocra); border: 1px solid rgba(217,164,65,.45); background: rgba(217,164,65,.1); padding: 7px 14px; border-radius: 999px; }
.etichetta::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ocra); }
.apertura h1 { font-size: clamp(2.9rem, 6.6vw, 5.4rem); margin: 26px 0 0; line-height: .98; max-width: 12.5ch; }
.apertura h1 em { font-style: normal; color: var(--ocra); }
.apertura .intro { font-size: 1.2rem; line-height: 1.55; color: #c9ced6; max-width: 560px; margin: 26px 0 0; }
.apertura .azioni { margin-top: 36px; }
.ultimo { position: absolute; z-index: 2; right: var(--margine); top: 130px; display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(14px); text-decoration: none; font-weight: 700; font-size: .95rem; max-width: 360px; }
.ultimo img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.ultimo small { display: block; color: var(--ocra); font-weight: 600; font-size: .78rem; }
.vetri { position: absolute; z-index: 2; left: var(--margine); right: var(--margine); bottom: 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; list-style: none; margin: 0; padding: 0; }
.vetri li { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(14px); border-radius: 18px; padding: 18px 20px; font-size: .86rem; color: #aeb4bd; }
.vetri strong { display: block; font-size: 1.35rem; letter-spacing: -.02em; color: #fff; margin-bottom: 2px; }

/* Sezioni chiare */
.servizi, .studio, .come { max-width: var(--larghezza); margin: 0 auto; padding: clamp(72px, 9vw, 128px) var(--margine) 0; }
.servizi-testa { display: grid; grid-template-columns: 1.1fr 1fr; align-items: end; gap: 24px 64px; margin-bottom: 48px; }
.servizi-testa p { margin: 0; color: var(--grigio); font-size: 1.12rem; max-width: 52ch; }
.griglia-servizi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.servizio { background: #fff; border: 1px solid var(--linea); border-radius: var(--raggio); padding: 28px 28px 26px; transition: transform .25s, box-shadow .25s, border-color .25s; }
.servizio:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgba(15,18,22,.35); border-color: transparent; }
.servizio::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--ocra); margin-bottom: 20px; }
.servizio h3 { margin-bottom: 10px; }
.servizio p { margin: 0 0 18px; color: var(--grigio); font-size: .98rem; }
.etichette { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.etichette li { font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--carta); color: #3d4249; }

.studio { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.studio-testo h2 { margin-bottom: 24px; }
.studio-testo p { font-size: 1.1rem; color: #3d4249; margin: 0 0 16px; max-width: 56ch; }
.studio-testo .bottone { margin-top: 8px; }
.punti { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.punti li { background: var(--notte); color: #b9bec6; border-radius: var(--raggio); padding: 24px 26px; }
.punti strong { display: block; color: #fff; font-size: 1.15rem; letter-spacing: -.02em; margin-bottom: 4px; }

/* Cantieri */
.cantieri { background: var(--notte); color: #fff; margin-top: clamp(72px, 9vw, 128px); padding: clamp(72px, 9vw, 128px) var(--margine); }
.cantieri-testa { max-width: var(--larghezza); margin: 0 auto 40px; display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.cantieri-testa h2, .cantieri-testa h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 0; }
.cantieri-testa p { margin: 0; color: #aeb4bd; max-width: 44ch; }
.griglia-cantieri { max-width: var(--larghezza); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 280px; gap: 16px; }
.scheda { position: relative; display: block; border-radius: var(--raggio); overflow: hidden; text-decoration: none; color: #fff; background: var(--notte-2); }
.scheda.grande { grid-column: span 2; grid-row: span 2; }
.scheda-foto, .scheda-foto img { position: absolute; inset: 0; width: 100%; height: 100%; }
.scheda-foto img { object-fit: cover; transition: transform .6s ease; }
.scheda:hover .scheda-foto img { transform: scale(1.05); }
.scheda::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,12,15,.88), rgba(10,12,15,0) 55%); }
.scheda-testo { position: absolute; z-index: 1; left: 22px; right: 22px; bottom: 20px; display: flex; flex-direction: column; gap: 2px; }
.scheda-lavori { color: var(--ocra); font-size: .82rem; font-weight: 700; }
.scheda-titolo { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; line-height: 1.15; }
.scheda.grande .scheda-titolo { font-size: 1.8rem; }
.scheda-dati { color: #c3c8cf; font-size: .9rem; }
.scheda-conta { position: absolute; z-index: 1; top: 16px; right: 16px; background: rgba(255,255,255,.14); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.2); padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.scheda:focus-visible { outline-color: var(--ocra); }
.tutti { max-width: var(--larghezza); margin: 32px auto 0; }
.paginazione { max-width: var(--larghezza); margin: 32px auto 0; }
.paginazione .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.paginazione a, .paginazione span { padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); text-decoration: none; }
.paginazione .current { background: var(--ocra); color: var(--notte); border-color: var(--ocra); }

/* Come si lavora */
.come h2 { margin-bottom: 44px; }
.passi { list-style: none; margin: 0; padding: 0; counter-reset: passo; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.passi li { counter-increment: passo; background: #fff; border: 1px solid var(--linea); border-radius: var(--raggio); padding: 26px 24px; color: var(--grigio); font-size: .98rem; }
.passi li::before { content: counter(passo); display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ocra); color: var(--notte); font-weight: 800; margin-bottom: 18px; }
.passi strong { display: block; color: var(--testo); font-size: 1.12rem; letter-spacing: -.02em; margin-bottom: 6px; }

/* Contatti */
.contatti { margin: clamp(72px, 9vw, 128px) var(--margine) var(--margine); border-radius: 28px; background: var(--notte); color: #fff; padding: clamp(40px, 6vw, 80px); position: relative; overflow: hidden; }
.contatti::before { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(217,164,65,.35), transparent 65%); }
.contatti-testa { position: relative; max-width: 760px; }
.contatti-testa p { color: #b9bec6; font-size: 1.15rem; margin: 18px 0 30px; }
.dati { position: relative; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dati > div { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 18px 20px; }
.dati dt { font-size: .8rem; color: var(--ocra); font-weight: 700; margin-bottom: 4px; }
.dati dd { margin: 0; color: #e6e8eb; }

/* Piede */
.piede { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; padding: 28px var(--margine) 36px; font-size: .88rem; color: var(--grigio); }
.piede p { margin: 0; }
.piede-link { display: flex; gap: 20px; align-items: center; }
.link-linkedin { display: inline-flex; align-items: center; gap: 6px; }
.link-linkedin svg { width: 18px; height: 18px; color: #0a66c2; }
.da-inserire { color: #b3261e; }

/* WhatsApp */
.whatsapp { position: fixed; right: 20px; bottom: 20px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; background: #1f9d55; color: #fff; text-decoration: none; font-weight: 700; padding: 13px 20px 13px 16px; border-radius: 999px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); }
.whatsapp svg { width: 22px; height: 22px; }
.whatsapp:hover { background: #18834a; }

/* Pagina del cantiere */
.cantiere-pagina { max-width: var(--larghezza); margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--margine) 0; }
.cantiere-torna { margin: 0 0 24px; }
.cantiere-lavori { display: inline-block; margin: 0 0 14px; font-weight: 700; font-size: .9rem; background: var(--ocra-chiaro); padding: 5px 14px; border-radius: 999px; }
.cantiere-pagina h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); max-width: 20ch; }
.cantiere-dati { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 28px 0 0; }
.cantiere-dati dt { font-size: .82rem; color: var(--grigio); }
.cantiere-dati dd { margin: 0; font-weight: 700; }
.cantiere-desc { max-width: 68ch; margin-top: 24px; font-size: 1.1rem; color: #3d4249; }
.galleria { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.galleria a { display: block; overflow: hidden; border-radius: 14px; background: var(--linea); }
.galleria img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s ease; }
.galleria a:hover img { transform: scale(1.04); }

/* Confronto prima/dopo */
.confronto { position: relative; overflow: hidden; background: #0b0d10; border-radius: var(--raggio); --pos: 50%; }
.confronto-pagina { margin-top: 40px; }
.confronto img { width: 100%; max-height: 72vh; object-fit: contain; }
.confronto-dopo { position: absolute; inset: 0; }
.confronto-dopo img { width: 100%; height: 100%; }
.confronto::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: var(--ocra); pointer-events: none; }
.confronto input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.confronto-etichetta { position: absolute; top: 14px; padding: 4px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; pointer-events: none; background: rgba(15,18,22,.75); color: #fff; }
.confronto-etichetta.sx { left: 14px; }
.confronto-etichetta.dx { right: 14px; background: var(--ocra); color: var(--notte); }

/* Visore delle foto */
.visore { width: min(1200px, 100vw); max-width: 100vw; max-height: 100vh; height: 100vh; margin: 0 auto; padding: 0; border: 0; background: var(--notte); color: #fff; overflow-y: auto; }
.visore::backdrop { background: rgba(8,10,12,.88); }
.visore-testa { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 20px 24px; background: rgba(15,18,22,.95); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.1); }
.visore-testa h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 0 0 6px; }
.visore-dati { margin: 0; color: #aeb4bd; max-width: 75ch; }
.visore-chiudi { all: unset; cursor: pointer; background: var(--ocra); color: var(--notte); font-weight: 700; padding: 9px 18px; border-radius: 999px; }
.visore-chiudi:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.visore-corpo { padding: 24px; display: grid; gap: 20px; }
.visore-foto { position: relative; margin: 0; background: #0b0d10; border-radius: var(--raggio); overflow: hidden; }
.visore-foto img { width: 100%; max-height: 72vh; object-fit: contain; margin: 0 auto; }
.visore-foto figcaption { position: absolute; left: 14px; bottom: 14px; background: rgba(15,18,22,.75); padding: 3px 12px; border-radius: 999px; font-size: .85rem; }
.visore-foto.singola .freccia, .visore-foto.singola figcaption { display: none; }
.freccia { all: unset; cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.9); color: var(--notte); font-size: 1.8rem; font-weight: 700; line-height: 1; }
.freccia:focus-visible { outline: 3px solid var(--ocra); }
.freccia.prec { left: 14px; }
.freccia.succ { right: 14px; }
.visore-desc { margin: 0; max-width: 70ch; color: #dfe2e6; white-space: pre-line; }
.miniature { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.mini { all: unset; cursor: pointer; flex: 0 0 auto; width: 96px; height: 72px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; }
.mini img { width: 100%; height: 100%; object-fit: cover; }
.mini[aria-current="true"] { border-color: var(--ocra); }
.visore-link { margin: 0; }
.visore-link a { color: var(--ocra); font-weight: 700; }

/* Pagine di testo */
.testo { max-width: 860px; margin: 0 auto; padding: 56px var(--margine) 80px; }
.testo h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 28px; }
.testo-corpo h2 { font-size: 1.5rem; margin: 34px 0 10px; }
.testo-corpo > * { max-width: 68ch; }

/* Responsive */
@media (max-width: 1024px) {
  .vetri { grid-template-columns: 1fr 1fr; }
  .apertura { padding-bottom: 270px; }
  .ultimo { display: none; }
  .griglia-servizi { grid-template-columns: 1fr 1fr; }
  .servizi-testa, .studio { grid-template-columns: 1fr; }
  .griglia-cantieri { grid-template-columns: 1fr 1fr; }
  .passi { grid-template-columns: 1fr 1fr; }
  .dati { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .testata nav a:not(.testata-tel) { display: none; }
  .testata nav li { display: none; }
  .marchio img { height: 30px; }
  .apertura { min-height: 0; padding: 130px 20px 40px; justify-content: flex-start; }
  .apertura::before { background: linear-gradient(0deg, rgba(12,14,18,.95) 25%, rgba(12,14,18,.55)); }
  .vetri { position: relative; left: auto; right: auto; bottom: auto; margin-top: 40px; }
  .vetri li { padding: 14px 16px; }
  .vetri strong { font-size: 1.1rem; }
  .griglia-servizi, .griglia-cantieri, .passi, .dati, .galleria { grid-template-columns: 1fr; }
  .scheda.grande { grid-column: auto; grid-row: auto; }
  .contatti { margin-left: 12px; margin-right: 12px; }
  .whatsapp span { display: none; }
  .whatsapp { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .apertura-sfondo, .apertura-testo { animation: none; }
  .servizio, .scheda-foto img, .galleria img { transition: none; }
}

/* Barra di amministrazione di WordPress (visibile solo a chi è collegato) */
.admin-bar .testata { top: 32px; }
@media (max-width: 782px) { .admin-bar .testata { top: 46px; } }
