/* ======================
   TB Logistica – Base CSS
   ====================== */

/* ---- Reset & base ---- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: #222; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
body { overflow-x: hidden; }

body { 
  margin: 0; 
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif; 
  color: #222; 
  line-height: 1.5; 
}

h1 { font-weight: 690; }
h2, h3 { font-weight: 600; }

.section-title {
  text-align: center;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
  padding-bottom: .25rem;
  margin-bottom: 1.5rem;
}

:root{
  --accent: #fcef06;     /* giallo aziendale */
  --text: #222;
  --muted: #666;
  --border: rgba(0,0,0,.06);
}

/* ---- Layout helpers ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.accent { color: var(--accent); }

/* ======================
   Header
   ====================== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; justify-content: space-between; padding: 1rem 2rem; }
.logo {
  display: flex;           /* per allineare l'immagine se serve */
  align-items: center;
  max-width: none;         /* togli eventuali limiti */
  flex-shrink: 0;          /* evita che si riduca se lo spazio è poco */
}

.logo img {
  display: block;
  width: 280px;            /* usa width invece di max-width per forzare */
  height: auto;
}

.menu { list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0; }
.menu a { color: #333; padding: .5rem .4rem; border-radius: 8px; transition: background .2s ease, color .2s ease; }
.menu a:hover { background: rgba(0,0,0,.05); color: #000; }

/* ---- HERO / SWIPER -------------------------------------------------- */

section.hero,
.hero {
  margin: 0 !important;
  padding: 0 !important;
  height: 60vh;               /* spazio visibile della hero */
  max-height: 760px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .hero { height: 50vh; }
}

/* Swiper eredita l’altezza della hero */
.hero .swiper,
.hero .swiper-wrapper,
.hero .swiper-slide {
  height: 100%;
}

/* Ogni slide riempie lo spazio */
.hero .swiper-slide {
  position: relative;
  overflow: hidden;
}

/* Immagini a pieno, nessun “buco” baseline */
.hero .swiper-slide img,
.hero .swiper-slide picture {     /* copre anche il caso <picture> */
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlay sfumato sopra l’immagine */
.hero .swiper-slide::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(0,0,0,.45) 100%);
}

/* Testo in overlay (sopra l’overlay) */
.hero-text{
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.hero-text-inner{
  max-width: 900px;
  text-align: center;
  padding: .75rem 1rem;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  backdrop-filter: saturate(120%) blur(2px);
}

.hero-text h1{
  margin: 0 0 .4rem;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.hero-text p{
  margin: 0;
  color: #f5f5f5;
  font-weight: 500;
  line-height: 1.35;
}

/* Frecce Swiper */
.swiper-button-prev, .swiper-button-next{
  color: #fff;
  text-shadow: 0 0 6px rgba(0,0,0,.6);
}

/* Frecce Swiper */
.swiper-button-prev, .swiper-button-next{
  color: #fff; text-shadow: 0 0 6px rgba(0,0,0,.6);
}

/* ======================
   Sezioni contenuto
   ====================== */
section { padding: 2.5rem 0; }
section h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); margin: 0 0 .75rem; }
section p { color: var(--muted); margin: 0.25rem 0 0; }

/* Intro (semplice) */
.intro.container { padding-top: 2rem; }

/* ======================
   Card Servizi - Stile a Riga
   ====================== */

   .cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
  }
  
  .card-riga {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
    background: #fdfdfd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 10px;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .card-riga:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  
  .card-img {
    flex: 0 0 300px;
    max-width: 300px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 8px;
  }
  
  .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
  }
  
  .card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.5rem 0;
  }
  
  .card-text h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #222;
  }
  
  .descrizione {
    font-size: 1rem;
    line-height: 1.5;
    color: #444;
    text-align: justify;
    margin-top: 0.5rem;
  }
  
  .card-cta {
    margin-top: 1rem;
    color: #005bbb;
    text-decoration: underline;
    font-weight: bold;
    align-self: flex-start;
    transition: color 0.2s ease;
  }
  
  .card-cta:hover {
    color: #003377;
  }
  
  /* ==========================
     Responsive (mobile/tablet)
     ========================== */
  
  @media (max-width: 768px) {
    .card-riga {
      flex-direction: column;
      align-items: stretch;
    }
  
    .card-img {
      flex: 1 1 auto;
      max-width: 100%;
      aspect-ratio: auto;
    }
  
    .card-img img {
      width: 100%;
      height: auto;
    }
  
    .card-text {
      padding-top: 1rem;
    }
  }

/* ======================
   Galleria (placeholder)
   ====================== */
.gallery-grid{
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}
@media (max-width: 1024px){ .gallery-grid{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px){ .gallery-grid{ grid-template-columns: repeat(2, 1fr); } }

.gallery-grid a{
  display: block; overflow: hidden; border-radius: 10px;
  border: 1px solid var(--border);
}
.gallery-grid img{ width: 100%; height: 180px; object-fit: cover; transition: transform .25s ease; }
.gallery-grid a:hover img{ transform: scale(1.04); }

/* ======================
   Contatti & Footer
   ====================== */
.footer{
  border-top: 1px solid var(--border);
  padding: 2rem 0; color: #444; font-size: .95rem;
}

/* Hero text esteso */
.hero-text-inner{
  max-width: 900px;
  text-align: center;
  padding: .75rem 1rem;
  border-radius: 12px;
  background: rgba(0,0,0,.25);              /* leggero fondo */
  backdrop-filter: saturate(120%) blur(2px); /* soft */
}

.hero-text h1{
  margin: 0 0 .4rem;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.hero-text p{
  margin: 0;
  color: #f5f5f5;
  font-weight: 500;
  line-height: 1.35;
}

section { padding: 3rem 0; }             /* da 2.5 a 3rem */
.intro.container { padding-top: 2.5rem; } /* intro un filo più bassa */

.card-media{ margin: -1.25rem -1.25rem .9rem; overflow: hidden; border-radius: 12px 12px 0 0; }
.card-media img{ width: 100%; height: 160px; object-fit: cover; }

@media (max-width: 768px) {
  .card-riga {
    flex-direction: column;
    flex: 1 1 100%;
  }

  .card-img img {
    max-width: 100%;
  }
}

.intro.container p {
  margin-bottom: 1rem;
}

/* ===== Galleria immagini ===== */
#galleria {                 /* l'ID della sezione */
  margin-top: 3rem;
}

#galleria .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* responsive */
  gap: 1rem;
}

/* Thumbnail uniformi (scegli un rapporto) */
#galleria .grid img {
  width: 100%;
  aspect-ratio: 4 / 3;         /* ✅ 4:3 gradevole - puoi usare 1/1 per quadrate o 16/9 */
  object-fit: cover;           /* ritaglio gradevole */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  transition: transform .25s ease, box-shadow .25s ease;
}

#galleria .grid a:hover img {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
}

#galleria .grid img {
  width: 100%;
  aspect-ratio: 4 / 3;   /* ✅ proporzioni uniformi: prova 1/1 per quadrate */
  object-fit: cover;     /* ritaglio estetico */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  transition: transform .25s ease, box-shadow .25s ease;
}

/* ========== Footer ========== */
.footer {
  border-top: 3px solid var(--accent);
  padding: 2rem 1rem;
  background: #fff;
  text-align: center;
  font-size: 0.95rem;
  color: #333;
  box-shadow: 0 -1px 0 rgba(0,0,0,.05);
}

.footer-logo img {
  max-width: 200px;
  margin: 0 auto 1rem;
}

.footer-menu {
  margin: 1rem 0;
}

.footer-menu a {
  margin: 0 0.8rem;
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.footer-menu a:hover {
  color: var(--accent);
}

.footer-contacts {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.footer-contacts a {
  color: #005bbb; /* BLU tradizionale link */
  text-decoration: none;
}

.footer-contacts a:hover {
  color: var(--accent); /* GIALLO al passaggio */
}

.footer-credits {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #555;
}

.footer-credits a {
  font-weight: bold;
  color: #005bbb; /* Link blu anche nei crediti */
  text-decoration: none;
}

.footer-credits a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* mobile */
@media (max-width: 600px){
  .footer-logo img { height: 64px; }
  .footer-nav { gap: 1.1rem; }
}

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--accent);
  color: #000;
  font-size: 1.5rem;
  font-weight: bold;
  padding: 0.4rem 0.6rem;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 200;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

/* ====== Contatti ====== */
.contatti h1 { margin-bottom: .5rem; }
.contatti .muted { color: var(--muted); }

.contatti-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}
@media (max-width: 960px){
  .contatti-grid { grid-template-columns: 1fr; }
}

.box {
  background: #fdfdfd;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.box h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.box p { margin: .25rem 0; }
.hours { margin: .25rem 0; padding-left: 1.2rem; }

.map-wrap { border-radius: 14px; overflow: hidden; box-shadow: 0 2px 14px rgba(0,0,0,.06); }
.map-wrap iframe { width: 100%; height: 360px; border: 0; display: block; }

.form-wrap { margin-top: 2rem; }
.contact-form { display: grid; gap: 1rem; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px){ .contact-form .row { grid-template-columns: 1fr; } }

.contact-form label { display: grid; gap: .35rem; font-weight: 600; }
.contact-form input,
.contact-form textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .7rem .9rem;
  font: inherit;
  background: #fff;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #bbc7ff;
  box-shadow: 0 0 0 3px rgba(88,104,255,.12);
}
.contact-form .btn {
  justify-self: start;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: .7rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .2s ease;
}
.contact-form .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }

.contact-form .hp { display: none !important; }
.form-note { color: var(--muted); font-size: .9rem; margin: .2rem 0 0; }

.scopri-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: bold;
  color: #005bbb;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.scopri-link:hover {
  color: #003377;
}

html { scroll-behavior: smooth; }

.prose p { margin: 0 0 1rem; color: #444; }
.prose img { max-width: 100%; border-radius: 8px; margin: .5rem 0 1rem; }