:root {
  --bg: #151514;
  --surface: #444242;
  --surface-alt: #3a3938;
  --hero-from: #1d1c1b;
  --hero-to: #141212;
  --hero-from-light: #f5f2ee;
  --hero-to-light: #f1ebe3;
  --slide-bg: #373737;
  --text: #e8e8e8;
  --muted: #a29f9b;
  --accent: #af4319;
  --accent-soft: #1b3a6f;
  --border: #5a5858;
  --shadow: 0 24px 60px rgba(79, 57, 49, 0.18);
  --radius: 24px;
  --slider-controls-bg: #1b3a6f;
}

/* Light Theme Variables */
html[data-theme="light"] {
  --bg: #fcfaf7;
  --surface: #ffffff;
  --surface-alt: #f1ebe3;
  --hero-from: var(--hero-from-light);
  --hero-to: var(--hero-to-light);
  --slide-bg: #e0dcd7;
  --text: #1a1a19;
  --muted: #6b6967;
  --accent: #d35400;
  --border: #e2deda;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

/* Fallback per prefers-color-scheme solo se non c'è una scelta manuale */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg: #fcfaf7;
    --surface: #ffffff;
    --surface-alt: #f1ebe3;
    --hero-from: var(--hero-from-light);
    --hero-to: var(--hero-to-light);
    --slide-bg: #e0dcd7;
    --text: #1a1a19;
    --muted: #6b6967;
    --accent: #d35400;
    --border: #e2deda;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: color-mix(in srgb, var(--text) 70%, white 30%);
  text-decoration: none;
  font-weight: 500;
}

html[data-theme="light"] .partner-card a,
html[data-theme="light"] .contact-card a {
  color: beige;
}

html[data-theme="light"] .partner-card h3,
html[data-theme="light"] .contact-card h3 {
  color: beige;
}

html[data-theme="light"] .partner-card p,
html[data-theme="light"] .contact-card p {
  color: beige;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) a {
    color: color-mix(in srgb, var(--text) 70%, black 30%);
  }
}

button {
  font: inherit;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  /* Logo as background for theme support */
  background-image: url('../logos/mts_distribuzione_logo_dark.png');
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
  height: 3.5rem;
  min-width: 180px;
  text-indent: -9999px;
  overflow: hidden;
}

html[data-theme="light"] .brand.logo-link {
  background-image: url('../logos/mts_distribuzione_logo_light.png');
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .brand.logo-link {
    background-image: url('../logos/mts_distribuzione_logo_light.png');
  }
}

.site-logo {
  display: block;
  width: 4.5rem;
  height: auto;
}

/* keep the inline <img> available for screen readers but visually hidden */
.brand.logo-link .site-logo {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.brand.logo-link span {
  display: inline-block;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
}

.theme-toggle svg {
  display: block;
}

.theme-toggle .icon-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .theme-toggle .icon-sun {
    display: none;
  }
  html:not([data-theme]) .theme-toggle .icon-moon {
    display: block;
  }
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg: #f1efe9;
    --surface: #ffffff;
    --surface-alt: #f8f2e9;
    --hero-from: #f5f2ee;
    --hero-to: #f1ebe3;
    --slide-bg: #fff7ee;
    --text: #2d2c2a;
    --muted: #67615c;
    --border: #cbc4bd;
    --shadow: 0 20px 50px rgba(79, 57, 49, 0.08);
  }
}

body.light-mode {
  color-scheme: light;
  --bg: #f1efe9;
  --surface: #ffffff;
  --surface-alt: #f8f2e9;
  --hero-from-light: #f5f2ee;
  --hero-to-light: #f1ebe3;
  --slide-bg: #fff7ee;
  --text: #2d2c2a;
  --muted: #67615c;
  --accent: #af4319;
  --accent-soft: #1b3a6f;
  --border: #cbc4bd;
  --shadow: 0 20px 50px rgba(79, 57, 49, 0.08);
  --slider-controls-bg: #af4319;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.site-nav a {
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--accent-soft);
  color: beige;
}

.nav-link-secondary {
  border: 1px solid var(--accent);
  color: var(--accent);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 999px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 0 4rem;
  background:
    url('../images/hair-musical/hair-the-tribal-love-rock-musical_008.png') center/cover no-repeat,
    var(--surface);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: opacity 1s ease-in-out;
}

.hero::before {
  background: linear-gradient(180deg, rgba(29,28,27,0.85) 0%, rgba(20,18,18,0.85) 100%);
  opacity: 1;
}

html[data-theme="light"] .hero::before {
  opacity: 0;
}

.hero::after {
  background: linear-gradient(180deg, rgba(245,242,238,0.75) 0%, rgba(241,235,227,0.75) 100%);
  opacity: 0;
}

html[data-theme="light"] .hero::after {
  opacity: 1;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .hero::before {
    opacity: 0;
  }
  html:not([data-theme]) .hero::after {
    opacity: 1;
  }
}

body,
.site-header,
.hero,
.button,
.button-secondary,
.feature-list article,
.artist-list article,
.client-card,
.contact-card,
.site-footer,
.slider,
.slide,
.accordion,
.accordion-button,
.contact-card,
.client-card,
.show-file-ref {
  transition: background 3s ease, color 3s ease, border-color 3s ease, box-shadow 3s ease;
}

.hero-copy {
  max-width: 720px;
  position: relative;
  z-index: 1;
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroFadeUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.show-meta {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.filter-row label {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.filter-row select {
  min-width: 220px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
}

.filter-row select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.eyebrow {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.05;
}

.hero p {
  max-width: 40rem;
  margin: 0 0 1.75rem;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.6rem;
  cursor: pointer;
}

.button-primary {
  background: rgb(175, 67, 25);
  color: white;
}

.button-secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.section {
  padding: 4rem 0;
}

.page-heading {
  padding-top: 4rem;
}

.section-heading {
  margin-bottom: 2rem;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-heading h2,
.page-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
}

.intro-section p,
.feature-section p,
.artists-section p,
.contact-section p {
  max-width: 720px;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reverse {
  direction: rtl;
}

.reverse > * {
  direction: ltr;
}

.feature-list,
.artist-list {
  display: grid;
  gap: 1.25rem;
}

.feature-list article,
.artist-list article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.partner-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.partner-card,
.contact-card {
  background: rgb(175, 67, 25);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.contact-cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 2rem 0;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.slider {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  align-self: start;
  min-height: auto;
  height: fit-content;
}

.slider-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  align-items: stretch;
  transition: transform 0.4s ease;
}

.slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--slide-bg);
  font-size: 1.1rem;
  color: var(--text);
  overflow: hidden;
  min-height: 260px;
}

/* Fix for lightbox slides to show full image without cropping/stretching */
.lightbox-frame .slide {
  min-height: auto;
  height: auto;
  background: transparent;
}

.lightbox-frame .slide img {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
}

.slide-video {
  background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.35)), var(--slide-bg);
}

.feature-section .grid-2 {
  align-items: flex-start;
  gap: 3rem;
  grid-template-columns: 1fr 1fr;
}

.slider-container-col {
  grid-column: 1;
  margin-top: 2rem;
}

.feature-list {
  grid-column: 2;
  grid-row: 1 / 3;
}

@media (max-width: 900px) {
  .feature-section .grid-2 {
    grid-template-columns: 1fr;
  }
  .slider-container-col, .feature-list {
    grid-column: 1;
  }
  .feature-list {
    grid-row: auto;
  }
}

/* Hero slider (images cropped, no padding) */
.hero-slider {
  width: 100%;
  height: 360px;
  overflow: hidden;
  border-radius: 1rem;
  position: relative;
  background: var(--slide-bg);
}
.hero-slider .slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s ease;
  will-change: transform;
}
.hero-slider .slide {
  flex: 0 0 100%;
  height: 100%;
  display: block;
}
.hero-slider .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* crop to fill, no padding */
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hero-slider .slide.loaded img {
  opacity: 1;
}

/* Placeholder mentre l'immagine lazy non è ancora caricata */
.hero-slider .slide-inner {
  width: 100%;
  height: 100%;
  background: var(--hero-from);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slider .slide img[data-src] {
  opacity: 0;
}
.hero-slider:hover .slider-track {
  transition: transform 0.3s ease;
}

.video-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 1rem;
  color: var(--text);
}

.video-card span {
  font-size: 1.75rem;
  line-height: 1;
}

.video-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.lightbox-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent);
  border-radius: 50%;
  animation: lightbox-spin 1s linear infinite;
  display: none;
  z-index: 9999;
}

@keyframes lightbox-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.loading .lightbox-loader {
  display: block;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.slide-inner.loaded img {
  opacity: 1;
}

.slide-inner {
  width: 100%;
  height: 100%;
  background: var(--hero-from);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide img[data-src] {
  opacity: 0;
}

.lightbox-frame .slide img {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  margin: auto;
}

.slider-controls {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  justify-content: flex-end;
  background-color: var(--slider-controls-bg);
}

html[data-theme="light"] .slider-controls {
  opacity: 0.9;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .slider-controls {
    opacity: 0.9;
  }
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  padding: 2rem;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-frame {
  position: relative;
  max-width: 80vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(90vw, 1280px);
  height: min(90vh, 720px);
  overflow: hidden;
}

.lightbox-media img,
.lightbox-media video,
.lightbox-media iframe {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 1rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.lightbox-media iframe {
  border: none;
}

.lightbox-close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #101010;
  font-size: 1.4rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover,
.lightbox-close:focus {
  background: white;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 50%;
  background: var(--slider-controls-bg);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10000;
}

.lightbox-nav:hover {
  opacity: 0.9;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.shows-list {
  display: grid;
  gap: 2rem;
}

.show-file-ref {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.error-message {
  color: var(--accent);
  font-weight: 700;
}

.alt-background {
  background: var(--surface-alt);
}

.accordion {
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  overflow: hidden;
  max-width: 720px;
}

.accordion-button {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: none;
  padding: 1.25rem 1.5rem;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 1rem;
}

.accordion-button::after {
  content: "\25be";
  transition: transform 0.3s ease;
}

.accordion-button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.accordion-panel {
  padding: 0 1.5rem 1.5rem;
  display: none;
}

.accordion-panel.active {
  display: block;
}

@media (max-width: 860px) {
  .grid-2,
  .client-grid,
  .contact-cards {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .site-nav.open {
    display: flex;
  }

  .slider-controls {
    justify-content: space-between;
  }
}
