/* Stili delle pagine Eventi. La base (tokens, nav, bottoni, footer) riprende quella di index.html. */

/* TOKENS — palette ufficiale: #1a1436 / #c1d82f / #ed1f79 / #ffffff */
:root {
  --midnight: #1a1436;
  --deep:     #1a1436;
  --lime:     #c1d82f;
  --magenta:  #ed1f79;
  --white:    #ffffff;
  --muted:    rgba(255,255,255,0.58);
  --r:        10px;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }
body {
  font-family: 'Raleway', sans-serif;
  background: var(--midnight);
  color: var(--white);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a   { text-decoration: none; color: inherit; }
[hidden] { display: none !important; }

/* TYPOGRAPHY */
h1, h2, h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  letter-spacing: -0.025em;
  line-height: 1.08;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 700; }
h3 { font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 600; }
p  { line-height: 1.75; }
.lime    { color: var(--lime); }
.magenta { color: var(--magenta); }

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 6%;
  background: var(--deep);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800; font-size: 1.4rem;
  letter-spacing: -0.03em;
}
.nav-logo img { height: 32px; width: auto; flex-shrink: 0; }
.nav-logo .tale { color: var(--white); }
.nav-logo .run  { color: var(--lime); }

.nav-right { display: flex; align-items: center; gap: 1.8rem; }

.nav-link {
  font-size: 0.85rem; font-weight: 600;
  color: var(--lime); letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--white); }
.nav-link.current { color: var(--white); }

.lang-switch {
  display: flex;
  background: rgba(255,255,255,0.06);
  border-radius: 40px; padding: 3px;
}
.lang-btn {
  background: none; border: none; cursor: pointer;
  font-family: 'Raleway', sans-serif;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.07em;
  padding: 5px 13px; border-radius: 40px;
  color: var(--muted); transition: all 0.2s;
}
.lang-btn.active { background: var(--lime); color: var(--midnight); }

/* BUTTONS */
.btn-primary {
  display: inline-block;
  background: var(--lime); color: var(--midnight);
  font-family: 'Raleway', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  padding: 0.95rem 2rem;
  border-radius: 4px; border: none; cursor: pointer;
  text-align: center;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: #c1d82f; transform: translateY(-2px); }

/* SCROLL REVEAL */
.r {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16,1,0.3,1),
              transform 0.75s cubic-bezier(0.16,1,0.3,1);
}
.r.visible { opacity: 1; transform: none; }
.r.d1 { transition-delay: 0.10s; }
.r.d2 { transition-delay: 0.20s; }

/* DECO helper */
.deco {
  position: absolute; pointer-events: none;
  user-select: none; opacity: 0.09;
  max-width: none;
}

.section-kicker {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--lime); margin-bottom: 0.9rem;
}
.section-lead {
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  color: var(--muted); max-width: 600px;
}


/* ============================================================
   EVENTS LIST
============================================================ */
.events-page { position: relative; overflow: hidden; }
.events-page > section { position: relative; z-index: 1; }
.events-hero { padding: 10rem 6% 3.5rem; }
.events-hero h1 { margin-bottom: 1.2rem; }
/* oversized on purpose: both cut ends of the ribbon fall outside the page */
.events-deco {
  left: -13.5vw; top: 3rem;
  width: 120vw; height: auto;
  opacity: 0.12;
}

.events-section { padding: 1rem 6% 5rem; }
.events-section h2 { margin-bottom: 0.8rem; }
.past-lead { color: var(--muted); margin-bottom: 1.8rem; }
.past-lead a { color: var(--lime); font-weight: 700; transition: color 0.2s; }
.past-lead a:hover { color: var(--white); }
#past { border-top: 1px solid rgba(255,255,255,0.06); padding-top: 4rem; }

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
}
.events-empty {
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,0.16);
  border-radius: var(--r);
  padding: 2rem 1.75rem;
  max-width: 600px;
}
.events-empty a { color: var(--lime); font-weight: 700; }

.event-card {
  display: flex; align-items: stretch; gap: 1.3rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r);
  padding: 1.4rem;
  transition: opacity 0.75s cubic-bezier(0.16,1,0.3,1),
              transform 0.3s cubic-bezier(0.16,1,0.3,1),
              border-color 0.3s, box-shadow 0.3s;
}
/* when rendered as a <button> (dynamic cards that open the booking modal) */
button.event-card {
  appearance: none; -webkit-appearance: none;
  font: inherit; color: inherit;
  text-align: left; width: 100%;
  cursor: pointer;
}
.event-card:hover {
  transform: translateY(-5px);
  border-color: rgba(193,216,47,0.5);
  box-shadow: 0 12px 36px rgba(0,0,0,0.28);
}
.event-date {
  flex-shrink: 0; width: 76px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--lime); color: var(--midnight);
  border-radius: 6px; padding: 0.8rem 0.4rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  line-height: 1;
}
.event-day   { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; }
.event-month { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; margin-top: 0.3rem; }
.event-year  { font-size: 0.68rem; font-weight: 600; opacity: 0.65; margin-top: 0.25rem; }

/* past events: same card, quieter, not clickable */
.event-card.past { cursor: default; }
.event-card.past .event-date {
  background: transparent; color: var(--muted);
  border: 1px solid rgba(255,255,255,0.16);
}
.event-card.past .event-place { color: var(--muted); }
.event-card.past:hover {
  transform: none; box-shadow: none;
  border-color: rgba(255,255,255,0.08);
}

.event-when { font-size: 0.92rem; font-weight: 600; color: rgba(255,255,255,0.82); line-height: 1.4; }

.event-info { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.event-place {
  font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--lime); line-height: 1.4;
}
.event-title { color: var(--white); line-height: 1.2; }
.event-more {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: auto; padding-top: 0.6rem;
  font-size: 0.85rem; font-weight: 700;
  color: var(--lime); transition: gap 0.2s;
}
.event-card:hover .event-more { gap: 10px; }


/* ============================================================
   FORM FIELDS (booking modal)
============================================================ */
.fgroup { margin-bottom: 1.15rem; }
.fgroup label {
  display: block;
  font-family: 'Raleway', sans-serif;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.60); margin-bottom: 0.45rem;
}
.fgroup input,
.fgroup select,
.fgroup textarea {
  width: 100%;
  background: #1a1436;
  border: 1px solid var(--lime);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.92rem; color: var(--white);
  outline: none; appearance: none;
  transition: border-color 0.2s;
}
.fgroup input:focus,
.fgroup select:focus,
.fgroup textarea:focus { border-color: #fff; }
.fgroup input::placeholder,
.fgroup textarea::placeholder { color: rgba(242,242,242,0.40); }
.fgroup input.invalid { border-color: var(--magenta); }

.field-error {
  color: var(--magenta); font-size: 0.75rem; margin-top: 0.4rem; display: none;
}
.field-error.visible { display: block; }

/* hide the number input's up/down spinner arrows */
.fgroup input[type="number"] { -moz-appearance: textfield; }
.fgroup input[type="number"]::-webkit-inner-spin-button,
.fgroup input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.fsub {
  width: 100%; margin-top: 0.3rem;
  background: var(--lime); color: var(--midnight);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  padding: 1rem; border: none; border-radius: 4px;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.fsub:hover { background: #c1d82f; transform: translateY(-2px); }


/* ============================================================
   BOOKING MODAL
============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center; justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--midnight);
  border: 1px solid rgba(193,216,47,0.3);
  border-radius: var(--r);
  max-width: 440px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  padding: 2rem 1.8rem;
  position: relative;
}
.modal-close {
  position: absolute; top: 1rem; right: 1.2rem;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.4rem; line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--white); }
.modal-box h3 { color: var(--white); margin-bottom: 0.3rem; padding-right: 1.5rem; }
.modal-event-meta { font-size: 0.85rem; color: var(--lime); margin-bottom: 1.4rem; }
.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.modal-total {
  font-size: 0.95rem; color: var(--white); font-weight: 700;
  margin: 1rem 0 0.2rem;
  display: flex; justify-content: space-between; align-items: baseline;
}
.modal-total span.lime { font-size: 1.2rem; }
.modal-error {
  color: var(--magenta); font-size: 0.85rem; margin-top: 0.8rem; display: none;
}
.modal-error.visible { display: block; }


/* ============================================================
   FOOTER
============================================================ */
footer {
  background: var(--deep);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2.2rem 6%;
  display: flex; flex-wrap: wrap;
  justify-content: space-between;
  align-items: center; gap: 1.4rem;
}
.footer-brand {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.3rem; font-weight: 800;
  letter-spacing: -0.03em;
}
.footer-brand .tale { color: var(--white); }
.footer-brand .run  { color: var(--lime); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.8rem; align-items: center; }
.footer-links a {
  font-size: 0.82rem; font-weight: 500;
  color: var(--muted); transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); }
.footer-copy { font-size: 0.76rem; color: rgba(255,255,255,0.42); text-align: center; }
.footer-mail { display: inline-flex; align-items: center; gap: 0.4em; color: inherit; transition: color 0.2s; }
.footer-mail:hover { color: var(--lime); }
.footer-social { display: flex; justify-content: center; gap: 1.1rem; margin-top: 0.7rem; }
.footer-social a { display: inline-flex; color: rgba(255,255,255,0.55); transition: color 0.2s; }
.footer-social a:hover { color: var(--lime); }


/* ============================================================
   EVENT DETAIL
============================================================ */
.event-page {
  position: relative; overflow: hidden;
  padding: 9rem 6% 6rem;
}
.event-page > *:not(.deco) { position: relative; z-index: 1; }
.event-page .events-deco { opacity: 0.09; }

.event-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; font-weight: 700;
  color: var(--lime); margin-bottom: 2.4rem;
  transition: gap 0.2s;
}
.event-back:hover { gap: 10px; }

.event-head { max-width: 900px; margin-bottom: 3rem; }
.event-head h1 { margin-bottom: 1.4rem; }
.event-head h1:has(+ .event-subtitle) { margin-bottom: 0.7rem; }
.event-subtitle {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2;
  color: var(--lime); margin-bottom: 1.2rem;
}
.event-lead {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  color: rgba(255,255,255,0.85); max-width: 720px;
}
.event-lead strong { color: var(--white); font-weight: 700; }
.event-ended {
  display: none;
  font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--white); background: var(--magenta);
  border-radius: 40px; padding: 5px 13px;
  margin-bottom: 1.2rem;
}
.is-past .event-ended { display: inline-block; }

.event-meta {
  display: flex; flex-wrap: wrap;
  gap: 1px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 3.5rem;
}
.event-meta > div { flex: 1 1 170px; background: var(--midnight); padding: 1.3rem 1.5rem; }
.event-meta > div.wide { flex: 2 1 340px; }
.event-meta dt {
  font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--lime); margin-bottom: 0.4rem;
}
.event-meta dd { font-size: 1rem; font-weight: 600; line-height: 1.45; }
.event-slots span { display: block; font-weight: 500; color: rgba(255,255,255,0.82); }
.event-slots span + span { margin-top: 0.35rem; }
.event-slots strong { color: var(--white); font-weight: 700; }

.event-layout { display: grid; gap: 3.5rem; align-items: start; }
.event-layout.has-poster { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }

.event-body { max-width: 1000px; }
.event-body h2 { font-size: clamp(1.6rem, 2.4vw, 1.75rem); margin: 2.4rem 0 1rem; }
.event-body h2:first-child { margin-top: 0; }
.event-body p { color: rgba(255,255,255,0.82); margin-bottom: 1.1rem; font-size: 1.06rem; }
.event-body ul { margin: 0 0 1.1rem 1.2rem; color: rgba(255,255,255,0.82); line-height: 1.75; font-size: 1.06rem; }
.event-body li::marker { color: var(--lime); }
.event-body p a { color: var(--lime); font-weight: 600; }
.event-body p a:hover { color: var(--white); }
.event-body strong { color: var(--white); font-weight: 700; }
.event-body mark { background: none; color: var(--magenta); font-weight: 700; }
.event-body .event-intro {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem); font-weight: 500;
  color: var(--white); line-height: 1.6;
}
.event-body .event-statement {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(1.5rem, 3vw, 1.85rem); font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.15;
  color: var(--white);
  margin: 2rem 0;
}
.event-body .event-statement mark { font-weight: 800; }

.event-map {
  display: block; margin-top: 0.4rem;
  font-size: 0.82rem; font-weight: 700;
  color: var(--lime); transition: color 0.2s;
}
.event-map:hover { color: var(--white); }

.event-cta h2 { margin-top: 0; }
.event-body .ticket-list { list-style: none; margin: 0 0 2rem; max-width: 460px; }
.ticket-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ticket-list span { color: rgba(255,255,255,0.82); }
.event-body .ticket-list strong {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.25rem; font-weight: 800;
  color: var(--lime); white-space: nowrap;
}

.event-poster img {
  width: 100%; height: auto;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.08);
}

.event-cta {
  margin-top: 2.6rem; padding-top: 2.2rem;
  border-top: 1px solid rgba(193,216,47,0.15);
}
.event-cta p { color: var(--muted); font-size: 0.88rem; margin: 1rem 0 0; }
.is-past .event-cta .btn-primary { display: none; }
.event-cta .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }


/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
  .event-layout.has-poster { grid-template-columns: 1fr; }
  .event-poster { max-width: 420px; }
}
@media (max-width: 680px) {
  nav { padding: 0.85rem 4%; }
  .nav-logo { font-size: 1.1rem; gap: 7px; }
  .nav-logo img { height: 26px; }
  .nav-right { gap: 0.9rem; }
  .nav-link { font-size: 0.68rem; white-space: nowrap; }
  .events-hero { padding: 8rem 5% 2.5rem; }
  .events-section { padding-left: 5%; padding-right: 5%; }
  .event-page { padding: 7.5rem 5% 4rem; }
  .events-grid { grid-template-columns: 1fr; }
  .events-deco { opacity: 0.1; }
  .btn-primary { display: block; }
  footer { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
@media (max-width: 380px) {
  .nav-logo { font-size: 1rem; }
  .nav-right { gap: 0.6rem; }
  .nav-link { font-size: 0.62rem; }
  .event-card { gap: 1rem; padding: 1.1rem; }
  .event-date { width: 64px; }
}
