/* ============================================================
   ASSOCIATIONS LEGO – Charte graphique Deparkatre
   Palette : --navy #16334c | --warm #faf7f1
             --ink #193044  | --muted #62717b
             --accent #f17b32 | --line #e3e8e3
   ============================================================ */

/* ---- HERO -------------------------------------------------- */
.asso-hero {
  padding: 30px 0 10px;
}
.asso-hero-copy {
  max-width: 820px;
}
.asso-hero-copy .eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
}
.asso-hero-copy h1 {
  color: var(--navy);
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -.03em;
  margin: 0 0 12px;
  line-height: 1.15;
}
.asso-hero-lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 20px;
}
.asso-hero-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.asso-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  transition: all .15s ease;
}
.asso-pill:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  transform: translateY(-1px);
}
.asso-pill.is-national { border-color: #bcd0e2; background: #eef4f9; color: var(--navy); }
.asso-pill.is-regional { border-color: #ffd8c0; background: #fff5ee; color: #b84f10; }
.asso-pill.is-local { border-color: #d8dedb; background: #f3f5f4; color: var(--ink); }
.asso-pill.is-foreign { border-color: #d1d5db; background: #f8fafc; color: #374151; }
.asso-pill.is-map { background: var(--green, #176b4d); color: #fff; border-color: var(--green, #176b4d); }
.asso-pill.is-map:hover { background: var(--green-dark, #10523b); }

/* ---- SECTIONS PAR PORTÉE ----------------------------------- */
.asso-section {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.asso-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.asso-section-badge-wrap {
  margin-bottom: 6px;
}
.asso-section-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.asso-section-badge.is-national {
  background: var(--navy);
  color: #fff;
}
.asso-section-badge.is-regional {
  background: #1b6f8a;
  color: #fff;
}
.asso-section-badge.is-local {
  background: var(--accent);
  color: #fff;
}
.asso-section-badge.is-foreign {
  background: #475569;
  color: #fff;
}
.asso-section-title {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--navy);
  letter-spacing: -.02em;
}
.asso-section-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.asso-section-count {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

/* Grille des cartes */
.asso-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

/* ---- CARTES D'ASSOCIATION ---------------------------------- */
.asso-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(22, 51, 76, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.asso-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(22, 51, 76, .10);
  border-color: #cbd5e1;
}

/* Variantes visuelles selon portée */
.asso-card.is-national {
  border-top: 3px solid var(--navy);
}
.asso-card.is-regional {
  border-top: 3px solid #1b6f8a;
}
.asso-card.is-local {
  border-top: 3px solid var(--accent);
}
.asso-card.is-foreign {
  border-top: 3px solid #64748b;
}

.asso-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px 12px;
}
.asso-card-visual {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.asso-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.asso-logo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: var(--navy);
  font-weight: 850;
  font-size: 18px;
  letter-spacing: .02em;
}

.asso-card-titles {
  flex: 1;
  min-width: 0;
}
.asso-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.asso-badge-portee {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.asso-badge-portee.is-national {
  background: #eef3f7;
  color: var(--navy);
  border: 1px solid #d0dee8;
}
.asso-badge-portee.is-regional {
  background: #e8f4f8;
  color: #1b6f8a;
  border: 1px solid #c8e4ed;
}
.asso-badge-portee.is-local {
  background: #fff5ee;
  color: #b84f10;
  border: 1px solid #ffd8c0;
}
.asso-badge-lego {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 750;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.asso-badge-lego svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.asso-card-name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: break-word;
}
.asso-card-zone {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.asso-card-pays {
  font-weight: 600;
}

.asso-card-body {
  flex: 1;
  padding: 0 18px 12px;
}
.asso-card-type {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.asso-card-type strong {
  color: var(--ink);
}
.asso-meta-label {
  color: var(--muted);
}
.asso-card-spec {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.asso-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 14px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}
.asso-card-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.asso-card-profile svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}
.asso-card-profile:hover {
  color: var(--green-dark, #10523b);
  text-decoration: underline;
}
.asso-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 750;
  color: var(--green, #176b4d);
  transition: color .15s ease;
}
.asso-card-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}
.asso-card-link:hover {
  color: var(--green-dark, #10523b);
  text-decoration: underline;
}

/* ---- CARTE MAPLIBRE ASSOCIATIONS --------------------------- */
.asso-map-section {
  margin-top: 50px;
  padding: 26px 0;
  border-top: 2px solid var(--line);
}
.asso-map-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.asso-map-headings {
  max-width: 600px;
}
.asso-map-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.asso-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.asso-map-filters {
  display: inline-flex;
  background: var(--soft);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.asso-filter-btn {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
}
.asso-filter-btn:hover {
  color: var(--ink);
}
.asso-filter-btn.is-active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.asso-filter-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--ink);
}
.asso-filter-btn.is-active .asso-filter-badge {
  background: var(--navy);
  color: #fff;
}

.asso-map-actions {
  display: flex;
  gap: 8px;
}
.asso-action-btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
}
.asso-action-btn:hover {
  background: var(--soft);
}

.asso-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: stretch;
  height: 600px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(22, 51, 76, .06);
}
.asso-map-main {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.asso-map-canvas {
  flex: 1;
  width: 100%;
  height: 100%;
}

.asso-map-footer-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
  z-index: 1;
}
.asso-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.asso-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .2);
}
.asso-legend-dot.is-national { background: var(--navy); }
.asso-legend-dot.is-regional { background: var(--accent); }
.asso-legend-dot.is-local { background: #62717b; }
.asso-legend-tip {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

/* Sidebar carte */
.asso-map-sidebar {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--line);
  height: 100%;
  overflow: hidden;
}
.asso-map-sidebar-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.asso-sidebar-title {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 750;
  color: var(--navy);
}
.asso-sidebar-hint {
  font-size: 11px;
  color: var(--muted);
}
.asso-map-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.asso-map-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.asso-side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all .15s ease;
  font-family: inherit;
}
.asso-side-item:hover {
  background: #f8fafc;
  border-color: var(--line);
}
.asso-side-item.is-active {
  background: #eef4f9;
  border-color: #cbd5e1;
  box-shadow: inset 3px 0 0 var(--navy);
}
.asso-side-badge-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.asso-side-badge-dot.is-national { background: var(--navy); }
.asso-side-badge-dot.is-regional { background: var(--accent); }
.asso-side-badge-dot.is-local { background: #62717b; }

.asso-side-info {
  flex: 1;
  min-width: 0;
}
.asso-side-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asso-side-zone {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

/* Marqueurs MapLibre ronds avec initiales */
.asso-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 850;
  color: #fff;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
  cursor: pointer;
  transition: transform .15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .15s ease;
  user-select: none;
}
.asso-marker:hover {
  transform: scale(1.22);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .36);
  z-index: 10;
}
.asso-marker.is-national {
  background: var(--navy);
}
.asso-marker.is-regional {
  background: var(--accent);
}
.asso-marker.is-local {
  background: #62717b;
}

/* Popup MapLibre */
.maplibregl-popup-content {
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(22, 51, 76, .18);
  font-family: inherit;
}
.asso-popup-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 250px;
}
.asso-popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.asso-popup-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.asso-popup-badge.is-national { background: #eef3f7; color: var(--navy); }
.asso-popup-badge.is-regional { background: #fff5ee; color: #b84f10; }
.asso-popup-badge.is-local { background: #f3f5f4; color: var(--ink); }
.asso-popup-title {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  color: var(--navy);
  line-height: 1.25;
}
.asso-popup-zone {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.asso-popup-spec {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #374151;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.asso-popup-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 750;
  color: var(--green, #176b4d);
}
.asso-popup-profile {
  display: block;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.asso-popup-profile:hover {
  text-decoration: underline;
}

/* ---- PROFIL D'ASSOCIATION --------------------------------- */
.asso-profile-dialog {
  width: min(580px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  margin: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  box-shadow: 0 20px 70px rgba(15, 23, 42, .3);
}
.asso-profile-dialog::backdrop {
  background: rgba(15, 23, 42, .65);
}
.asso-profile-dialog-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 34px;
}
.asso-profile-visual {
  display: flex;
  flex: 0 0 76px;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.asso-profile-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.asso-profile-visual span {
  color: var(--navy);
  font-size: 20px;
  font-weight: 850;
}
.asso-profile-heading {
  min-width: 0;
}
.asso-profile-heading h2 {
  margin: 3px 0;
  color: var(--navy);
  font-size: 22px;
  line-height: 1.2;
}
.asso-profile-type {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
}
.asso-profile-location {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.asso-profile-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--navy);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.asso-profile-dialog-body {
  margin-top: 22px;
}
.asso-profile-dialog-body h3 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 15px;
}
.asso-profile-dialog-body > p {
  margin: 0;
  color: #374151;
  line-height: 1.6;
}
.asso-profile-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}
.asso-profile-details div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}
.asso-profile-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.asso-profile-details dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 13px;
}
.asso-profile-visit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}
.asso-profile-visit svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.asso-profile-dialog [hidden] {
  display: none;
}

/* ---- PROPOSER CTA ------------------------------------------ */
.asso-propose-cta {
  margin: 60px 0 20px;
  background: var(--warm);
  border: 1px solid #ebd9c8;
  border-radius: 14px;
  padding: 28px 32px;
}
.asso-propose-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.asso-propose-icon {
  font-size: 32px;
}
.asso-propose-text {
  flex: 1;
  min-width: 240px;
}
.asso-propose-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 750;
  color: var(--navy);
}
.asso-propose-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.asso-propose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  font-size: 14px;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.asso-propose-btn:hover {
  background: #df6922;
  transform: translateY(-1px);
}

/* ---- FORMULAIRE PROPOSER ----------------------------------- */
.asso-intro {
  padding: 20px 0 10px;
}
.asso-intro h1 {
  margin: 10px 0;
  color: var(--navy);
  font-size: 32px;
}
.asso-form {
  max-width: 680px;
  margin: 24px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.asso-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 650;
  font-size: 14px;
  color: var(--ink);
}
.asso-form input,
.asso-form select,
.asso-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}
.asso-form input:focus,
.asso-form select:focus,
.asso-form textarea:focus {
  outline: 2px solid var(--green, #176b4d);
  outline-offset: -1px;
}
.asso-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.asso-form small {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}
.asso-submit-btn {
  align-self: flex-start;
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 860px) {
  .asso-map-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .asso-map-canvas {
    height: 420px;
  }
  .asso-map-sidebar {
    height: 300px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .asso-form-row {
    grid-template-columns: 1fr;
  }
}
