/* =========================================================================
   Chiesa di Pandino — Pagina Associazioni
   Regole specifiche di questa pagina. I token :root e le classi base
   (.container, .section, .grid, .pill, .btn, ecc.) sono in style.css.
   ========================================================================= */

/* ---- Page hero -------------------------------------------------------- */
.page-hero {
  background: linear-gradient(180deg, #eaf1f7 0%, var(--bg) 100%);
  border-bottom: 1px solid rgba(38, 48, 58, 0.06);
  padding-top: 54px;
  padding-bottom: 46px;
}
.page-hero .eyebrow { margin-bottom: 14px; letter-spacing: 0.16em; }
.page-hero__title {
  font-weight: 800;
  font-size: clamp(34px, 6vw, 50px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 16px;
}
.page-hero__lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  max-width: 640px;
}

/* ---- Griglia associazioni -------------------------------------------- */
.assoc-section { padding-top: 48px; padding-bottom: 64px; }
.assoc-grid { gap: 24px; }

.assoc-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(31, 41, 51, 0.04);
  display: flex;
  flex-direction: column;
}

/* Media placeholder a righe (pattern "[ foto / logo ]") */
.assoc-card__media {
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.assoc-card__media--photo {
  background-size: cover;
  background-position: center;
}
.assoc-card__media--ph {
  background:
    repeating-linear-gradient(45deg, rgba(31, 41, 51, 0.05) 0 10px, rgba(31, 41, 51, 0.08) 10px 20px),
    #cdd8e2;
}
.assoc-card__media--ph-accent {
  background:
    repeating-linear-gradient(45deg, rgba(181, 100, 31, 0.07) 0 10px, rgba(181, 100, 31, 0.12) 10px 20px),
    #ecd9c4;
}
.assoc-card__ph-label {
  font-family: monospace;
  font-size: 11px;
  color: var(--muted);
}

/* Badge categoria (in alto a sinistra sulla media) */
.assoc-card__cat {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
}
.assoc-card__cat.pill--blue { background: var(--primary-tint); color: var(--primary); }
.assoc-card__cat.pill--accent-solid { background: var(--accent-tint); color: var(--accent); }

/* Corpo card */
.assoc-card__body {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.assoc-card__name {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}
.assoc-card__short {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 20px;
}

/* ---- Pulsante "Più info" (apre il modal) ----------------------------- */
.assoc-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 14.5px;
  font-family: var(--font-body);
  cursor: pointer;
  width: fit-content;
  transition: background 0.15s ease, color 0.15s ease;
}
.assoc-more__chev { transition: transform 0.15s ease; }
.assoc-more:hover .assoc-more__chev { transform: translateX(3px); }
.assoc-more--blue { background: var(--primary-tint); color: var(--primary); }
.assoc-more--blue:hover { background: #e2ebf4; }
.assoc-more--accent { background: var(--accent-tint); color: var(--accent); }
.assoc-more--accent:hover { background: #efe1d2; }

/* ---- Contenuto di dettaglio (riusato dentro il modal) ---------------- */
.assoc-details__long {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 22px;
}
.assoc-details__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 14px;
}

/* Chips "Cosa facciamo" */
.assoc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.assoc-chips li {
  padding: 8px 14px;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}
.assoc-details--blue .assoc-chips li { background: var(--primary-tint); color: var(--primary); }
.assoc-details--accent .assoc-chips li { background: var(--accent-tint); color: var(--accent); }

/* Box referente / contatti */
.assoc-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px 22px;
  background: #f6f7f9;
  border-radius: 12px;
}
.assoc-meta__col { flex: 1; min-width: 180px; }
.assoc-meta__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 6px;
}
.assoc-meta__name {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin: 0;
}
.assoc-meta__role {
  font-size: 13.5px;
  color: var(--muted);
  margin: 2px 0 0;
}
.assoc-meta__contact {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}
.assoc-meta__contact a { text-decoration: none; color: inherit; }
.assoc-meta__contact a:hover { text-decoration: underline; }

/* CTA "Unisciti a noi" */
.assoc-actions { margin-top: 24px; }
.assoc-join {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
}
.assoc-join:hover { background: var(--primary-dark); }
.assoc-join--accent { background: var(--accent); }
.assoc-join--accent:hover { background: #9c521a; }

/* =========================================================================
   Modal "Più info" (<dialog>)
   ========================================================================= */
.assoc-modal {
  width: min(560px, calc(100vw - 32px));
  max-width: 560px;
  padding: 0;
  border: none;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: 0 30px 80px rgba(20, 30, 40, 0.35);
}
.assoc-modal::backdrop {
  background: rgba(20, 30, 40, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.assoc-modal[open] { animation: assoc-modal-in 0.22s ease both; }
.assoc-modal[open]::backdrop { animation: assoc-backdrop-in 0.22s ease both; }
@keyframes assoc-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes assoc-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.assoc-modal__panel {
  position: relative;
  padding: 34px 34px 30px;
  max-height: min(86vh, 760px);
  overflow-y: auto;
}

.assoc-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.assoc-modal__close:hover { background: #f1f3f5; color: var(--ink); }

.assoc-modal__head { margin: 0 44px 20px 0; }
.assoc-modal__cat {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 12px;
}
.assoc-modal__cat--blue { background: var(--primary-tint); color: var(--primary); }
.assoc-modal__cat--accent { background: var(--accent-tint); color: var(--accent); }
.assoc-modal__title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1023px) {
  /* .grid--3 diventa 2 colonne via style.css */
  .page-hero { padding-top: 44px; padding-bottom: 38px; }
}

@media (max-width: 620px) {
  /* .grid--3 diventa 1 colonna via style.css */
  .page-hero { padding-top: 36px; padding-bottom: 32px; }
  .page-hero__lead { font-size: 16px; }
  .assoc-section { padding-bottom: 44px; }
  .assoc-card__body { padding: 22px 20px; }
  .assoc-meta { flex-direction: column; gap: 16px; }
  .assoc-meta__col { min-width: 0; }
  .assoc-modal__panel { padding: 28px 22px 24px; }
  .assoc-modal__title { font-size: 24px; }
}

/* =========================================================================
   Carosello immagini nel modale "Più info"
   ========================================================================= */
.assoc-carousel {
  position: relative;
  margin: 0 0 22px;
  border-radius: 14px;
  overflow: hidden;
  background: #eef1f4;
}
.assoc-carousel__track {
  display: flex;
  transition: transform 0.35s ease;
}
.assoc-carousel__slide {
  flex: 0 0 100%;
  margin: 0;
  aspect-ratio: 16 / 9;
  background: #dde3e9;
}
.assoc-carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.assoc-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2933;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 28, 38, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.assoc-carousel__nav:hover { background: #fff; }
.assoc-carousel__nav--prev { left: 12px; }
.assoc-carousel__nav--next { right: 12px; }
.assoc-carousel__dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
}
.assoc-carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(20, 28, 38, 0.3);
}
.assoc-carousel__dot.is-active { background: #fff; transform: scale(1.25); }

@media (prefers-reduced-motion: reduce) {
  .assoc-carousel__track { transition: none; }
}
