/* ============================================================
   SOS Italia - Components CSS
   Baseline: Header + Hero + Subnav + Buttons + Preview Badge
   ============================================================ */


/* ============================================================
   HEADER / TOP BAR
   ============================================================ */

.site-header {
  padding-top: 8px;
}

.topbar {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 6px auto;
  padding: 10px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(11,15,20,.74);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 72px;
  height: auto;
  display: block;
}

.brand-compact img {
  width: 52px;
}

.brand-text strong {
  display: block;
  font-size: 24px;
  letter-spacing: .02em;
}

.brand-compact .brand-text strong {
  font-size: 21px;
}

.brand-text span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 3px;
}

.brand-compact .brand-text span {
  font-size: 13px;
}


/* ============================================================
   TOP NAV
   ============================================================ */

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255,255,255,.82);
  font-size: 14px;
}

.nav a {
  position: relative;
  padding: 8px 4px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  transition: color .25s ease, text-shadow .25s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: #f28c28;
  transition: width .25s ease;
  border-radius: 2px;
}

.nav a:hover {
  color: #ffffff;
  text-shadow:
    0 0 8px rgba(242,140,40,0.70),
    0 0 18px rgba(242,140,40,0.55),
    0 2px 6px rgba(0,0,0,0.25);
}

.nav a:hover::after {
  width: 100%;
}


/* ============================================================
   HERO BANNER
   ============================================================ */

.hero-banner {
  position: relative;
  width: min(1180px, calc(100% - 36px));
  height: auto;
  aspect-ratio: 1920 / 430;
  min-height: 210px;
  max-height: 320px;
  margin: 6px auto 6px auto;
  border-radius: 28px;
  overflow: hidden;
  background-image: url('/assets/img/banner_sos-italia.webp');
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-color: rgba(11,15,20,.92);
  display: flex;
  align-items: center;
  box-shadow: 0 24px 80px rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.10);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(11,15,20,0.10),
    rgba(11,15,20,0.03),
    rgba(11,15,20,0.10)
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-text {
  padding-left: clamp(130px, 13vw, 180px);
  margin-top: -92px;
  opacity: 0;
  animation: sosFadeInUp 1.4s ease .7s forwards;
}

.hero-text h1 {
  font-size: clamp(30px, 3.35vw, 48px);
  line-height: 1.12;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #2b2b2b;
  text-shadow: none;
}

/* colori corretti */
.hero-text .line1,
.hero-text .line2 {
  color: #2b2b2b;
}

.hero-text .red,
.hero-text .highlight {
  color: #e95b1d;
}

/* ombra UNIFICATA */
.hero-text .line1,
.hero-text .line2,
.hero-text .red,
.hero-text .highlight {
  text-shadow:
    0 2px 6px rgba(0,0,0,0.45),
    0 6px 18px rgba(0,0,0,0.30);
}

.hero-text .red {
  font-weight: 750;
}

.hero-text .highlight {
  font-weight: 900;
}

@keyframes sosFadeInUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================================
   SUBNAV
   ============================================================ */

.subnav {
  background: rgba(242,140,40,.10);
  border-top: 1px solid rgba(242,140,40,.18);
  border-bottom: 1px solid rgba(242,140,40,.25);
}

.subnav-inner {
  display: flex;
  gap: 18px;
  padding: 10px 0;
  color: rgba(255,255,255,.86);
  font-size: 14px;
  overflow-x: auto;
}

.subnav a {
  position: relative;
  padding: 8px 4px;
  color: rgba(255,255,255,0.76);
  transition: color .25s ease, text-shadow .25s ease;
}

.subnav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0%;
  height: 2px;
  background: #f28c28;
  transition: width .25s ease;
  border-radius: 2px;
}

.subnav a:hover {
  color: #ffffff;
  text-shadow:
    0 0 8px rgba(242,140,40,0.70),
    0 0 18px rgba(242,140,40,0.55),
    0 2px 6px rgba(0,0,0,0.25);
}

.subnav a:hover::after {
  width: 100%;
}

/* =========================
   BUTTON HOVER ENHANCED
========================= */

.btn {
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(242,140,40,.35);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.10);
}

/* ============================================================
   PREVIEW BADGE
   ============================================================ */

.preview-badge {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  background: rgba(242,140,40,.92);
  color: #111;
  font-weight: 800;
  font-size: 12px;
  padding: 9px 12px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 820px) {
  .site-header {
    padding-top: 6px;
  }

  .topbar {
    width: min(100% - 24px, 720px);
    margin-bottom: 6px;
    padding: 12px;
    border-radius: 18px;
  }

  .header-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-compact img {
    width: 46px;
  }

  .brand-compact .brand-text strong {
    font-size: 19px;
  }

  .brand-compact .brand-text span {
    font-size: 12px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
  }

  .hero-banner {
    width: min(100% - 24px, 720px);
    min-height: 145px;
    max-height: 210px;
    border-radius: 20px;
  }

  .hero-text {
    padding-left: 55px;
    margin-top: -35px;
  }

  .hero-text h1 {
    font-size: clamp(12px, 5.8vw, 30px);
  }

  .subnav-inner {
    gap: 14px;
    font-size: 13px;
  }
}

/* CSS Per pagina News */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.news-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 20px;
  transition: transform .2s ease;
}

.news-card:hover {
  transform: translateY(-4px);
}

.news-card h3 {
  margin-bottom: 10px;
}

.news-card a {
  color: orange;
  text-decoration: none;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 32px;
}

.news-card {
  overflow: hidden;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}

.news-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.news-card-body {
  padding: 20px;
}

.news-date {
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 10px;
}

.news-card h2 {
  font-size: 22px;
  margin: 0 0 10px;
}

.news-card p {
  color: rgba(255,255,255,.78);
  line-height: 1.55;
}

.news-card a {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.news-grid-home {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.news-cta {
  margin-top: 30px;
  text-align: center;
}

/* ============================================================
   SOS Italia - Responsive fixes
   Banner responsive + mobile header
   ============================================================ */

.hero-banner {
  height: clamp(185px, 22vw, 320px);
  aspect-ratio: auto;
  background-size: cover;
  background-position: center center;
}

.hero-text {
  padding-left: clamp(92px, 12vw, 170px);
  margin-top: clamp(-82px, -7vw, -34px);
}

@media (max-width: 760px) {
  .topbar {
    width: min(100% - 24px, 1180px);
    padding: 10px 14px;
    border-radius: 18px;
  }

  .header-row {
    gap: 14px;
  }

  .brand-compact img {
    width: 44px;
  }

  .brand-compact .brand-text strong {
    font-size: 18px;
  }

  .brand-compact .brand-text span {
    display: none;
  }

  .nav {
    gap: 10px;
    font-size: 13px;
  }

  .hero-banner {
    width: min(100% - 24px, 1180px);
    height: clamp(150px, 43vw, 230px);
    border-radius: 20px;
    background-size: cover;
    background-position: center center;
  }

  .hero-text {
    padding-left: clamp(58px, 13vw, 92px);
    margin-top: clamp(-54px, -9vw, -26px);
  }

  .hero-text h1 {
    font-size: clamp(19px, 5.4vw, 32px);
    line-height: 1.08;
  }
}

@media (max-width: 480px) {
  .nav {
    gap: 8px;
    font-size: 12px;
  }

  .hero-banner {
    height: 165px;
  }

  .hero-text {
    padding-left: 52px;
    margin-top: -34px;
  }

  .hero-text h1 {
    font-size: 22px;
  }
}

/* ============================================================
   SOS Italia - Footer
   ============================================================ */

.footer {
  margin-top: 54px;
  padding: 42px 0 24px;
  background: rgba(6,9,13,.86);
  border-top: 1px solid rgba(255,255,255,.10);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr .75fr .75fr;
  gap: 28px;
}

.footer-brand strong,
.footer-links strong {
  display: block;
  color: #fff;
  font-size: 18px;
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
  max-width: 560px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a {
  color: rgba(255,255,255,.72);
  transition: color .2s ease, text-shadow .2s ease;
}

.footer-links a:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(242,140,40,.55);
}

.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.52);
  font-size: 13px;
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    padding-top: 34px;
  }
}

/* ============================================================
   SOS Italia - Banner rollback: immagine intera non tagliata
   ============================================================ */

.hero-banner {
  aspect-ratio: 1920 / 430;
  height: auto;
  min-height: 210px;
  max-height: 320px;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
}

@media (max-width: 760px) {
  .hero-banner {
    aspect-ratio: 1920 / 430;
    height: auto;
    min-height: 130px;
    max-height: 210px;
    background-size: contain;
  }
}

/* =========================
   NAV ACTIVE STATE
========================= */

.header-nav a.active,
.subnav a.active,
nav a.active {
  color: var(--orange);
}

.header-nav a.active::after,
.subnav a.active::after,
nav a.active::after {
  opacity: 1;
}

/* =========================
   NAV ACTIVE STATE
========================= */

.header-nav a.active,
.main-nav a.active,
.subnav a.active,
.site-nav a.active,
nav a.active {
  color: var(--orange);
}

.header-nav a.active,
.main-nav a.active,
.subnav a.active,
.site-nav a.active,
nav a.active {
  text-shadow: 0 0 18px rgba(242,140,40,.45);
}

/* SOS Italia — footer pre-pubblicazione 2026-05 */
.footer-grid-prepub {
  grid-template-columns: minmax(280px, 1.55fr) minmax(130px, .65fr) minmax(150px, .75fr) minmax(230px, 1.05fr);
  gap: 42px;
  align-items: start;
}

.footer-brand-prepub p {
  max-width: 520px;
}

.footer-partner-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  max-width: 520px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.footer-partner-logos a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 34px;
  padding: 3px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.07);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.footer-partner-logos a:hover {
  transform: translateY(-2px);
  background: rgba(255,138,31,.08);
  border-color: rgba(255,138,31,.35);
}

.footer-partner-logos img {
  display: block;
  width: auto;
  max-width: 104px;
  max-height: 26px;
  object-fit: contain;
}

.footer-partner-logos a:nth-child(1) img {
  max-width: 78px;
  max-height: 28px;
}

.footer-partner-logos a:nth-child(2) img {
  max-width: 42px;
  max-height: 28px;
}

.footer-partner-logos a:nth-child(3) img {
  max-width: 112px;
  max-height: 22px;
}

.footer-partner-logos a:nth-child(4) img {
  max-width: 104px;
  max-height: 24px;
}

.footer-social {
  gap: 10px;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.footer-social-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,138,31,.10);
  border: 1px solid rgba(255,138,31,.22);
  color: #ff8a1f;
}

.footer-social-icon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.footer-contact span {
  color: rgba(255,255,255,.62);
  line-height: 1.55;
}

.footer-contact-cta {
  margin-top: 4px;
  color: #ff8a1f !important;
  font-weight: 700;
}

@media (max-width: 980px) {
  .footer-grid-prepub {
    grid-template-columns: 1fr 1fr;
    gap: 34px;
  }

  .footer-brand-prepub {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .footer-grid-prepub {
    grid-template-columns: 1fr;
  }

  .footer-partner-logos {
    flex-wrap: wrap;
  }
}

/* SOS Italia — logo Meshtastic/PWD footer PNG */
.footer-partner-logos a:nth-child(4) {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 5px;
  background: rgba(255,255,255,.94);
  border-color: rgba(255,255,255,.22);
}

.footer-partner-logos a:nth-child(4) img {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  filter: none;
}

/* SOS Italia — uniforma altezza loghi partner footer */
.footer-partner-logos a {
  height: 42px;
  min-height: 42px;
  padding: 5px 8px;
}

.footer-partner-logos a:nth-child(1) {
  min-width: 46px;
}

.footer-partner-logos a:nth-child(1) img {
  max-width: 34px;
  max-height: 34px;
}

.footer-partner-logos a:nth-child(2) {
  min-width: 54px;
}

.footer-partner-logos a:nth-child(2) img {
  max-width: 42px;
  max-height: 34px;
}

.footer-partner-logos a:nth-child(3) {
  min-width: 128px;
}

.footer-partner-logos a:nth-child(3) img {
  max-width: 116px;
  max-height: 30px;
}

.footer-partner-logos a:nth-child(4) {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 5px;
}

.footer-partner-logos a:nth-child(4) img {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
}

/* SOS Italia — footer partner logos mobile hard fix definitivo */
.footer .footer-partner-logos {
  max-width: 520px !important;
  width: 100% !important;
  overflow: hidden !important;
}

.footer .footer-partner-logos a {
  box-sizing: border-box !important;
  overflow: hidden !important;
  flex: 0 0 auto !important;
}

.footer .footer-partner-logos img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  max-width: 100% !important;
}

/* Desktop/tablet: dimensioni logo controllate */
.footer .footer-partner-logos a:nth-child(1) img {
  max-width: 34px !important;
  max-height: 34px !important;
}

.footer .footer-partner-logos a:nth-child(2) img {
  max-width: 42px !important;
  max-height: 34px !important;
}

.footer .footer-partner-logos a:nth-child(3) img {
  max-width: 116px !important;
  max-height: 30px !important;
}

.footer .footer-partner-logos a:nth-child(4) img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
}

/* Mobile: loghi in griglia compatta, mai a dimensione originale */
@media (max-width: 680px) {
  .footer .footer-partner-logos {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    max-width: 260px !important;
    width: 260px !important;
    margin-top: 16px !important;
  }

  .footer .footer-partner-logos a {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 6px 8px !important;
  }

  .footer .footer-partner-logos img {
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }

  .footer .footer-partner-logos a:nth-child(1) img {
    max-width: 34px !important;
    max-height: 34px !important;
  }

  .footer .footer-partner-logos a:nth-child(2) img {
    max-width: 42px !important;
    max-height: 34px !important;
  }

  .footer .footer-partner-logos a:nth-child(3) img {
    max-width: 104px !important;
    max-height: 28px !important;
  }

  .footer .footer-partner-logos a:nth-child(4) img {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
  }
}

/* Mobile molto stretto */
@media (max-width: 420px) {
  .footer .footer-partner-logos {
    max-width: 230px !important;
    width: 230px !important;
  }

  .footer .footer-partner-logos a {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
  }

  .footer .footer-partner-logos a:nth-child(3) img {
    max-width: 92px !important;
    max-height: 24px !important;
  }
}
