/* ============================================
   LAYOUT.CSS — Header, Hero, Sezioni, Footer
   MediaStreaming.it
   ============================================ */

/* ══════════════════════════════
   HEADER
══════════════════════════════ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  height: 72px;
  padding: 0 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 20px rgba(22,34,64,.07);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 11px;
}
.logo-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--navy) 0%, var(--blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-mark img {
  /* Quando carichi il logo: width: 28px; height: auto; */
  width: 22px; height: 22px;
}
.logo-mark svg { width: 22px; height: 22px; }
.logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -.025em;
  color: var(--navy);
}
.logo-name span { color: var(--blue); }
.logo-tld {
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .02em;
  margin-top: 1px;
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  color: var(--navy);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.01em;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.site-nav a:hover {
  background: rgba(34,83,160,.07);
  color: var(--blue);
}
.site-nav .btn-nav {
  margin-left: 10px;
  padding: 10px 24px;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: background var(--transition);
}
.site-nav .btn-nav:hover {
  background: var(--blue);
  transform: none;
}

/* Mobile hamburger (nascosto su desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ══════════════════════════════
   HERO
══════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--navy);
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .2;
  filter: grayscale(30%) saturate(1.2);
  z-index: 0;
}

/* Immagine fallback se il video non carica */
.hero-image-bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .18;
  z-index: 0;
  /* src impostato via attributo HTML: images/hero/hero-bg.jpg */
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to right, rgba(22,34,64,.92) 40%, rgba(22,34,64,.5) 100%),
    linear-gradient(to bottom, transparent 60%, rgba(22,34,64,1) 100%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(rgba(111,163,232,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111,163,232,.07) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 65% 80% at 30% 50%, black 10%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 65% 80% at 30% 50%, black 10%, transparent 80%);
}

/* Anelli animati */
.signal-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(111,163,232,.2);
  top: 48%; left: 62%;
  transform: translate(-50%, -50%);
  animation: ringExpand 5s ease-out infinite;
  z-index: 2;
}
.signal-ring:nth-child(2) { animation-delay: 1.5s; border-color: rgba(111,163,232,.13); }
.signal-ring:nth-child(3) { animation-delay: 3s;   border-color: rgba(111,163,232,.07); }
@keyframes ringExpand {
  0%   { width: 0;    height: 0;    opacity: .9; }
  100% { width: 700px; height: 700px; opacity: 0; }
}

.hero-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 180px;
  z-index: 3;
  background: linear-gradient(transparent, var(--bg));
}

.hero-inner {
  position: relative;
  z-index: 4;
  max-width: 680px;
  padding: 0 60px;
  padding-top: 90px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.hero-stats {
  display: flex;
  width: fit-content;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(16px);
  overflow: hidden;
  margin-top: 52px;
}
.hero-stat {
  padding: 18px 28px;
  border-right: 1px solid rgba(255,255,255,.1);
  text-align: center;
}
.hero-stat:last-child { border-right: none; }
.hero-stat .n {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}
.hero-stat .n span { color: var(--light); }
.hero-stat .l {
  font-size: .67rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}

/* ══════════════════════════════
   BRAND STRIP
══════════════════════════════ */
.brand-strip {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 36px 60px;
}
.brand-strip-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  flex-wrap: wrap;
}
.brand-strip-label {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.brand-strip-logos {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.brand-item {
  opacity: .55;
  transition: opacity var(--transition);
}
.brand-item:hover { opacity: 1; }

/* ══════════════════════════════
   SERVERS
══════════════════════════════ */
.servers-section { background: var(--white); }

.srv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 56px;
}

.srv-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.srv-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--light));
  opacity: 0;
  transition: opacity var(--transition);
}
.srv-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(34,83,160,.3);
  transform: translateY(-5px);
}
.srv-card:hover::before { opacity: 1; }

.srv-num {
  font-family: 'Syne', sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  color: rgba(34,83,160,.07);
  line-height: 1;
  margin-bottom: 14px;
  user-select: none;
}

.srv-logo-wrap {
  height: 50px;
  display: flex;
  align-items: center;
  margin-bottom: 22px;
}
/* Quando caricherai i loghi ufficiali: */
.srv-logo-wrap img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.srv-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}
.srv-desc {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.78;
  margin-bottom: 24px;
}

/* ══════════════════════════════
   FEATURES
══════════════════════════════ */
.features-section { background: var(--bg); }

.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 56px;
}

/* ══════════════════════════════
   WHY US
══════════════════════════════ */
.why-section { background: var(--white); }

.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  margin-top: 0;
}
.why-text p {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 28px;
}
.why-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ══════════════════════════════
   CTA BAND
══════════════════════════════ */
.cta-band {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  padding: 90px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 {
  color: #fff;
  max-width: 680px;
  margin: 0 auto 36px;
}
.cta-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ══════════════════════════════
   FOOTER
══════════════════════════════ */
.site-footer { background: var(--navy); }

.footer-top {
  padding: 80px 60px 56px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
  gap: 60px;
  max-width: var(--container);
  margin: 0 auto;
}

.footer-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  display: block;
  margin-bottom: 14px;
}
.footer-logo span { color: var(--light); }

/* Logo immagine — desktop vs mobile */
.site-logo { display: flex; align-items: center; }
.logo-desktop {
  display: block;
  height: 45px;
  width: auto;
  object-fit: contain;
}
.logo-mobile { display: none; }

@media (max-width: 768px) {
  .logo-desktop { display: none; }
  .logo-mobile  {
    display: block;
    height: 40px;
    width: auto;
    object-fit: contain;
  }
}

/* Logo immagine nel footer */
.footer-logo-img {
  height: 36px;
  width: auto;
  margin-bottom: 16px;
  /* src impostato via HTML: images/logo/logo-white.png */
}

.footer-brand p {
  font-size: .85rem;
  color: rgba(255,255,255,.42);
  line-height: 1.82;
  margin-bottom: 22px;
}

.footer-social {
  display: flex;
  gap: 10px;
}
.footer-social a {
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.45);
  font-size: .78rem;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.footer-social a:hover {
  border-color: var(--light);
  color: #fff;
  background: rgba(255,255,255,.06);
}

.footer-col h5 {
  font-family: 'Syne', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin-bottom: 20px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  color: rgba(255,255,255,.58);
  font-size: .87rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition), gap var(--transition);
}
.footer-col ul li a::before {
  content: '→';
  font-size: .72rem;
  opacity: .4;
  transition: opacity var(--transition);
}
.footer-col ul li a:hover { color: #fff; gap: 12px; }
.footer-col ul li a:hover::before { opacity: 1; }

.footer-contact p {
  font-size: .85rem;
  color: rgba(255,255,255,.48);
  line-height: 1.85;
  margin-bottom: 4px;
}
.footer-contact strong { color: rgba(255,255,255,.85); font-weight: 500; }
.footer-contact a { color: var(--light); }
.footer-contact a:hover { text-decoration: underline; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 22px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  max-width: var(--container);
  margin: 0 auto;
}
.footer-bottom p {
  font-size: .75rem;
  color: rgba(255,255,255,.28);
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 1024px) {
  .site-header  { padding: 0 36px; }
  .hero-inner   { padding: 0 36px; padding-top: 90px; }
  .brand-strip  { padding: 32px 36px; }
  .srv-grid     { grid-template-columns: 1fr 1fr; }
  .feat-grid    { grid-template-columns: 1fr 1fr; }
  .why-grid     { grid-template-columns: 1fr; gap: 48px; }
  .footer-top   { grid-template-columns: 1fr 1fr; padding: 60px 36px 48px; }
  .footer-bottom{ padding: 20px 36px; }
  .cta-band     { padding: 72px 36px; }
}

@media (max-width: 768px) {
  .site-header  { padding: 0 20px; }
  .site-nav     { display: none; }
  .nav-toggle   { display: flex; }

  .hero-inner   { padding: 0 20px; padding-top: 90px; }
  .hero-stats   { flex-direction: column; width: calc(100% - 40px); }
  .hero-stat    { border-right: none; border-bottom: 1px solid rgba(255,255,255,.1); }
  .hero-stat:last-child { border-bottom: none; }

  .brand-strip  { padding: 28px 20px; }
  .brand-strip-inner { gap: 24px; }
  .brand-strip-logos { gap: 12px; }

  .srv-grid     { grid-template-columns: 1fr; }
  .feat-grid    { grid-template-columns: 1fr; }
  .why-numbers  { grid-template-columns: 1fr 1fr; }

  .cta-band     { padding: 60px 20px; }
  .footer-top   { grid-template-columns: 1fr; padding: 52px 20px 36px; }
  .footer-bottom{ padding: 18px 20px; flex-direction: column; text-align: center; }
}


/* ══════════════════════════════
   PAGE HERO (sottopagine interne)
══════════════════════════════ */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  padding: 140px 60px 80px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }

/* Nav link attivo */
.site-nav a.active {
  color: var(--blue);
  background: rgba(34,83,160,.07);
}

@media (max-width: 768px) {
  .page-hero { padding: 120px 20px 60px; }
}

/* ══════════════════════════════
   NAV DROPDOWN
══════════════════════════════ */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--navy);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.01em;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  user-select: none;
}
.nav-dropdown-toggle:hover,
.nav-dropdown:hover .nav-dropdown-toggle {
  background: rgba(34,83,160,.07);
  color: var(--blue);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(22,34,64,.12);
  min-width: 200px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 400;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--navy);
  transition: background var(--transition), color var(--transition);
}
.nav-dropdown-menu a:hover {
  background: rgba(34,83,160,.07);
  color: var(--blue);
}

/* Mobile: dropdown come lista espansa */
@media (max-width: 768px) {
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--border);
    border-radius: 0;
    margin-left: 14px;
    padding: 4px 0;
    background: transparent;
  }
  .nav-dropdown-menu a {
    font-size: .88rem;
    padding: 8px 14px;
    color: var(--muted);
  }
}

/* Logo hero visibile solo su desktop */
.hero-logo-desktop { display: flex; }
@media (max-width: 1024px) {
  .hero-logo-desktop { display: none !important; }
}
/* ============================================
   FIX MOBILE MENU (NUOVO)
============================================ */

/* Overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease;
  z-index: 900;
}

.nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Mobile */
@media (max-width: 768px) {

  /* Header corretto */
  .site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* LOGO FIX */
  .site-logo {
    flex: 1;
    justify-content: flex-start;
  }

  /* MENU MOBILE */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100dvh;

  background: #fff;

  display: flex;
  flex-direction: column;

  padding: 90px 24px 80px;

  transform: translateX(100%);
  transition: transform .35s ease;

  z-index: 1000;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

  .site-nav.open {
    transform: translateX(0);
  }

  /* LINK */
  .site-nav a {
    padding: 12px 0;
    width: 100%;
  }

  /* HAMBURGER */
  .nav-toggle {
    display: flex;
    z-index: 1100;
  }

}

/* BLOCCA SCROLL quando menu aperto */
body.menu-open {
  overflow: hidden;
}
@media (max-width: 768px) {

  .nav-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    border-left: none;
    margin-left: 0;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    max-height: 300px;
  }

}

/* ══════════════════════════════
   FIX MOBILE — problemi visivi
══════════════════════════════ */

@media (max-width: 768px) {

  /* ── HERO: h1 visibile, spazio ridotto ── */
  .hero { min-height: 100svh; align-items: flex-start; }
  .hero-inner { padding: 110px 20px 60px; }
  .hero h1 {
    font-size: clamp(2rem, 10vw, 3rem) !important;
    line-height: 1.1 !important;
    letter-spacing: -.03em !important;
  }
  .hero-fade { height: 80px; }

  /* ── NUM CARD: testo non esce ── */
  .num-card { overflow: hidden; padding: 20px 12px; }
  .num-card .n {
    font-size: clamp(1.5rem, 7vw, 2rem) !important;
    line-height: 1 !important;
    word-break: break-all;
  }
  .num-card .nl { font-size: .62rem; letter-spacing: .04em; }
  .why-numbers { gap: 10px; }

  /* ── HERO STATS: rimangono orizzontali ── */
  .hero-stats {
    flex-direction: row !important;
    width: calc(100% - 40px) !important;
  }
  .hero-stat {
    flex: 1;
    padding: 12px 6px !important;
    border-right: 1px solid rgba(255,255,255,.1) !important;
    border-bottom: none !important;
  }
  .hero-stat:last-child { border-right: none !important; }
  .hero-stat .n { font-size: 1rem !important; }
  .hero-stat .l { font-size: .58rem; }

  /* ── CONTATTI: label più piccola, non si spezza ── */
  .contact-label {
    font-size: .78rem !important;
    letter-spacing: .04em !important;
    line-height: 1.3 !important;
  }
}
