/* Design: the shared building blocks of a page about one person or one
   record (a staff member, a player), written once and reused. In the brand of
   the homepage and "Today": the navy band with its yellow line, the italic
   display face for names, white cards sized to their content, labels right
   next to their values, and colours that mean something. The partials are
   in app/views/shared (_profile_head, _section_card, _needs) and the helpers
   in DesignHelper. */

/* The header: a navy band (like shared/hero), with the person's
   avatar, name, tags and main actions, and the way back on top. */
.band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: 22px;
  padding: 18px 28px 26px;
  border-top: 4px solid var(--yellow);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 82% 0%, rgb(54 87 212 / 45%), transparent 55%),
    linear-gradient(160deg, var(--navy-deep), var(--navy) 60%, var(--blue-deep));
  color: var(--on-navy);
}

/* A big faint figure behind the band, like the homepage's "11": the shirt
   number on a player's page. */
.band-ghost {
  position: absolute;
  right: 4%;
  bottom: -.22em;
  z-index: -1;
  color: rgb(255 255 255 / 6%);
  font-family: var(--display);
  font-size: 210px;
  font-style: italic;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.band-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-4);
  color: var(--on-navy-muted);
  font-size: var(--text-small);
  font-weight: 600;
}

.band-back:hover { color: var(--surface); }

/* On phones and small tablets the back link is at least 24px tall to tap. */
@media (max-width: 800px) {
  .band-back { min-height: 24px; }
}

.band-main { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 22px; }

/* An athlete's photo fills their avatar, cropped to its circle whatever
   the photo's shape (DesignHelper#athlete_avatar). */
.avatar-photo { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
/* A club's crest keeps its own shape inside the box it replaces the shield
   in (DesignHelper#club_crest); the match pages and the shop show it larger. */
.crest-image { display: block; object-fit: contain; }
.club-crest .crest-image { width: 32px; height: 32px; }
.shop-placeholder .crest-image { width: 42%; height: 42%; opacity: .85; }
.match-crest.with-crest { clip-path: none; background: none; }
.match-crest.with-crest .crest-image { width: 40px; height: 40px; }

/* The call-up picker shows a player's photo, when there is one, before the name. */
.lp-avatar { width: 28px; height: 28px; }
.band-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 6px rgb(255 241 59 / 15%);
  color: var(--navy-deep);
  font-family: var(--display);
  font-size: 30px;
  font-style: italic;
}

.band-title { flex: 1 1 320px; min-width: 0; }

.band .eyebrow { margin-bottom: var(--space-2); color: var(--yellow); font-size: var(--text-small); }

.band h1 {
  margin: 0;
  color: var(--on-navy);
  font-family: var(--font);
  font-size: var(--text-title);
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.3px;
  overflow-wrap: anywhere;
}

.band .heading-dot { color: var(--yellow); }

.band-facts { margin-top: 10px; color: var(--blue-line); font-size: var(--text-body); }

.band-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.band-tag {
  padding: 5px 10px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 999px;
  color: var(--line);
  font-size: var(--text-small);
  font-weight: 650;
}

/* Teams in yellow, as the homepage marks what belongs to the club. */
.band-tag.team { border-color: rgb(255 241 59 / 50%); color: var(--yellow); }

.band-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

/* Buttons on navy, as on "Today": the main action yellow, the others outlined. */
.band .btn {
  border-color: rgb(255 255 255 / 35%);
  background: transparent;
  color: var(--on-navy);
}

.band .btn:hover { background: rgb(255 255 255 / 10%); }

.band .btn.primary { border-color: var(--yellow); background: var(--yellow); color: var(--navy-deep); }

.band .btn.primary:hover { background: var(--yellow-hover); }

.band a:focus-visible,
.band button:focus-visible { outline-color: var(--yellow); outline-offset: 2px; }

/* The page under the band: a wide column for the work, a narrow one for the
   details, each card as tall as what it holds. */
.profile-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; align-items: start; }

.profile-col { display: grid; gap: 22px; align-content: start; }

/* Team badges keep the library's one size (11px) inside a card too. */
.section-card .badge:not(.team) { padding: var(--space-1) var(--space-2); font-size: var(--text-small); }

/* A group inside a card, such as one guardian: a heading with its action, then its facts. */
.card-group+.card-group { margin-top: 6px; padding-top: var(--space-3); border-top: 1px solid var(--line); }

.card-group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0 2px; }

.card-group-head strong { font-size: var(--text-body); }

/* A queue in a panel (requests, notices, imports): its lines (shared/_row)
   run to the panel's edges, like any row list; what else it holds (the
   empty state, "Mostrar mais") keeps the panel's side padding. */
.queue-list { overflow: hidden; }
.queue-list > :not(.row-list) { padding-inline: 20px; }

@media (max-width: 700px) {
  .queue-list > :not(.row-list) { padding-inline: var(--space-4); }
}

.row-note { flex-basis: 100%; color: var(--muted); font-size: var(--text-small); }

.row-note a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
}

/* On a phone the band stays short and the actions sit in one compact row. */
@media (max-width: 700px) {
  .band { margin-bottom: var(--space-4); padding: 14px var(--space-4) 18px; }

  .band-back { margin-bottom: var(--space-3); }

  .band-main { gap: 14px; }

  .band-avatar { width: 56px; height: 56px; box-shadow: 0 0 0 4px rgb(255 241 59 / 15%); font-size: 22px; }

  .band-title { flex-basis: 0; }

  .band h1 { font-size: var(--text-title-phone); }

  .band-ghost { font-size: 130px; }

  .band-actions { width: 100%; gap: var(--space-2); }

  .band-actions>* { flex: 1 1 auto; }

  .band .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .profile-grid,
  .profile-col { gap: var(--space-4); }

}

/* Text for screen readers only, beside an icon that says it visually. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Text beside actions. A button, badge or tab label wraps only between words,
   never inside one, and never shrinks below its longest word; its icon keeps
   its size. In a row, the text keeps about 12rem before an action may sit
   beside it; with less room the action wraps under the text. Below 480px the
   action always goes under the text, lined up with it, at its own width. */
:is(.btn, .small-btn, .text-btn, .badge, .tabs a) { overflow-wrap: normal; word-break: normal; hyphens: none; }

.settings-row:where(:has(>.btn, >form, >a.text-btn))>span:first-child { flex: 1 1 12rem; min-width: 0; }

@media (max-width: 480px) {

  .settings-row:where(:has(>.btn, >form, >a.text-btn))>span:first-child { flex-basis: 100%; }

}

/* The style page (styles/show): an index of the blocks, then each block
   with its reason and a live example. Only its own frame lives here. */
.style-page { display: grid; gap: var(--space-6); }
.style-index { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--text-small); }
.style-index a { color: var(--blue); font-weight: 600; }
.style-block { display: grid; gap: var(--space-3); padding-top: var(--space-5); border-top: 1px solid var(--line); scroll-margin-top: var(--space-5); }
.style-block > h2 { font-size: var(--text-heading); }
.style-why { max-width: 72ch; color: var(--muted); }
.style-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.style-swatches { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.style-swatch, .style-space { display: grid; gap: var(--space-1); font-size: var(--text-small); }
.style-swatch span { width: 64px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); }
.style-space span { height: 16px; background: var(--blue); border-radius: 2px; }
.style-type { display: grid; gap: var(--space-3); }
.style-navy { padding: var(--space-5); }
