/* A performer's own public profile page (performers/show.html.erb) —
   same "main column + sidebar of cards" shape shows.css/
   performance_groups.css already use, reusing .sidebar-card from
   dashboard.css and .pg-header/.pg-header__identity/.pg-avatar from
   performance_groups.css directly rather than redefining them. Only
   what's actually new to this page (the header's action row and social
   icon row, the two-column grid, and the Ensembles/Performances rows'
   own layout) gets its own rules here. */
.performer-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.performer-header {
  margin-bottom: 1.5rem;
}

/* The name, with the owner's Edit profile button right after it. */
.performer-header__name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0;
}

.performer-header__name h1 {
  margin: 0;
}

.performer-header__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

/* button_to renders a block-level <form> (see catalog.css's own
   .follow-icon-form comment) -- the non-compact Follow button here
   needs the same inline treatment to sit in this flex row. */
.performer-header__actions form {
  display: inline-block;
}

/* .contact_actions' own wrapper (.inline-links) is a full-width stacked
   list everywhere else it's used (auth flows) -- unwrapping it here via
   `display: contents` lets its Message/Hire links become direct items
   of this flex row instead, without touching the shared partial itself. */
.performer-header__actions .inline-links {
  display: contents;
}

.performer-header__actions .primary-button,
.performer-header__actions .secondary-link {
  width: auto;
  padding: 0.65rem 1.25rem;
}

.performer-social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.performer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--secondary-text);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.performer-social-icon:hover {
  background: var(--primary);
  color: #ffffff;
}

.performer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.performer-main,
.performer-aside {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
}

@media (max-width: 960px) {
  .performer-shell {
    padding: 1.25rem;
  }

  .performer-layout {
    grid-template-columns: 1fr;
  }
}

.performer-glance-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.performer-glance-facts li {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.performer-glance-facts li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.performer-group-rows,
.performer-show-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.performer-group-row,
.performer-show-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.performer-group-row:last-child,
.performer-show-row:last-child {
  border-bottom: none;
}

.pg-avatar.performer-group-row__avatar,
.performer-group-row__avatar.pg-avatar--placeholder {
  width: 40px;
  height: 40px;
  font-size: 1.05rem;
  flex: 0 0 auto;
}

.performer-group-row__body,
.performer-show-row__body {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.performer-group-row__body a,
.performer-show-row__title a {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.performer-group-row__body a:hover,
.performer-show-row__title a:hover {
  color: var(--primary);
}

.performer-show-row__title {
  margin: 0;
}

.performer-group-row__chevron,
.performer-show-row__chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.3rem;
}

.performer-show-row__date {
  flex: 0 0 48px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  line-height: 1.3;
}

.performer-show-row__date strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text);
}

/* A performer's performance history page (see performers/performed.html.erb)
   — one section per concert/composer/category, each row's dates on their
   own line under the piece. */
.history-groupings {
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
}

/* A group's search (see performance_groups/_header), at the end of its
   tab row — its own full line once the row runs out of room. */
.group-search {
  margin-left: auto;
  flex: 0 1 20rem;
  min-width: min(100%, 14rem);
}

.group-search input[type="search"],
.group-search.site-search input[type="search"] {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
}

.history-groupings a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* Sets a group's Featured Soloists sub-tab apart from the groupings
   before it (see performance_groups/_performances_subnav). */
.history-groupings__divider {
  color: var(--border);
}

.history-section {
  margin-bottom: 2rem;
}

.history-section h2,
.history-section h3 {
  margin-bottom: 0.25rem;
}

/* A concert nested under its group (the by-group listing). */
.history-section .history-section {
  margin: 1rem 0 1.5rem;
}

.history-section > .card-meta {
  margin-bottom: 0.75rem;
}

.history-section .program-list__row-main > .card-meta {
  display: block;
  margin-top: 0.2rem;
}

/* One group-and-date run of a history entry (see
   ApplicationHelper#show_date_run_links) — each on its own line. */
.history-run {
  display: block;
}

/* The owner's own actions on one of their profile tabs (Library's "Add
   to my library", Photos' "New album"), just under the tabs. */
.tab-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tab-actions .secondary-link {
  width: auto;
}

/* A section's h2 with its one action right beside it (the Photos tab's
   Albums + New album). */
.section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Each kind of result a group's Performances-tab search found — a
   .cast-section, without the generic details > summary spacing. */
/* Its dropdown preview (see search_preview.html.erb) hangs from the
   box's right edge, the box being at the right end of the tab row. */
.group-search__preview {
  left: auto;
  right: 0;
  z-index: 20;
}

.group-search__section > summary {
  margin: 0;
}

.group-search__section > .program-list {
  margin: 0 0 0.75rem;
}

/* A piece's dates under its title, one run per line (see
   .history-run), as quiet as the rest of a result's details. */
.site-search__result .group-search__dates {
  display: block;
  margin: 0.15rem 0 0;
}

.site-search__result .group-search__dates a {
  font-weight: 400;
  color: var(--muted);
}

/* The invite page's preview of the email (see performer_invitations/new)
   — set apart like a message, its heading no bigger than the page's. */
.invitation-preview {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.invitation-preview h2 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}

.invitation-preview__email {
  margin-top: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 0.92rem;
}

.invitation-preview__email h1 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.invitation-preview__email ul {
  padding-left: 1.2rem;
}


/* Groups a performer has left, under their current ones. */
.performer-group-rows__heading {
  margin: 1rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* On the owner's own profile, a group hidden from their public profile:
   the same red as a conflict on the dashboard (.schedule-row--conflict),
   bled out to the card's edges the same way. */
.performer-group-row--hidden {
  background: var(--danger-bg);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  margin: 0 -0.75rem;
  border-radius: 10px;
  border-bottom-color: transparent;
}

/* The owner's Attended tab: a pointer to uploading a program they went to. */
.attended-upload-note {
  margin: 0.75rem 0 1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
}

/* A profile card's own edit button ("Edit which groups show on my public
   profile") is long: it drops under the heading rather than squeezing it. */
.performer-layout .sidebar-card__header {
  flex-wrap: wrap;
}

/* The owner's Library viewing permissions, under their Library tab's tabs
   (see performers/_library_permissions.html.erb): one line closed, the
   whole form open. */
.library-permissions {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.library-permissions > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  cursor: pointer;
}

/* display: flex drops the browser's own disclosure triangle, so it gets
   one back: pointing right when closed, down when open. */
.library-permissions > summary::-webkit-details-marker {
  display: none;
}

.library-permissions > summary::before {
  content: "\25B8";
  color: var(--muted);
  transition: transform 0.15s ease;
}

.library-permissions[open] > summary::before {
  transform: rotate(90deg);
}

.library-permissions__title {
  font-weight: 700;
  color: var(--text);
}

.library-permissions__form {
  margin-top: 1rem;
}

.library-permissions__everyone {
  display: grid;
  gap: 0.4rem;
}

.library-permissions__groups {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.library-permissions__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.library-permissions__group-name {
  font-weight: 600;
}

.library-permissions__members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.library-permissions__heading {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.library-permissions__add > summary {
  width: auto;
  list-style: none;
}

.library-permissions__add > summary::-webkit-details-marker {
  display: none;
}

.library-permissions__add[open] > summary {
  margin-bottom: 0.75rem;
}

.library-permissions__add input[type="text"] {
  width: 100%;
  padding: 0.8rem 0.95rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.98rem;
}

.library-permissions__actions .primary-button {
  width: auto;
}
