/* ============================================================
   STEB — Steel Technology Equipments Brescia
   Foglio di stile principale — vanilla CSS, mobile-first
   ============================================================ */

:root {
  --blue: #16337e;          /* blu del logo STEB */
  --blue-dark: #0d1f4d;
  --navy: #0b1730;          /* fondo header / footer / hero */
  --accent: #f2740b;        /* arancio "acciaio fuso" per le CTA */
  --accent-dark: #d55f00;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1c2533;
  --muted: #5a6678;
  --line: #e3e8ef;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(13, 31, 77, .07);
  --shadow-lg: 0 12px 32px rgba(13, 31, 77, .16);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; color: var(--blue-dark); font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }

.container { width: min(1180px, 92%); margin-inline: auto; }

/* ---------- Header / navigazione ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .55rem 0;
}

.brand { display: flex; align-items: center; gap: .7rem; }
.brand img { height: 52px; width: auto; }

.nav-toggle {
  display: none;
  background: none; border: 0; cursor: pointer; padding: .5rem;
}
.nav-toggle span {
  display: block; width: 26px; height: 3px; margin: 5px 0;
  background: var(--blue-dark); border-radius: 2px; transition: .25s;
}

.nav-menu { display: flex; align-items: center; gap: .2rem; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-menu a {
  display: block; padding: .55rem .8rem;
  font-weight: 600; font-size: .93rem; color: var(--text);
  border-radius: 8px; white-space: nowrap;
}
.nav-menu a:hover, .nav-menu a.active { color: var(--blue); background: #eef2f9; }

.nav-cta {
  background: var(--accent); color: #fff !important;
  border-radius: 999px; padding: .55rem 1.15rem !important;
}
.nav-cta:hover { background: var(--accent-dark) !important; }

/* dropdown Steelmaking / Rolling */
.dropdown > a::after { content: ' ▾'; font-size: .7em; }
.dropdown-panel {
  position: absolute; top: 100%; left: 0; min-width: 250px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .45rem;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: .2s; list-style: none; margin: 0;
}
.dropdown:hover .dropdown-panel,
.dropdown:focus-within .dropdown-panel,
.dropdown.open .dropdown-panel {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-panel a { font-weight: 500; white-space: normal; }

/* ---------- Hero home ---------- */

.hero {
  position: relative; overflow: hidden;
  min-height: 88vh;
  display: flex; align-items: center;
  background: var(--navy);
  color: #fff;
}

.hero-video {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
/* iframe YouTube dimensionato per coprire sempre l'area (16:9 cover) */
.hero-video iframe {
  position: absolute; top: 50%; left: 50%;
  width: 177.78vh; min-width: 100%;
  height: 56.25vw; min-height: 100%;
  transform: translate(-50%, -50%);
  border: 0;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(11, 23, 48, .93) 0%, rgba(11, 23, 48, .72) 45%, rgba(11, 23, 48, .35) 100%);
}

.hero-content { position: relative; z-index: 2; padding: 7rem 0 5.5rem; max-width: 720px; }
.hero-content h1 { color: #fff; margin-bottom: .5em; }
.hero-content .tagline { font-size: clamp(1.05rem, 2vw, 1.3rem); color: #cdd8ee; margin-bottom: 2rem; }

.hero-kicker {
  display: inline-block; margin-bottom: 1.2rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: #fbb066;
}

/* ---------- Bottoni ---------- */

.btn {
  display: inline-block; padding: .8rem 1.7rem; border-radius: 999px;
  font-weight: 700; font-size: .95rem; transition: .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; transform: translateY(-2px); }
.btn-ghost { border: 2px solid rgba(255,255,255,.5); color: #fff; margin-left: .6rem; }
.btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.12); }
.btn-outline { border: 2px solid var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }

/* ---------- Banner sottopagine ---------- */

.page-hero {
  position: relative; background: var(--navy); color: #fff;
  padding: 5.5rem 0 3.5rem; overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: var(--hero-img);
  background-size: cover; background-position: center;
  opacity: .28;
}
.page-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(11,23,48,.85), rgba(11,23,48,.35));
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero .lead { color: #cdd8ee; max-width: 760px; font-size: 1.08rem; margin: 0; }

.breadcrumb { font-size: .82rem; margin-bottom: 1.4rem; color: #9fb0d0; }
.breadcrumb a { color: #cdd8ee; }
.breadcrumb a:hover { color: #fff; }

/* ---------- Sezioni ---------- */

.section { padding: 4.5rem 0; }
.section.alt { background: #fff; border-block: 1px solid var(--line); }
.section-dark { background: var(--navy); color: #dbe4f5; }
.section-dark h2 { color: #fff; }

.section-head { max-width: 760px; margin-bottom: 2.6rem; }
.section-head .kicker {
  display: block; font-size: .78rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
  margin-bottom: .5rem;
}
.section-head p { color: var(--muted); }
.section-dark .section-head p { color: #aebbd6; }

/* ---------- Card ---------- */

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.card-media { aspect-ratio: 16/10; overflow: hidden; background: #dfe5ee; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 1.25rem 1.4rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: .4em; }
.card-body p { color: var(--muted); font-size: .93rem; flex: 1; }
.card-link { font-weight: 700; font-size: .9rem; }
.card-link::after { content: ' →'; }

a.card { color: inherit; }

/* ---------- Blocco testo + immagine ---------- */

.split { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split.reverse > .split-media { order: 2; }
}
.split-media img, .split-media video {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg);
}

/* ---------- Liste con spunta ---------- */

.check-list { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.check-list li {
  position: relative; padding-left: 1.9rem; margin-bottom: .65rem; color: var(--text);
}
.check-list li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: #e8f0e6; color: #2f7d32; font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.section-dark .check-list li { color: #dbe4f5; }

/* ---------- Numeri / statistiche ---------- */

.stats { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 1.4rem 1.2rem; text-align: center;
}
.stat b { display: block; font-size: 1.9rem; color: #fbb066; margin-bottom: .2rem; }
.stat span { font-size: .85rem; color: #aebbd6; }

.section:not(.section-dark) .stat { background: #fff; border-color: var(--line); box-shadow: var(--shadow); }
.section:not(.section-dark) .stat b { color: var(--blue); }
.section:not(.section-dark) .stat span { color: var(--muted); }

/* ---------- Galleria ---------- */

.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.gallery a {
  display: block; aspect-ratio: 4/3; overflow: hidden;
  border-radius: 10px; background: #dfe5ee; box-shadow: var(--shadow);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.gallery a:hover img { transform: scale(1.06); }

/* lightbox */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(8, 14, 28, .93);
  display: flex; align-items: center; justify-content: center;
  padding: 3vh 3vw;
}
.lightbox img { max-width: 94vw; max-height: 88vh; width: auto; height: auto; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.4rem;
  background: none; border: 0; color: #fff; font-size: 2.2rem; cursor: pointer; line-height: 1;
}
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12); border: 0; color: #fff;
  font-size: 1.6rem; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev:hover, .lightbox-next:hover { background: var(--accent); }

/* ---------- Video ---------- */

.video-block video {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); background: #000;
}
.video-caption { font-size: .85rem; color: var(--muted); margin-top: .6rem; }

/* ---------- CTA band ---------- */

.cta-band {
  background: linear-gradient(115deg, var(--blue-dark), var(--blue));
  color: #fff; text-align: center; padding: 4rem 0;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #c6d3ec; max-width: 640px; margin: 0 auto 1.8rem; }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy); color: #9fb0d0; padding: 3.5rem 0 2rem; font-size: .92rem; }
.footer-grid { display: grid; gap: 2.4rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 2.5rem; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: #9fb0d0; }
.site-footer a:hover { color: #fff; }
.footer-brand img { height: 46px; background: #fff; padding: 6px 10px; border-radius: 8px; margin-bottom: 1rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.4rem; font-size: .82rem; display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; }
.footer-mail { color: #fbb066 !important; font-weight: 700; }

/* ---------- Animazione reveal ---------- */

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive nav ---------- */

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed; top: 66px; right: 0; bottom: 0; width: min(320px, 85vw);
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-left: 1px solid var(--line);
    padding: 1rem; overflow-y: auto;
    transform: translateX(100%); transition: transform .3s;
    box-shadow: -12px 0 32px rgba(13,31,77,.15);
  }
  .nav-menu.open { transform: none; }
  .nav-menu a { padding: .8rem .9rem; white-space: normal; }
  .dropdown-panel {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-left: 3px solid var(--line);
    border-radius: 0; margin: 0 0 .4rem .9rem; padding: 0;
    display: none;
  }
  .dropdown.open .dropdown-panel { display: block; }
  .nav-cta { text-align: center; margin-top: .6rem; }
  body.nav-locked { overflow: hidden; }
  .hero { min-height: 72vh; }
}
