/* ==========================================================================
   Apple Music Dark Mode Bento Roster — UG IN THE BOX
   Theme: Apple Inc. Inset Bento + Tactical Bunker (Zero-Neon / Resident Evil Olive)
   Aspect Ratio: 4:5 Portrait Studio
   Layout: 3-Col Desktop, 2-Col Tablet, 2-Col Mobile (Strict Symmetry)
   ========================================================================== */

/* Main Container */
.ah-main .tp-artists-apple-page {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding-block: clamp(28px, 4vw, 56px);
  box-sizing: border-box;
}

/* Header & Chassis Card (Unified Grounded Plate) */
.tp-artists-apple-heading.tp-artists-header-chassis {
  position: relative;
  border-radius: var(--tp-radius-chassis, 24px);
  background: rgba(14, 16, 21, 0.95);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(122, 147, 116, 0.22);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
  padding: clamp(22px, 3.5vw, 36px);
  margin-top: 8px;
  margin-bottom: 28px;
  box-sizing: border-box;
}

.tp-artists-chassis-top {
  margin-bottom: 20px;
}

.tp-artist-back-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--tp-radius-pill, 980px);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--tp-text-secondary, #B8B6AA);
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-bottom: 20px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.tp-artist-back-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateX(-2px);
}

.tp-artist-back-pill:active {
  transform: scale(0.97);
}

.tp-pill-arrow-back {
  font-size: 13px;
  transition: transform 0.15s ease;
}

.tp-artist-back-pill:hover .tp-pill-arrow-back {
  transform: translateX(-2px);
}

.tp-artists-badge-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  line-height: 1;
}

.tp-artists-badge-row .tp-radar-dot-pulse {
  width: 6px !important;
  height: 6px !important;
  flex-shrink: 0;
  margin: 0 !important;
  display: inline-block;
  vertical-align: middle;
  transform: translateY(-1px);
}

.tp-artists-badge-row .tp-artist-eyebrow {
  font-family: var(--ah-mono, ui-monospace, monospace) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  color: var(--tp-status-success, #7A9374) !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-transform: uppercase;
  display: inline-block;
  vertical-align: middle;
}

.tp-artists-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tp-artists-main-title {
  font-family: var(--ah-display, 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--tp-text-primary, #F5F5F7);
  margin: 0;
}

.tp-artists-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--tp-radius-pill, 980px);
  background: rgba(122, 147, 116, 0.12);
  border: 1px solid rgba(122, 147, 116, 0.25);
  color: var(--tp-text-primary, #F5F5F7);
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tp-artists-intro {
  font-family: var(--ah-text, 'IBM Plex Sans Thai', sans-serif);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--tp-text-secondary, #B8B6AA);
  margin: 10px 0 0 0;
  max-width: 60ch;
}

/* --- Apple Quick Search Dock Integrated inside Chassis --- */
.tp-artist-search-dock {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 20px;
  box-sizing: border-box;
}

.tp-artist-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 480px;
  min-width: 240px;
  height: 44px;
  border-radius: var(--tp-radius-pill, 980px);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.tp-artist-search-box:focus-within {
  border-color: rgba(122, 147, 116, 0.45);
  box-shadow: 0 0 0 3px rgba(122, 147, 116, 0.12);
  background: rgba(10, 10, 14, 0.85);
}

.tp-artist-search-box .tp-search-svg,
.tp-artist-search-box .tp-search-icon {
  font-size: 15px;
  color: var(--tp-text-muted, #7E7D75);
  margin-right: 10px;
  flex-shrink: 0;
  user-select: none;
  transition: color 0.16s ease;
}

.tp-artist-search-box:focus-within :is(.tp-search-svg, .tp-search-icon) {
  color: #FFFFFF;
}

.tp-artist-search-box .tp-search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--tp-text-primary, #F5F5F7);
  font-family: var(--ah-text, system-ui, sans-serif);
  font-size: 13.5px;
  padding: 0;
  height: 100%;
  outline: none;
  min-width: 0;
}

.tp-artist-search-box .tp-search-input::placeholder {
  color: #71717A;
}

.tp-artist-search-box .tp-search-clear {
  background: transparent;
  border: none;
  color: var(--tp-text-muted, #7E7D75);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tp-artist-search-box .tp-search-clear:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

.tp-artist-search-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--tp-text-muted, #7E7D75);
  white-space: nowrap;
}

.tp-artist-search-feedback strong {
  color: var(--tp-text-primary, #F5F5F7);
}

/* ==========================================================================
   Apple Music Bento Cards Grid
   ========================================================================== */
.tp-artists-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  width: 100%;
  box-sizing: border-box;
}

/* Tactical Grounded Bento Slab (Anti-Floating, High Contrast) */
.tp-artist-bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--tp-radius-card, 18px);
  background: rgba(14, 16, 21, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(122, 147, 116, 0.22);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              box-shadow 0.35s ease;
  box-sizing: border-box;
}

.tp-artist-bento-card:hover {
  transform: translateY(-4px);
  border-color: rgba(122, 147, 116, 0.45);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tp-artist-bento-card:active {
  transform: scale(0.985);
  transition: transform 100ms ease-out;
}

/* ==========================================================================
   Bento Portrait Studio Frame (Strict 4:5 Apple Ratio)
   ========================================================================== */
.tp-artist-visual-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #07080A;
}

/* Subtle Bottom Dark Vignette for Contrast */
.tp-artist-visual-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 65%, rgba(14, 16, 21, 0.85) 100%);
  pointer-events: none;
  z-index: 3;
}

.tp-artist-image-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
  overflow: hidden;
}

.tp-artist-backdrop-blur {
  position: absolute;
  inset: -14%;
  width: 128%;
  height: 128%;
  object-fit: cover;
  filter: blur(32px) brightness(0.35) saturate(150%);
  transform: scale(1.1);
  pointer-events: none;
  z-index: 1;
}

.tp-artist-stage-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0;
}

.tp-artist-portrait-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-artist-bento-card:hover .tp-artist-portrait-img {
  transform: scale(1.038);
}

.tp-artist-portrait-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #14161D 0%, #0A0B0E 100%);
  color: var(--tp-text-muted, #7E7D75);
}

.tp-artist-placeholder-monogram {
  font-family: var(--ah-display, 'IBM Plex Sans Thai', sans-serif);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--tp-text-primary, #F5F5F7);
}

.tp-artist-placeholder-note {
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--tp-status-success, #7A9374);
}

/* Floating Glass Badges on Studio Frame (Tour badge on top right) */
.tp-artist-top-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  z-index: 4;
  pointer-events: none;
}

.tp-artist-tour-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--tp-radius-pill, 980px);
  background: rgba(14, 16, 21, 0.75);
  border: 1px solid rgba(122, 147, 116, 0.4);
  color: #A9BC9A;
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.45;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   Card Content Body
   ========================================================================== */
body.ah-customer-system .ah-main .tp-artist-bento-card .tp-artist-card-body,
body.ah-customer-system .ah-main :is(.tp-artist-bento-card) .tp-artist-card-body,
.ah-main .tp-artist-bento-card .tp-artist-card-body,
.tp-artist-bento-card .tp-artist-card-body {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 18px 20px 20px !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  flex-grow: 1 !important;
  min-height: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.tp-artist-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tp-artist-index {
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--tp-text-muted, #7E7D75);
}

.tp-artist-band-pill {
  padding: 2px 8px;
  border-radius: var(--tp-radius-pill, 980px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #D4D2C7;
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 10.5px;
  font-weight: 600;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-artist-title {
  margin: 0;
  font-family: var(--ah-display, 'IBM Plex Sans Thai', sans-serif);
  font-size: clamp(19px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.tp-artist-title a {
  color: var(--tp-text-primary, #F5F5F7);
  text-decoration: none;
  transition: color 0.16s ease;
}

.tp-artist-title a:hover {
  color: #FFFFFF;
}

.tp-artist-bio-preview {
  margin: 0;
  font-family: var(--ah-text, 'IBM Plex Sans Thai', sans-serif);
  font-size: 13px;
  line-height: 1.55;
  color: var(--tp-text-secondary, #B8B6AA);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 4.5em;
}

.tp-artist-bio-preview.is-empty {
  color: #71717A;
  font-style: italic;
}

/* Upcoming Events Chips */
.tp-artist-upcoming-events {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.tp-artist-upcoming-events a {
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--tp-status-success, #7A9374);
  background: rgba(122, 147, 116, 0.1);
  border: 1px solid rgba(122, 147, 116, 0.22);
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.tp-artist-upcoming-events a:hover {
  background: rgba(122, 147, 116, 0.2);
  border-color: rgba(122, 147, 116, 0.4);
  color: #FFFFFF;
}

.tp-artist-upcoming-events span {
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--tp-text-muted, #7E7D75);
  align-self: center;
}

/* ==========================================================================
   Card Footer & Action Pill (Single-Row Apple Music Architecture)
   ========================================================================== */
.tp-artist-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.tp-artist-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.03em;
  min-width: 0;
}

.tp-status-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tp-status-success, #7A9374);
  box-shadow: 0 0 6px rgba(122, 147, 116, 0.6);
  flex-shrink: 0;
}

.tp-status-live-text {
  color: #A9BC9A;
  font-weight: 600;
  white-space: nowrap;
}

.tp-status-dormant-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #71717A;
  flex-shrink: 0;
}

.tp-status-dormant-text {
  color: var(--tp-text-muted, #7E7D75);
  font-weight: 500;
  white-space: nowrap;
}

.tp-artist-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--tp-radius-pill, 980px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--tp-text-primary, #F5F5F7);
  font-family: var(--ah-mono, ui-monospace, monospace);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  flex-shrink: 0;
}

.tp-artist-profile-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.tp-artist-profile-btn:active {
  transform: scale(0.96);
}

.tp-btn-arrow {
  font-size: 12px;
  transition: transform 0.15s ease;
}

.tp-artist-profile-btn:hover .tp-btn-arrow {
  transform: translate(1px, -1px);
}

/* Empty State */
.tp-artist-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  background: rgba(14, 16, 21, 0.85);
  border: 1px solid rgba(122, 147, 116, 0.2);
  border-radius: var(--tp-radius-card, 18px);
}

.tp-artist-empty-state .tp-empty-icon {
  font-size: 32px;
  color: var(--tp-text-muted, #7E7D75);
  display: block;
  margin-bottom: 12px;
}

.tp-artist-empty-state h2 {
  font-family: var(--ah-display, 'IBM Plex Sans Thai', sans-serif);
  font-size: 20px;
  color: var(--tp-text-primary, #F5F5F7);
  margin: 0 0 8px 0;
}

.tp-artist-empty-state p {
  color: var(--tp-text-secondary, #B8B6AA);
  font-size: 14px;
  margin: 0;
}

/* ==========================================================================
   Responsive Adaptations
   - Desktop: 3 Cols
   - Tablet (640-1023px): 2 Cols
   - Mobile (< 640px): 2 Cols (Strict Symmetry, Zero Floating Elements)
   ========================================================================== */
@media (max-width: 1023px) and (min-width: 640px) {
  .tp-artists-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 639px) {
  .ah-main .tp-artists-apple-page {
    width: 100%;
    padding-inline: 12px;
    padding-block: 20px 48px;
  }

  .tp-artists-apple-heading.tp-artists-header-chassis {
    padding: 18px 16px;
    border-radius: 18px;
    margin-bottom: 20px;
  }

  .tp-artists-title-row {
    gap: 10px;
  }

  .tp-artists-main-title {
    font-size: 24px;
  }

  .tp-artist-search-dock {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 14px;
    margin-top: 16px;
    width: 100%;
  }

  .tp-artist-search-box {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    box-sizing: border-box;
  }

  .tp-artist-search-box .tp-search-input {
    font-size: 13px;
  }

  .tp-artist-search-feedback {
    justify-content: flex-start;
  }

  /* 2 Columns on Mobile - Strict User Requirement */
  .tp-artists-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 2.5vw, 14px);
  }

  .tp-artist-bento-card {
    border-radius: 16px;
  }

  .tp-artist-visual-stage {
    aspect-ratio: 4 / 5;
  }

  .tp-artist-top-badges {
    top: 8px;
    left: 8px;
    right: 8px;
  }

  .tp-artist-tour-badge {
    font-size: 9px;
    padding: 2px 7px;
    gap: 4px;
  }

  .tp-artist-card-body {
    padding: 12px 10px 14px !important;
    gap: 8px !important;
  }

  .tp-artist-header-row {
    gap: 4px;
  }

  .tp-artist-index {
    font-size: 9.5px;
    letter-spacing: 0.04em;
  }

  .tp-artist-band-pill {
    max-width: 76px;
    font-size: 9px;
    padding: 1px 5px;
  }

  .tp-artist-title {
    font-size: clamp(14px, 3.8vw, 16px);
    line-height: 1.25;
  }

  .tp-artist-bio-preview {
    font-size: 11.5px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    min-height: 0 !important;
    margin-bottom: 2px;
  }

  .tp-artist-upcoming-events {
    display: none; /* Hide multi-line event chips on 2-col to avoid jagged card heights */
  }

  /* Symmetrical Full-Width Action Container on Mobile 2-Column */
  .tp-artist-card-footer {
    padding-top: 10px;
    margin-top: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .tp-artist-status-indicator {
    justify-content: center;
    font-size: 10px;
    gap: 5px;
  }

  .tp-artist-profile-btn {
    width: 100%;
    justify-content: center;
    min-height: 36px;
    padding: 0 8px;
    font-size: 11.5px;
    box-sizing: border-box;
  }
}
