/* ============================================================
   WELFARE COME TE — Layout & Components
   ============================================================ */

/* --- SKIP LINK --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-accent);
  color: var(--color-bg-dark);
  padding: 8px 20px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  transition: top var(--dur-fast);
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--color-bg-dark);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-atmosphere);
  pointer-events: none;
  z-index: 0;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--color-accent-hover); }
::selection { background: var(--color-accent); color: var(--color-bg-dark); }

/* --- FOCUS --- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* --- TYPOGRAPHY --- */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5.5vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.015em;
}
h3, .h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.25;
}
p { font-size: clamp(15px, 1.2vw, 17px); line-height: 1.65; color: var(--color-text-secondary); }

.keyword { color: var(--color-accent); }
.keyword-dark { color: var(--color-text-light-primary); }
.section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  display: block;
  margin-bottom: var(--space-4);
}
.label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.caption { font-size: 13px; color: var(--color-text-tertiary); line-height: 1.5; }
.body-card { font-size: 15px; line-height: 1.60; color: var(--color-text-light-secondary); }
.stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  color: var(--color-accent);
  display: block;
}

/* --- LAYOUT --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
  position: relative;
  z-index: 1;
}

/* --- BUTTONS --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-accent);
  color: var(--color-bg-dark);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
  color: var(--color-bg-dark);
}
.btn-primary:active { background: var(--color-accent-pressed); transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(255,255,255,0.25);
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* --- NAV --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background var(--dur-slow) var(--ease-out),
              backdrop-filter var(--dur-slow) var(--ease-out),
              box-shadow var(--dur-slow) var(--ease-out);
}
.nav.scrolled {
  background: rgba(25, 78, 72, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--color-hairline);
}
.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
  height: 72px;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav-logo img { height: 36px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
  margin-left: auto;
}
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-links a:hover { color: var(--color-text-primary); }
.nav-cta { margin-left: var(--space-4); }

.nav-dropdown { position: relative; }
.nav-dropdown > a::after { content: ' ↓'; font-size: 10px; opacity: 0.6; }
.dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-dark-mid);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-2) 0;
  list-style: none;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              visibility var(--dur-base);
  box-shadow: var(--shadow-lg);
}
.nav-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown li a {
  display: block;
  padding: var(--space-3) var(--space-5);
  font-size: 14px;
  color: var(--color-text-secondary);
}
.dropdown li a:hover { color: var(--color-text-primary); background: var(--color-card-bg); }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  margin-left: auto;
}
.nav-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base);
}

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 72px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(17, 47, 43, 0.92) 0%,
    rgba(25, 78, 72, 0.75) 55%,
    rgba(25, 78, 72, 0.40) 100%
  );
}
.hero-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-16);
  align-items: center;
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
  width: 100%;
}
.hero-left { max-width: 620px; }
.hero-left h1 { margin-bottom: var(--space-6); }
.hero-left p { margin-bottom: var(--space-8); max-width: 520px; }
.hero-cta { display: flex; gap: var(--space-4); flex-wrap: wrap; }

.hero-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 200px;
}
.stat-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  backdrop-filter: blur(8px);
}
.stat-card .stat-number { font-size: clamp(28px, 3vw, 40px); margin-bottom: var(--space-1); }
.stat-card .stat-label { font-size: 13px; color: var(--color-text-secondary); line-height: 1.4; }

/* --- SEZIONE COMPARATIVA --- */
.section-compare {
  background: var(--color-bg-light);
  padding: var(--space-24) 0;
  position: relative;
  z-index: 1;
}
.section-compare .section-label { color: var(--color-text-light-tertiary); }
.compare-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
  align-items: start;
}
.compare-header h2 { color: var(--color-text-light-primary); }
.compare-header p { color: var(--color-text-light-secondary); }
.compare-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.compare-col { padding: 0; }
.compare-col-header {
  padding: var(--space-5) var(--space-8);
  text-align: center;
  letter-spacing: 0.08em;
}
.compare-col--trad .compare-col-header {
  background: var(--color-bg-light);
  color: var(--color-text-light-tertiary);
  border-bottom: 1px solid var(--color-hairline-light);
}
.compare-col--wct .compare-col-header {
  background: var(--color-bg-dark);
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-hairline);
}
.compare-col ul { list-style: none; }
.compare-col--trad ul li {
  padding: var(--space-5) var(--space-8);
  font-size: 15px;
  color: var(--color-text-light-secondary);
  border-bottom: 1px solid var(--color-hairline-light);
  background: var(--color-bg-light-pure);
}
.compare-col--wct ul li {
  padding: var(--space-5) var(--space-8);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-hairline);
  background: var(--color-bg-dark);
}
.compare-col--trad ul li:last-child,
.compare-col--wct ul li:last-child { border-bottom: none; }

/* --- SEZIONE OSSERVATORIO --- */
.section-osservatorio {
  background: var(--color-bg-dark-deep);
  padding: var(--space-24) 0;
  position: relative;
  z-index: 1;
}
.osservatorio-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}
.osservatorio-text h2 { margin-bottom: var(--space-6); }
.osservatorio-text p { margin-bottom: var(--space-8); }
.osservatorio-foto { position: relative; }
.osservatorio-foto img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  object-position: 65% center;
  border-radius: var(--radius-xl);
}
.osservatorio-stats {
  position: absolute;
  bottom: var(--space-6);
  left: var(--space-6);
  right: var(--space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.stat-mini {
  background: rgba(17, 47, 43, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}
.stat-mini .stat-number { font-size: clamp(24px, 2.5vw, 36px); margin-bottom: 2px; }
.stat-mini span:last-child { font-size: 12px; color: var(--color-text-secondary); line-height: 1.3; display: block; }

/* --- SEZIONE QUATTRO AMBITI --- */
.section-ambiti {
  padding: var(--space-24) 0;
  position: relative;
  z-index: 1;
}
.ambiti-header {
  max-width: 640px;
  margin-bottom: var(--space-12);
}
.ambiti-header h2 { margin-bottom: var(--space-5); }
.ambiti-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}
.card-service {
  background: var(--color-bg-light-pure);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.card-service:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.accent-bar { height: 5px; width: 100%; }
.card-service img { width: 100%; height: 180px; object-fit: cover; }
.card-service .card-body { padding: var(--space-5); }
.card-service .label { margin-bottom: var(--space-2); }
.card-service h3 { color: var(--color-text-light-primary); margin-bottom: var(--space-3); font-size: 18px; }
.card-service .body-card { margin-bottom: var(--space-5); }
.card-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-light-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: gap var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.card-link:hover { color: var(--color-bg-dark); gap: var(--space-3); }

/* --- SEZIONE PROCESSO --- */
.section-processo {
  background: var(--color-bg-dark-deep);
  padding: var(--space-24) 0;
  position: relative;
  z-index: 1;
}
.processo-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}
.processo-foto img {
  width: 100%;
  height: 540px;
  object-fit: cover;
  border-radius: var(--radius-xl);
}
.processo-text h2 { margin-bottom: var(--space-5); }
.processo-text > p { margin-bottom: var(--space-10); }
.processo-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.processo-steps li {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent-muted);
  border: 1.5px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
}
.processo-steps strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.processo-steps .caption { display: block; }

/* --- SEZIONE PRODOTTI --- */
.section-prodotti {
  padding: var(--space-24) 0;
  position: relative;
  z-index: 1;
}
.section-prodotti > .container > h2 { margin-bottom: var(--space-12); }
.prodotti-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-8);
  align-items: center;
}
.prodotto-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
}
.prodotto-card--accent {
  background: var(--color-bg-dark-mid);
  border-color: rgba(152,186,125,0.20);
}
.prodotto-num {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  display: block;
  margin-bottom: var(--space-5);
}
.prodotto-card h3 { margin-bottom: var(--space-4); }
.prodotto-card p { font-size: 15px; }


.prodotto-divider {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--color-accent);
  opacity: 0.4;
  text-align: center;
}

/* --- SEZIONE CLOSING --- */
.section-closing {
  position: relative;
  padding: var(--space-30) 0;
  overflow: hidden;
  z-index: 1;
}
.section-closing-bg {
  position: absolute;
  inset: 0;
}
.closing-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}
.closing-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(17, 47, 43, 0.95) 0%,
    rgba(25, 78, 72, 0.85) 50%,
    rgba(25, 78, 72, 0.60) 100%
  );
}
.closing-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-16);
  align-items: center;
}
.closing-text h2 { margin-bottom: var(--space-6); }
.closing-text p { margin-bottom: var(--space-8); max-width: 520px; }
.closing-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 180px;
}
.closing-stats .stat-mini { text-align: center; }

/* --- FOOTER --- */
.footer {
  background: var(--color-bg-dark-deep);
  border-top: 1px solid var(--color-hairline);
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-16);
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
  align-items: start;
}
.footer-brand img { margin-bottom: var(--space-4); }
.footer-brand .caption { max-width: 220px; }
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-10);
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer-col .label { margin-bottom: var(--space-2); }
.footer-col a {
  font-size: 14px;
  color: var(--color-text-secondary);
  transition: color var(--dur-fast) var(--ease-out);
}
.footer-col a:hover { color: var(--color-text-primary); }
.footer-bottom {
  border-top: 1px solid var(--color-hairline);
  padding: var(--space-5) 0;
}
.footer-bottom .caption { color: var(--color-text-tertiary); }
.footer-bottom a { color: var(--color-text-tertiary); }
.footer-bottom a:hover { color: var(--color-text-secondary); }

.footer-info {
  border-top: 1px solid var(--color-hairline);
  padding: var(--space-10) 0;
}
.footer-info-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  align-items: start;
}
.footer-info-left { display: flex; flex-direction: column; gap: var(--space-4); }
.footer-info-right { display: flex; flex-direction: column; gap: var(--space-4); }
.footer-info .caption { color: var(--color-text-tertiary); line-height: 1.6; }
.footer-info a { color: var(--color-text-tertiary); transition: color var(--dur-fast) var(--ease-out); }
.footer-info a:hover { color: var(--color-text-secondary); }
.footer-linkedin {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-tertiary);
  transition: color var(--dur-fast) var(--ease-out);
}
.footer-linkedin:hover { color: var(--color-text-primary); }

/* --- RESPONSIVE --- */
@media (max-width: 1023px) {
  .ambiti-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-header { grid-template-columns: 1fr; }
  .prodotti-grid { grid-template-columns: 1fr; }
  .prodotto-divider { transform: rotate(90deg); font-size: 24px; }
}

@media (max-width: 767px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }

  .hero-content { grid-template-columns: 1fr; }
  .hero-right { flex-direction: row; flex-wrap: wrap; }
  .stat-card { flex: 1; min-width: 140px; }

  .compare-table { grid-template-columns: 1fr; }
  .compare-col--trad { display: none; }
  .compare-col--wct { border-radius: var(--radius-xl); }

  .osservatorio-content,
  .processo-inner,
  .closing-content { grid-template-columns: 1fr; }

  .osservatorio-foto img { height: 240px; }
  .processo-foto img { height: 300px; }

  /* Su mobile le stat-mini escono dall'overlay e vanno sotto l'immagine */
  .osservatorio-foto { position: static; }
  .osservatorio-stats {
    position: static;
    margin-top: var(--space-4);
    background: transparent;
    left: auto; right: auto; bottom: auto;
  }
  .osservatorio-stats .stat-mini {
    background: var(--color-card-bg);
  }

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

  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
  .footer-info-inner { grid-template-columns: 1fr; }
}

/* --- NAV MOBILE APERTO — overlay full screen --- */
.nav.open {
  background: var(--color-bg-dark-deep);
}
.nav.open .nav-inner {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.nav.open .nav-links {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-dark-deep);
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  z-index: 99;
  overflow-y: auto;
}
.nav.open .nav-cta { display: flex; }

/* Dropdown su mobile aperto — inline display */
.nav.open .nav-dropdown {
  position: relative;
}
.nav.open .nav-dropdown.touch-open .dropdown {
  position: static;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  min-width: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.nav.open .nav-dropdown.touch-open .dropdown li a {
  color: var(--color-text-secondary);
  background: transparent;
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
}
.nav.open .nav-dropdown.touch-open .dropdown li a:hover {
  color: var(--color-text-primary);
  background: transparent;
}

/* Burger → X */
.nav.open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav-burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav.open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dropdown aperto da touch/click */
.nav-dropdown.touch-open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
