/* =========================================
   CIRCOLO TENNIS FUSIGNANO – STILE PRINCIPALE
   ========================================= */

html, body { overflow-x: hidden; }
main, section, .container { overflow-x: clip; }
img { max-width:100%; display:block; }
/* RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  border: 0;
  height: 100%;
}

header {
  margin: 0;
  padding: 0;
  border: 0;
}

/* COLORI PRINCIPALI */
:root {
  --rosso: #d92323;
  --nero: #111;
  --grigio: #555;
  --chiaro: #fafafa;
}

/* BASE */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--chiaro);
  color: var(--nero);
  line-height: 1.6;
  padding-top: 0; /* nessuno spazio sopra, gestito dallo scroll sticky */
}

h1, h2, h3 {
  font-weight: 700;
  margin-top: 0;
}
a {
  color: var(--rosso);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.container {
  max-width: 1100px;
  margin: auto;
  padding: 20px;
}

/* =========================================
   HEADER HERO
   ========================================= */
.top-hero {
  position: relative;
  background: url('/img/top-tennis-fusignano.jpg') center center/cover no-repeat;
  color: #fff;
  height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.top-hero .overlay {
  background: rgba(0, 0, 0, 0.45);
  height: 100%;
  padding: 20px 0 0;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-area img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #fff;
}

.logo-area .title h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .5px;
}

.logo-area .title p {
  margin: 0;
  font-size: .95rem;
  font-weight: 400;
}

.contacts {
  font-size: .9rem;
  text-align: right;
}
.contacts a { color: #fff; }
.contacts a:hover { text-decoration: underline; }

/* =========================================
   MENU - a metà immagine + sticky allo scroll
   ========================================= */

/* posizione iniziale: centrato sulla hero */
.menu {
  
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  background: rgba(217, 35, 35, 0.9);
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.4s ease-in-out;
  width: 80%;
  max-width: 1100px;
  margin: 20px auto 0 auto;
}

/* quando scrolli oltre la hero */
.menu.fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  transform: none;
  border-radius: 0;
  background: rgba(3, 3, 35, 0.5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  padding: 12px 20px;
  margin: 0;
  max-width: 100%;
  justify-content: center;
}

/* link desktop */
.menu-links {
  display: flex;
  gap: 24px;
}
.menu a {
  color: #fff;
  text-transform: uppercase;
  font-size: 0.9rem;
}
.menu a:hover {
  color: #ffe9e9;
  text-decoration: underline;
}

/* pulsante hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}
.menu-toggle .bar {
  height: 3px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* =========================================
   MOBILE / TABLET
   ========================================= */
@media (max-width: 900px) {
  .top-hero {
    padding-top: 40px;
}

  /* menu sempre fisso in alto su mobile */
  .menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    transform: none;
    border-radius: 0;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(217, 35, 35, 0.97);
    margin: 0px 0px;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-links {
    display: none;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(217, 35, 35, 0.97);
    padding: 20px 0;
    gap: 18px;
  }

  .menu.open .menu-links {
    display: flex;
  }

  /* animazione hamburger a X */
  .menu.open .menu-toggle .bar:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
  }
  .menu.open .menu-toggle .bar:nth-child(2) {
    opacity: 0;
  }
  .menu.open .menu-toggle .bar:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
  }

  .menu a {
    font-size: 1rem;
  }

  
}

/* =========================================
   SEZIONI BASE
   ========================================= */
section { padding: 60px 20px; }
section.rosso { background: var(--rosso); color: #fff; }
section.rosso a { color: #fff; text-decoration: underline; }
.btn { display:inline-block; background:var(--rosso); color:#fff; padding:12px 22px; border-radius:6px; font-weight:600; }
.btn:hover { background:#b71d1d; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:24px; }
footer { background:#222; color:#ccc; text-align:center; padding:30px 10px; font-size:.9rem; }
footer a { color:#fff; }

/* =========================================
   SUB-HERO (pagine interne)
   ========================================= */
.top-hero.sub-hero { height: 280px; }
.sub-hero .overlay { padding-top: 10px; }
.sub-hero-title {
  display:flex; flex-direction:column; align-items:center; gap:6px;
  justify-content:center; height:150px; text-align:center;
}
.sub-hero-title h1 { font-size: 2.4rem; margin: 0; font-weight: 700; letter-spacing: .5px; }
.sub-hero-title p { font-size: 1.1rem; margin: 4px 0 8px; opacity: .9; }
.badge-date {
  display: inline-block; padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.4);
  font-size: .9rem;
}

/* =========================================
   LAYOUT PAGINE LEGALI
   ========================================= */
.policy-wrap {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  margin-top: 24px;
}
.card { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 20px; }
.policy-toc h3 { margin-top: 0; }
.policy-toc ol { margin: 10px 0 0 18px; }
.policy-toc a { text-decoration: none; color: var(--rosso); }
.policy-toc a:hover { text-decoration: underline; }
.policy-content h2 { margin-top: 0; border-left: 6px solid var(--rosso); padding-left: 10px; }
.policy-content p, .policy-content li { color: #333; }
.policy-content .bullets { list-style: none; padding-left: 0; }
.policy-content .bullets li { position: relative; padding-left: 22px; margin: 8px 0; }
.policy-content .bullets li::before { content: "•"; color: var(--rosso); position: absolute; left: 0; }
.policy-toc { position: sticky; top: 100px; align-self: start; height: fit-content; }

/* =========================================
   RESPONSIVE GENERALE
   ========================================= */
@media (max-width: 920px) {
  .policy-wrap { grid-template-columns: 1fr; }

}
@media (max-width: 768px) {
  .top-hero { height: auto; }
  .top-bar { flex-direction: column; text-align: center; gap: 10px; padding: 0 20px; }
  .contacts { text-align: center; }
}

/* =========================================
   SEZIONE CONTATTI (due colonne)
   ========================================= */
.contatti-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.contatti-info iframe {
  border-radius: 8px;
  margin-top: 15px;
}

.contatti-foto img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  max-height: 220px;
  object-fit: cover;
  margin-top: 170px;
}

.contatti-foto .caption {
  font-size: 0.9rem;
  margin-top: 8px;
  color: #fceaea;
  text-align: center;
  font-style: italic;
  opacity: 0.9;
}

/* MOBILE */
@media (max-width: 900px) {
  .contatti-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .contatti-foto img {max-height: 220px;  margin-top: 20px;}
}

/* =========================================
   ANIMAZIONI SEZIONI
   ========================================= */

/* Stato iniziale: invisibile e leggermente spostato */
.animate,
.animate-left,
.animate-right,
.animate-zoom {
  opacity: 0;
 transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Entrata verso l'alto (default) */
.animate {
  transform: translateY(40px);
}
.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Entrata da sinistra */
.animate-left {
  transform: translateX(-60px);
}
.animate-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Entrata da destra */
.animate-right {
  transform: translateX(60px);
}
.animate-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Zoom per immagini / gallery / contatti */
.animate-zoom {
  transform: scale(0.95);
}
.animate-zoom.visible {
  opacity: 1;
  transform: scale(1);
}

/* =========================================
   RITARDO SEQUENZIALE AUTOMATICO
   ========================================= */
.animate.visible:nth-child(1),
.animate-left.visible:nth-child(1),
.animate-right.visible:nth-child(1),
.animate-zoom.visible:nth-child(1) {
  transition-delay: 0s;
}

.animate.visible:nth-child(2),
.animate-left.visible:nth-child(2),
.animate-right.visible:nth-child(2),
.animate-zoom.visible:nth-child(2) {
  transition-delay: 0.1s;
}

.animate.visible:nth-child(3),
.animate-left.visible:nth-child(3),
.animate-right.visible:nth-child(3),
.animate-zoom.visible:nth-child(3) {
  transition-delay: 0.2s;
}

.animate.visible:nth-child(4),
.animate-left.visible:nth-child(4),
.animate-right.visible:nth-child(4),
.animate-zoom.visible:nth-child(4) {
  transition-delay: 0.3s;
}

.animate.visible:nth-child(5),
.animate-left.visible:nth-child(5),
.animate-right.visible:nth-child(5),
.animate-zoom.visible:nth-child(5) {
  transition-delay: 0.4s;
}

.animate.visible:nth-child(6),
.animate-left.visible:nth-child(6),
.animate-right.visible:nth-child(6),
.animate-zoom.visible:nth-child(6) {
  transition-delay: 0.5s;
}

/* =========================================
   EFFETTI INTERATTIVI (hover + dinamica)
   ========================================= */

/* Card e box */
.grid > div, .card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.grid > div:hover, .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Immagini (gallery, staff, contatti) */
.grid img, .contatti-foto img {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s ease;
  border-radius: 8px;
}
.grid img:hover, .contatti-foto img:hover {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}

/* Pulsanti */
.btn {
  transition: background 0.3s ease, transform 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px);
  background: #fff;
  color: var(--rosso);
  border: 1px solid var(--rosso);
}

/* Titoli e testi in sezione rossa */
section.rosso h2:hover {
  letter-spacing: 1px;
  transition: all 0.3s ease-in-out;
}

/* Testimonianze */
.testimonial {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  color: #222;
  transition: transform 0.4s ease, box-shadow 0.3s ease;
}
.testimonial:hover {
  transform: scale(1.03);
  box-shadow: 0 5px 14px rgba(0,0,0,0.15);
}

.divider-elegante{
display:flex;
align-items:center;
justify-content:center;
margin:10px 0 40px 0;
text-align:center;
}

.divider-elegante::before,
.divider-elegante::after{
content:"";
flex:1;
height:2px;
background:linear-gradient(to right, transparent, #d92323);
}

.divider-elegante::after{
background:linear-gradient(to left, transparent, #d92323);
}

.divider-elegante span{
padding:0 20px;
font-weight:700;
letter-spacing:1px;
color:#111;
font-size:1rem;
}