:root {
  --bg: #050505;
  --panel: rgba(18, 18, 18, 0.9);
  --text: #f4f2ec;
  --muted: #9da3ae;
  --green: #5fcf80;
  --gold: #c8a45d;
  --red: #c65353;
  --border: rgba(255, 255, 255, 0.12);
  --stroke: rgba(255, 255, 255, 0.16);
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.38);
  --radius: 14px;
  --sidebar-w: 280px;
  --content-max: 1080px;
  --max-width: var(--content-max);
  --transition: 200ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

@media (max-width: 980px) {
  body {
    font-size: 14.5px;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--green);
}

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

.media-satin {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.02);
}


.media-satin img,
.figure-media img,
.media-frame img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.media-satin img {
  filter: saturate(0.82) contrast(0.97) brightness(0.94);
}

.media-satin > * {
  position: relative;
  z-index: 1;
}

.media-satin::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(5, 5, 5, 0.10), rgba(5, 5, 5, 0.28));
}

.media-satin--wide {
  display: block;
  width: 100%;
}

header,
main,
footer {
  width: 100%;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 16px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.10);
  background: #070707;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: 0.4px;
  color: var(--text);
  line-height: 1;
}

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
}

.brand-logo--small {
  height: 30px;
}

.brand-name {
  font-size: 16px;
  letter-spacing: 0.05em;
}

.sidebar__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.sidebar__nav a {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 550;
  letter-spacing: 0.01em;
}

.sidebar__nav a:hover,
.sidebar__nav a:focus-visible {
  outline: none;
  border-color: rgba(95, 207, 128, 0.45);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar__nav .active {
  border-color: rgba(95, 207, 128, 0.45);
  color: var(--green);
}

.sidebar__footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.powered {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.content {
  padding: 26px 26px 64px;
}

.content > * {
  max-width: var(--content-max);
  margin-inline: auto;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 22px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 15px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--text);
  background: linear-gradient(120deg, rgba(95, 207, 128, 0.12), rgba(200, 164, 93, 0.1));
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  font-weight: 650;
  letter-spacing: 0.01em;
  min-height: 42px;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  outline: none;
  border-color: rgba(200, 164, 93, 0.85);
}

.btn.secondary {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.btn.text {
  border: 1px solid transparent;
  padding-left: 0;
  padding-right: 0;
  background: none;
  color: var(--muted);
}

.hero { 
  position: relative;
  overflow: hidden;
  background: #060606;
  border-bottom: 1px solid var(--stroke);
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.hero--split {
  padding: 0 0 18px;
}

.hero--text-only {
  grid-template-columns: 1fr;
}

.media-center {
  background-position: center center !important;
}

.media-center img {
  object-fit: cover;
  object-position: center center;
}

.hero__media {
  position: relative;
  height: clamp(220px, 48vw, 300px);
  background-color: #0b0b0b;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  isolation: isolate;
  border-bottom: 1px solid var(--stroke);
}

.hero__media,
.card__media {
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

.media-satin img,
.card img,
.hero img {
  object-fit: cover;
  object-position: center center;
}

.media-fixed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__inner {
  position: relative;
  margin-top: 0;
  z-index: 2;
  padding: 0 clamp(18px, 4vw, 22px) 8px;
}

.hero__content {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 26px);
  box-shadow: var(--shadow);
}

.eyebrow {
  color: var(--green);
  letter-spacing: 0.4px;
  font-weight: 650;
  margin: 0 0 10px;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  line-height: 1.18;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(26px, 2.6vw, 38px);
  margin: 0 0 8px;
  font-weight: 600;
}

.lead {
  font-size: 16.5px;
  color: var(--muted);
  margin: 0 0 16px;
  max-width: 62ch;
  line-height: 1.65;
}

p {
  max-width: 70ch;
}

.section {
  padding: 42px 0;
  border-bottom: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 12px;
  font-weight: 650;
  font-size: clamp(20px, 2vw, 28px);
}

.section p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.65;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.media-block {
  display: grid;
  gap: 18px;
  align-items: center;
}

.media-block__visual {
  max-width: 520px;
  width: 100%;
  margin-left: auto;
}

.media-block__visual figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}

.card__media {
  position: relative;
  height: clamp(140px, 36vw, 170px);
  margin: -20px -20px 14px;
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 10px 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  isolation: isolate;
}

.card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.35), rgba(5, 5, 5, 0.55));
  z-index: 1;
}

.card__body {
  position: relative;
  z-index: 2;
}

.page-ambiti .content > * {
  max-width: 1180px;
}

.page-ambiti .hero__media {
  display: none;
}

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

.page-ambiti .hero__content,
.page-ambiti .hero__content .lead {
  max-width: 88ch;
}

.page-ambiti .grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.page-chi-siamo .hero__media--cubes {
  background-position: center top !important;
}

.page-chi-siamo .img--cubes {
  object-position: center top;
}

/* Partner page: card hero full width */
.page-partner .card--full {
  width: 100%;
  max-width: 100%;
}

/* Rendi la sezione intro del partner una colonna unica */
.page-partner .partner-intro,
.page-partner .hero-grid,
.page-partner .intro-grid {
  display: block;
}

/* Media detail: altezza coerente e zoom sul soggetto */
.media-detail {
  max-width: 980px;
  margin-top: 18px;
}

.media-detail img.img-zoom-cubes {
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: 75% 60%;
  display: block;
}

/* Mobile: altezza e posizione ottimizzate */
@media (max-width: 600px) {
  .media-detail img.img-zoom-cubes {
    height: 240px;
    object-position: 70% 55%;
  }
}

.media-satin figcaption,
.media-detail figcaption {
  text-align: center;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.70);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .media-satin figcaption,
  .media-detail figcaption {
    font-size: 12.5px;
  }
}

.card:hover,
.card:focus-within {
  border-color: rgba(95, 207, 128, 0.4);
  transform: translateY(-2px);
}

.card small {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.card h3 {
  margin: 0 0 10px;
  font-weight: 650;
}

.card .accent {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.5;
}

.callout {
  border-left: 2px solid var(--green);
  padding: 16px;
  background: rgba(95, 207, 128, 0.08);
  border-radius: var(--radius);
  color: var(--text);
}

.disclaimer {
  border: 1px dashed var(--gold);
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(200, 164, 93, 0.08);
  color: var(--muted);
  font-size: 15px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.list li strong {
  color: var(--text);
}

.muted {
  color: var(--muted);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 18px 0;
  opacity: 0.4;
}

.breadcrumb {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.footer {
  padding: 32px 0 44px;
  color: var(--muted);
  font-size: 15px;
}

.footer a {
  color: var(--text);
}

.footer-inner {
  display: grid;
  gap: 14px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.footer-powered {
  color: var(--muted);
  font-size: 14px;
}

.table-like {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
}

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(95, 207, 128, 0.15);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 9998;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(88vw, 360px);
  height: 100vh;
  background: #070707;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateX(-102%);
  transition: transform 200ms ease;
  z-index: 9999;
  padding: 14px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.drawer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 2px;
}

.drawer__nav a {
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.drawer__nav a:hover,
.drawer__nav a:focus-visible {
  outline: none;
  border-color: rgba(95, 207, 128, 0.45);
  background: rgba(255, 255, 255, 0.04);
}

.drawer__cta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open .backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-open .drawer {
  transform: translateX(0);
}

@media (min-width: 981px) {
  .media-block {
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.9fr);
  }

  .hero--split {
    grid-template-columns: minmax(320px, 1fr) minmax(460px, var(--content-max));
    align-items: stretch;
  }

  .hero__media {
    height: auto;
    min-height: 340px;
  }

  .hero__inner {
    padding: clamp(40px, 6vw, 78px) clamp(28px, 5vw, 38px);
  }

  .sidebar__toggle {
    display: none;
  }
}

@media (max-width: 980px) {
  .media-block__visual {
    order: -1;
  }

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

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
  }

  .sidebar__nav,
  .sidebar__footer {
    display: none;
  }

  .sidebar__toggle {
    display: inline-flex;
  }

  .content {
    padding: 18px 16px 54px;
  }

  .section {
    padding: 28px 0;
  }

  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .page-chi-siamo .hero__media {
    height: 260px;
    min-height: 260px;
  }

  .page-chi-siamo .hero__media--cubes {
    background-size: contain;
    background-color: #070707;
  }

  .page-chi-siamo .img--cubes {
    object-fit: contain;
    background: #070707;
  }
}
