/**
 * SPG — Athlete Profile Stylesheet
 * Loads only on single-athletes (enqueued dependent on spg-design-tokens.css).
 *
 * Uses the global "Court Green" tokens defined in spg-design-tokens.css:
 *   --spg-bg, --spg-surface, --spg-surface-alt, --spg-border,
 *   --spg-text, --spg-text-secondary, --spg-text-muted,
 *   --spg-cta, --spg-cta-hover, --spg-cta-text
 *
 * CTA color update (this session): --spg-cta moved away from amber to a
 * sober near-white, per design feedback ("amber CTAs looked bad"). Update
 * the values in spg-design-tokens.css so the whole site stays in sync:
 *   --spg-cta: #eef0f3        (was amber #f59e0b)
 *   --spg-cta-hover: #ffffff  (was #ffb02e)
 *   --spg-cta-text: #1a1d22   (was #3d2400)
 * New token needed for the segmented Shop US / Shop EU divider:
 *   --spg-cta-divider: #b9bec6
 *
 * Two additional tokens (added for this template, not yet in
 * spg-design-tokens.css — add them there so they're available site-wide).
 * The page background stays flat (--spg-bg) everywhere on this template —
 * no separate "panel" background. These two only style the gear/season
 * cards themselves, so they stand out against the flat page:
 *   --spg-surface-elevated-alt: #2f3540  (gear/season card background)
 *   --spg-border-elevated: #3a4049       (gear/season card border —
 *                                          --spg-border is too close in
 *                                          tone against --spg-bg)
 *
 * --spg-sport-accent is resolved per-page in header.php (sport of the
 * athlete being viewed, fallback to Padel green #7fd858). Reused here for
 * the sport badge only — never on CTAs or body text (architecture decision,
 * section 11 of PROJECT_CONTEXT.md).
 *
 * Mobile-first. Breakpoints: 640px (tablet), 960px (desktop).
 */

.spg-athlete-profile {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  color: var(--spg-text);
}

/* ============ HEADER ============ */

.spg-athlete-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  padding-bottom: 1.75rem;
}

.spg-athlete-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.spg-athlete-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--spg-border);
}

.spg-athlete-header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

/* Sport badge + rank badge, above the name */
.spg-athlete-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.spg-badge-sport {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--spg-bg);
  background-color: var(--spg-sport-accent, #7fd858);
}

.spg-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background-color: var(--spg-surface-alt);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--spg-text-secondary);
  line-height: 1.5;
}

.spg-rank-icon {
  color: var(--spg-sport-accent, #7fd858);
  flex-shrink: 0;
}

.spg-rank-value {
  font-weight: 800;
  color: var(--spg-sport-accent, #7fd858);
  margin-left: 0.1rem;
}

.spg-athlete-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

/* Identity chips: nationality, age, hand, court side */
.spg-athlete-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.spg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background-color: var(--spg-surface-alt);
  border: 1px solid var(--spg-border);
  font-size: 0.8rem;
  color: var(--spg-text-secondary);
  white-space: nowrap;
}

.spg-flag {
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--spg-border);
}

.spg-athlete-socials {
  display: flex;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.spg-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--spg-text-secondary);
  background-color: var(--spg-surface-alt);
  border: 1px solid var(--spg-border);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.spg-social-link:hover,
.spg-social-link:focus-visible {
  color: var(--spg-text);
  border-color: var(--spg-text-secondary);
}

/* ============ BIO / CURRENT PARTNER (both inside header) ============ */

.spg-athlete-bio {
  max-width: 52ch;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--spg-text-secondary);
  text-align: center;
}

.spg-partner-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem 0.35rem 0.9rem;
  border-radius: 999px;
  background-color: var(--spg-surface-alt);
  border: 1px solid var(--spg-border);
  text-decoration: none;
  color: var(--spg-text);
  transition: border-color 0.15s ease;
}

.spg-partner-pill:hover,
.spg-partner-pill:focus-visible {
  border-color: var(--spg-text-secondary);
  color:var(--spg-text);
}

.spg-partner-label {
  font-size: 0.75rem;
  color: var(--spg-text-secondary);
}

.spg-partner-name {
  font-size: 0.8rem;
  font-weight: 600;
}

.spg-partner-arrow {
  color: var(--spg-text-secondary);
  flex-shrink: 0;
}

/* ============ SECTION HEADINGS (shared — whole page is one flat background) ============ */

/* Heading provides its own top spacing, so it works equally well right
   after the header or after a previous section's cards. The wrapping
   <section> around each grid has no extra margin of its own. */
.spg-section-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: var(--spg-text);
}

/* ============ GEAR GRID (Racket / Shoes / Bag — equal cards) ============ */

.spg-gear-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.spg-gear-card {
  display: flex;
  flex-direction: column;
  background-color: var(--spg-surface-elevated-alt, #2f3540);
  border: 1px solid var(--spg-border-elevated, #3a4049);
  border-radius: 16px;
  padding: 1.25rem;
}

.spg-gear-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--spg-text-muted);
  margin-bottom: 0.6rem;
}

/* Light "stage" behind the product photo — most product photography
   (including the current racket image) still has a white/near-white
   background baked in, so a dark stage shows an ugly hard-edged box.
   A light stage blends seamlessly today and still works once images
   with a transparent background are used. */
.spg-gear-image-wrap {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--spg-cta, #eef0f3);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.spg-gear-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.spg-gear-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.spg-gear-note {
  color: var(--spg-text-muted);
  font-style: italic;
  margin: 0;
}

/* ============ GEAR CTA — sober, near-white, segmented US/EU ============ */

.spg-gear-cta-group {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--spg-cta, #eef0f3);
  margin-top: 0.9rem;
}

.spg-gear-cta-segment {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--spg-cta-text, #1a1d22);
  transition: background-color 0.15s ease;
}

.spg-gear-cta-segment:not(:last-child) {
  border-right: 2px solid var(--spg-cta-divider, #b9bec6);
}

.spg-gear-cta-segment:hover,
.spg-gear-cta-segment:focus-visible {
  background-color: var(--spg-cta-hover, #ffffff);
}

/* ============ SECONDARY ACTION — only one shown per card ============ */

.spg-gear-review-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--spg-border-elevated, #3a4049);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--spg-text);
  text-decoration: none;
}

.spg-gear-review-link:hover,
.spg-gear-review-link:focus-visible {
  color: var(--spg-text-secondary);
}

.spg-gear-details {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--spg-border-elevated, #3a4049);
}

.spg-gear-details summary {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--spg-text-secondary);
  cursor: pointer;
  list-style: none;
}

.spg-gear-details summary::-webkit-details-marker {
  display: none;
}

.spg-gear-details summary:hover,
.spg-gear-details summary:focus-visible {
  color: var(--spg-text);
}

.spg-gear-details-chevron {
  transition: transform 0.15s ease;
}

.spg-gear-details[open] .spg-gear-details-chevron {
  transform: rotate(180deg);
}

.spg-gear-details-content {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--spg-text-secondary);
}

.spg-gear-details-content p {
  margin: 0;
}

.spg-gear-details-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spg-gear-details-label {
  color: var(--spg-text-muted);
}

/* ============ PREVIOUS SEASONS ============ */

.spg-previous-seasons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.spg-season-card {
  background-color: var(--spg-surface-elevated-alt, #2f3540);
  border: 1px solid var(--spg-border-elevated, #3a4049);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  text-align: center;
}

.spg-season-year {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--spg-text-muted);
}

.spg-season-gear {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

/* ============ TABLET (>= 640px) ============ */

@media (min-width: 640px) {
  .spg-athlete-header {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }

  .spg-athlete-header-info {
    align-items: flex-start;
    flex: 1;
  }

  .spg-athlete-badges,
  .spg-athlete-chips {
    justify-content: flex-start;
  }

  .spg-athlete-bio {
    text-align: left;
  }

  .spg-gear-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .spg-previous-seasons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============ DESKTOP (>= 960px) ============ */

@media (min-width: 960px) {
  .spg-athlete-profile {
    padding-top: 2.5rem;
  }

  .spg-athlete-photo {
    width: 168px;
    height: 168px;
  }

  .spg-athlete-name {
    font-size: 2rem;
  }

  .spg-gear-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
