:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #4b5563;
  --brand: #123b7a;
  --brand-2: #2459a8;
  --accent: #e0b100;
  --border: #e5e7eb;
  --shadow: 0 12px 28px rgba(18, 59, 122, 0.12);
  --section-strip-bg: linear-gradient(180deg, #f1f5ff, #e7eefc);
  --hero-image-mobile: url("images/fuin_logo_smartphone.webp");
  --hero-image-desktop: url("images/tutti3_1920x1080_web_light.webp");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

.hero {
  position: relative;
  min-height: 88vh;
  background:
    linear-gradient(120deg, rgba(10, 25, 54, 0.48), rgba(10, 25, 54, 0.3)),
    var(--hero-image-mobile) center/cover no-repeat;
  color: #fff;
  display: grid;
  align-items: end;
}

@media (min-width: 901px) {
  .hero {
    background:
      linear-gradient(120deg, rgba(10, 25, 54, 0.48), rgba(10, 25, 54, 0.3)),
      var(--hero-image-desktop) center/cover no-repeat;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(224, 177, 0, 0.25), transparent 40%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 2rem 0 3rem;
  width: 100%;
}

.hero-text {
  width: min(700px, 100%);
  margin-inline: auto;
}

.hero-events {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.hero-events[hidden] {
  display: none !important;
}

.hero-event {
  margin: 0;
  padding: 1rem 1.1rem;
  background: rgba(15, 35, 71, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.75rem;
}

.hero-event time {
  display: block;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.hero-event-place {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5ff;
  line-height: 1.35;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #d8e6ff;
  margin-bottom: 0.4rem;
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.2;
}

h1 {
  font-family: Merriweather, Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.8rem);
  margin-bottom: 1rem;
}

.cta {
  display: inline-block;
  margin-top: 1.6rem;
  background: var(--accent);
  color: #111827;
  font-weight: 800;
  text-decoration: none;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.party-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--brand);
  font-weight: 800;
  border-radius: 999px;
  padding: 0.5rem 1rem;
}

.party-logo {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 999px;
}

.section-heading {
  padding: 4rem 0 1.5rem;
}

.section-heading h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.section-heading p {
  color: var(--muted);
  max-width: none; /*70ch;*/
  text-align: justify;
  text-justify: auto;
}

.mayor-history {
  padding: 1rem 0 2.5rem;
}

.mayor-history .section-heading {
  padding-bottom: 1rem;
}
.mayor-history h3 {
  font-size: 1.25rem;
  color: var(--brand);
  margin-bottom: 0.35rem;
}

.mayor-history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
  display: grid;
  justify-items: center;
}

.mayor-history-card p {
  margin: 0 0 0.9rem;
  color: #374151;
  text-align: justify;
  text-justify: auto;
}

.mayor-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
}

.candidates {
  display: grid;
  gap: 1.4rem;
  padding-bottom: 4.5rem;
}

.candidate {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem 1.4rem;
  align-items: center;
}

.candidate.reverse {
  grid-template-columns: 1fr 280px;
}

.candidate img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: center top; /*aggiunto per non tagliare la testa*/
  border-radius: 12px;
}

.candidate.reverse img {
  order: 2;
}

.candidate h3 {
  font-size: 1.25rem;
  color: var(--brand);
  margin-bottom: 0.35rem;
}

.candidate p {
  margin: 0;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.program {
  background: var(--section-strip-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4rem;
}

.program-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.program-card {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--brand);
  border-radius: 14px;
  padding: 1rem 1.2rem;
}

.program-card:nth-child(1) { border-top-color: #1d4ed8; }
.program-card:nth-child(2) { border-top-color: #0f766e; }
.program-card:nth-child(3) { border-top-color: #7c3aed; }
.program-card:nth-child(4) { border-top-color: #b45309; }
.program-card:nth-child(5) { border-top-color: #be123c; }
.program-card:nth-child(6) { border-top-color: #047857; }
.program-card:nth-child(7) { border-top-color: #334155; }
/*
.program-card:last-child {
  grid-column: 1 / -1;
}*/

.program-card h3 {
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.program-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: #374151;
}

.events-section {
  padding: 3rem 0 4.5rem;
  background: var(--section-strip-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.events-section .section-heading {
  padding-top: 0;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
}

.event-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--brand-2);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
}

.event-card:nth-child(1) { border-top-color: #1d4ed8; }
.event-card:nth-child(2) { border-top-color: #0f766e; }
.event-card:nth-child(3) { border-top-color: #7c3aed; }
.event-card:nth-child(4) { border-top-color: #b45309; }
.event-card:nth-child(5) { border-top-color: #be123c; }

.event-card time {
  display: block;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 0.45rem;
}

.event-place {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
}

.footer {
  background: #0f2347;
  color: #dbe7ff;
  text-align: center;
  padding: 1.2rem 0;
}

.footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.footer-link {
  color: #dbe7ff;
  text-decoration: none;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(219, 231, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.footer-icon-link:hover,
.footer-icon-link:focus-visible {
  background: rgba(224, 177, 0, 0.14);
}

.footer-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.footer-email {
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero-text {
    text-align: center;
    margin-inline: auto;
  }

  .hero-events {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 2rem;
  }

  .candidate,
  .candidate.reverse {
    grid-template-columns: 1fr;
  }

  .candidate.reverse img {
    order: 0;
  }

  .program-grid {
    grid-template-columns: 1fr;
  }

  .program-card:last-child {
    grid-column: auto;
  }

  .events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .hero-events {
    grid-template-columns: 1fr;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }
}
