/* ==========================================================================
   ROBERTO CONTIERO - SITO PERSONALE
   Stile ispirato da elenaweb
   ========================================================================== */

/* ---------- CSS VARIABLES ---------- */
:root {
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-display: Georgia, serif;

  /* Dark Theme (Default) */
  --bg-primary: #0d0f14;
  --bg-secondary: #12141c;
  --bg-alt: #161922;
  --bg-card: #1a1d27;
  --bg-glass: rgba(18, 20, 28, 0.85);
  --bg-glass-strong: rgba(18, 20, 28, 0.95);

  --text-primary: #e8e6e3;
  --text-secondary: #b0aca5;
  --text-muted: #706c66;

  --primary: #4a7c8a;
  --primary-hover: #5a939f;
  --gold: #c9a84c;
  --gold-hover: #d4b85e;

  --border-color: rgba(201, 168, 76, 0.15);
  --border-hover: rgba(201, 168, 76, 0.35);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

[data-theme="light"] {
  --bg-primary: #f5f3f0;
  --bg-secondary: #eae7e3;
  --bg-alt: #e2dfd9;
  --bg-card: #ffffff;
  --bg-glass: rgba(245, 243, 240, 0.85);
  --bg-glass-strong: rgba(245, 243, 240, 0.95);

  --text-primary: #1a1d27;
  --text-secondary: #4a4a4a;
  --text-muted: #777;

  --primary: #3a6a78;
  --primary-hover: #2a5a68;
  --gold: #a8861c;
  --gold-hover: #b8962c;

  --border-color: rgba(58, 106, 120, 0.15);
  --border-hover: rgba(58, 106, 120, 0.35);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover { color: var(--gold-hover); }

img { max-width: 100%; height: auto; }
ul { list-style: none; }

/* ---------- CONTAINER ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- UTILITY ---------- */
.text-gold { color: var(--gold); }
.text-uppercase { text-transform: uppercase; }
.text-center { text-align: center; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #d4a843);
  color: #0d0f14;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
  color: #0d0f14;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- NAVBAR ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 14px 0;
  transition: all 0.3s ease;
}
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.25s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}
.nav-cta {
  padding: 8px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold), #d4a843);
  color: #0d0f14;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(201, 168, 76, 0.3);
  color: #0d0f14;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}
.theme-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.theme-icon-moon { display: block; }
.theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: block; }

/* Mobile Menu */
.menu-trigger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
}
.menu-trigger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
  border-radius: 2px;
}
.menu-trigger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-trigger.active span:nth-child(2) { opacity: 0; }
.menu-trigger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 120px 20px 80px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-alt) 100%);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(201, 168, 76, 0.06) 0%, transparent 60%),
              radial-gradient(circle at 70% 30%, rgba(74, 124, 138, 0.06) 0%, transparent 60%);
  pointer-events: none;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-primary) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}
.hero-photo {
  width: 240px;
  height: 240px;
  object-fit: cover;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.3));
  border-radius: 50%;
}
.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- SECTIONS ---------- */
.section-padding {
  padding: 80px 0;
}
.section-header {
  text-align: center;
  margin-bottom: 50px;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.section-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- TIMELINE ---------- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  opacity: 0.3;
}
.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 20px;
}
.timeline-year {
  flex-shrink: 0;
  width: 100px;
  text-align: right;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
}
.timeline-year::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -11px;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg-primary);
}
.timeline-content {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  transition: all 0.3s ease;
}
.timeline-content:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}
.timeline-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- DISCIPLINES / CARDS GRID ---------- */
.disciplines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.discipline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.35s ease;
  box-shadow: var(--shadow-sm);
}
.discipline-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}
.card-img-wrapper {
  position: relative;
  height: 180px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-alt), var(--bg-secondary));
}
.card-icon-placeholder {
  font-size: 3.5rem;
  z-index: 2;
  position: relative;
}
.card-img-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 50%, var(--bg-card));
}
.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: 1px solid rgba(201, 168, 76, 0.5);
  z-index: 2;
}
.card-content {
  padding: 20px;
}
.card-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.card-subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 10px;
  font-weight: 500;
}
.card-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}
.card-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 14px;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}
.card-teacher {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  transition: all 0.25s ease;
}
.card-link:hover {
  gap: 10px;
  color: var(--gold-hover);
}

/* ---------- GALLERY ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.gallery-item {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.35s ease;
  aspect-ratio: 4/3;
}
.gallery-item:hover {
  transform: scale(1.02);
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.2);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img {
  transform: scale(1.05);
}

/* ---------- LIGHTBOX ---------- */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
}
.lightbox-close:hover {
  color: var(--gold);
}

/* ---------- LOCATIONS / CONTATTI ---------- */
.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.location-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}
.location-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.location-icon-wrapper {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
  margin-bottom: 16px;
}
.location-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.address {
  display: block;
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 10px;
  font-weight: 500;
}
.location-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.location-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  transition: all 0.25s ease;
}
.location-map-btn:hover {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- FOOTER ---------- */
.site-footer {
  padding: 30px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}
.footer-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- ANIMATIONS ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero-photo {
    width: 260px;
    max-height: 220px;
    border-radius: 50%;
  }
}
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    padding: 80px 30px 30px;
    transition: right 0.35s ease;
    z-index: 999;
    border-left: 1px solid var(--border-color);
  }
  .nav-menu.active { right: 0; }
  .nav-links {
    flex-direction: column;
    gap: 4px;
  }
  .nav-link {
    display: block;
    padding: 12px 16px;
    font-size: 1rem;
  }
  .nav-cta { display: none; }
  .menu-trigger { display: flex; }
  .theme-toggle { display: flex; }

  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 0.95rem; }
  .hero-actions { flex-direction: column; align-items: center; }

  .form-grid { grid-template-columns: 1fr; }

  .section-padding { padding: 50px 0; }
  .section-header h2 { font-size: 1.6rem; }

  .timeline::before { left: 20px; }
  .timeline-item { flex-direction: column; gap: 6px; }
  .timeline-year { text-align: center; width: 100%; }
  .timeline-year::after { display: none; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .disciplines-grid { grid-template-columns: 1fr; }
  .locations-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
}
