:root {
  --col-gray: #555555;
  --col-red: #c8102e;
  --col-yellow: #f4b41a;
  --col-green: #8cc63f;
  --col-cyan: #00a6ce;

  --bg-light: #f7f7f7;
  --text-main: #333333;

  --hero-blue: #1f3c88; /* blu istituzionale fascia HERO */
}

/* RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg-light);
  line-height: 1.4;
}

/* HEADER */
.top-bar {
  background: var(--col-gray);
  color: #ffffff;
  font-size: 0.85rem;
  padding: 0.3rem 1rem;
  text-align: right;
}

header {
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
}

.logo-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  gap: 1rem;
}

.logo-nav img {
  height: 60px;
  max-width: 100%;
  object-fit: contain;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav a {
  text-decoration: none;
  color: var(--col-gray);
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
  font-size: 0.95rem;
}

nav a:hover,
nav a.active {
  background: var(--col-cyan);
  color: #ffffff;
}

/* HERO (foto + fascia colore in basso) */
.hero {
  position: relative;
  width: 100%;
  overflow: visible; /* fondamentale per mobile */
  background: #000000;
}


.hero-bg {
  display: block;
  width: 100%;
  max-height: 480px; /* home */
  object-fit: cover;
  object-position: center;
  opacity: 0.9;
}

/* HERO: altezza più uniforme nelle pagine interne */
.hero.hero-small .hero-bg {
  max-height: 360px;
  min-height: 260px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.25),
    rgba(0,0,0,0.55)
  );
}

.hero-band {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1100px;
  padding: 1.4rem 1.6rem 1.6rem;
  background: var(--hero-blue);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: 1rem 1rem 0 0;
  backdrop-filter: blur(0px); /* non cambia visivamente, evita glitch su alcuni browser */
}

.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.9;
}

.hero-band h1 {
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  line-height: 1.2;
  margin: 0.3rem 0;
  word-break: break-word;
}

.hero-band p {
  font-size: 0.95rem;
  max-width: 780px;
  opacity: 0.95;
}

/* Accento colore per HERO in base al percorso */
.hero-band.band-umane { border-left: 8px solid var(--col-red); }
.hero-band.band-les   { border-left: 8px solid var(--col-yellow); }
.hero-band.band-app   { border-left: 8px solid var(--col-cyan); }
.hero-band.band-sport { border-left: 8px solid var(--col-green); }

/* Manteniamo un po' di padding corretto con la border */
.hero-band.band-umane,
.hero-band.band-les,
.hero-band.band-app,
.hero-band.band-sport {
  padding-left: 1.3rem;
}

/* BOTTONI */
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  font-size: 0.95rem;
  white-space: nowrap;
}

.btn-primary {
  background: var(--col-yellow);
  color: #333333;
}

.btn-outline {
  border: 2px solid #ffffff;
  color: #ffffff;
  background: transparent;
}

.btn-secondary {
  background: #eeeeee;
  color: #333333;
}

.btn-small {
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
}

/* MAIN */
main {
  padding: 2.5rem 1.5rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
  background: var(--bg-light);
}

.section-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--col-gray);
  border-left: 6px solid var(--col-green);
  padding-left: 0.6rem;
}

.page-section { margin-bottom: 2.5rem; }

/* GRID + CARD */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.card {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.card h3 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.card p { font-size: 0.95rem; }

.news-item small {
  color: #777777;
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  width: fit-content;
}

.badge-red { background: var(--col-red); color: #ffffff; }
.badge-yellow { background: var(--col-yellow); color: #444444; }
.badge-green { background: var(--col-green); color: #ffffff; }
.badge-cyan { background: var(--col-cyan); color: #ffffff; }

/* Card actions (per percorsi-di-studio) */
.card-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Tabelle (quadro orario) */
.table-orario {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.table-orario th,
.table-orario td {
  border: 1px solid #dddddd;
  font-weight: 700;
  padding: 0.4rem 0.5rem;
  text-align: center;
}

.table-orario th:first-child,
.table-orario td:first-child {
  text-align: left;
}

.table-orario thead { 
  background: #e9e9e9;
   }
.table-orario tbody tr:nth-child(even) { background: #fafafa; }

.table-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #777777;
}

/* FOOTER */
footer {
  background: var(--col-gray);
  color: #ffffff;
  padding: 1.5rem;
  font-size: 0.85rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-band { border-radius: 0; }
}

@media (max-width: 700px) {
  .logo-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  nav ul { justify-content: flex-start; }

  .hero-band {
    padding: 1.1rem 1.2rem 1.3rem;
  }
}

@media (max-width: 600px) {
  main { padding: 2rem 1rem 2.5rem; }

  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { width: 100%; text-align: center; }

  .card-actions { flex-direction: column; }
  .card-actions .btn { 
    width: 100%; 
    text-align: center;
    line-height: 1; }
}
/* FIX definitivo HERO su smartphone: fascia sotto l'immagine (niente tagli) */
@media (max-width: 600px) {

  /* l'immagine resta sopra */
  .hero {
    overflow: visible;
  }

  .hero-bg {
    max-height: 260px;
    min-height: 220px;
    width: 100%;
    object-fit: cover;
  }

  /* la fascia NON è più assoluta */
  .hero-band {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;

    width: 100%;
    max-width: none;

    border-radius: 0;
    margin: 0;

    padding: 1.2rem 1rem 1.4rem;
  }

  /* titoli più “elastici” */
  .hero-band h1 {
    font-size: clamp(1.45rem, 6vw, 2.1rem);
    line-height: 1.2;
    word-break: break-word;
  }

  .hero-band p {
    font-size: 0.9rem;
  }
}
