/* Reset base — v4 — push retry */
/* CSS aggiornato 2026-04-28 con: .logo h100, .logo-title bg, btn-youtube[hidden] fix */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

html, body {
  height: 100%;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #222;
  background-color: #1bcfa2;
  line-height: 1.6;
}

/* Barra informativa in alto */
.top-strip {
  background: #111;
  color: #f5f5f5;
  text-align: center;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 244, 242, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 1;
  min-width: 0;
}

.logo {
    height: 100px;
    width: auto;
    object-fit: contain;
}

.logo-main {
  height: 70px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.logo-school {
  height: 70px;
  opacity: 0.85;
}

.logo-tvweb {
  height: 70px;
}

.logo-scritta {
  height: 60px;
}

.section-inner.narrow img {
    width: 100%;
    margin: -10% 0 -8%;
}

/* Sezione "Cosa facciamo": layout compatto, tutto centrato e ravvicinato */
#chi-siamo .section-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#chi-siamo h2 {
  margin-bottom: 0;
}

#chi-siamo img {
  max-width: 380px;
  width: 100%;
  margin: -1.5rem 0 -1rem;
}

#chi-siamo p {
  margin-top: 0;
  max-width: 720px;
}

/* Sezione disclaimer/copyright più compatta */
#contatti {
  padding: 2rem 1.5rem;
}

#contatti h2 {
  font-size: 1rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.logo-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.logo-text:hover,
.logo-text:focus-visible {
  opacity: 0.78;
  outline: none;
}

.logo-title {
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 1.1rem;
    background: url(img/scritta-cactus.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
    width: clamp(180px, 22vw, 320px);
    height: 120px;
}

.logo-subtitle {
  font-weight: 300;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #666;
}

/* Menu */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  font-size: 0.9rem;
}

.main-nav a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #333;
  font-weight: 500;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.main-nav a:hover {
  color: #008a5a;
  border-color: #008a5a;
}

/* Social link semplici */
.social-links {
  display: flex;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.social-links a {
  text-decoration: none;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.social-links a:hover {
  color: #008a5a;
}

.social-icon {
  display: block;
  height: 32px;
  width: auto;
  transition: transform 0.18s ease;
}

.social-links a:hover .social-icon,
.social-links a:focus-visible .social-icon {
  transform: scale(1.1);
}

/* Hero */
.hero {
  position: relative;
  height: 85vh;
  min-height: 480px;
  max-height: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  /* Cambia il nome del file qui sotto con quello che metterai nella cartella img */
  background-image: url('img/miosfondo.jpg');
  background-size: cover;
  background-position: left;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.42), rgba(0,0,0,0.65));
}

.hero-content {
    z-index: 1;
    max-width: 760px;
    padding: 2rem 1.5rem;
    text-align: right !important;
    color: #000000;
    float: right;
    right: 5%;
    position: absolute;
}

.hero-content .btn-primary {
  /* block-level + width:fit-content + margin-left:auto → bottone a destra sotto la quote */
  display: flex;
  width: fit-content;
  margin: 2.75rem 0 0 auto;
  top: 50px;
  position: relative;
  clear: both;
}

.hero-tagline {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 0.8rem;
  opacity: 0.85;
}

.hero h1 {
    font-size: clamp(1.7rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.hero-quote {
    font-size: 1.5rem;
    max-width: 600px;
    margin-bottom: 1.6rem;
    float: right;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.8rem;
  background: #00a86b;
  color: #fff;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary:hover {
  background: #00c07a;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.35);
}

.hero-scroll {
  margin-top: 1.2rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  opacity: 0.8;
}

/* Sezioni generiche */
.section {
  padding: 4.5rem 1.5rem;
}

.section-alt {
  background: #fdfbf8;
}

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.section-inner.narrow {
  max-width: 760px;
  text-align: center;
}

.section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.6rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.section p {
    font-size: 0.95rem;
    color: #444;
    text-align: justify;
}

/* Griglia rubriche */
.rubriche-grid {
    margin-top: 2.2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(370px, 1fr));
    gap: 1.6rem;
    grid-auto-flow: row;
}

.rubrica-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.rubrica-card {
    background: #fff;
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 630px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, translate 0.18s ease;
    cursor: pointer;
}

.rubrica-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 60px rgba(0,0,0,0.14);
}

.rubrica-img {
    height: 300px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.rubrica-body {
  padding: 1.1rem 1.3rem 1.4rem;
}

.rubrica-body h3 {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
    color: #333;
}

.rubrica-body p {
  font-size: 0.9rem;
  color: #555;
}

/* Dettaglio rubriche */
#rubriche-dettaglio {
  display: none;
}

.rubriche-dettaglio-visible {
  display: block;
}

.rubrica-detail {
  display: none;
  margin-top: 2.5rem;
  padding: 1.8rem 1.6rem;
  background: #fff;
  border-radius: 1.2rem;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.06);
  text-align: left;
}

.rubrica-detail.rubrica-detail-attiva {
  display: block;
}

.rubrica-detail h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 0.8rem;
  color: #333;
}

.rubrica-detail p {
  font-size: 0.92rem;
  color: #444;
  margin-bottom: 1.1rem;
}

/* Pannello in sovraimpressione (modal) per rubriche */
.rubrica-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.rubrica-modal.aperta {
  display: flex;
}

.rubrica-modal-contenuto {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 1.3rem;
  padding: 0.6rem 1.8rem 1.6rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.rubrica-modal-titolo {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 0.9rem;
  color: #222;
}

.rubrica-modal-testo {
  font-size: 0.94rem;
  color: #444;
  margin-bottom: 1.3rem;
}

.rubrica-modal-chiudi {
  position: sticky;
  top: 0;
  align-self: flex-end;
  z-index: 10;
  width: 44px;
  height: 44px;
  margin-right: -0.6rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: #444;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}

.rubrica-modal-chiudi:hover,
.rubrica-modal-chiudi:focus-visible {
  background: #f44336;
  color: #fff;
  transform: scale(1.05);
  outline: none;
}

.btn-youtube[hidden] {
  display: none !important;
}

.btn-youtube {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  background: #ff0000;
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-youtube:hover {
  background: #ff3333;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

/* Video / embed placeholder */
.video-placeholder {
  margin: 1rem auto 0;
  border-radius: 0.8rem;
  border: 1px dashed #ccc;
  padding: 0.9rem 1rem;
  text-align: center;
  background: #fff;
  color: #777;
  font-size: 0.78rem;
  line-height: 1.4;
}

.video-placeholder p {
  margin: 0;
}

/* Torna alla homepage */
.back-home {
  margin-top: 1.5rem;
  text-align: center;
}

.back-home a {
  text-decoration: none;
  color: #008a5a;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

/* Footer */
.site-footer {
  background: #111;
  color: #eee;
  padding: 1.6rem 1.5rem;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-inner p {
  font-size: 0.85rem;
}

.footer-social {
  display: flex;
  gap: 0.8rem;
  font-size: 0.8rem;
}

.footer-social a {
  text-decoration: none;
  color: #ddd;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
}

.footer-social a:hover {
  color: #00c07a;
}

/* Responsive */

/* Tablet: il margin -30% è troppo aggressivo, lo dimezzo */
@media (max-width: 1100px) and (min-width: 601px) {
  .section-inner.narrow img {
    margin: -10% 0;
  }
}

@media (max-width: 900px) {
  /* Header in 3 righe: logo-group | nav | social */
  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 0.8rem;
  }

  /* Logo-group: cactus + scritta + Fermi sempre IN UNA SOLA RIGA, larghezza piena */
  .logo-group {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
  }

  /* Nav: riga propria, centrato */
  .main-nav {
    flex: 1 1 100%;
  }

  .main-nav ul {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  /* Social: riga propria, centrato */
  .social-links {
    flex: 1 1 100%;
    justify-content: center;
  }

  /* Loghi laterali ridotti per stare in riga col logo-text */
  .logo-main,
  .logo-school,
  .logo-tvweb {
    height: 70px;
  }

  /* Scritta cactus dimensionata per non saturare la riga */
  .logo-title {
    width: clamp(180px, 32vw, 320px);
    height: 80px;
  }

  .logo-subtitle {
    font-size: 0.7rem;
  }

  .hero-content {
    text-align: center;
    align-items: center;
  }

  .hero-quote {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 600px) {
  .site-header {
    position: static;
  }

  .hero {
    height: auto;
    padding: 4rem 0 3rem;
  }

  .section {
    padding: 3.2rem 1.2rem;
  }

  /* Hero responsive: contenuto torna nel flusso, niente float/absolute */
  .hero-content {
    position: static;
    float: none;
    right: auto;
    max-width: 100%;
    padding: 1.2rem 1rem;
    text-align: center;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-quote {
    font-size: 1rem;
    float: none;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .btn-primary {
    padding: 0.75rem 1.4rem;
    font-size: 0.85rem;
  }

  /* Rimuovo il margin negativo aggressivo su mobile (creava overlap) */
  .section-inner.narrow img {
    margin: 0 0 1rem;
  }

  /* Rubriche: card più compatte su mobile */
  .rubrica-img {
    height: 200px;
  }

  .rubrica-card {
    min-height: auto;
  }

  /* Loghi header più piccoli su mobile per stare in riga: cactus + scritta + Fermi + TVweb */
  .logo,
  .logo-main,
  .logo-school,
  .logo-tvweb {
    height: 50px;
    flex-shrink: 0;
  }

  .logo-title {
    height: 56px;
    width: clamp(120px, 38vw, 200px);
  }

  /* Header: tre righe (logo-group | nav | social), logo-group sempre in riga */
  .header-inner {
    gap: 0.6rem;
  }

  .logo-group {
    flex-wrap: nowrap;
    gap: 0.6rem;
    align-items: center;
  }

  .main-nav ul {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

  .social-icon {
    height: 28px;
  }

  /* Cosa facciamo: ancora più compatto su mobile */
  #chi-siamo img {
    max-width: 260px;
    margin: -0.6rem 0 -0.4rem;
  }

  /* Disclaimer/copyright: ancora più compatto */
  #contatti {
    padding: 1.4rem 1rem;
  }

  #contatti h2 {
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
  }

  .video-placeholder {
    padding: 0.7rem 0.9rem;
    font-size: 0.72rem;
    margin-top: 0.7rem;
  }

  /* Top strip: testo più compatto */
  .top-strip {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
    line-height: 1.3;
  }

  /* Rubriche grid: una colonna per evitare card strette */
  .rubriche-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .rubrica-body {
    padding: 0.9rem 1rem 1.1rem;
  }

  .rubrica-body h3 {
    font-size: 1rem;
  }

  /* Modal: padding ridotto per dare spazio al contenuto */
  .rubrica-modal {
    padding: 0.5rem;
  }

  .rubrica-modal-contenuto {
    padding: 0.4rem 1rem 1.2rem;
    border-radius: 1rem;
    max-height: 95vh;
  }

  .rubrica-modal-titolo {
    font-size: 1rem;
    padding-right: 2.5rem;
  }

  .rubrica-modal-testo {
    font-size: 0.9rem;
  }

  /* Section: padding verticale ridotto su mobile */
  .section {
    padding: 2.4rem 1rem;
  }

  /* Footer e contatti */
  .site-footer .footer-inner {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }

  .video-placeholder p {
    font-size: 0.8rem;
  }
}

/* Breakpoint extra-small per smartphone piccoli (<= 380px) */
@media (max-width: 380px) {
  .logo,
  .logo-main,
  .logo-school,
  .logo-tvweb {
    height: 40px;
  }

  .logo-title {
    height: 44px;
    width: clamp(100px, 36vw, 160px);
  }

  .logo-subtitle {
    font-size: 0.5rem;
  }

  .logo-group {
    gap: 0.4rem;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  .hero-quote {
    font-size: 0.95rem;
  }

  .rubrica-img {
    height: 160px;
  }

  .gallery-item-info h4,
  .gallery-item-title {
    font-size: 0.95rem;
  }

  .gallery-item-desc {
    font-size: 0.85rem;
  }
}

/* ======================================================
   Galleria video nella modal rubrica
   ====================================================== */
.rubrica-modal-gallery {
  margin-top: 1.2rem;
}

.gallery-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.gallery-item {
  display: flex;
  flex-direction: row;
  gap: 1.1rem;
  align-items: flex-start;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.gallery-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.gallery-item-media {
  flex: 0 0 320px;
  max-width: 320px;
}

.gallery-item-media video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #000;
  display: block;
}

.gallery-item-info {
  flex: 1;
  min-width: 0;
}

.gallery-item-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #222;
}

.gallery-item-desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #444;
  text-align: justify;
}

.gallery-empty,
.gallery-loading {
  margin: 0.6rem 0 0;
  font-style: italic;
  color: #888;
}

.gallery-item-desc.gallery-empty {
  margin: 0;
}

@media (max-width: 700px) {
  .gallery-item {
    flex-direction: column;
  }

  .gallery-item-media {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
  }
}

/* ======================================================
   Media speciale (es. Accadde oggi: immagine cliccabile → link)
   ====================================================== */
.media-speciale-link {
  display: block;
  text-align: center;
  text-decoration: none;
}

.media-speciale-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.media-speciale-img:hover,
.media-speciale-img:focus-visible {
  transform: scale(1.02);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}
