/* ==========================================================================
   CLAUDIO SIRMIO · EVENTI & AGENDA DELLA COMUNITÀ
   Design System: Giallo Miele / Zafferano Dorato (#ca8a04) & Blu Notte (#0f2942)
   ========================================================================== */

:root {
  --primary: #ca8a04;
  --primary-hover: #a16207;
  --primary-dark: #b45309;
  --primary-light: #fef3c7;
  --primary-border: #fde68a;

  --civic-primary: #0f2942;
  --civic-hover: #1e3a5f;
  --civic-light: #e0f2fe;
  --civic-text: #0369a1;

  --bg-page: #faf9f6;
  --bg-surface: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* SHELL & CONTAINER */
.shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* HEADER */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.identity-photo-wrap {
  display: inline-flex;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 2px #e2e8f0;
}

.identity-photo {
  width: 44px;
  height: 44px;
  object-fit: cover;
}

.identity-text {
  display: flex;
  flex-direction: column;
}

.identity-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f172a;
}

.identity-role {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.nav-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #334155;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-back-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* MAIN CONTENT */
.agenda-main {
  padding: 44px 20px 80px;
}

.agenda-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  border: 1px solid var(--primary-border);
}

.agenda-hero-title {
  font-size: 2.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.agenda-hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 740px;
  margin-bottom: 30px;
}

/* BARRA FILTRI DUALI: CATEGORIA & PERIODO */
.agenda-filter-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.filter-controls-grid {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end;
  gap: 16px;
  width: 100%;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
}

.filter-group-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filter-group-label svg {
  color: var(--primary);
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 38px 10px 14px;
  font-size: 0.94rem;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  font-family: inherit;
}

.custom-select:hover {
  background-color: #ffffff;
  border-color: #94a3b8;
}

.custom-select:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.18);
}

.select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  color: #64748b;
}

/* Status Bar & Reset */
.filter-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.85rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 8px;
}

.reset-filter-btn {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.reset-filter-btn:hover {
  background: #fee2e2;
}

/* Box Nessun Evento Trovato */
.no-events-box {
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  margin: 20px 0 30px;
}

.no-events-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fef3c7;
  color: #b45309;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.no-events-box h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.no-events-box p {
  color: #64748b;
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

/* GRIGLIA EVENTI */
.agenda-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  width: 100%;
}

.agenda-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  min-width: 0;
  box-sizing: border-box;
}

.agenda-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Varianti Tipologia Card & Bordo Superiore */
.agenda-card.card-cultura { border-top: 4px solid #ca8a04; }
.agenda-card.card-mostre { border-top: 4px solid #7c3aed; }
.agenda-card.card-fotografia { border-top: 4px solid #0284c7; }
.agenda-card.card-sport { border-top: 4px solid #16a34a; }
.agenda-card.card-musica { border-top: 4px solid #e11d48; }
.agenda-card.card-food { border-top: 4px solid #ea580c; }
.agenda-card.card-feste { border-top: 4px solid #d97706; }
.agenda-card.card-civico { border-top: 4px solid #0f2942; }

.agenda-card-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.agenda-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.agenda-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Badge distintivi per ciascuna tipologia */
.agenda-badge-cultura {
  background: #fef3c7;
  color: #b45309;
}

.agenda-badge-mostre {
  background: #f3e8ff;
  color: #6b21a8;
}

.agenda-badge-fotografia {
  background: #e0f2fe;
  color: #0369a1;
}

.agenda-badge-sport {
  background: #dcfce7;
  color: #15803d;
}

.agenda-badge-musica {
  background: #ffe4e6;
  color: #be123c;
}

.agenda-badge-food {
  background: #ffedd5;
  color: #c2410c;
}

.agenda-badge-feste {
  background: #fef9c3;
  color: #a16207;
}

.agenda-badge-civico {
  background: #e2e8f0;
  color: #0f2942;
  font-weight: 800;
}

.agenda-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.25;
}

.agenda-date svg {
  flex-shrink: 0;
  color: var(--primary-dark);
}

.agenda-card.card-civico .agenda-date {
  color: var(--civic-primary);
}

.agenda-card.card-civico .agenda-date svg {
  color: var(--civic-primary);
}

.agenda-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.agenda-place {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #475569;
  font-weight: 600;
  min-width: 0;
}

.agenda-place svg {
  flex-shrink: 0;
  color: #94a3b8;
}

.agenda-place span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-desc {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.agenda-footer {
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.agenda-source {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
}

.agenda-btn {
  background: var(--primary);
  color: #ffffff !important;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.agenda-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.agenda-btn svg {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.agenda-btn:hover svg {
  transform: translateX(2px);
}

.agenda-card.card-civico .agenda-btn {
  background: var(--civic-primary);
}

.agenda-card.card-civico .agenda-btn:hover {
  background: var(--civic-hover);
}

/* FOOTER COMPACT */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 30px 0;
  margin-top: 60px;
}

.footer-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-compact-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand {
  font-weight: 800;
  color: #0f172a;
}

.footer-tagline {
  font-size: 0.85rem;
  color: #64748b;
}

.footer-compact-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #64748b;
}

.footer-link {
  color: #475569;
  font-weight: 600;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--primary-dark);
}

.footer-sep {
  color: #cbd5e1;
}

/* RESPONSIVE SMARTPHONE & DESKTOP */
@media (max-width: 520px) {
  .filter-controls-grid {
    flex-direction: column !important;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .agenda-main {
    padding: 24px 16px 60px;
  }

  .agenda-filter-card {
    padding: 14px 14px;
    margin-bottom: 22px;
  }

  .agenda-hero-title {
    font-size: 1.85rem;
  }

  .agenda-hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }

  .agenda-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .agenda-card {
    padding: 18px 16px;
  }

  .footer-compact {
    flex-direction: column;
    align-items: flex-start;
  }
}
