/*
Theme Name: Ditta Trasformatori
Description: Tema per aziende che progettano e producono trasformatori elettrici, autotrasformatori e induttanze. Stile tecnico in rosso e blu, con disegno di progetto animato, catalogo prodotti con schede tecniche, modulo contatti, menu da Aspetto > Menu e opzioni dal Customizer.
Version: 2.11.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ditta-trasformatori
*/

:root {
  --bg: #eef2f9;
  --paper: #ffffff;
  --ink: #0e1b33;
  --muted: #46566e;
  --blue-dark: #082a5e;
  --blue: #0b3a82;
  --blue-2: #1558c0;
  --blue-soft: #dbe6f7;
  --red: #d6212f;
  --red-dark: #b0141f;
  --line: #c9d4e6;
  --steel: #9fb0c8;
  --radius: 4px;
  --wrap: 1160px;
  --font-head: "Bahnschrift", "DIN Alternate", "Franklin Gothic Medium", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--red-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-2); }

:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 3px; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed !important;
  top: 0.5rem; left: 0.5rem;
  width: auto; height: auto;
  clip: auto;
  padding: 0.75rem 1rem;
  background: var(--paper);
  z-index: 100;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); color: var(--blue); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; max-width: 68ch; }

/* ---------- Animazioni di base ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes rise-left { from { opacity: 0; transform: translateX(-44px); } }
@keyframes rise-right { from { opacity: 0; transform: translateX(44px); } }
@keyframes fade { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes flow { to { stroke-dashoffset: -22; } }
@keyframes grid-drift { to { background-position: 40px 40px; } }
@keyframes sweep { 0% { transform: translateX(0); } 60%, 100% { transform: translateX(640px); } }

/* Elementi che entrano scorrendo la pagina (attivati da main.js) */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].in {
  opacity: 1;
  animation: rise 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: calc(var(--rd, 0) * 90ms);
}
.js [data-reveal="left"].in { animation-name: rise-left; }
.js [data-reveal="right"].in { animation-name: rise-right; }

/* ---------- Bottoni ---------- */
.btn {
  position: relative;
  z-index: 0;
  display: inline-block;
  overflow: hidden;
  padding: 0.85rem 1.4rem;
  background: var(--red);
  color: #fff;
  border: 2px solid var(--red);
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--blue-dark);
  transform: translateX(-101%);
  transition: transform 0.3s ease;
}
.btn:hover { color: #fff; border-color: var(--blue-dark); }
.btn:hover::before { transform: none; }
.btn-small { padding: 0.55rem 1rem; font-size: 0.98rem; }
.btn-ghost { background: transparent; color: #fff; border-color: currentColor; }
.btn-ghost::before { background: #fff; }
.btn-ghost:hover { color: var(--blue); border-color: #fff; }
.btn-light { background: #fff; color: var(--red-dark); border-color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.75rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-top: 5px solid var(--red);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding-block: 0.4rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand a { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--blue); }
.brand img { height: 64px; width: auto; max-width: 100%; }
.brand .custom-logo-link { display: block; line-height: 0; }
.brand-mark {
  width: 1.9rem; height: 1.9rem;
  border: 3px solid var(--blue);
  background: repeating-linear-gradient(180deg, var(--red) 0 3px, transparent 3px 6px);
}
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.01em; }

.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.menu { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; list-style: none; margin: 0; padding: 0; }
.menu a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 0.3rem 0; }
.menu a:hover,
.menu .current-menu-item > a,
.menu .current_page_item > a { color: var(--red-dark); text-decoration: underline; text-underline-offset: 0.35em; text-decoration-thickness: 3px; }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 0.45rem 0.8rem;
  font: 600 1rem var(--font-head);
  color: var(--blue);
  cursor: pointer;
}

@media (max-width: 860px) {
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0.5rem 0 1.25rem;
  }
  .js .site-nav.is-open .menu { flex-direction: column; }
}

/* ---------- Hero: foglio di progetto ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 30%, rgba(60, 130, 230, 0.35), transparent 50%),
    linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 55%, var(--blue-2) 100%);
  color: var(--blue-soft);
  padding: clamp(2.2rem, 5vw, 3.8rem) 0 clamp(4.2rem, 8vw, 6.5rem);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 15%, transparent 75%);
  mask-image: radial-gradient(ellipse at 70% 40%, #000 15%, transparent 75%);
  animation: grid-drift 9s linear infinite;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(2.5rem, 6vw, 5rem);
  background: var(--red);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 { color: #fff; }
.hero p { font-size: 1.2rem; }

.hero-copy > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.hero-copy > :nth-child(2) { animation-delay: 0.12s; }
.hero-copy > :nth-child(3) { animation-delay: 0.24s; }
.hero-copy > :nth-child(4) { animation-delay: 0.36s; }

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  list-style: none;
  margin: 2.4rem 0 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.hero-points li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.15rem;
  color: #fff;
}
.hero-points svg { fill: none; stroke: #ff8f98; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Foglio di disegno */
.blueprint {
  position: relative;
  padding: 1.1rem;
  background: rgba(6, 28, 66, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.3);
  outline: 1px solid rgba(255, 255, 255, 0.18);
  outline-offset: -8px;
}

.bp {
  display: block;
  width: 100%;
  fill: none;
  stroke: #cfe0fb;
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.bp .d {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.2s cubic-bezier(0.5, 0, 0.2, 1) forwards;
  animation-delay: calc(var(--d, 0) * 90ms);
}
.bp .thin { stroke-width: 0.8; stroke: #8fb0e6; }
.bp .wire { stroke: #ff9fa8; stroke-width: 1.5; }
.bp .hid { stroke: #8fb0e6; stroke-width: 1; stroke-dasharray: 4 3; opacity: 0; animation: fade 0.8s ease 2.4s forwards; }
.bp .axis { stroke: #ff8f98; stroke-width: 0.9; stroke-dasharray: 10 3 2 3; opacity: 0; animation: fade 0.8s ease 2.6s forwards; }
.bp .dim { stroke: #ffd0d4; stroke-width: 1; opacity: 0; animation: fade 0.8s ease 3s forwards; }
.bp .dim text { fill: #ffd0d4; stroke: none; font: 600 15px var(--font-head); }
.bp .sweep { animation: sweep 7s ease-in-out 4s infinite; pointer-events: none; }

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

/* ---------- Fascia onde: media → bassa tensione ---------- */
.flow { background: var(--paper); padding: clamp(2.5rem, 5vw, 4rem) 0; border-bottom: 1px solid var(--line); }
.flow-head { max-width: 62ch; margin-bottom: 1.5rem; }
.flow-head p { color: var(--muted); }
.flow-labels { display: flex; justify-content: space-between; margin-bottom: 0.4rem; }
.chip {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  color: #fff;
}
.chip-blue { background: var(--blue-2); }
.chip-red { background: var(--red); }
.flow-chart svg { display: block; width: 100%; }
.flow-chart path, .flow-chart line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.w-blue { stroke: var(--blue-2); }
.w-red { stroke: var(--red); }
.w-ghost { opacity: 0.2; }
.w-flow { stroke-dasharray: 14 8; animation: flow 1.1s linear infinite; }
.sym { stroke: var(--blue-dark); }

/* ---------- Sezioni ---------- */
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section-paper { background: var(--paper); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 2rem; }
.section-head p { color: var(--muted); }
.section-head h2,
.flow-head h2 { padding-left: 0.9rem; border-left: 6px solid var(--red); }

.range { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.range-item { padding: 2.2rem; color: #fff; border-radius: var(--radius); }
.range-item--mt { background: linear-gradient(135deg, var(--blue-dark), var(--blue-2)); }
.range-item--bt { background: linear-gradient(135deg, var(--red-dark), var(--red)); }
.range-item h3 { color: #fff; font-size: 1.7rem; }
.range-item p { color: rgba(255, 255, 255, 0.92); }
.range-item a { color: #fff; font-weight: 600; text-decoration-thickness: 2px; }
.range-item a:hover { color: #fff; text-decoration-thickness: 4px; }
.range-wave { display: block; width: 140px; height: 48px; margin-bottom: 0.8rem; }
.range-wave path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 14 8; animation: flow 1.2s linear infinite; }
@media (max-width: 760px) { .range { grid-template-columns: 1fr; } }

/* ---------- Schede prodotto ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--blue-2);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}
.card:hover { transform: translateY(-6px); border-top-color: var(--red); box-shadow: 0 16px 32px rgba(8, 42, 94, 0.2); }
.card-media {
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(90deg, #d5e0f1 0 6px, #c2d1e9 6px 8px);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.card-body h3 { margin: 0; }
.card-body h3 a { color: var(--blue); text-decoration: none; }
.card-body h3 a::after { content: ""; position: absolute; inset: 0; }
.card-specs { margin: 0; display: grid; gap: 0.15rem; font-size: 0.95rem; color: var(--muted); }
.card-specs div { display: flex; justify-content: space-between; gap: 1rem; }
.card-specs dt { margin: 0; }
.card-specs dd { margin: 0; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.empty-note { padding: 1.5rem; background: var(--paper); border: 1px dashed var(--steel); border-radius: var(--radius); }

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.filters a {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 2px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.filters a:hover,
.filters a[aria-current="page"] { background: var(--blue); color: #fff; }

/* ---------- Come lavoriamo: percorso a tappe ---------- */
@keyframes step-ring { 0% { box-shadow: 0 0 0 0 rgba(214, 33, 47, 0.6); } 70%, 100% { box-shadow: 0 0 0 14px rgba(214, 33, 47, 0); } }
@keyframes dash-run { to { background-position: 14px 0; } }
@keyframes dash-run-v { to { background-position: 0 14px; } }

.steps {
  list-style: none; counter-reset: fase; margin: 0; padding: 2rem 0 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1.5rem;
}
.steps li {
  --badge: 52px;
  position: relative;
  counter-increment: fase;
  padding: calc(var(--badge) / 2 + 1.1rem) 1.4rem 1.6rem;
  background-color: rgba(255, 255, 255, 0.06);
  background-image:
    linear-gradient(#8fb0e6, #8fb0e6), linear-gradient(#8fb0e6, #8fb0e6),
    linear-gradient(#8fb0e6, #8fb0e6), linear-gradient(#8fb0e6, #8fb0e6);
  background-repeat: no-repeat;
  background-size: 16px 2px, 2px 16px, 16px 2px, 2px 16px;
  background-position: left 7px bottom 7px, left 7px bottom 7px, right 7px bottom 7px, right 7px bottom 7px;
  border: 1px solid rgba(143, 176, 230, 0.35);
  border-radius: var(--radius);
  transition: transform 0.3s ease, border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
}
.steps li:hover {
  transform: translateY(-5px);
  border-color: #8fb0e6;
  background-color: rgba(255, 255, 255, 0.11);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}
/* cerchio numerato che "pulsa" come un punto di controllo */
.steps li::before {
  content: counter(fase);
  position: absolute; top: calc(var(--badge) / -2); left: 1.2rem;
  width: var(--badge); height: var(--badge);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--red); color: #fff;
  border: 3px solid var(--blue-dark);
  font: 700 1.5rem/1 var(--font-head);
  animation: step-ring 2.6s ease-out infinite;
  animation-delay: calc(var(--rd, 0) * 250ms);
}
/* linea tratteggiata che collega una tappa alla successiva */
.steps li::after {
  content: "";
  position: absolute; top: -1px; height: 2px;
  left: calc(1.2rem + var(--badge));
  width: calc(100% - var(--badge) + 1.5rem);
  background: repeating-linear-gradient(90deg, #8fb0e6 0 8px, transparent 8px 14px);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.8s ease 0.35s;
  animation: dash-run 0.9s linear infinite;
}
.steps li.in::after { transform: none; }
.steps li:last-child::after { display: none; }
.steps h3 { color: #fff; font-size: 1.25rem; margin: 0 0 0.5rem; }
.steps p { color: #c5d6f2; font-size: 1rem; margin-bottom: 0; }
.step-media { margin: 0 0 1rem; }
.step-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border: 1px solid rgba(143, 176, 230, 0.35); border-radius: 2px; }

/* su schermi stretti il percorso diventa verticale */
@media (max-width: 900px) {
  .steps { grid-auto-flow: row; grid-template-columns: 1fr; gap: 1.6rem; padding: 0 0 0 4rem; }
  .steps li { --badge: 44px; padding: 1.2rem 1.3rem 1.4rem; }
  .steps li::before { top: 1rem; left: -4rem; font-size: 1.25rem; }
  .steps li::after {
    top: calc(1rem + var(--badge)); left: -43px; width: 2px;
    height: calc(100% + 1.6rem - var(--badge));
    background: repeating-linear-gradient(180deg, #8fb0e6 0 8px, transparent 8px 14px);
    transform: scaleY(0); transform-origin: top;
    animation-name: dash-run-v;
  }
  .steps li.in::after { transform: none; }
}

/* ---------- Banda di invito ---------- */
.cta-band { background: var(--red); color: #fff; padding: 2.5rem 0; }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; }
.cta-band h2 { margin: 0; color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); }

/* ---------- Contatti ---------- */
.contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-data { margin: 0; display: grid; gap: 1rem; }
.contact-data dt { font-weight: 700; font-family: var(--font-head); color: var(--blue); }
.contact-data dd { margin: 0; color: var(--muted); }
.contact-data a { color: var(--ink); }

.form { background: var(--bg); border: 1px solid var(--line); border-top: 5px solid var(--red); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid #7d90ad;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field textarea:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(21, 88, 192, 0.2); outline: none; }
.field textarea { min-height: 9rem; resize: vertical; }
.field-check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; }
.field-check input { margin-top: 0.3rem; }
.hp { position: absolute; left: -9999px; }

.notice { padding: 1rem 1.2rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-weight: 500; }
.notice-ok { background: #dff0e3; border: 1px solid #5b9a6b; }
.notice-err { background: #fbe1e3; border: 1px solid var(--red-dark); }

/* ---------- Pagine interne ---------- */
.page-head {
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(135deg, var(--blue-dark), var(--blue) 60%, var(--blue-2));
  border-bottom: 4px solid var(--red);
  color: var(--blue-soft);
  padding: clamp(1rem, 2.4vw, 1.6rem) 0;
}
.page-head h1 { margin: 0; color: #fff; font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.page-head p { margin: 0.6rem 0 0; color: var(--blue-soft); }

.entry { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.entry-content { max-width: none; }
.entry-content p { max-width: none; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content img { border-radius: var(--radius); }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; }
.entry-content .alignwide { max-width: none; }

/* scheda prodotto a tutta larghezza */
.product-layout { display: block; }
.product-layout .gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.product-layout .card-media { border-radius: var(--radius); border: 1px solid var(--line); }

.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.post-list article { background: var(--paper); border: 1px solid var(--line); border-top: 5px solid var(--blue-2); padding: 1.5rem; border-radius: var(--radius); }
.post-list h2 { font-size: 1.6rem; }
.post-list h2 a { color: var(--blue); text-decoration: none; }
.post-meta { color: var(--muted); font-size: 0.92rem; }

.navigation.pagination { margin-top: 2.5rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.nav-links a, .nav-links span { padding: 0.45rem 0.9rem; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); text-decoration: none; }
.nav-links .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue-dark); border-top: 8px solid var(--red); color: #b7caec; padding: 3rem 0 1.5rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ffb3b9; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: 1.15rem; color: #fff; margin-bottom: 0.7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid #2d5aa3; font-size: 0.92rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }

/* ---------- Chi preferisce meno movimento ---------- */
/* Le animazioni sono sempre attive. Solo se nel Personalizza si sceglie di rispettare
   "riduci movimento" (classe .dt-calm sul body) vengono spente per chi lo ha attivo. */
@media (prefers-reduced-motion: reduce) {
  body.dt-calm *, body.dt-calm *::before, body.dt-calm *::after { animation: none !important; transition: none !important; }
  body.dt-calm [data-reveal] { opacity: 1; }
  body.dt-calm .bp .d { stroke-dashoffset: 0; }
  body.dt-calm .bp .hid, body.dt-calm .bp .axis, body.dt-calm .bp .dim { opacity: 1; }
  body.dt-calm .steps li::after { transform: none; }
  body.dt-calm .dv-line { transform: none; }
  body.dt-calm .dv-line i { display: none; }
}

/* Se lo script non parte (cache o ottimizzatori), i contenuti vengono comunque mostrati */
.reveal-fallback [data-reveal]:not(.in) { opacity: 1; }

/* ---------- Prodotti, campi di impiego, foto ---------- */
.blueprint--photo img { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, 0.25); }
.card-media .card-ph { width: 40%; height: auto; margin: auto; fill: none; stroke: var(--steel); stroke-width: 2; }
.card-media:has(.card-ph) { display: grid; place-items: center; background: var(--blue-soft); }
.card-text { margin: 0; color: var(--muted); font-size: 0.97rem; }

.uses { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.6rem; }
.use {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s;
}
.use:hover { transform: translateY(-6px); border-color: var(--blue-2); box-shadow: 0 16px 34px rgba(8, 42, 94, 0.2); }
/* barra in alto: la parte rossa si allunga al passaggio del mouse */
.use::before {
  content: ""; position: absolute; z-index: 3; top: 0; left: 0; width: 100%; height: 5px;
  background-color: var(--blue-2);
  background-image: linear-gradient(var(--red), var(--red));
  background-repeat: no-repeat; background-size: 34% 100%;
  transition: background-size 0.5s ease;
}
.use:hover::before { background-size: 100% 100%; }

.use-media { position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: var(--blue-dark); }
.use-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.7s ease, filter 0.5s; }
.use:hover .use-media img { transform: scale(1.07); filter: brightness(0.82); }
/* griglia da disegno tecnico che compare sulla foto */
.use-media::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0; transition: opacity 0.4s;
}
.use:hover .use-media::before { opacity: 1; }
/* angoli di inquadratura */
.use-media::after {
  content: ""; position: absolute; inset: 12px; z-index: 2; pointer-events: none;
  background:
    linear-gradient(#fff, #fff) left top / 18px 2px,
    linear-gradient(#fff, #fff) left top / 2px 18px,
    linear-gradient(#fff, #fff) right top / 18px 2px,
    linear-gradient(#fff, #fff) right top / 2px 18px,
    linear-gradient(#fff, #fff) left bottom / 18px 2px,
    linear-gradient(#fff, #fff) left bottom / 2px 18px,
    linear-gradient(#fff, #fff) right bottom / 18px 2px,
    linear-gradient(#fff, #fff) right bottom / 2px 18px;
  background-repeat: no-repeat;
  opacity: 0.9; transition: inset 0.35s ease;
}
.use:hover .use-media::after { inset: 18px; }
/* senza foto: riquadro con simbolo animato */
.use-media--empty { display: grid; place-items: center; background: linear-gradient(135deg, var(--blue-dark), var(--blue-2)); }
.use-media--empty::before { opacity: 0.35; }
.use-media--empty svg { position: relative; width: 56%; max-width: 200px; fill: none; stroke: rgba(255, 255, 255, 0.92); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.use-body { position: relative; flex: 1; display: flex; flex-direction: column; padding: 1.3rem 1.4rem 1.4rem; }
.use-body h3 { margin: 0 0 0.5rem; color: var(--blue); font-size: 1.3rem; }
.use-body h3::before { content: ""; display: block; width: 34px; height: 3px; margin-bottom: 0.8rem; background: var(--red); transition: width 0.35s ease; }
.use:hover .use-body h3::before { width: 64px; }
.use-body p { color: var(--muted); font-size: 1rem; }
.use-body > :last-child { margin-bottom: 1.2rem; }
/* righello in fondo alla scheda */
.use-body::after {
  content: ""; display: block; margin-top: auto; height: 7px;
  background: repeating-linear-gradient(90deg, var(--steel) 0 1px, transparent 1px 10px);
  border-bottom: 1px solid var(--steel); opacity: 0.8;
}
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.gallery a { display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform 0.4s ease; }
.gallery a:hover img { transform: scale(1.06); }

/* ---------- Sezioni più marcate ---------- */
.home-sec { position: relative; padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.home-sec .section-head h2 { font-size: clamp(2rem, 4vw, 2.8rem); }

/* sfondo a quadretti da disegno tecnico */
.home-sec--grid {
  background-image:
    linear-gradient(rgba(11, 58, 130, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 58, 130, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* sezione scura: stacco forte a metà pagina */
.section--dark { background: var(--blue-dark); color: #dbe6f7; overflow: hidden; border-block: 0; }
.section--dark::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-drift 9s linear infinite;
  pointer-events: none;
}
.section--dark > .wrap { position: relative; }
.section--dark h2 { color: #fff; }
.section--dark .section-head p { color: #c5d6f2; }
.section--dark .empty-note { color: #c5d6f2; }

.news-date { font: 600 0.82rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--red-dark); }

/* ---------- Divisore tecnico tra le sezioni ---------- */
@keyframes dv-run { from { left: -70px; } to { left: 100%; } }
.divider { position: relative; height: 0; z-index: 3; }
.divider-inner {
  position: absolute; left: 0; right: 0; top: -24px; height: 48px;
  display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.dv-line {
  position: relative; flex: 1; height: 2px;
  background: var(--blue-2);
  transform: scaleX(0);
  transition: transform 1.2s cubic-bezier(0.5, 0, 0.2, 1) 0.2s;
}
.dv-line--l { transform-origin: right; }
.dv-line--r { transform-origin: left; }
.divider-inner.in .dv-line { transform: none; }
.dv-line::before, .dv-line::after {
  content: ""; position: absolute; left: 0; right: 0;
}
.dv-line::before { bottom: 2px; height: 6px; background: repeating-linear-gradient(90deg, var(--blue-2) 0 1px, transparent 1px 12px); }
.dv-line::after { top: 2px; height: 11px; background: repeating-linear-gradient(90deg, var(--blue-2) 0 2px, transparent 2px 60px); }
.dv-line i {
  position: absolute; top: -1px; left: -70px; width: 70px; height: 4px; z-index: 1;
  background: linear-gradient(90deg, transparent, #fff, var(--red), transparent);
  animation: dv-run 3.4s linear infinite;
}
.dv-line--r i { animation-delay: 1.7s; }
.dv-badge {
  flex: none; position: relative; width: 20px; height: 20px; margin: 0 1.1rem;
  background: var(--paper); border: 2px solid var(--red); border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 0 0 0 6px rgba(214, 33, 47, 0.14);
}
.dv-badge::after { content: ""; position: absolute; inset: 4px; background: var(--red); }


/* ---------- Effetti di ingresso diversi (campi di impiego) ---------- */
@keyframes reveal-wipe { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0); } }
@keyframes reveal-unfold { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0); } }
@keyframes reveal-pop { from { opacity: 0; transform: scale(0.86) translateY(16px); } }
@keyframes reveal-drop { from { opacity: 0; transform: translateY(-36px); } }
@keyframes reveal-blur { from { opacity: 0; filter: blur(10px); transform: scale(1.05); } }
.js [data-reveal="wipe"].in { animation: reveal-wipe 0.9s cubic-bezier(0.65, 0, 0.25, 1) backwards; animation-delay: calc(var(--rd, 0) * 90ms); }
.js [data-reveal="unfold"].in { animation: reveal-unfold 0.9s cubic-bezier(0.65, 0, 0.25, 1) backwards; animation-delay: calc(var(--rd, 0) * 90ms); }
.js [data-reveal="pop"].in { animation: reveal-pop 0.8s cubic-bezier(0.2, 1.3, 0.4, 1) backwards; animation-delay: calc(var(--rd, 0) * 90ms); }
.js [data-reveal="drop"].in { animation: reveal-drop 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) backwards; animation-delay: calc(var(--rd, 0) * 90ms); }
.js [data-reveal="blur"].in { animation: reveal-blur 0.9s ease-out backwards; animation-delay: calc(var(--rd, 0) * 90ms); }

/* dettagli tecnici che si "montano" una volta sola */
@keyframes frame-in { from { inset: 46px; opacity: 0; } }
@keyframes bar-in { from { background-size: 0 100%; } }
.use.in .use-media::after { animation: frame-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.35s backwards; }
.use.in::before { animation: bar-in 0.9s ease 0.5s backwards; }
@keyframes draw-icon { from { stroke-dashoffset: 1; opacity: 0; } 6% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
.use.in .use-media--empty svg > * { stroke-dasharray: 1 2; animation: draw-icon 1.5s ease 0.5s both; }
body.dt-calm .use-media--empty svg > * { stroke-dasharray: none !important; stroke-dashoffset: 0; opacity: 1; }

/* ---------- Modulo Contact Form 7 ---------- */
.form--cf7 .wpcf7-form p { margin: 0 0 1rem; max-width: none; }
.form--cf7 label { display: block; font-weight: 600; font-size: 0.95rem; }
.form--cf7 .wpcf7-form-control-wrap { display: block; margin-top: 0.3rem; font-weight: 400; }
.form--cf7 input[type="text"], .form--cf7 input[type="email"], .form--cf7 input[type="tel"],
.form--cf7 input[type="url"], .form--cf7 input[type="number"], .form--cf7 input[type="date"],
.form--cf7 select, .form--cf7 textarea {
  width: 100%; padding: 0.75rem 0.9rem;
  border: 1px solid #7d90ad; border-radius: var(--radius);
  background: #fff; color: var(--ink); font: inherit; font-weight: 400;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form--cf7 input:focus, .form--cf7 select:focus, .form--cf7 textarea:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(21, 88, 192, 0.2); outline: none; }
.form--cf7 textarea { min-height: 9rem; resize: vertical; }
.form--cf7 .wpcf7-list-item { margin: 0 1rem 0 0; display: inline-block; }
.form--cf7 .wpcf7-acceptance label, .form--cf7 .wpcf7-checkbox label, .form--cf7 .wpcf7-radio label { font-weight: 400; font-size: 0.95rem; }
.form--cf7 .wpcf7-submit {
  display: inline-block; padding: 0.85rem 1.6rem; cursor: pointer;
  background: var(--red); color: #fff; border: 2px solid var(--red); border-radius: var(--radius);
  font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; line-height: 1.2;
  transition: background 0.25s, border-color 0.25s;
}
.form--cf7 .wpcf7-submit:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.form--cf7 .wpcf7-not-valid-tip { display: block; margin-top: 0.25rem; color: var(--red-dark); font-size: 0.9rem; }
.form--cf7 .wpcf7-spinner { margin: 0 0 0 0.8rem; vertical-align: middle; }
.form--cf7 .wpcf7 form .wpcf7-response-output { margin: 1.2rem 0 0; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 500; }
.form--cf7 .wpcf7 form.sent .wpcf7-response-output { background: #dff0e3; border-color: #5b9a6b; }
.form--cf7 .wpcf7 form.invalid .wpcf7-response-output,
.form--cf7 .wpcf7 form.unaccepted .wpcf7-response-output,
.form--cf7 .wpcf7 form.failed .wpcf7-response-output,
.form--cf7 .wpcf7 form.aborted .wpcf7-response-output { background: #fbe1e3; border-color: var(--red-dark); }

/* ---------- Pagine a tutta larghezza e barre laterali ---------- */
.entry { overflow-x: clip; }
.layout { display: block; }
.layout.has-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(2rem, 4vw, 3rem); align-items: start; }
@media (max-width: 900px) { .layout.has-sidebar { grid-template-columns: 1fr; } }
.layout:not(.has-sidebar) .entry-content .alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.entry-content .alignwide { max-width: none; }
.entry-content > * + * { margin-top: 1.2em; }
.entry-content img, .entry-content video, .entry-content iframe { max-width: 100%; }

.post-list article { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.post-list article > *:not(.post-thumb) { margin-inline: 1.5rem; }
.post-list article h2 { margin-top: 1.2rem; }
.post-list article > :last-child { margin-bottom: 1.5rem; }
.post-thumb { display: block; line-height: 0; }
.post-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* Widget */
.widget { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--blue-2); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1.5rem; overflow-wrap: anywhere; }
.widget-title { font-size: 1.15rem; margin: 0 0 0.8rem; padding-left: 0.7rem; border-left: 4px solid var(--red); color: var(--blue); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 0.45rem 0; border-bottom: 1px dashed var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget a { text-decoration: none; }
.widget a:hover { text-decoration: underline; }
.widget input[type="search"], .widget input[type="text"], .widget input[type="email"], .widget select, .widget textarea { width: 100%; padding: 0.65rem 0.8rem; border: 1px solid #7d90ad; border-radius: var(--radius); background: #fff; font: inherit; }
.widget input[type="submit"], .widget button, .widget .wp-block-search__button { margin-top: 0.6rem; padding: 0.6rem 1rem; background: var(--blue); color: #fff; border: 0; border-radius: var(--radius); font: 600 1rem var(--font-head); cursor: pointer; }
.widget input[type="submit"]:hover, .widget button:hover { background: var(--red); }
.sidebar .widget:last-child { margin-bottom: 0; }

.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; padding-bottom: 2rem; margin-bottom: 2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.site-footer .widget { background: transparent; border: 0; padding: 0; margin-bottom: 1.4rem; color: #b7caec; }
.site-footer .widget-title { color: #fff; }
.site-footer .widget li { border-bottom-color: rgba(255, 255, 255, 0.15); }
.site-footer .widget input[type="search"], .site-footer .widget input[type="text"] { color: var(--ink); }

/* i simboli si disegnano a strati */
.use.in .use-media--empty svg > *:nth-child(3n) { animation-delay: 0.8s; }
.use.in .use-media--empty svg > *:nth-child(3n+1) { animation-delay: 1.1s; }

/* ---------- Menu a tendina (sottomenu al passaggio del mouse) ---------- */
.menu li { position: relative; }
.menu .menu-item-has-children > a::after {
  content: ""; display: inline-block; width: 0.38em; height: 0.38em; margin-left: 0.5em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); position: relative; top: -0.18em;
}
.menu .sub-menu {
  list-style: none; margin: 0; padding: 0.4rem 0;
  position: absolute; left: -1rem; top: 100%; z-index: 60;
  min-width: 240px; max-width: 320px;
  background: var(--paper);
  border: 1px solid var(--line); border-top: 4px solid var(--red);
  box-shadow: 0 16px 32px rgba(8, 42, 94, 0.2);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.menu li:hover > .sub-menu,
.menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.menu .sub-menu li { display: block; }
.menu .sub-menu a {
  display: block; padding: 0.6rem 1.2rem; font-weight: 500; line-height: 1.3;
  text-decoration: none !important; border-left: 3px solid transparent;
  transition: background 0.2s, border-color 0.2s, padding-left 0.2s;
}
.menu .sub-menu a:hover,
.menu .sub-menu .current-menu-item > a { background: var(--blue-soft); border-left-color: var(--red); padding-left: 1.45rem; color: var(--blue); }
.menu .sub-menu .menu-item-has-children > a::after { transform: rotate(-45deg); float: right; top: 0.55em; }
.menu .sub-menu .sub-menu { left: 100%; top: -0.4rem; }

@media (max-width: 860px) {
  .js .site-nav.is-open .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; max-width: none; margin: 0.2rem 0 0.4rem 0.4rem; padding: 0 0 0 0.9rem;
    background: transparent; border: 0; border-left: 3px solid var(--red); box-shadow: none;
  }
  .js .site-nav.is-open .sub-menu a { padding: 0.35rem 0; border-left: 0; }
  .js .site-nav.is-open .sub-menu a:hover { background: transparent; padding-left: 0; }
  .js .site-nav.is-open .menu-item-has-children > a::after { display: none; }
  .js .site-nav.is-open .sub-menu .sub-menu { left: auto; top: auto; }
}
body.dt-calm .menu .sub-menu { transition: none; }

/* =========================================================
   Contenuti delle pagine: stile del sito
   (titoli, elenchi, tabelle, pulsanti e componenti dt-*)
   ========================================================= */
.entry-content { font-size: 1.08rem; line-height: 1.75; }
.entry-content h2 { margin: 2.2em 0 0.7em; padding-left: 0.8rem; border-left: 5px solid var(--red); color: var(--blue); font-size: clamp(1.6rem, 3vw, 2.1rem); }
.entry-content h2:first-child { margin-top: 0; }
.entry-content h3 { margin: 1.8em 0 0.5em; color: var(--blue); font-size: 1.35rem; }
.entry-content h4 { margin: 1.5em 0 0.4em; color: var(--blue); }
.entry-content a:not(.wp-block-button__link) { color: var(--red-dark); text-underline-offset: 0.2em; }
.entry-content a:not(.wp-block-button__link):hover { color: var(--blue-2); }

.entry-content ul:not([class]), .entry-content ul.wp-block-list { list-style: none; padding-left: 0; }
.entry-content ul:not([class]) li, .entry-content ul.wp-block-list li { position: relative; padding-left: 1.5rem; margin: 0.45rem 0; }
.entry-content ul:not([class]) li::before, .entry-content ul.wp-block-list li::before { content: ""; position: absolute; left: 0.15rem; top: 0.7em; width: 0.5rem; height: 0.5rem; background: var(--red); transform: rotate(45deg); }
.entry-content ol:not([class]), .entry-content ol.wp-block-list { list-style: none; counter-reset: n; padding-left: 0; }
.entry-content ol:not([class]) li, .entry-content ol.wp-block-list li { position: relative; counter-increment: n; padding-left: 2.4rem; margin: 0.6rem 0; }
.entry-content ol:not([class]) li::before, .entry-content ol.wp-block-list li::before { content: counter(n); position: absolute; left: 0; top: 0.1em; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; background: var(--blue); color: #fff; border-radius: 50%; font: 700 0.9rem var(--font-head); }

.entry-content blockquote, .entry-content .wp-block-quote { margin: 2rem 0; padding: 1.2rem 1.6rem; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--red); color: var(--blue); font-size: 1.15rem; }
.entry-content blockquote p { margin: 0; }
.entry-content blockquote cite { display: block; margin-top: 0.6rem; font-size: 0.95rem; color: var(--muted); font-style: normal; }

.entry-content hr, .entry-content .wp-block-separator { border: 0; height: 11px; margin: 2.6rem 0; background: repeating-linear-gradient(90deg, var(--blue-2) 0 1px, transparent 1px 12px); border-bottom: 2px solid var(--blue-2); opacity: 1; }
.entry-content figure { margin: 1.6rem 0; }
.entry-content figcaption { margin-top: 0.5rem; font-size: 0.92rem; color: var(--muted); }

.entry-content table, .entry-content .wp-block-table table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 1rem; }
.entry-content th { background: var(--blue); color: #fff; font-family: var(--font-head); text-align: left; padding: 0.75rem 1rem; border: 1px solid var(--blue); }
.entry-content td { padding: 0.7rem 1rem; border: 1px solid var(--line); }
.entry-content tbody tr:nth-child(even) td { background: var(--bg); }

.entry-content .wp-block-button__link, .entry-content .wp-element-button {
  display: inline-block; padding: 0.85rem 1.6rem; background: var(--red); color: #fff;
  border: 2px solid var(--red); border-radius: var(--radius);
  font: 600 1.05rem/1.2 var(--font-head); text-decoration: none; transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.entry-content .wp-block-button__link:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.entry-content .is-style-outline .wp-block-button__link { background: transparent; color: var(--blue); border-color: var(--blue); }
.entry-content .is-style-outline .wp-block-button__link:hover { background: var(--blue); color: #fff; }
.entry-content .wp-block-columns { gap: clamp(1.5rem, 4vw, 3rem); margin: 1.6rem 0; }

/* --- Testo + immagine --- */
.entry-content .wp-block-columns.dt-split { align-items: center; }
.entry-content .wp-block-columns.dt-split--top { align-items: flex-start; }
.dt-lead { font-size: 1.3rem; line-height: 1.6; color: var(--blue); font-weight: 500; }
.dt-frame { position: relative; margin: 0; }
.dt-frame img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.dt-frame::after {
  content: ""; position: absolute; inset: 12px; pointer-events: none;
  background:
    linear-gradient(#fff, #fff) left top / 20px 2px, linear-gradient(#fff, #fff) left top / 2px 20px,
    linear-gradient(#fff, #fff) right top / 20px 2px, linear-gradient(#fff, #fff) right top / 2px 20px,
    linear-gradient(#fff, #fff) left bottom / 20px 2px, linear-gradient(#fff, #fff) left bottom / 2px 20px,
    linear-gradient(#fff, #fff) right bottom / 20px 2px, linear-gradient(#fff, #fff) right bottom / 2px 20px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 2px rgba(8, 42, 94, 0.5));
}

/* --- Schede --- */
.dt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin: 1.8rem 0; }
.dt-card {
  position: relative; margin: 0; padding: 1.7rem 1.6rem 1.7rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}
.dt-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 5px;
  background-color: var(--blue-2); background-image: linear-gradient(var(--red), var(--red)); background-repeat: no-repeat; background-size: 34% 100%;
  transition: background-size 0.5s ease;
}
.dt-card:hover { transform: translateY(-5px); border-color: var(--blue-2); box-shadow: 0 14px 30px rgba(8, 42, 94, 0.18); }
.dt-card:hover::before { background-size: 100% 100%; }
.dt-card > * { margin: 0; }
.dt-card > * + * { margin-top: 0.6rem; }
.dt-card h3 { margin-top: 0.4rem; }

/* --- Numeri --- */
.dt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 2.2rem 0; padding: 1.8rem 1.2rem; background: var(--blue-dark); border-radius: var(--radius); color: #dbe6f7; }
.dt-stat { margin: 0; padding: 0.3rem 1rem; text-align: center; border-left: 1px dashed rgba(143, 176, 230, 0.45); }
.dt-stat:first-child { border-left: 0; }
.dt-stat > * { margin: 0; }
.dt-num { font: 700 clamp(2.2rem, 4.5vw, 3rem)/1.1 var(--font-head); color: #ff8f98; }
.dt-label { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; color: #c5d6f2; margin-top: 0.4rem; }
@media (max-width: 700px) { .dt-stat { border-left: 0; } }

/* --- Linea del tempo --- */
.dt-timeline { position: relative; margin: 2.2rem 0; padding-left: 2.6rem; }
.dt-timeline::before {
  content: ""; position: absolute; left: 0.55rem; top: 0.5rem; bottom: 0.5rem; width: 2px;
  background: repeating-linear-gradient(180deg, var(--blue-2) 0 8px, transparent 8px 14px);
}
.dt-event { position: relative; margin: 0 0 1.5rem; padding: 1.2rem 1.6rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.dt-event::before {
  content: ""; position: absolute; left: -2.6rem; top: 1.7rem; width: 1.2rem; height: 1.2rem;
  background: var(--red); border: 3px solid var(--bg); border-radius: 50%; box-shadow: 0 0 0 2px var(--blue-2);
}
.dt-event::after { content: ""; position: absolute; left: -1.4rem; top: 2.25rem; width: 1.4rem; height: 2px; background: var(--blue-2); }
.dt-event > * { margin: 0; }
.dt-event > * + * { margin-top: 0.4rem; }
.dt-year { font: 700 1.9rem/1.1 var(--font-head); color: var(--red); }
.dt-event h3 { margin-top: 0.2rem; }

/* --- Schede dei contatti --- */
.dt-infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.dt-info { margin: 0; padding: 1.1rem 1.3rem; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--red); border-radius: var(--radius); }
.dt-info > * { margin: 0; }
.dt-label-s { font: 700 0.8rem/1 var(--font-head); letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue-2); margin-bottom: 0.5rem !important; }

/* --- Banda blu con pulsante --- */
.dt-band { position: relative; overflow: hidden; margin: 2.8rem 0; padding: clamp(2rem, 5vw, 3.2rem) clamp(1.5rem, 4vw, 3rem); background: var(--blue-dark); color: #dbe6f7; border-radius: var(--radius); }
.dt-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px; animation: grid-drift 9s linear infinite;
}
.dt-band > * { position: relative; margin-top: 0; }
.dt-band > * + * { margin-top: 0.8rem; }
.dt-band h2, .dt-band h3 { color: #fff; margin: 0 0 0.3rem; }
.dt-band .wp-block-buttons { margin-top: 1.4rem; }
.dt-band.alignfull { border-radius: 0; padding-inline: max(1.5rem, calc((100vw - var(--wrap)) / 2)); }
body.dt-calm .dt-band::before { animation: none; }

/* =========================================================
   Richiesta di preventivo
   ========================================================= */
.dt-quote { margin-top: 1rem; }
.dtq-form[hidden], .dtq-done[hidden] { display: none; }
.dtq-intro { margin: 0 0 1.6rem; padding: 0.9rem 1.2rem; background: var(--blue-soft); border-left: 4px solid var(--blue-2); color: var(--blue); font-size: 1rem; }
.dtq-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(1.5rem, 3vw, 2.2rem); align-items: start; }
.dtq-card { margin: 0 0 1.5rem; padding: 1.4rem 1.5rem 1.6rem; background: var(--paper); border: 1px solid var(--line); border-top: 5px solid var(--blue-2); border-radius: var(--radius); min-width: 0; }
.dtq-card legend { float: left; width: 100%; padding: 0; margin: 0 0 1.1rem; display: flex; align-items: center; gap: 0.7rem; font: 700 1.3rem/1.2 var(--font-head); color: var(--blue); }
.dtq-card legend + * { clear: both; }
.dtq-step { width: 2rem; height: 2rem; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff; font-size: 1rem; }

.dtq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; }
.dtq-wide { grid-column: 1 / -1; }
.dtq-field label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.95rem; }
.dtq-req { color: var(--red); }
.dtq-input { display: flex; align-items: stretch; }
.dtq-input input, .dtq-input textarea { width: 100%; min-width: 0; padding: 0.7rem 0.85rem; background: #fff; color: var(--ink); border: 1px solid #7d90ad; border-radius: var(--radius); font: inherit; font-weight: 400; transition: border-color 0.2s, box-shadow 0.2s; }
.dtq-input input:focus, .dtq-input textarea:focus { outline: none; border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(21, 88, 192, 0.2); }
.dtq-input textarea { resize: vertical; min-height: 5.5rem; }
.dtq-input.has-unit input { border-radius: var(--radius) 0 0 var(--radius); }
.dtq-unit { display: grid; place-items: center; padding: 0 0.8rem; background: var(--blue-soft); border: 1px solid #7d90ad; border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; color: var(--blue); font: 600 0.85rem var(--font-head); white-space: nowrap; }
.dtq-invalid input, .dtq-invalid textarea { border-color: var(--red); box-shadow: 0 0 0 3px rgba(214, 33, 47, 0.15); }
.dtq-err { margin-top: 0.25rem; color: var(--red-dark); font-size: 0.88rem; }
.dtq-err:empty { display: none; }

.dtq-help { margin: 0 0 1rem; color: var(--muted); font-size: 1rem; }
.dtq-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.8rem; }
.dtq-tile { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 1rem; text-align: left; background: var(--bg); color: var(--blue); border: 1px solid var(--line); border-radius: var(--radius); font: 600 1rem/1.2 var(--font-head); cursor: pointer; transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s, background 0.25s; }
.dtq-tile:hover, .dtq-tile:focus-visible { transform: translateY(-3px); border-color: var(--blue-2); background: #fff; box-shadow: 0 10px 22px rgba(8, 42, 94, 0.15); outline: none; }
.dtq-plus { flex: none; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff; font-size: 1.35rem; line-height: 1; transition: transform 0.3s; }
.dtq-tile:hover .dtq-plus { transform: rotate(90deg); }
.dtq-empty { margin: 1.2rem 0 0; padding: 1.2rem; text-align: center; border: 2px dashed var(--line); color: var(--muted); }

.dtq-lines { margin-top: 0.4rem; }
@keyframes dtq-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.dtq-line { position: relative; margin-top: 1.3rem; padding: 1.2rem 1.3rem 1.4rem; background: var(--bg); border: 1px solid var(--line); border-left: 5px solid var(--red); border-radius: var(--radius); scroll-margin-top: 6rem; }
.dtq-new { animation: dtq-in 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.dtq-line-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.dtq-badge { flex: none; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font: 700 1rem var(--font-head); }
.dtq-line-title { flex: 1; min-width: 0; font: 700 1.15rem/1.2 var(--font-head); color: var(--blue); }
.dtq-line-actions { display: flex; gap: 0.9rem; }
.dtq-link { padding: 0; background: none; border: 0; color: var(--blue-2); font: 600 0.92rem var(--font-body); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.dtq-link:hover { color: var(--blue-dark); }
.dtq-link-del { color: var(--red-dark); }
.dtq-line-info { margin: 0 0 1rem; padding: 0.6rem 0.9rem; background: var(--blue-soft); border-left: 3px solid var(--blue-2); color: var(--blue); font-size: 0.95rem; }
.dtq-qty label { color: var(--red-dark); }
.dtq-consent { margin-top: 1.1rem; }
.dtq-check { display: flex !important; gap: 0.6rem; align-items: flex-start; font-weight: 400 !important; font-size: 0.95rem !important; }
.dtq-check input { flex: none; margin-top: 0.25rem; width: 1.1rem; height: 1.1rem; }
.dtq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.dtq-summary { position: sticky; top: 6.5rem; padding: 1.5rem 1.5rem 1.4rem; background: var(--blue-dark); color: #dbe6f7; border-top: 5px solid var(--red); border-radius: var(--radius); }
.entry-content .dtq-summary h3 { margin: 0 0 0.8rem; color: #fff; font-size: 1.3rem; }
.dtq-summary p { margin: 0; }
.dtq-sum-empty { color: #c5d6f2; }
.dtq-sum-list { list-style: none; margin: 0.4rem 0 0.8rem; padding: 0; }
.dtq-sum-list li { margin: 0; }
.entry-content .dtq-summary a.dtq-sum-item { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.55rem 0; color: #fff; text-decoration: none; border-bottom: 1px dashed rgba(143, 176, 230, 0.4); }
.entry-content .dtq-summary a.dtq-sum-item:hover { color: #ff8f98; }
.dtq-sum-qty { flex: none; color: #ff8f98; font-weight: 700; }
.dtq-sum-totals { margin-bottom: 1rem !important; font: 700 0.95rem var(--font-head); letter-spacing: 0.04em; color: #c5d6f2; }
.dtq-msg:empty { display: none; }
.dtq-msg { margin: 0 0 1rem; padding: 0.8rem 1rem; background: rgba(255, 255, 255, 0.1); border-left: 4px solid #8fb0e6; font-size: 0.95rem; }
.dtq-msg.is-error { background: #fbe1e3; border-left-color: var(--red); color: #5c0a12; }
.dtq-msg-list { margin: 0.5rem 0 0; padding-left: 1.2rem; list-style: disc; }
.dtq-msg-list li { margin: 0.2rem 0; padding: 0; }
.dtq-submit { width: 100%; cursor: pointer; font-size: 1.05rem; }
.dtq-submit:disabled { opacity: 0.7; cursor: wait; }
.dtq-small { margin-top: 0.9rem !important; font-size: 0.85rem; color: #9db6df; }

.dtq-done { padding: clamp(2rem, 6vw, 3.5rem) 1.5rem; text-align: center; background: var(--paper); border: 1px solid var(--line); border-top: 5px solid #2e8b57; border-radius: var(--radius); }
.dtq-done-icon { position: relative; width: 76px; height: 76px; margin: 0 auto 1.1rem; border-radius: 50%; background: #dff0e3; border: 3px solid #2e8b57; }
.dtq-done-icon::after { content: ""; position: absolute; left: 25px; top: 13px; width: 17px; height: 30px; border: solid #2e8b57; border-width: 0 5px 5px 0; transform: rotate(45deg); }
.entry-content .dtq-done h3 { margin: 0 0 0.5rem; }

@media (max-width: 960px) {
  .dtq-layout { grid-template-columns: 1fr; }
  .dtq-summary { position: static; }
}
@media (max-width: 600px) {
  .dtq-grid { grid-template-columns: 1fr; }
  .dtq-line-head { flex-wrap: wrap; }
  .dtq-line-actions { width: 100%; padding-left: 2.8rem; }
}
body.dt-calm .dtq-new { animation: none; }

/* ---------- Preventivo: schede che si chiudono e riepilogo con icone ---------- */
.dtq-products { scroll-margin-top: 6rem; }
.dtq-flash:empty { display: none; }
.dtq-flash { margin: 1rem 0 0; }
.dtq-flash.is-on { padding: 0.7rem 1rem; background: #dff0e3; border-left: 4px solid #2e8b57; color: #1d5c38; font-weight: 600; animation: dtq-in 0.4s ease both; }
.dtq-flash.is-error { padding: 0.7rem 1rem; background: #fbe1e3; border-left: 4px solid var(--red); color: #5c0a12; font-weight: 600; }
.dtq-tiles.is-locked { opacity: 0.45; }
.dtq-tiles.is-locked .dtq-tile { cursor: not-allowed; }
.dtq-line[data-state="done"] { display: none; }
.dtq-kicker { display: block; margin-bottom: 0.35rem; font: 700 0.75rem/1 var(--font-head); letter-spacing: 0.16em; text-transform: uppercase; color: var(--red-dark); }
.dtq-line-foot { display: flex; justify-content: flex-end; align-items: center; gap: 1.2rem; margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px dashed var(--line); }
.dtq-insert { cursor: pointer; }

.dtq-sum-row { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.8rem; align-items: start; padding: 0.75rem 0; border-bottom: 1px dashed rgba(143, 176, 230, 0.4); }
.dtq-sum-main { display: flex; flex-direction: column; min-width: 0; }
.dtq-sum-name { color: #fff; font-weight: 600; }
.dtq-sum-sub { margin-top: 0.15rem; font-size: 0.85rem; color: #9db6df; overflow-wrap: anywhere; }
.dtq-sum-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 0.4rem; margin-top: 0.3rem; }
.dtq-icon { width: 2rem; height: 2rem; display: grid; place-items: center; padding: 0; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(143, 176, 230, 0.4); border-radius: var(--radius); color: #dbe6f7; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s; }
.dtq-icon svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dtq-icon:hover, .dtq-icon:focus-visible { background: #fff; color: var(--blue-dark); transform: translateY(-2px); outline: none; }
.dtq-icon[data-sum="del"]:hover, .dtq-icon[data-sum="del"]:focus-visible { background: var(--red); border-color: var(--red); color: #fff; }
@media (max-width: 600px) { .dtq-line-foot { flex-direction: column-reverse; align-items: stretch; } .dtq-insert { width: 100%; } }

/* =========================================================
   Galleria fotografica nella colonna a destra
   ========================================================= */
.layout.has-gallery { grid-template-columns: minmax(0, 1fr) 390px; }
.sidebar--sticky { position: sticky; top: 6.5rem; }
.sidebar--gallery .widget:first-of-type { margin-top: 0; }

.dt-gallery { display: grid; gap: 0.9rem; margin-bottom: 1.6rem; }
.dt-g-item {
  position: relative; display: block; overflow: hidden; line-height: 0; cursor: zoom-in;
  background: var(--blue-dark); border: 1px solid var(--line); border-radius: var(--radius);
}
.dt-g-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s ease, filter 0.5s ease; }
.dt-g-main img { aspect-ratio: 4 / 3; }
.dt-g-main::before {
  content: ""; position: absolute; z-index: 3; top: 0; left: 0; width: 100%; height: 5px;
  background-color: var(--blue-2); background-image: linear-gradient(var(--red), var(--red));
  background-repeat: no-repeat; background-size: 34% 100%; transition: background-size 0.5s ease;
}
.dt-g-main:hover::before { background-size: 100% 100%; }
.dt-g-item:hover img, .dt-g-item:focus-visible img { transform: scale(1.07); filter: brightness(0.8); }
.dt-g-item:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 2px; }
/* angoli di inquadratura */
.dt-g-item::after {
  content: ""; position: absolute; inset: 12px; z-index: 2; pointer-events: none;
  background:
    linear-gradient(#fff, #fff) left top / 18px 2px, linear-gradient(#fff, #fff) left top / 2px 18px,
    linear-gradient(#fff, #fff) right top / 18px 2px, linear-gradient(#fff, #fff) right top / 2px 18px,
    linear-gradient(#fff, #fff) left bottom / 18px 2px, linear-gradient(#fff, #fff) left bottom / 2px 18px,
    linear-gradient(#fff, #fff) right bottom / 18px 2px, linear-gradient(#fff, #fff) right bottom / 2px 18px;
  background-repeat: no-repeat; opacity: 0.85; transition: inset 0.35s ease;
  filter: drop-shadow(0 0 2px rgba(8, 42, 94, 0.55));
}
.dt-g-item:hover::after { inset: 18px; }
/* lente d'ingrandimento */
.dt-g-zoom {
  position: absolute; z-index: 3; right: 0.8rem; bottom: 0.8rem; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 62% no-repeat;
  opacity: 0; transform: scale(0.6); transition: opacity 0.3s ease, transform 0.3s ease;
}
.dt-g-item:hover .dt-g-zoom, .dt-g-item:focus-visible .dt-g-zoom { opacity: 1; transform: none; }
.dt-g-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.dt-g-thumbs .dt-g-item img { aspect-ratio: 4 / 3; }
.dt-g-thumbs .dt-g-item::after { inset: 6px; background-size: 11px 2px, 2px 11px, 11px 2px, 2px 11px, 11px 2px, 2px 11px, 11px 2px, 2px 11px; }
.dt-g-thumbs .dt-g-item:hover::after { inset: 9px; }
.dt-g-thumbs .dt-g-zoom { display: none; }

@media (max-width: 900px) {
  .layout.has-gallery { grid-template-columns: 1fr; }
  .sidebar--sticky { position: static; }
  .sidebar--gallery { order: -1; }
}

/* ---- Ingrandimento a schermo intero ---- */
@keyframes dtlb-in { from { opacity: 0; } }
html.dtlb-open { overflow: hidden; }
.dtlb {
  position: fixed; inset: 0; z-index: 300; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.6rem;
  padding: 1rem; background: rgba(6, 28, 66, 0.98); animation: dtlb-in 0.25s ease;
}
.dtlb[hidden] { display: none; }
.dtlb::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}
.dtlb-fig { position: relative; margin: 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.dtlb-frame { position: relative; line-height: 0; }
.dtlb-img { display: block; max-width: min(100%, 1200px); max-height: 76vh; width: auto; height: auto; object-fit: contain; background: #0b2f6a; border: 1px solid rgba(255, 255, 255, 0.25); transition: opacity 0.25s ease, transform 0.35s ease; }
.dtlb.is-swap .dtlb-img { opacity: 0; transform: scale(0.97); }
.dtlb-frame::after {
  content: ""; position: absolute; inset: -9px; pointer-events: none;
  background:
    linear-gradient(#fff, #fff) left top / 22px 2px, linear-gradient(#fff, #fff) left top / 2px 22px,
    linear-gradient(#fff, #fff) right top / 22px 2px, linear-gradient(#fff, #fff) right top / 2px 22px,
    linear-gradient(#fff, #fff) left bottom / 22px 2px, linear-gradient(#fff, #fff) left bottom / 2px 22px,
    linear-gradient(#fff, #fff) right bottom / 22px 2px, linear-gradient(#fff, #fff) right bottom / 2px 22px;
  background-repeat: no-repeat;
}
.dtlb-cap { min-height: 1.5em; margin: 0; color: #dbe6f7; text-align: center; font-size: 1rem; }
.dtlb-count { position: absolute; top: 1.3rem; left: 1.4rem; z-index: 2; color: #9db6df; font: 700 0.9rem var(--font-head); letter-spacing: 0.12em; }
.dtlb button { position: relative; z-index: 2; cursor: pointer; border: 0; color: #fff; font-family: var(--font-head); transition: background 0.2s, transform 0.2s; }
.dtlb-close { position: absolute !important; top: 0.9rem; right: 1rem; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--red); font-size: 1.8rem; line-height: 1; }
.dtlb-nav { width: 3rem; height: 3rem; border-radius: 50%; background: rgba(255, 255, 255, 0.12); font-size: 2.2rem; line-height: 1; padding-bottom: 0.25rem; }
.dtlb button:hover, .dtlb button:focus-visible { background: var(--red); transform: scale(1.08); outline: none; }
@media (max-width: 700px) {
  .dtlb { grid-template-columns: 1fr; padding: 0.6rem; }
  .dtlb-nav { position: absolute; top: auto; bottom: 1.2rem; width: 2.8rem; height: 2.8rem; }
  .dtlb-prev { left: 1rem; }
  .dtlb-next { right: 1rem; }
  .dtlb-img { max-height: 64vh; }
}

/* =========================================================
   Preventivo: schede tecniche a passaggi
   ========================================================= */
.dtq-grid .dtq-w12 { grid-column: 1 / -1; }
.dtq-tiles { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.dtq-tile-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.dtq-tile-text strong { font: 700 1rem/1.25 var(--font-head); color: var(--blue); }
.dtq-tile-text small { font: 400 0.85rem/1.3 var(--font-body); color: var(--muted); }

.dtq-line { padding: 0; }
.dtq-line-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.2rem 1.4rem 0.9rem; }
.dtq-line-title strong { display: block; font: 700 1.25rem/1.25 var(--font-head); color: var(--blue); }
.dtq-qtybar { flex: none; width: 150px; }
.dtq-qtybar .dtq-field { margin: 0; }
.dtq-details { margin: 0 1.4rem 1rem; padding: 0.7rem 1rem; background: var(--blue-soft); border-left: 3px solid var(--blue-2); font-size: 0.95rem; color: var(--blue); }
.dtq-details summary { cursor: pointer; font-weight: 700; }
.dtq-details p { margin: 0.7rem 0 0; color: var(--ink); line-height: 1.55; }

/* barra dei passaggi */
.dtq-steps { list-style: none; margin: 0; padding: 0 1.4rem; display: flex; gap: 0.5rem; }
.dtq-steps li { flex: 1; min-width: 0; margin: 0; padding: 0; }
.dtq-steps li::before { content: none; }
.dtq-tab { width: 100%; display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0.7rem; text-align: left; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font: 600 0.88rem/1.2 var(--font-head); transition: border-color 0.2s, box-shadow 0.2s, color 0.2s; }
.dtq-tab:hover { border-color: var(--blue-2); }
.dtq-tab-n { flex: none; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 0.85rem; }
.dtq-tab.is-current { border-color: var(--blue-2); color: var(--blue); box-shadow: 0 0 0 2px rgba(21, 88, 192, 0.15); }
.dtq-tab.is-current .dtq-tab-n { background: var(--red); color: #fff; }
.dtq-tab.is-done .dtq-tab-n { background: #2e8b57; color: #fff; font-size: 0; }
.dtq-tab.is-done .dtq-tab-n::after { content: "\2713"; font-size: 0.85rem; }
.dtq-progress { height: 4px; margin: 0.8rem 1.4rem 0; background: var(--line); border-radius: 2px; overflow: hidden; }
.dtq-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--blue-2)); transition: width 0.4s ease; }

.dtq-panel { padding: 1.3rem 1.4rem 0.2rem; }
.dtq-panel[hidden], .dtq-block[hidden], .dtq-field[hidden] { display: none; }
.dtq-block { margin: 0 0 1.6rem; }
.dtq-block h4 { position: relative; margin: 0 0 0.95rem; padding: 0 0 0.5rem; border-bottom: 2px solid var(--line); color: var(--blue); font: 700 0.85rem/1.2 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; }
.dtq-block h4::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 46px; height: 2px; background: var(--red); }
.dtq-fgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.dtq-fgrid .dtq-w3 { grid-column: span 3; }
.dtq-fgrid .dtq-w4 { grid-column: span 4; }
.dtq-fgrid .dtq-w6 { grid-column: span 6; }
.dtq-fgrid .dtq-w8 { grid-column: span 8; }
.dtq-fgrid .dtq-w12 { grid-column: 1 / -1; }

.dtq-lab { display: block; margin-bottom: 0.35rem; font-weight: 600; font-size: 0.95rem; }
.dtq-hint { margin-top: 0.3rem; font-size: 0.85rem; line-height: 1.4; color: var(--muted); }

/* scelte a pulsante */
.dtq-opts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dtq-field label.dtq-opt { position: relative; display: block; margin: 0; font-weight: 500; cursor: pointer; }
.dtq-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dtq-opt span { display: block; padding: 0.6rem 1rem; background: #fff; color: var(--ink); border: 1px solid #7d90ad; border-radius: 999px; font-size: 0.95rem; line-height: 1.25; transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s; }
.dtq-opt:hover span { border-color: var(--blue-2); }
.dtq-opt input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.dtq-opt input[type="checkbox"]:checked + span::before { content: "\2713\00a0"; }
.dtq-opt input:focus-visible + span { outline: 3px solid rgba(21, 88, 192, 0.35); outline-offset: 2px; }
.dtq-invalid .dtq-opt span { border-color: var(--red); }

/* interruttore (secondari facoltativi) */
.dtq-field label.dtq-toggle { display: flex; align-items: center; gap: 0.75rem; margin: 0; padding: 0.7rem 0.9rem; background: var(--bg); border: 1px dashed #7d90ad; border-radius: var(--radius); font-weight: 600; cursor: pointer; }
.dtq-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dtq-switch { position: relative; flex: none; width: 2.6rem; height: 1.45rem; background: #9fb0cc; border-radius: 999px; transition: background 0.25s; }
.dtq-switch::after { content: ""; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.05rem; height: 1.05rem; background: #fff; border-radius: 50%; transition: transform 0.25s; }
.dtq-toggle input:checked + .dtq-switch { background: var(--red); }
.dtq-toggle input:checked + .dtq-switch::after { transform: translateX(1.15rem); }
.dtq-toggle input:focus-visible + .dtq-switch { outline: 3px solid rgba(21, 88, 192, 0.35); outline-offset: 2px; }

/* titoletti, avvisi, valore fisso */
.dtq-t-heading { margin: 0.3rem 0 0; padding-left: 0.6rem; border-left: 4px solid var(--red); font: 700 1rem/1.3 var(--font-head); color: var(--blue); }
.dtq-t-info { padding: 0.7rem 1rem; background: var(--blue-soft); border-left: 3px solid var(--blue-2); color: var(--blue); font-size: 0.95rem; }
.dtq-t-info p { margin: 0; line-height: 1.5; }
.dtq-fixed-val { display: block; padding: 0.7rem 0.9rem; background: var(--blue-soft); border: 1px solid var(--line); border-radius: var(--radius); color: var(--blue); }
.dtq-unit-sel { padding: 0 0.5rem; background: var(--blue-soft); border: 1px solid #7d90ad; border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; color: var(--blue); font: 600 0.85rem var(--font-head); cursor: pointer; }
.dtq-t-num[data-calc] input { background: #f3f8ff; }

/* verifica finale */
.dtq-rev-intro { margin: 0 0 1rem; color: var(--muted); }
.dtq-rev-sec { margin: 0 0 1rem; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.dtq-rev-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.dtq-rev-head h5 { margin: 0; font: 700 1rem var(--font-head); color: var(--blue); }
.dtq-rev-list { display: grid; grid-template-columns: minmax(140px, 38%) 1fr; gap: 0.35rem 1rem; margin: 0; }
.dtq-rev-list dt { color: var(--muted); font-size: 0.92rem; }
.dtq-rev-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dtq-rev-empty { padding: 1rem; border: 2px dashed var(--line); color: var(--muted); }

/* comandi in fondo alla scheda */
.dtq-line-foot { margin-top: 0; padding: 1rem 1.4rem 1.3rem; justify-content: flex-start; background: #fff; border-top: 1px dashed var(--line); }
.dtq-spacer { flex: 1; }
.dtq-line-foot [hidden] { display: none !important; }
.dtq-back { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.dtq-back:hover { background: var(--blue); color: #fff; }
.dtq-next, .dtq-insert, .dtq-back { cursor: pointer; }

@media (max-width: 700px) {
  .dtq-fgrid .dtq-w3, .dtq-fgrid .dtq-w4, .dtq-fgrid .dtq-w6, .dtq-fgrid .dtq-w8 { grid-column: 1 / -1; }
  .dtq-line-top { flex-wrap: wrap; }
  .dtq-qtybar { width: 100%; }
  .dtq-tab-t { display: none; }
  .dtq-tab.is-current .dtq-tab-t { display: inline; }
  .dtq-steps li { flex: 0 0 auto; }
  .dtq-steps li:has(.is-current) { flex: 1; }
  .dtq-rev-list { grid-template-columns: 1fr; gap: 0; }
  .dtq-rev-list dd { margin-bottom: 0.5rem; }
  .dtq-line-foot { flex-wrap: wrap; }
  .dtq-spacer { display: none; }
  .dtq-line-foot .btn { flex: 1; }
}

.dtq-rev-blk { margin: 0.9rem 0 0.4rem; font: 700 0.75rem/1 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-dark); }
.dtq-rev-list dt.dtq-rev-sub { grid-column: 1 / -1; margin-top: 0.3rem; padding-left: 0.5rem; border-left: 3px solid var(--red); color: var(--blue); font-weight: 700; }
