/* Layout a due colonne per la sezione rione */

.rione-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 40px;
  align-items: stretch;
}
.rione-stemma {
  min-height: 420px;
  min-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
}
.rione-stemma img {
  width: 100%;
  height: 100%;
  min-width: 420px;
  min-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid #ccc;
  background: #fff;
  box-shadow: 0 8px 24px rgba(7,74,18,0.10);
}

@media (max-width: 900px) {
  .rione-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .rione-stemma {
    min-height: auto;
    min-width: auto;
    margin-top: 24px;
  }
  .rione-stemma img {
    max-width: 200px;
    max-height: 200px;
    min-width: auto;
    min-height: auto;
    margin: 0 auto;
  }
  .rione-form {
    max-width: 100%;
  }
}
:root {
  --black-forest: #074a12ff;
  --golden-glow: #ddd92aff;
  --banana-cream: #eae151ff;
  --vanilla-custard: #eeefa8ff;
  --porcelain: #fafdf6ff;
  --ink: #0d1f12;
  --shadow: rgba(7, 74, 18, 0.18);
}


html {
  scroll-behavior: smooth;
}

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

body {
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, var(--vanilla-custard), var(--porcelain) 45%),
    linear-gradient(120deg, rgba(7, 74, 18, 0.05), rgba(221, 217, 42, 0.1));
  line-height: 1.6;
}

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

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

.section {
  padding: 110px 8vw 90px;
  scroll-margin-top: 90px;
}

.section-header {
  max-width: 700px;
  margin-bottom: 40px;
}

.section-header h2 {
  font-family: "Cinzel", serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--black-forest);
  margin-bottom: 10px;
}

.section-header p {
  font-size: 1.05rem;
  color: #1a3a20;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 6vw;
  background: rgba(250, 253, 246, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(7, 74, 18, 0.08);
}

.brand {
  display: flex;
  flex-direction: column;
  font-family: "Cinzel", serif;
  color: var(--black-forest);
  letter-spacing: 1px;
}

.brand-mark {
  font-size: 1.4rem;
  font-weight: 700;
}

.brand-sub {
  font-size: 0.9rem;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 20px;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a {
  position: relative;
  padding-bottom: 4px;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--golden-glow);
  transition: width 0.3s ease;
}

.site-nav a:hover::after,
.site-nav a:focus::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--black-forest);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  align-items: center;
}

.eyebrow {
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #2d5f38;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: "Cinzel", serif;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  color: var(--black-forest);
  margin-bottom: 18px;
}

.lead {
  font-size: 1.1rem;
  margin-bottom: 28px;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--black-forest);
  color: var(--porcelain);
  box-shadow: 0 8px 16px var(--shadow);
}

.btn.ghost {
  background: transparent;
  border-color: var(--black-forest);
  color: var(--black-forest);
}

.btn:hover {
  transform: translateY(-2px);
}

.hero-media {
  background: linear-gradient(160deg, var(--black-forest), #12351f);
  padding: 28px;
  border-radius: 24px;
  color: var(--porcelain);
  box-shadow: 0 20px 40px var(--shadow);
}

.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.partner {
  background: transparent;
}

.partner-marquee {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.partner-marquee__track {
  display: flex;
  align-items: center;
  /* NIENTE gap qui */
  animation: partner-marquee 25s linear infinite;
  animation-direction: normal;
  animation-fill-mode: none;
  width: max-content;
}

.partner-marquee__group {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding-right: 3rem; /* stesso valore del gap */
}

.partner-marquee__item {
  flex: 0 0 auto;
}


.partner-logo {
  max-width: 280px;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: saturate(0.95);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.partner-logo:hover {
  transform: scale(1.05);
  filter: saturate(1.1);
}

.partner-marquee:hover .partner-marquee__track {
  animation-play-state: paused;
}

@keyframes partner-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.partner-slider {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.partner-slider .splide__track {
  overflow: hidden;
}

.partner-slider .splide__list {
  display: flex;
  align-items: center;
}

.partner-slider .splide__slide {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 320px;
  padding: 0 1rem;
}

.partner-logo {
  max-width: 320px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: saturate(0.95);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.partner-logo:hover {
  transform: scale(1.05);
  filter: saturate(1.1);
}

.partner-slider .splide__slide img {
  display: block;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .partner-slider .splide__slide {
    min-width: 280px;
  }
  .partner-logo {
    max-width: 260px;
    max-height: 180px;
  }
}

@media (max-width: 640px) {
  .partner-slider .splide__slide {
    min-width: 220px;
  }
  .partner-logo {
    max-width: 220px;
    max-height: 160px;
  }
}

@media (max-width: 900px) {
  .partner-slider .splide__slide {
    min-width: 210px;
  }
  .partner-logo {
    max-width: 220px;
    max-height: 150px;
  }
}

@media (max-width: 640px) {
  .partner-slider .splide__slide {
    min-width: 180px;
  }
  .partner-logo {
    max-width: 180px;
    max-height: 130px;
  }
}
@media (max-width: 900px) {
  .partner-slider {
    padding: 18px 0;
  }
}

@media (max-width: 640px) {
  .partner-logo {
    max-width: 130px;
    max-height: 100px;
  }
}

.carousel-track img {
  width: 100%;
  min-width: 100%;
  height: 280px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.35);
  border: none;
  color: var(--porcelain);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.carousel-btn.prev {
  left: 12px;
}

.carousel-btn.next {
  right: 12px;
}

.carousel-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.carousel-note {
  margin-top: 16px;
  font-size: 0.95rem;
  opacity: 0.8;
}

.rione-grid,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.rione-form {
  display: grid;
  gap: 16px;
  max-width: 520px;
  background: var(--porcelain);
  padding: 28px;
  border-radius: 20px;
  border: 1px solid rgba(7, 74, 18, 0.1);
  box-shadow: 0 12px 22px rgba(7, 74, 18, 0.08);
}

.rione-label {
  gap: 10px;
}

.rione-input-wrap {
  position: relative;
}

.rione-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(7, 74, 18, 0.18);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(7, 74, 18, 0.12);
  max-height: 220px;
  overflow-y: auto;
  display: none;
  z-index: 5;
}

.rione-suggestions.open {
  display: block;
}

.rione-suggestion {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.rione-suggestion span {
  font-size: 0.85rem;
  color: #4b5a49;
  white-space: nowrap;
}

.rione-suggestion:hover,
.rione-suggestion:focus {
  background: var(--vanilla-custard);
}

.rione-hint {
  font-size: 0.95rem;
  color: #4b5a49;
}

.rione-result {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(234, 225, 81, 0.25);
  color: var(--black-forest);
  font-weight: 600;
  display: flex;
  align-items: center;
}

.rione-card,
.calendar-card {
  background: var(--porcelain);
  border-radius: 18px;
  padding: 24px;
  border: 1px solid rgba(7, 74, 18, 0.1);
  box-shadow: 0 12px 22px rgba(7, 74, 18, 0.08);
}

.rione-card h3,
.calendar-card h3 {
  font-family: "Cinzel", serif;
  margin-bottom: 8px;
  color: var(--black-forest);
}

.iscrizione-form {
  display: grid;
  gap: 18px;
  max-width: 760px;
  background: var(--porcelain);
  padding: 30px;
  border-radius: 24px;
  border: 1px solid rgba(7, 74, 18, 0.1);
  box-shadow: 0 14px 24px rgba(7, 74, 18, 0.08);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: #1a3a20;
}

input,
select,
textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(7, 74, 18, 0.2);
  font: inherit;
  background: #fff;
}

.checkbox {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

/* === Dropdown attività di interesse === */
.attivita-dropdown-wrap {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: #1a3a20;
}

.attivita-dropdown-label {
  font-weight: 600;
  color: #1a3a20;
}

.attivita-dropdown {
  position: relative;
}

.attivita-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(7, 74, 18, 0.2);
  background: #fff;
  font: inherit;
  font-weight: 400;
  color: #1a3a20;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s;
}

.attivita-toggle:hover {
  border-color: rgba(7, 74, 18, 0.5);
}

.attivita-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
  color: #4b5a49;
}

.attivita-dropdown.open .attivita-chevron {
  transform: rotate(180deg);
}

.attivita-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(7, 74, 18, 0.2);
  border-radius: 12px;
  padding: 6px 0;
  z-index: 200;
  box-shadow: 0 8px 20px rgba(7, 74, 18, 0.12);
  max-height: 260px;
  overflow-y: auto;
}

.attivita-dropdown.open .attivita-panel {
  display: block;
}

.attivita-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-weight: 400;
  color: #1a3a20;
  cursor: pointer;
  transition: background 0.15s;
}

.attivita-option:hover {
  background: rgba(7, 74, 18, 0.06);
}

.attivita-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #074a12;
  cursor: pointer;
}

.classifica-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.classifica-meta {
  display: flex;
  gap: 8px;
  font-weight: 600;
}

.label {
  color: #4b5a49;
}

.site-footer {
  padding: 60px 8vw 40px;
  background: var(--black-forest);
  color: var(--porcelain);
  display: grid;
  gap: 20px;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 1.4rem;
}

.footer-social a {
  color: var(--golden-glow);
}

.footer-copy {
  font-size: 0.9rem;
  opacity: 0.8;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--porcelain);
  padding: 30px;
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  font-family: "Cinzel", serif;
  color: var(--black-forest);
  margin-bottom: 20px;
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 16px;
  border: none;
  background: none;
  font-size: 1.8rem;
  cursor: pointer;
}

.table-wrap {
  overflow-x: auto;
}

.classifica-note {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(7, 74, 18, 0.06);
  color: var(--black-forest);
}

#classificaTable {
  width: 100%;
  border-collapse: collapse;
}

#classificaTable th,
#classificaTable td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(7, 74, 18, 0.12);
}

#classificaTable thead {
  background: var(--vanilla-custard);
}

.classifica-breakdown {
  margin-top: 28px;
  display: grid;
  gap: 20px;
}

.classifica-category {
  border: 1px solid rgba(7, 74, 18, 0.12);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 250, 239, 0.65);
}

.classifica-category h3 {
  margin: 0 0 8px;
}

.classifica-category p {
  margin: 0;
}

.classifica-category-meta {
  margin-bottom: 14px;
  color: rgba(37, 36, 34, 0.8);
}

.classifica-category-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0 18px;
}

.classifica-chip {
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
  border: 1px solid rgba(7, 74, 18, 0.1);
}

.classifica-chip strong {
  display: block;
  margin-bottom: 4px;
}

.classifica-chip span {
  color: rgba(37, 36, 34, 0.8);
}

.classifica-category table {
  width: 100%;
  border-collapse: collapse;
}

.classifica-category th,
.classifica-category td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(7, 74, 18, 0.12);
}

.classifica-category th {
  background: rgba(7, 74, 18, 0.07);
}

.classifica-rione-label {
  font-weight: 700;
}

@media (max-width: 960px) {
  .site-nav {
    position: absolute;
    top: 70px;
    right: 6vw;
    background: var(--porcelain);
    flex-direction: column;
    padding: 18px;
    border-radius: 16px;
    box-shadow: 0 14px 24px rgba(7, 74, 18, 0.12);
    display: none;
    z-index: 20;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
  }
  .nav-toggle span {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 80px 5vw 60px;
  }

  .classifica-category {
    padding: 14px;
  }

  .classifica-chip {
    padding: 10px 12px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-content {
    text-align: center;
  }

  .eyebrow {
    font-size: 0.8rem;
  }

  .hero h1 {
    font-size: clamp(1.4rem, 5vw, 2rem) !important;
  }

  .lead {
    font-size: 0.95rem;
  }

  .cta-group {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .cta-group .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .hero-media {
    padding: 16px;
  }

  .carousel-track img {
    height: 200px;
  }

  #toggleTraduzione {
    align-self: center !important;
    font-size: 0.85rem;
    padding: 8px 18px;
  }

  .section-header h2 {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
  }

  .section-header p {
    font-size: 0.9rem;
  }

  /* Form iscrizione mobile */
  .iscrizione-form {
    padding: 20px;
    max-width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  input, select, textarea {
    padding: 14px 12px;
    font-size: 16px; /* Previene zoom su iOS */
  }

  .btn {
    padding: 14px 24px;
    font-size: 1rem;
    min-height: 48px; /* Touch-friendly */
  }

  /* Calendario filtri mobile */
  .calendar-filters {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .calendar-filters input,
  .calendar-filters select {
    width: 100%;
    font-size: 16px;
  }

  /* Calendario card mobile */
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-card {
    padding: 18px;
  }

  /* Classifica actions mobile */
  .classifica-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Footer mobile */
  .site-footer {
    padding: 40px 5vw 30px;
    gap: 16px;
  }

  .footer-info {
    text-align:center;
}

  .footer-info h2 {
    font-size: 1.4rem;
}

  .footer-info p {
    font-size: 0.95rem;
}

  .footer-info a {
    color: var(--golden-glow);
    text-decoration: underline;
}

  .footer-social {
    gap: 28px;
    font-size: 1.8rem;
  }

  .footer-social a {
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Modal mobile */
  .modal-content {
    padding: 20px 14px;
    border-radius: 14px;
  }

  .modal-close {
    right: 10px;
    top: 10px;
    font-size: 2rem;
    min-width: 44px;
    min-height: 44px;
  }

  #classificaTable th,
  #classificaTable td {
    padding: 8px 6px;
    font-size: 0.85rem;
  }

  /* Rione form mobile */
  .rione-form {
    padding: 20px;
    max-width: 100%;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .section {
    padding: 60px 4vw 40px;
  }

  .hero h1 {
    font-size: clamp(1.2rem, 5vw, 1.6rem) !important;
  }

  .section-header h2 {
    font-size: 1.2rem;
  }

  .brand-mark {
    font-size: 1.1rem;
  }

  .brand-sub {
    font-size: 0.75rem;
  }

  .site-header {
    padding: 12px 4vw;
  }

  .btn {
    padding: 12px 18px;
    font-size: 0.9rem;
  }

  .carousel-track img {
    height: 160px;
  }

  .hero-media {
    padding: 12px;
  }
}

body.rione-dromedaria {
  --black-forest: #2196f3;
  --golden-glow: #64b5f6;
  --banana-cream: #bbdefb;
  --vanilla-custard: #e3f2fd;
  --porcelain: #f5fbff;
}
body.rione-algeria {
  --black-forest: #ff9800;
  --golden-glow: #ffb74d;
  --banana-cream: #ffe0b2;
  --vanilla-custard: #fff3e0;
  --porcelain: #fff8ed;
}
body.rione-quartier-cinese {
  --black-forest: #ffd600;
  --golden-glow: #fff176;
  --banana-cream: #fff9c4;
  --vanilla-custard: #fffde7;
  --porcelain: #fffef5;
}