/* ==========================================================================
   Clubs page — reuses ligues top half; gallery bottom
   ========================================================================== */

/*
 * Bare dark theme (entry): chips + map regions dark by default.
 * Green only on .is-selected — Bureau org-chart style.
 * Scoped to body.clubs-page so Ligues keeps status colours.
 */
body.clubs-page .region-list-btn {
  background: rgba(14, 14, 14, 0.95) !important;
  color: #f0f0f0 !important;
  border: 1.5px solid #1a7a4c !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}
body.clubs-page .region-list-btn:hover {
  border-color: #e8c872 !important;
  color: #fff !important;
  background: rgba(22, 22, 22, 0.98) !important;
  box-shadow: 0 0 0 1px rgba(232, 200, 114, 0.22), 0 0 14px rgba(232, 200, 114, 0.16) !important;
  filter: none !important;
}
body.clubs-page .region-list-btn.is-selected {
  background: #1a7a4c !important;
  color: #fff !important;
  border-color: #e8c872 !important;
  box-shadow:
    0 0 0 2px rgba(232, 200, 114, 0.55),
    0 0 16px rgba(26, 122, 76, 0.45) !important;
  transform: none !important;
  filter: none !important;
}

/* Map: bare dark; green only when selected */
body.clubs-page .cmr-map .region {
  fill: #1c1c1c !important;
  fill-opacity: 0.95 !important;
  stroke: rgba(232, 200, 114, 0.28) !important;
  stroke-width: 1 !important;
  filter: none !important;
  animation: none !important;
}
body.clubs-page .cmr-map .region:hover {
  fill: #2a2a2a !important;
  fill-opacity: 1 !important;
  stroke: rgba(232, 200, 114, 0.55) !important;
  filter: drop-shadow(0 0 8px rgba(232, 200, 114, 0.25)) !important;
}
body.clubs-page .cmr-map .region.is-selected {
  fill: #1a7a4c !important;
  fill-opacity: 1 !important;
  stroke: #e8c872 !important;
  stroke-width: 1.25 !important;
  animation: clubs-region-pulse 1.8s ease-in-out infinite !important;
}
@keyframes clubs-region-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(26, 122, 76, 0.55)) brightness(1.05); }
  50% { filter: drop-shadow(0 0 16px rgba(232, 200, 114, 0.45)) brightness(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  body.clubs-page .cmr-map .region.is-selected {
    animation: none !important;
    filter: drop-shadow(0 0 10px rgba(26, 122, 76, 0.5)) !important;
  }
}

/* Taller map+panel for club slides — keep compact so profile fits without scroll */
@media (min-width: 900px) {
  body.clubs-page .ligues-map-layout {
    min-height: min(70vh, 560px);
    height: min(70vh, 560px);
    position: relative;
  }
}

/* map-body is positioning context for k_affiliated */
body.clubs-page .map-body {
  position: relative;
}

/*
 * k_affiliated — tiny green chip lined up with the selected region chip.
 * Top/left set by clubs.js from the selected .region-list-btn rect.
 */
body.clubs-page .k-affiliated {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 6.8rem;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1.5px solid #e8c872;
  background: #1a7a4c;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: normal;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(232, 200, 114, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: top 0.18s ease;
}
body.clubs-page .k-affiliated[hidden] {
  display: none !important;
}
@media (max-width: 560px) {
  body.clubs-page .k-affiliated {
    position: static;
    max-width: none;
    margin: 0.15rem 0 0.35rem;
    pointer-events: auto;
  }
}

/* ---------- Club panel carousel (standard: club ‹ › + content slides) ---------- */
/* Override ligues .league-panel overflow so k/N corner badge is never clipped */
body.clubs-page #clubs-panel.league-panel,
body.clubs-page #clubs-panel.is-open {
  overflow: visible;
}
#clubs-panel.is-open {
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0;
  position: relative;
}
.club-panel-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  background: inherit;
}
.club-panel-empty-region {
  padding: 1.25rem 1.1rem;
  width: 100%;
  box-sizing: border-box;
}
.club-panel-count {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--gold, #e8c872);
  white-space: nowrap;
}
/* k/N — top-right corner of club frame (fully visible) */
.club-counter {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.club-counter--float {
  position: absolute;
  top: 0.4rem;
  right: 0.45rem;
  z-index: 8;
  transform: none;
  padding: 0.28rem 0.55rem;
  min-width: 2.4rem;
  text-align: center;
  background: #0e0e0e;
  border: 1.5px solid rgba(232, 200, 114, 0.65);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  line-height: 1;
  pointer-events: none;
}
/* Club header: ‹ CLUB NAME › + logo — leave room for k/N */
.club-nav {
  display: grid;
  grid-template-columns: 2.4rem 1fr 2.4rem;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 2.85rem 0.25rem 0.4rem;
  flex-shrink: 0;
}
.club-identity {
  text-align: center;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
}
.club-name {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.12;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.club-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  flex-shrink: 0;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(232, 200, 114, 0.35);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.club-logo-wrap[hidden] {
  display: none !important;
}
.club-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 0.15rem;
  box-sizing: border-box;
}
.club-president {
  margin: 0;
  font-size: clamp(0.92rem, 1.6vw, 1.08rem);
  font-weight: 750;
  color: var(--gold, #e8c872);
  line-height: 1.25;
}
.club-title-role {
  margin: 0.08rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.25;
}
.club-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--gold, #e8c872);
  line-height: 1.3;
}
.club-nav-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.65rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease,
    border-color 0.12s ease, color 0.12s ease;
}
.club-nav-chev:hover:not(:disabled):not(.is-disabled) {
  transform: scale(1.1);
}
.club-nav-chev.is-spacer {
  visibility: hidden;
  pointer-events: none;
}
.club-nav-chev.is-disabled,
.club-nav-chev:disabled {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}
/* Top club-switch chevrons */
.club-nav-chev--club {
  font-size: 1.85rem;
  color: rgba(255, 255, 255, 0.92);
}
/* Slide chevrons — more visible (mock) */
.club-nav-chev--slide,
.club-nav-chev-sm.club-nav-chev--slide {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 200, 114, 0.55);
  background: rgba(26, 122, 76, 0.22);
  color: var(--gold, #e8c872);
  font-size: 1.35rem;
  font-weight: 500;
  box-shadow: 0 0 10px rgba(232, 200, 114, 0.18);
}
.club-nav-chev--slide:hover:not(:disabled) {
  background: rgba(26, 122, 76, 0.4);
  border-color: var(--gold, #e8c872);
  color: #fff;
}
.club-nav-chev-sm {
  width: 2rem;
  height: 2rem;
  font-size: 1.4rem;
}
.club-slide-nav {
  display: grid;
  grid-template-columns: 2.2rem 1fr 2.2rem;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.club-slide-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
}
.club-slide-dots .hist-dot,
.club-slide-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(232, 200, 114, 0.32);
  cursor: pointer;
  flex-shrink: 0;
}
.club-slide-dots .hist-dot.is-active,
.club-slide-dot.is-active {
  background: var(--gold, #e8c872);
  transform: scale(1.22);
  box-shadow: 0 0 10px rgba(232, 200, 114, 0.55);
}
.club-slide-viewport {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(26, 122, 76, 0.07), transparent 55%),
    #0a0a0a;
  display: flex;
  flex-direction: column;
}
.club-slide-viewport > * {
  flex: 1;
  min-height: 0;
  overflow: hidden; /* fit content — no forced scroll on profile */
}
.club-slide-viewport > .club-slide:not(.is-profile) {
  overflow-y: auto;
  scrollbar-width: thin;
}
.club-slide-empty {
  padding: 1.5rem;
  text-align: center;
  color: #8a8a8a;
}

/* Profile slide — auto-fit photo + bio, no push-down scroll */
.club-profile {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 0.55rem 0.75rem;
  align-items: center;
  padding: 0.55rem 0.75rem 0.65rem;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  box-sizing: border-box;
}
.club-profile-photo {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #080808;
  border: 1px solid rgba(232, 200, 114, 0.2);
  min-height: 0;
  max-height: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.club-profile-photo img {
  width: 100%;
  height: 100%;
  max-height: min(28vh, 220px);
  min-height: 0;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.club-profile-photo-ph {
  min-height: 120px;
  width: 100%;
  height: 100%;
  max-height: min(28vh, 220px);
  background: #121212;
}
.club-profile-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.club-profile-meta .club-president {
  margin: 0;
}
.club-profile-meta .club-title-role {
  margin: 0;
}
.club-profile-bio {
  margin: 0.2rem 0 0;
  font-size: clamp(0.72rem, 1.2vw, 0.84rem);
  color: #d0d0d0;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  line-clamp: 8;
}
.club-profile-bio p {
  margin: 0 0 0.35rem;
}
.club-profile-bio p:last-child {
  margin-bottom: 0;
}
@media (max-width: 720px) {
  .club-profile {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .club-profile-photo img,
  .club-profile-photo-ph {
    max-height: min(22vh, 180px);
  }
  .club-profile-bio {
    -webkit-line-clamp: 6;
    line-clamp: 6;
  }
}

/* Content slides */
.club-content-slide {
  padding: 0.75rem 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  box-sizing: border-box;
}
.club-content-media {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.club-content-media img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(232, 200, 114, 0.25);
}
.club-content-tag {
  margin: 0 0 0.3rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold, #e8c872);
  text-align: center;
}
.club-content-title {
  margin: 0 0 0.55rem;
  font-size: 0.98rem;
  font-weight: 800;
  color: #f0f0f0;
  text-align: center;
  line-height: 1.25;
}
.club-content-body {
  font-size: 0.82rem;
  color: #d0d0d0;
  line-height: 1.45;
}
.club-content-body p {
  margin: 0 0 0.5rem;
}
.club-section {
  margin: 0 0 0.75rem;
}
.club-section h4 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold, #e8c872);
}
.club-section p {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  color: #d0d0d0;
  line-height: 1.4;
}
.club-panel-cta-row {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.club-panel-cta-row .league-panel-cta {
  width: 100%;
}

/* ---------- Teams slide — standard roster tables (all clubs) ---------- */
.club-teams-slide {
  align-items: stretch;
}
.club-team-captain {
  margin: 0 0 0.65rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--gold, #e8c872);
}
.club-teams-tables {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}
.club-team-block {
  min-width: 0;
}
.club-team-section {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold, #e8c872);
}
.club-team-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 8, 8, 0.55);
  scrollbar-width: thin;
}
.club-team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
  line-height: 1.35;
  min-width: 320px;
}
.club-team-table th,
.club-team-table td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  vertical-align: top;
}
.club-team-table th {
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold, #e8c872);
  background: rgba(26, 122, 76, 0.18);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.club-team-table td {
  color: #e0e0e0;
}
.club-team-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.club-team-table tbody tr:last-child td {
  border-bottom: none;
}
/* Name column emphasis */
.club-team-table td:first-child {
  font-weight: 650;
  color: #f4f4f4;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .club-profile {
    grid-template-columns: 1fr;
  }
  .club-profile-photo img {
    max-height: 180px;
  }
  .club-team-table {
    font-size: 0.68rem;
    min-width: 280px;
  }
  .club-team-table th,
  .club-team-table td {
    padding: 0.32rem 0.4rem;
  }
}

/* Gallery */
.clubs-gallery-section {
  padding: 1.75rem 0 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #050505;
}
.clubs-gallery-section[hidden] {
  display: none !important;
}
.clubs-gallery-head {
  text-align: center;
  margin-bottom: 1.25rem;
}
.clubs-gallery-head h2 {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
  color: #f4f4f4;
}
.clubs-gallery-sub {
  font-size: 0.88rem;
  color: #8a8a8a;
  margin: 0;
}
.clubs-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.club-gallery-item {
  margin: 0;
  background: #0a0a0a;
  border: 1px solid var(--border-mid);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.club-gallery-item:hover {
  border-color: rgba(232, 200, 114, 0.4);
  transform: translateY(-2px);
}
.club-gallery-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #080808;
  overflow: hidden;
}
.club-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.club-gallery-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem;
  background:
    linear-gradient(160deg, rgba(26, 122, 76, 0.12), transparent 55%),
    #0a0a0a;
  text-align: center;
}
.club-gallery-ph[hidden] {
  display: none !important;
}
.club-gallery-ph img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  opacity: 0.85;
}
.club-gallery-ph span {
  font-size: 0.82rem;
  font-weight: 650;
  color: #c8c8c8;
  line-height: 1.3;
}
.club-gallery-item figcaption {
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: #f0f0f0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.3;
}
.clubs-gallery-empty {
  text-align: center;
  color: #7a7a7a;
  font-size: 0.92rem;
  padding: 2rem 1rem;
  margin: 0;
}
.clubs-gallery-empty[hidden] {
  display: none !important;
}

.club-dir-link {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
}
.club-dir-link a {
  color: #e8c872;
  text-decoration: none;
}
.club-dir-link a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .clubs-gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }
  .club-gallery-item figcaption {
    font-size: 0.78rem;
    padding: 0.5rem 0.55rem;
  }
}
