/* =================================================================
   WOLFCODING — sito istituzionale (tema WordPress)
   Brand-driven, dark, tecnico. Caricato sia nel sito sia nell'editor.

   Mappa classi → blocchi dell'editor:
     .wc-section / .wc-hero        Gruppo (tag <section>) di una sezione
     .is-style-alt                 Stile "Sfondo alternato" del Gruppo
     .section-header               Gruppo con occhiello + titolo + testo
     .is-style-eyebrow / -lead / -badge   Stili del Paragrafo
     .services-grid > .service-card       Gruppo con card servizio
     .phases > .phase                     Fasi numerate automaticamente
     .sectors-grid > .sector              Settori
     .certs-grid > .cert (.is-highlight)  Certificazioni
     .contact-grid                        Colonne contatti
   ================================================================= */

:root {
  --bg-1: #050918;
  --bg-2: #0b1330;
  --bg-3: #142055;
  --brand: #4FB8E8;
  --brand-2: #2E8FC4;
  --brand-soft: rgba(79, 184, 232, 0.12);
  --green: #2EE6A0;
  --green-soft: rgba(46, 230, 160, 0.18);
  --text: #ffffff;
  --text-dim: #a8b3cf;
  --text-meta: #6b7799;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --shadow-1: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 24px 60px rgba(0, 0, 0, 0.45);

  --maxw: 1200px;
  --gutter: 1.5rem;
  --header-h: 72px;

  --arrow-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M5 12h14M13 5l7 7-7 7'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-1);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-decoration: none; transition: color 150ms; }
a:hover { color: #82d3f5; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 3px;
}
button { font-family: inherit; cursor: pointer; }

.accent { color: var(--brand); }

/* prevenzione overflow su parole/url molto lunghe */
h1, h2, h3, p, li, td {
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

/* ---------- SKIP LINK ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--bg-1);
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* =================================================================
   HEADER / NAV
   ================================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(5, 9, 24, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background 200ms;
}
.site-header.is-scrolled { background: rgba(5, 9, 24, 0.95); }
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 1rem;
}
.brand-logo:hover { color: var(--text); }
.brand-logo img { width: 34px; height: 34px; object-fit: contain; }
.brand-logo span { color: var(--text); }
.brand-logo .accent { color: var(--brand); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color 150ms, background 150ms, border-color 150ms;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

/* Voce di menu con classe CSS "cta" → pulsante pieno */
.nav-links .cta > a {
  margin-left: 0.5rem;
  background: var(--brand);
  color: var(--bg-1);
  padding: 0.6rem 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nav-links .cta > a:hover { background: #6ec6ee; color: var(--bg-1); }

/* Voce di menu con classe CSS "nav-deck" → pulsante bordato con freccia */
.nav-links .nav-deck > a {
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 0.85rem;
}
.nav-links .nav-deck > a:hover { border-color: var(--brand); color: var(--brand); background: transparent; }
.nav-links .nav-deck svg { opacity: 0.7; transition: opacity 150ms, transform 150ms; }
.nav-links .nav-deck > a:hover svg { opacity: 1; transform: translate(1px, -1px); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* =================================================================
   BOTTONI (blocco Pulsanti + classi .btn)
   ================================================================= */
.btn,
.wp-block-button .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--bg-1);
  text-decoration: none;
  transition: transform 150ms, background 150ms, border-color 150ms, color 150ms;
}
.btn:hover,
.wp-block-button .wp-block-button__link:hover {
  background: #6ec6ee;
  color: var(--bg-1);
  transform: translateY(-1px);
}
.btn-secondary,
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover,
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand);
  transform: none;
}
.wp-block-button.is-style-arrow .wp-block-button__link::after {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--arrow-icon) center / contain no-repeat;
  mask: var(--arrow-icon) center / contain no-repeat;
}
.btn-block { width: 100%; }

.wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* =================================================================
   TIPOGRAFIA DEI BLOCCHI (stili paragrafo)
   ================================================================= */
.is-style-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
}
.is-style-lead {
  color: var(--text-dim);
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.6;
  max-width: 65ch;
}
.is-style-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
  background: var(--brand-soft);
}
.is-style-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* =================================================================
   HERO
   ================================================================= */
.wc-hero {
  position: relative;
  padding: 8rem var(--gutter) 5rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 70% 30%, rgba(79, 184, 232, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 50% at 20% 90%, rgba(20, 32, 85, 0.7), transparent 70%),
    linear-gradient(140deg, var(--bg-1) 0%, var(--bg-2) 60%, #0d1638 100%);
}

.wc-hero .hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 4rem;
  align-items: center;
}
.wc-hero .hero-inner > .wp-block-column { margin: 0; min-width: 0; }

.wc-hero h1 {
  margin-top: 1.5rem;
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.wc-hero h1 .accent {
  background: linear-gradient(135deg, var(--brand) 0%, #82d3f5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wc-hero .is-style-lead {
  margin-top: 1.5rem;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  max-width: 60ch;
}
.wc-hero .wp-block-buttons { margin-top: 2.5rem; }

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-logo {
  width: 320px;
  height: 320px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 184, 232, 0.2) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hero-logo::before,
.hero-logo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(79, 184, 232, 0.25);
  animation: ring 6s ease-in-out infinite;
  pointer-events: none;
}
.hero-logo::after {
  inset: -30px;
  animation-delay: 1s;
  border-color: rgba(79, 184, 232, 0.12);
}
@keyframes ring {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}
.hero-logo img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(79, 184, 232, 0.5));
}

/* =================================================================
   SEZIONI GENERICHE
   ================================================================= */
.wc-section {
  padding: 6rem var(--gutter);
  position: relative;
}
.wc-section.is-style-alt { background: var(--bg-2); }

/* Tutti i blocchi dentro una sezione stanno nel contenitore da 1200px */
.wc-section > * {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}
.wc-section > * + * { margin-top: 1.5rem; }
.wc-section > .section-header + * { margin-top: 0; }

.section-header { margin-bottom: 3rem; }
.section-header > * { max-width: 800px; }
.section-header .is-style-eyebrow { margin-bottom: 1rem; }
.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.section-header p:not(.is-style-eyebrow) {
  color: var(--text-dim);
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.6;
  max-width: 65ch;
}

/* Titoli e testi liberi aggiunti dentro una sezione */
.wc-section > h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 800; line-height: 1.15; }
.wc-section > h3 { font-size: 1.3rem; font-weight: 700; }
.wc-section > p { color: var(--text-dim); }

/* Le griglie azzerano i margini dei figli (layout gestito dalla grid) */
.services-grid > *, .phases > *, .sectors-grid > *, .certs-grid > * { margin: 0 !important; }

/* =================================================================
   SERVIZI
   ================================================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color 200ms, transform 200ms;
  position: relative;
  overflow: hidden;
}
.service-card:hover { border-color: var(--brand); transform: translateY(-3px); }
.service-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--green));
  opacity: 0.7;
}

.ico,
.service-card .ico {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.service-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin-bottom: 0.6rem;
}
.service-card .is-style-lead {
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}
.service-card p { color: var(--text-dim); font-size: 0.95rem; }

.is-style-arrows {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
}
.is-style-arrows li {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding-left: 1.2rem;
  position: relative;
}
.is-style-arrows li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

/* =================================================================
   METODO / FASI (numerate automaticamente)
   ================================================================= */
.phases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  counter-reset: phase;
}
.phase {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  background: rgba(255, 255, 255, 0.02);
  counter-increment: phase;
  position: relative;
}
.phase::before {
  content: counter(phase, decimal-leading-zero);
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 0.95rem;
  color: var(--brand);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
.phase h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.6rem; }
.phase p { font-size: 0.9rem; color: var(--text-dim); line-height: 1.5; }

/* =================================================================
   CERTIFICAZIONI
   ================================================================= */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.cert {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.025);
  position: relative;
  overflow: hidden;
  transition: border-color 200ms;
}
.cert:hover { border-color: var(--brand); }
.cert::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--brand);
  opacity: 0.7;
}
.cert .iso {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-weight: 800;
  color: var(--brand);
  font-size: 1rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.cert .desc {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.cert.is-highlight {
  background: linear-gradient(135deg, rgba(79, 184, 232, 0.15), rgba(46, 230, 160, 0.05));
  border-color: var(--brand);
}
.cert.is-highlight .iso { color: var(--text); }
.cert.is-highlight .desc { color: var(--brand); font-weight: 600; }

/* =================================================================
   SETTORI
   ================================================================= */
.sectors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.sector {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 200ms, transform 200ms;
  position: relative;
}
.sector:hover { border-color: var(--brand); transform: translateY(-2px); }
.sector::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.4rem;
  width: 28px;
  height: 2px;
  background: var(--brand);
}
.sector h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0.4rem 0 0.5rem 0;
  line-height: 1.25;
}
.sector p { font-size: 0.85rem; line-height: 1.5; color: var(--text-dim); }

/* =================================================================
   CTA BANNER (pattern "Banner call to action")
   ================================================================= */
.cta-banner {
  border: 1px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3.5rem);
  background:
    radial-gradient(ellipse 70% 80% at 90% 10%, rgba(79, 184, 232, 0.18), transparent 70%),
    linear-gradient(135deg, var(--bg-2), var(--bg-1));
  text-align: center;
}
.cta-banner h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); font-weight: 800; line-height: 1.15; }
.cta-banner p { color: var(--text-dim); max-width: 60ch; margin: 1rem auto 0; }
.cta-banner .wp-block-buttons { justify-content: center; margin-top: 2rem; }

/* =================================================================
   CONTATTI
   ================================================================= */
.contact-grid {
  display: grid !important;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
}
.contact-grid > .wp-block-column { margin: 0; min-width: 0; }
.contact-info h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }
.contact-info p { color: var(--text-dim); line-height: 1.6; margin-bottom: 1.5rem; }

.institutional {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}
.institutional .row { display: flex; flex-direction: column; gap: 0.2rem; }
.institutional .k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--brand);
  font-weight: 600;
}
.institutional .v { font-size: 0.92rem; color: var(--text); }

.contact-form {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
}
.field { margin-bottom: 1.2rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 150ms;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field textarea { resize: vertical; min-height: 130px; }

.consent {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}
.consent label { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; cursor: pointer; }
.consent label a { text-decoration: underline; }

.form-msg {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: none;
}
.form-msg.success { display: block; background: var(--green-soft); color: var(--green); border: 1px solid var(--green); }
.form-msg.error { display: block; background: rgba(255, 100, 100, 0.1); color: #ff7676; border: 1px solid #ff7676; }
.form-msg__fallback { margin-left: 0.4rem; text-decoration: underline; font-weight: 600; }

/* Contact Form 7 — adattamento allo stile del sito */
.wpcf7 form.contact-form,
.wc-section .wpcf7 form {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
}
.wpcf7-form-control-wrap { display: block; }
.wpcf7 .consent .wpcf7-form-control-wrap,
.wpcf7 .consent .wpcf7-list-item { display: block; margin: 0; }
.wpcf7 .consent label { display: flex; gap: 0.7rem; align-items: flex-start; }
.wpcf7 .consent input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.wpcf7 .consent .wpcf7-list-item-label { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }
.wpcf7 input.wpcf7-submit { width: 100%; cursor: pointer; font-family: inherit; }
.wpcf7 input.wpcf7-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.wpcf7 .wpcf7-spinner { display: block; margin: 0.8rem auto 0; background-color: var(--brand); }
.wpcf7-not-valid-tip { color: #ff7676; font-size: 0.8rem; margin-top: 0.35rem; display: block; }
.wpcf7 .field .wpcf7-not-valid { border-color: #ff7676; }
.wpcf7 form .wpcf7-response-output {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.wpcf7 form.sent .wpcf7-response-output { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output { background: rgba(255, 100, 100, 0.1); color: #ff7676; border-color: #ff7676; }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* =================================================================
   PAGINE STANDARD (testo, legali, articoli)
   ================================================================= */
.page-shell {
  padding: 8rem var(--gutter) 5rem;
  min-height: 70vh;
  background: var(--bg-1);
}
.page-shell--center { display: flex; align-items: center; }
.page-inner { max-width: 820px; margin: 0 auto; width: 100%; }
.page-inner--wide { max-width: var(--maxw); }

.page-header { margin-bottom: 2.5rem; }
.page-header h1,
.page-shell h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.page-intro { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 2rem; }
.post-meta, .last-update { color: var(--text-meta); font-size: 0.85rem; }
.entry-content .last-update { margin-bottom: 3rem; }

.entry-content > * + * { margin-top: 0.9rem; }
.entry-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.4rem;
  color: var(--brand);
}
.entry-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
}
.entry-content h4 { font-size: 1rem; font-weight: 600; margin-top: 1.2rem; }
.entry-content p,
.entry-content li {
  color: var(--text-dim);
  line-height: 1.7;
  font-size: 0.95rem;
}
.entry-content li + li { margin-top: 0.5rem; }
.entry-content ul:not(.is-style-arrows),
.entry-content ol { padding-left: 1.5rem; }
.entry-content strong { color: var(--text); }
.entry-content code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--text);
}
.entry-content blockquote {
  border-left: 3px solid var(--brand);
  padding: 0.5rem 0 0.5rem 1.2rem;
}
.entry-content blockquote p { font-size: 1.1rem; color: var(--text); }
.entry-content figure.wp-block-image img { border-radius: var(--radius); }
.entry-content figcaption { color: var(--text-meta); font-size: 0.8rem; margin-top: 0.5rem; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.entry-content .wp-block-buttons { margin-top: 1.5rem; }

.wp-block-table { margin: 1.5rem 0; overflow-x: auto; }
.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.wp-block-table th,
.wp-block-table td {
  text-align: left;
  padding: 0.8rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
}
.wp-block-table th {
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.03);
}
.wp-block-table thead { border-bottom: 0; }

/* Articoli in elenco */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.post-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  transition: border-color 200ms, transform 200ms;
}
.post-card:hover { border-color: var(--brand); transform: translateY(-3px); }
.post-card__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.post-card h2 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--brand); }
.post-card p { color: var(--text-dim); font-size: 0.9rem; }
.post-card__more { margin-top: auto; font-weight: 600; font-size: 0.9rem; }
.post-hero { margin-bottom: 2rem; }
.post-hero img { border-radius: var(--radius-lg); width: 100%; }
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-weight: 600;
}
.pagination { margin-top: 3rem; }
.pagination .nav-links { justify-content: center; }
.pagination .page-numbers {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}
.pagination .page-numbers.current { border-color: var(--brand); color: var(--brand); }

/* Contenuto libero nelle landing fuori da una sezione */
.landing > :not(.wc-section):not(.wc-hero) {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* =================================================================
   FOOTER
   ================================================================= */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  padding: 4rem var(--gutter) 2rem;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
}
.footer-col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 1rem;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.footer-col ul a { color: var(--text-dim); font-size: 0.9rem; }
.footer-col ul a:hover { color: var(--text); }

.footer-brand p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 1rem;
  max-width: 35ch;
}
.footer-brand .brand-logo { margin-bottom: 0.5rem; }

.footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-meta);
}
.footer-bottom .legal { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-bottom .legal a { color: var(--text-meta); }
.footer-bottom .legal a:hover { color: var(--brand); }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 1280px) {
  :root { --maxw: 1140px; }
}

@media (max-width: 1024px) {
  .wc-hero .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
  .hero-visual { order: -1; }
  .hero-logo { width: 240px; height: 240px; }
  .hero-logo img { width: 170px; height: 170px; }

  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .phases { grid-template-columns: repeat(2, 1fr); }
  .certs-grid { grid-template-columns: repeat(3, 1fr); }
  .sectors-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(5, 9, 24, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
    align-items: stretch;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  }
  .nav-links.open a { display: flex; padding: 0.95rem 1rem; }
  .nav-links.open .nav-deck > a { justify-content: center; }
  .nav-links.open .cta > a { margin: 0.4rem 0 0 0; justify-content: center; }
  .nav-toggle { display: inline-flex; }

  .certs-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}
/* Sotto i 600px la barra admin di WordPress non è più fissa */
@media (max-width: 600px) {
  .admin-bar .site-header { top: 0; }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 70px; }

  .wc-section { padding: 4rem 1.2rem; }
  .wc-hero { padding: 6rem 1.2rem 3rem; }
  .page-shell { padding: 6.5rem 1.2rem 3.5rem; }
  .site-footer { padding-bottom: max(2rem, 5vh); }

  .wc-hero h1 { font-size: clamp(2rem, 7vw, 2.8rem); margin-top: 1.2rem; }
  .wc-hero .is-style-lead { margin-top: 1.2rem; font-size: 1rem; }
  .wc-hero .wp-block-buttons { margin-top: 2rem; flex-direction: column; align-items: stretch; }
  .wc-hero .wp-block-button { width: 100%; }
  .wc-hero .wp-block-button__link { width: 100%; padding: 0.9rem 1.2rem; }

  .wc-hero .hero-inner { gap: 2.2rem; }
  .hero-logo { width: 200px; height: 200px; }
  .hero-logo img { width: 145px; height: 145px; }
  .hero-logo::after { inset: -20px; }

  .section-header { margin-bottom: 2.2rem; }
  .section-header h2 { font-size: clamp(1.7rem, 5.5vw, 2.2rem); }

  .services-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .phases { grid-template-columns: 1fr; gap: 1rem; }
  .sectors-grid { grid-template-columns: 1fr; gap: 0.9rem; }
  .institutional { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .post-grid { grid-template-columns: 1fr; }
  .footer-brand p { max-width: none; }

  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-bottom .legal { gap: 1rem; }
}

@media (max-width: 540px) {
  .wc-section { padding: 3.2rem 1rem; }
  .wc-hero { padding: 5.5rem 1rem 2.5rem; }
  .page-shell { padding: 6rem 1rem 3rem; }

  .nav-inner { padding: 0.7rem 1rem; gap: 1rem; }
  .brand-logo span { font-size: 0.92rem; }

  .is-style-badge { font-size: 0.68rem; letter-spacing: 0.1em; padding: 0.35rem 0.75rem; }
  .wc-hero h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); }
  .wc-hero .is-style-lead { font-size: 0.95rem; line-height: 1.55; }

  .section-header { margin-bottom: 1.8rem; }
  .section-header .is-style-eyebrow { font-size: 0.72rem; letter-spacing: 0.18em; margin-bottom: 0.7rem; }
  .section-header h2 { font-size: clamp(1.55rem, 7vw, 2rem); }
  .section-header p:not(.is-style-eyebrow) { font-size: 0.95rem; }

  .certs-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .cert { padding: 1.1rem 0.8rem; }
  .cert .iso { font-size: 0.88rem; }
  .cert .desc { font-size: 0.72rem; }

  .institutional { padding: 1.2rem; gap: 0.8rem; }
  .service-card { padding: 1.5rem 1.3rem; }
  .phase { padding: 1.5rem 1.3rem; }
  .sector { padding: 1.3rem 1.2rem; }

  .contact-form { padding: 1.3rem; }
  .field input, .field textarea, .field select { padding: 0.75rem 0.9rem; font-size: 0.9rem; }
  .consent { padding: 0.85rem; }
  .consent label { font-size: 0.8rem; }

  .footer-inner { gap: 2rem; }
  .footer-bottom { font-size: 0.75rem; }
  .footer-bottom .legal { flex-direction: column; gap: 0.5rem; }
}

@media (max-width: 380px) {
  :root { --radius: 10px; --radius-lg: 14px; }
  .wc-hero { padding: 5rem 0.85rem 2.2rem; }
  .wc-section { padding: 2.8rem 0.85rem; }

  .nav-inner { padding: 0.55rem 0.85rem; gap: 0.7rem; }
  .brand-logo img { width: 28px; height: 28px; }
  .brand-logo span { font-size: 0.82rem; letter-spacing: 0.04em; }
  .nav-toggle { width: 38px; height: 38px; }

  .is-style-badge { font-size: 0.62rem; letter-spacing: 0.08em; padding: 0.3rem 0.65rem; }
  .wc-hero h1 { font-size: clamp(1.65rem, 8.5vw, 2rem); }
  .wc-hero .is-style-lead { font-size: 0.9rem; }

  .hero-logo { width: 170px; height: 170px; }
  .hero-logo img { width: 120px; height: 120px; }
  .hero-logo::after { inset: -15px; }

  .certs-grid { grid-template-columns: 1fr; }

  .section-header h2 { font-size: clamp(1.4rem, 7.5vw, 1.75rem); }
  .section-header p:not(.is-style-eyebrow) { font-size: 0.9rem; }

  .service-card, .phase, .sector { padding: 1.3rem 1.1rem; }
  .service-card h3 { font-size: 1.1rem; }
  .service-card .is-style-lead { font-size: 0.9rem; margin-bottom: 1rem; }
  .is-style-arrows li { font-size: 0.82rem; }

  .institutional { padding: 1rem; gap: 0.7rem; }
  .institutional .v { font-size: 0.85rem; }
  .contact-form { padding: 1.1rem; }

}
