/* ================================================
   calendario.css — Stili specifici pagina gare
   ================================================ */

/* ─── FILTRO WORLD ─── */
.pub-ftab.cal-world.on { color: var(--gold); border-bottom-color: var(--gold); }
.pub-ftab.cal-world.on .cnt { background: var(--goldb); color: var(--goldd); }

/* ─── NEXT CARDS ─── */
.cal-next-ti {
  background: linear-gradient(135deg, var(--n), #0d2260);
  border-radius: var(--br);
  padding: 18px 18px 0;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}
.cal-next-ti::before {
  content: '►';
  position: absolute;
  right: 12px;
  bottom: -10px;
  font-size: 100px;
  color: rgba(255,255,255,.04);
  line-height: 1;
}
.cal-next-world {
  background: linear-gradient(135deg, #3d2e00, #5c4500);
  border-radius: var(--br);
  padding: 16px 18px 0;
  margin-bottom: 8px;
  position: relative;
}
.cal-next-world::before {
  content: '🌍';
  position: absolute;
  right: 14px;
  top: 14px;
  font-size: 40px;
  opacity: .2;
}
.cal-next-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.45);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal-next-dot { width: 6px; height: 6px; background: var(--r); border-radius: 50%; }
.cal-next-date { font-family: var(--bb); font-size: 44px; color: var(--r); line-height: 1; margin-bottom: 4px; }
.cal-next-name { font-size: 16px; font-weight: 700; color: var(--w); margin-bottom: 4px; }
.cal-next-loc  { font-size: 12px; color: rgba(255,255,255,.5); margin-bottom: 14px; }
.cal-next-footer {
  background: rgba(255,255,255,.06);
  margin: 0 -18px;
  padding: 10px 18px;
  font-size: 11px;
  color: rgba(255,255,255,.6);
}
.cal-next-footer strong { color: var(--wrc); }

/* ─── LISTA EVENTI ─── */
.cal-mese-h {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--mu);
  padding: 20px 2px 8px;
}
.cal-mese-h:first-of-type { padding-top: 8px; }

.cal-ecard {
  background: var(--w);
  border-radius: var(--br);
  border: 1px solid var(--bo);
  box-shadow: var(--sh);
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.cal-ecard:hover { box-shadow: 0 6px 24px rgba(10,26,78,.13); transform: translateY(-1px); }
.cal-ecard.ti    { border-left: 3.5px solid var(--r); }
.cal-ecard.wrc   { border-left: 3.5px solid var(--wrc); }
.cal-ecard.world {
  background: linear-gradient(135deg, #fffdf5, #fff8e1);
  border: 1px solid #e8d88a;
  border-left: 3.5px solid var(--gold);
  box-shadow: 0 2px 12px rgba(184,134,11,.1);
}
.cal-ecard.world:hover { box-shadow: 0 6px 24px rgba(184,134,11,.18); }
.cal-ecard.world .cal-ecday   { color: var(--gold); }
.cal-ecard.world .cal-ectitle { color: #3d2e00; }
.cal-ecard.interno {
  background: #f8f9fb;
  border: 1px solid #e2e6ef;
  box-shadow: none;
  opacity: .72;
}
.cal-ecard.interno:hover      { opacity: 1; box-shadow: var(--sh); transform: none; }
.cal-ecard.interno .cal-ectitle { font-size: 13px; color: var(--mu); }
.cal-ecard.interno .cal-ecday   { color: var(--mu); }

.cal-ecrow   { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; }
.cal-ecdate  { width: 44px; flex-shrink: 0; text-align: center; }
.cal-ecday   { font-family: var(--bb); font-size: 28px; color: var(--n); line-height: 1; }
.cal-ecmon   { font-size: 9px; color: var(--mu); text-transform: uppercase; letter-spacing: .5px; margin-top: 1px; }
.cal-ecsep   { width: 1px; background: var(--bo); align-self: stretch; flex-shrink: 0; }
.cal-ecbody  { flex: 1; min-width: 0; }
.cal-ectitle { font-size: 14px; font-weight: 700; color: var(--tx); line-height: 1.3; margin-bottom: 4px; }
.cal-ecloc   { font-size: 12px; color: var(--mu); display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.cal-ecloc svg { flex-shrink: 0; opacity: .4; }
.cal-badges  { display: flex; gap: 4px; flex-wrap: wrap; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

.cal-meld {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #fafbfd;
  border-top: 1px solid var(--bo);
  font-size: 11px;
}
.cal-meld svg    { flex-shrink: 0; opacity: .4; }
.cal-meld-label  { color: var(--mu); font-weight: 600; }
.cal-meld-date   { font-family: var(--mn); color: var(--tx); font-weight: 500; }
.cal-meld-giorni { margin-left: auto; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 6px; }
.cal-meld-giorni.urgent { background: #fef2f2; color: #dc2626; }
.cal-meld-giorni.soon   { background: #fff7ed; color: #d97706; }
.cal-meld-giorni.ok     { background: #f0fdf4; color: #166534; }
.cal-meld-giorni.chiuse { color: var(--mu); font-weight: 400; }

.cal-eclink {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px;
  background: var(--n);
  color: var(--w);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  transition: background .12s;
}
.cal-eclink:hover       { background: var(--n2); }
.cal-eclink.world       { background: var(--gold); }
.cal-eclink.world:hover { background: var(--goldd); }

/* ─── GRIGLIA ─── */
.cal-grid-wrap  { display: flex; flex-direction: column; gap: 24px; }
.cal-grid-month { background: var(--w); border-radius: var(--br); border: 1px solid var(--bo); box-shadow: var(--sh); overflow: hidden; }
.cal-grid-header { background: var(--n); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.cal-grid-title  { font-family: var(--bb); font-size: 22px; color: var(--w); letter-spacing: .5px; }
.cal-grid-count  { font-size: 11px; color: rgba(255,255,255,.5); font-weight: 600; }
.cal-grid-dow    { display: grid; grid-template-columns: repeat(7,1fr); background: var(--g); border-bottom: 1px solid var(--bo); }
.cal-grid-dow-cell { padding: 6px 4px; text-align: center; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--mu); }
.cal-grid-dow-cell.weekend { color: var(--rd); }
.cal-grid-days   { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; background: var(--bo); }
.cal-grid-day    { background: var(--w); min-height: 64px; padding: 4px; }
.cal-grid-day.other-month { background: #f9fafb; }
.cal-grid-day.today       { background: #fff8f8; }
.cal-grid-day.today .cal-gday-num { background: var(--r); color: var(--w); border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cal-grid-day.has-events  { cursor: pointer; }
.cal-grid-day.has-events:hover { background: #f8f9ff; }
.cal-gday-num    { font-size: 11px; font-weight: 600; color: var(--mu); margin-bottom: 3px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.cal-gday-num.weekend { color: var(--rd); }
.cal-gday-dots   { display: flex; flex-direction: column; gap: 2px; }
.cal-gdot        { font-size: 9px; font-weight: 600; padding: 1px 4px; border-radius: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.cal-gdot.ti     { background: #e8f0ff; color: var(--n); }
.cal-gdot.world  { background: var(--goldb); color: var(--goldd); }
.cal-gdot.wrc    { background: var(--wrcb); color: var(--wrcd); }
.cal-gdot.swiss  { background: var(--rb); color: var(--rd); }
.cal-gdot.ftal   { background: #e8f7ee; color: #1a6b3a; }
.cal-gdot.int    { background: #f1f3f6; color: #8a94a6; }
.cal-gdot.more   { background: var(--g2); color: var(--mu); text-align: center; }

/* ─── STAGIONE ─── */
.cal-stagione-mob-note { display: none; background: var(--n); color: rgba(255,255,255,.7); padding: 12px 16px; text-align: center; font-size: 12px; border-radius: var(--br); }
.cal-stagione-outer    { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal-stagione-wrap     { min-width: 900px; background: var(--w); border-radius: var(--br); border: 1px solid var(--bo); box-shadow: var(--sh); overflow: hidden; }
.cal-stagione-table    { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-stagione-table thead tr th { background: var(--n); color: var(--w); padding: 10px 8px; text-align: center; font-family: var(--bb); font-size: 18px; letter-spacing: .5px; border-right: 1px solid rgba(255,255,255,.1); }
.cal-stagione-table thead tr th.day-col { font-family: var(--sf); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; width: 32px; color: rgba(255,255,255,.5); }
.cal-stagione-table tbody td { border: 1px solid var(--bo); padding: 1px 2px; vertical-align: top; height: 22px; }
.cal-stagione-table tbody td.day-num { text-align: center; font-weight: 700; color: var(--mu); font-size: 10px; background: var(--g); width: 32px; vertical-align: middle; border-right: 2px solid var(--bo); }
.cal-stagione-table tbody td.day-num.weekend { color: var(--rd); background: #fff5f5; }
.cal-stagione-table tbody td.day-num.today-row { background: var(--r); color: white; }
.cal-stagione-table tbody td.no-day { background: #f5f5f5; border-color: #eee; }
.cal-stagione-table tbody tr:hover td:not(.day-num) { background: #fafbff; }
.s-cell { display: flex; flex-direction: column; gap: 1px; min-height: 20px; }
.s-bar  { font-size: 9px; font-weight: 600; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; cursor: pointer; transition: opacity .1s; }
.s-bar:hover { opacity: .8; }
.s-bar.ti    { background: #fde8ea; color: #a50e26; border-left: 2px solid var(--r); }
.s-bar.wrc   { background: var(--wrcb); color: var(--wrcd); border-left: 2px solid var(--wrc); }
.s-bar.world { background: var(--goldb); color: var(--goldd); border-left: 2px solid var(--gold); }
.s-bar.ftal  { background: #e8f7ee; color: #1a6b3a; border-left: 2px solid #2d9a5f; }
.s-bar.swiss { background: #f0f4ff; color: #2c4fa0; border-left: 2px solid #4a6fd4; }
.s-bar.int   { background: #f5f5f5; color: #9ca3af; border-left: 2px solid #d1d5db; }
.s-bar.bar-mid, .s-bar.bar-end { border-top: none; }
.cal-stagione-legenda { display: flex; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--g); border-top: 1px solid var(--bo); font-size: 10px; }
.cal-leg-item { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.cal-leg-dot  { width: 12px; height: 12px; border-radius: 2px; }
.cal-leg-dot.ti    { background: #fde8ea; border-left: 3px solid var(--r); }
.cal-leg-dot.wrc   { background: var(--wrcb); border-left: 3px solid var(--wrc); }
.cal-leg-dot.world { background: var(--goldb); border-left: 3px solid var(--gold); }
.cal-leg-dot.ftal  { background: #e8f7ee; border-left: 3px solid #2d9a5f; }
.cal-leg-dot.swiss { background: #f0f4ff; border-left: 3px solid #4a6fd4; }

/* ─── RESPONSIVE ─── */
@media (min-width: 768px) {
  .cal-ecrow   { padding: 15px 20px; }
  .cal-ectitle { font-size: 15px; }
  .cal-grid-day { min-height: 80px; }
  .cal-gdot    { font-size: 10px; }
}
@media (max-width: 767px) {
  .cal-stagione-mob-note { display: block; }
  .cal-stagione-outer    { display: none; }
}