:root {
  --red: #dc2626;
  --red-dark: #b91c1c;
  --blue: #1a3a8a;
  --blue-dark: #102060;
  --white: #ffffff;
  --gray-light: #f3f4f6;
}

/* ── Navbar ───────────────────────────────────────── */
.bg-brand {
  background-color: var(--red) !important;
}

.navbar-logo {
  height: 52px;
  width: auto;
  border-radius: 50%;
  background: white;
  padding: 2px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

.navbar > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  min-width: 0;
  max-width: calc(100% - 76px);
}

.navbar-toggler {
  margin-left: auto;
  flex-shrink: 0;
}

.navbar-collapse {
  flex-basis: 100%;
  width: 100%;
}

@media (max-width: 991.98px) {
  .navbar-logo {
    height: 44px;
  }

  .navbar-logo-text {
    max-width: min(220px, calc(100vw - 130px)) !important;
  }
}

@media (min-width: 992px) {
  .navbar-brand {
    max-width: none;
  }

  .navbar-collapse {
    flex-basis: auto;
    width: auto;
  }
}

.footer-logo {
  height: 64px;
  width: auto;
  border-radius: 50%;
  background: white;
  padding: 4px;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.navbar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* ── Hero ─────────────────────────────────────────── */
.hero {
  min-height: 90vh;
  background-image: url('/static/images/hero.webp');
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.75) 0%, rgba(26, 58, 138, 0.85) 100%);
}

/* ── Page header ──────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--red) 0%, var(--blue) 100%);
}

/* ── Section titles ───────────────────────────────── */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background-color: var(--red);
  border-radius: 2px;
}

/* ── Cards ────────────────────────────────────────── */
.card-hover {
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.card-img-placeholder {
  border-radius: calc(0.375rem - 1px) calc(0.375rem - 1px) 0 0;
}

.contact-social-panel {
  background: #f8fafc !important;
}

.contact-social-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 58px;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  color: #111827;
  background: #fff;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.contact-social-link:hover,
.contact-social-link:focus {
  color: #111827;
  border-color: rgba(220, 38, 38, 0.28);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.09);
  transform: translateY(-1px);
}

.contact-social-link i {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
}

.contact-social-link strong,
.contact-social-link small {
  display: block;
  line-height: 1.2;
}

.contact-social-link small {
  color: #6b7280;
  margin-top: 0.15rem;
}

.contact-social-link--instagram i {
  background: #d62976;
}

.contact-social-link--facebook i {
  background: #1877f2;
}

.contact-social-link--youtube i {
  background: #ff0000;
}

.card-media {
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-media-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* ── Event date badge ─────────────────────────────── */
.event-date-badge {
  background-color: var(--red);
  color: var(--white);
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 52px;
  flex-shrink: 0;
}

.event-date-badge .day {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.event-date-badge .month {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Call to action ───────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, var(--red) 0%, var(--blue) 100%);
}

.text-white-75 {
  color: rgba(255, 255, 255, 0.75) !important;
}

/* ── Footer ───────────────────────────────────────── */
.footer-brand {
  background-color: var(--blue-dark);
}

.footer-link {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.875rem;
  display: block;
  padding: 2px 0;
  transition: color 0.2s;
}

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

/* ── Sponsor ──────────────────────────────────────── */
.footer-donation-banner {
  max-width: 100%;
}

.footer-donation-banner-image {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

.footer-donation-banner-fallback {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.4);
}

.sponsor-card {
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 100px;
}

.sponsor-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
}

.sponsor-logo {
  max-height: 80px;
  object-fit: contain;
  filter: grayscale(30%);
  transition: filter 0.2s;
}

.sponsor-card:hover .sponsor-logo {
  filter: grayscale(0%);
}

/* ── Calendario ───────────────────────────────────── */
.calendar-note {
  font-size: 0.95rem;
  color: #334155;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.calendar-shell {
  overflow-x: auto;
}

.calendar-month-label {
  font-size: 1.05rem;
}

.calendar-grid-head,
.calendar-grid-body {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  min-width: 910px;
}

.calendar-head-cell {
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  padding: 0.65rem 0.5rem;
  font-weight: 700;
  text-align: center;
  font-size: 0.85rem;
  color: #334155;
}

.calendar-head-cell:nth-child(7) {
  border-right: 0;
}

.calendar-day-cell {
  min-height: 120px;
  padding: 0.5rem;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.calendar-day-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.calendar-day-number {
  font-weight: 700;
  color: #0f172a;
}

.calendar-day-cell.is-outside {
  background: #f8fafc;
}

.calendar-day-cell.is-outside .calendar-day-number {
  color: #94a3b8;
}

.calendar-day-slots {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.8rem;
  color: #475569;
}

.calendar-slot {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.calendar-slot-time {
  font-weight: 600;
  color: #334155;
}

.calendar-slot-rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.calendar-room-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
}

.calendar-room-palestra {
  background: #dc2626;
}

.calendar-room-saletta {
  background: #2563eb;
}

.calendar-room-salone {
  background: #15803d;
}

.calendar-room-campo-basket {
  background: #ea580c;
}

.calendar-room-parco {
  background: #0f766e;
}

.calendar-room-other {
  background: #64748b;
}

@media (max-width: 767.98px) {
  .calendar-toolbar {
    gap: 0.5rem;
    flex-wrap: wrap;
  }
}

/* ── Document content ────────────────────────────────── */
.document-content {
  font-size: 1rem;
  color: #1e293b;
}

.document-content h2,
.document-content h3,
.document-content h4 {
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #0f172a;
}

.document-content h2 { font-size: 1.4rem; }
.document-content h3 { font-size: 1.2rem; }
.document-content h4 { font-size: 1.05rem; }

.document-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.document-content ul,
.document-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.document-content li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.document-content strong {
  color: #0f172a;
  font-weight: 600;
}

.document-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.document-content table th,
.document-content table td {
  border: 1px solid #e2e8f0;
  padding: 0.6rem 0.9rem;
  text-align: left;
}

.document-content table th {
  background: #f1f5f9;
  font-weight: 600;
}

.document-content hr {
  border-color: #e2e8f0;
  margin: 2rem 0;
}

.document-content blockquote {
  border-left: 4px solid var(--red);
  padding-left: 1rem;
  color: #475569;
  font-style: italic;
  margin: 1.5rem 0;
}

/* ── Page header varianti con immagine ───────────────── */
.page-header--chisiamo {
  background-image: linear-gradient(135deg, rgba(220,38,38,0.85) 0%, rgba(26,58,138,0.95) 100%);
}

.navbar-logo--shield {
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  object-fit: contain;
}

.navbar-logo-text {
  height: 52px !important;
  width: auto !important;
  max-width: 220px !important;
  object-fit: contain !important;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}
