/* assets/css/global.css */
/* Design system EITango — variabili, reset, stili base */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500&display=swap');

/* ── VARIABILI ───────────────────────────────────────────── */
:root {
  --red:        #B70018;
  --red-dark:   #8f0012;
  --red-light:  #fce8eb;
  --ink:        #111111;
  --gray:       #666666;
  --gray2:      #999999;
  --gray3:      #dddddd;
  --bg:         #ffffff;
  --bg2:        #f9f9f9;
  --font-title: 'Bebas Neue', sans-serif;
  --font-body:  'DM Sans', sans-serif;
  --max-width:  1200px;
  --radius:     0;
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── HEADER / NAVBAR ─────────────────────────────────────── */
.header {
  background: #fff;
  border-bottom: 1px solid var(--gray3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top { padding: 0; }
.header-top-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
}
.logo-img { height: 80px; width: auto; display: block; }

.nav-bar {
  background: var(--red);
  padding: 0 1.5rem;
}
.nav-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
}
.nav-link {
  font-size: .95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: rgba(255,255,255,.9);
  padding: .8rem .7rem;
  text-decoration: none;
  transition: background .15s;
  border-radius: 0;
}
.nav-link:hover,
.nav-link.active { background: #111; color: #fff; text-decoration: none; }
.nav-admin { border-left: 1px solid rgba(255,255,255,.25); }
.nav-spacer { flex: 1; }
.nav-login {
  font-size: .95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: #fff;
  padding: .55rem 1.15rem;
  border: 1px solid rgba(255,255,255,.4);
  text-decoration: none;
  transition: background .15s;
  margin-left: .5rem;
}
.nav-login:hover { background: #111; border-color: #111; text-decoration: none; }

/* Hamburger button — nascosto su desktop */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem .25rem;
  flex-direction: column;
  gap: 5px;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: transform .25s, opacity .25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav links — flex row su desktop */
.nav-links {
  display: flex;
  align-items: center;
  flex: 1;
}

/* ── MAIN CONTENT ────────────────────────────────────────── */
.main-content { min-height: calc(100vh - 200px); }

/* ── CONTAINER ───────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 .5rem;
}

/* ── PAGE LAYOUT ─────────────────────────────────────────── */
.page { max-width: var(--max-width); margin: 0 auto; padding: 2rem .5rem; }

.page-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--red);
  padding-bottom: .75rem;
}
.page-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  color: var(--ink);
  letter-spacing: .05em;
}
.page-count {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray2);
}

/* ── BADGE CATEGORIE ─────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: .62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .2rem .55rem;
  border-radius: 0;
}
.badge-milonga  { background: #fce8eb; color: #8f0012; }
.badge-festival { background: #fff3e0; color: #7a3c00; }
.badge-pratica  { background: #e8f5e9; color: #1b5e20; }
.badge-corso    { background: #e3f2fd; color: #0d3c6e; }
.badge-workshop { background: #f3e5f5; color: #4a0e72; }
.badge-stage    { background: #e8eaf6; color: #1a237e; }
.badge-default  { background: var(--bg2); color: var(--gray); }

/* ── PULSANTI ────────────────────────────────────────────── */
.btn {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  line-height: 1.2;
  padding: .6rem 1.2rem;
  border: none;
  cursor: pointer;
  border-radius: 0;
  text-decoration: none;
  display: inline-block;
  transition: background .15s, color .15s;
  box-sizing: border-box;
  vertical-align: middle;
}
button.btn { -webkit-appearance: none; appearance: none; margin: 0; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); text-decoration: none; color: #fff; }
.btn-dark { background: #111; color: #fff; }
.btn-dark:hover { background: var(--red); text-decoration: none; color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--gray);
  border: 1px solid var(--gray3);
}
.btn-ghost:hover { border-color: var(--gray2); color: var(--ink); text-decoration: none; }
.btn-full { width: 100%; text-align: center; }
.btn-sm { font-size: .55rem; padding: .4rem .8rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dark); }

/* ── FILTRI ──────────────────────────────────────────────── */
.filters-box {
  background: var(--bg2);
  border: 1px solid var(--gray3);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}
.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
  margin-bottom: .75rem;
}
.f-group { display: flex; flex-direction: column; gap: .3rem; }
.f-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray);
}
.f-select, .f-input {
  border: 1px solid var(--gray3);
  padding: .45rem .6rem;
  font-family: var(--font-body);
  font-size: .95rem;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.f-select:focus, .f-input:focus { border-color: var(--red); }
.filters-actions { display: flex; gap: .5rem; }

/* ── TABELLA EVENTI ──────────────────────────────────────── */
.date-group { margin-bottom: 2rem; }
.date-label {
  background: var(--ink);
  color: #fff;
  padding: .4rem 1rem;
  margin-bottom: 0;
}
.date-day {
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.evt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.evt-table thead tr {
  background: var(--bg2);
  border-bottom: 1px solid var(--gray3);
}
.evt-table th {
  padding: .5rem 1rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray);
  font-weight: 500;
  text-align: left;
}
.evt-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--gray3);
  vertical-align: middle;
}
.evt-table tbody tr:hover { background: #fafafa; }
.evt-link { color: var(--ink); font-weight: 500; }
.evt-link:hover { color: var(--red); text-decoration: none; }
.org-link { color: var(--gray); font-size: .95rem; }
.org-link:hover { color: var(--red); }
.btn-detail {
  font-size: .70rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--red);
  white-space: nowrap;
}
.btn-detail:hover { color: var(--red-dark); }

/* ── FORM ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray);
  margin-bottom: .35rem;
}
.form-label .required { color: var(--red); }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border: 1px solid var(--gray3);
  padding: .6rem .8rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: 0;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--red); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-hint {
  font-size: .72rem;
  color: var(--gray2);
  margin-top: .3rem;
}
.form-error {
  font-size: .72rem;
  color: var(--red);
  margin-top: .3rem;
}

/* ── FLASH MESSAGES ──────────────────────────────────────── */
.flash {
  padding: .85rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  border-left: 3px solid;
}
.flash-success { background: #e8f5e9; color: #1b5e20; border-color: #4caf50; }
.flash-error   { background: #fce8eb; color: #8f0012; border-color: var(--red); }
.flash-info    { background: #e3f2fd; color: #0d3c6e; border-color: #2196f3; }

/* ── PAGINAZIONE ─────────────────────────────────────────── */
.paginazione {
  display: flex;
  gap: .25rem;
  justify-content: center;
  margin-top: 2rem;
  padding: 1rem 0;
}
.paginazione a {
  padding: .45rem .8rem;
  border: 1px solid var(--gray3);
  font-size: .8rem;
  color: var(--gray);
  text-decoration: none;
  transition: all .15s;
}
.paginazione a:hover,
.paginazione a.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ── FOOTER ──────────────────────────────────────────────── */
.footer {
  background: #fff;
  padding: 2.5rem 1.5rem 1.5rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo { height: 32px; width: auto; }
.footer-copy {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray2);
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray2);
}
.footer-links a:hover { color: var(--red); }

/* ── UTILS ───────────────────────────────────────────────── */
.text-red   { color: var(--red); }
.text-gray  { color: var(--gray); }
.text-small { font-size: .82rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ── MOBILE EVENT CARDS (nascosto su desktop) ────────────── */
.evt-mobile { display: none; }

.evt-cards {
  display: flex;
  flex-direction: column;
}
.evt-card {
  display: block;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray3);
  text-decoration: none;
  color: var(--ink);
  transition: background .15s;
}
.evt-card:hover { background: #fafafa; text-decoration: none; }
.evt-card:active { background: var(--red-light); }
.evt-card-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}
.evt-card-citta {
  font-size: .82rem;
  color: var(--gray);
  font-weight: 500;
}
.evt-card-title {
  font-weight: 500;
  font-size: .95rem;
  line-height: 1.3;
}
.evt-card-ora {
  font-size: .78rem;
  color: var(--gray2);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-hamburger {
    display: flex;
  }
  .nav-bar {
    position: relative;
  }
  .nav-bar-inner {
    flex-wrap: wrap;
  }
  /* Hamburger resta fisso in alto a sinistra nella barra rossa */
  .nav-hamburger {
    position: absolute;
    top: 0;
    left: 1rem;
    padding: .75rem .25rem;
    z-index: 10;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: .5rem 0;
    margin-top: 2.5rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-link {
    width: 100%;
    padding: .75rem 1rem;
    font-size: .9rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .nav-link:last-of-type {
    border-bottom: none;
  }
  .nav-spacer { display: none; }
  .nav-admin { border-left: none; }
  .nav-login {
    width: 100%;
    text-align: center;
    margin: .5rem 0 .25rem;
    padding: .65rem 1rem;
    margin-left: 0;
  }
  /* Header top mobile */
  .header-top-inner { padding: .5rem 1rem; }
  .logo-img { height: 55px; }
  .header-auth { display: none !important; }
  .nav-mobile-auth {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: .25rem;
    padding-top: .25rem;
  }
  .nav-mobile-auth .nav-link { width: 100%; }
  .page { padding: 1.25rem .5rem; }
  .page-title { font-size: 2rem; }

  /* Tabella → card su mobile */
  .evt-desktop { display: none; }
  .evt-mobile  { display: flex; }

  .filters-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .filters-grid { grid-template-columns: 1fr; }
}
