/* 26-figure-page.css – the figure page's own rules (/Minifigures/{number}, both markups), moved out of 08-minifigures.css in
   task 271: until then its 866 lines loaded on every page of the site (_Layout). Linked by Pages/Minifigures/Details.cshtml
   only. What other pages show of a figure stays in 08 – the catalogue's tiles, /Minifigures, and the forms the edit panel
   opens over /Wishlist (.fig-form, .fig-edit, .fig-wish-form__remove). */

/* ── The figure page (task 178; rebuilt in task 184; the set page's dense page in task 213; its head from Figma in task
   271 – .fig-hero, below). It still borrows the set page's .set-detail-page, .sp-crumbs, .sp-section-head and .sp-metrics
   (03-set-details.css) for the chart and the sets; these rules are what a figure has of its own. */
.fig-top__source {
  margin: 0;
  color: var(--text-muted);
}

.fig-top__source a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}

.fig-page__note {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.fig-more__list {
  min-width: 220px;
}

/* The price by month: the set page's chart (.chart-canvas-wrap, .price-chart), a little lower – a figure has months, not
   years, and the head above is the page. */
.fig-chart,
.fig-chart .price-chart {
  height: 260px;
  min-height: 0;
}

.set-detail-page [id^="fig-"] {
  scroll-margin-top: 72px;
}

/* The page's tables (task 271, Figma's ui-table inside the page's one card, .fig-card – «Moje egzemplarze», «Zestawy z …»,
   «Inne wersje»): they scroll sideways on their own under their width, never the page; a 64 px photo column, a 40 px picture
   on the photo ground. */
.fig-table-scroll {
  overflow-x: auto;
}

.fig-table__photo {
  width: 64px;
  padding-block: var(--space-2);
}

.fig-table__img {
  display: block;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: var(--radius-2);
  background: var(--photo-bg);
}

.fig-table__img img {
  display: block;
  width: 100%;
  height: 100%;
  padding: var(--photo-inset);
  object-fit: contain;
}

/* The name is the row's header (Figma's Cell Strong for a set, Text for a version), its hairline the row's like every cell's.
   :where() keeps these under the row's hover and focus (01-components.css, 0-2-4): at 0-3-2 the name's cell lost its ring,
   and the last row's «none» at 0-3-3 lost it again (WebKit and Chromium, the focus shot of task 271). */
:where(.fig-card .ui-table tbody) th[scope="row"] {
  box-shadow: inset 0 -1px 0 var(--border);
  font-weight: 400;
  white-space: normal;
}

:where(.fig-card .ui-table tbody tr:last-child) th[scope="row"] {
  box-shadow: none;
}

.fig-sets-table th[scope="row"] {
  width: 100%;
  font-weight: 600;
}

.fig-sets-table th[scope="row"] a,
.fig-versions-table th[scope="row"] a {
  color: var(--text);
  text-decoration: none;
}

/* «Inne wersje»: the first ten and the rest in a second table behind «Pokaż wszystkie N» – the same columns (fixed widths,
   Figma 231:1067), so the folded rows line up under the first. The figure on the page is the lit row. */
.fig-versions-table {
  table-layout: fixed;
}

.fig-col--photo { width: 64px; }
.fig-col--number { width: 120px; }
.fig-col--year { width: 90px; }
.fig-col--price { width: 140px; }
.fig-col--rank { width: 170px; }
.fig-col--score { width: 190px; }

/* A version priced by its used sales: the mark under the price, so the amounts keep one right edge. */
.fig-versions__used {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.fig-versions-table tr[aria-current] > * {
  background: var(--surface-2);
}

.fig-block__more > summary {
  margin-top: var(--space-2);
}

.fig-lots tr.is-editing td {
  background: var(--surface-2);
}

.fig-lots__note {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.fig-lots__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
  white-space: nowrap;
}

.fig-lots__actions form {
  margin: 0;
}

.fig-page .sp-metrics,
.fig-page .sp-metrics .ui-stat {
  border: 0;
}

/* «Схожі мініфігурки»: their 8 in one row from 1 101 px, two rows of 4 below – never 7 and one alone (the design review). */
.fig-page .fig-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

@media (max-width: 1100px) {

  .fig-page .fig-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ── The figure page's one card and one rhythm (task 236; the audit: three card styles – the price without a rule, radius 10,
   padding 16; the chart and the score a 1 px rule, radius 8, padding 16 / 20; «Як отримати» radius 6, padding 12 – and gaps
   of 4 and 16 px between blocks). Every block is the design system's card (.ui-card's radius, ground and shadow, no rule)
   with one padding; one gap between blocks (--space-5) and one inside a block (--space-3); an H2 two steps over the text. */
.fig-page {
  display: grid;
  gap: var(--space-4); /* Figma 224:3: 16 px between cards (task 271; 20 before) */
  /* Centred at the content's widest (task 244: 1 880 px at 1920 before). */
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
}

.fig-page > *,
.fig-page > .content-band {
  margin: 0;
}

.fig-card,
.fig-page .content-section {
  padding: var(--space-5);
  border: 0;
  border-radius: var(--radius-3);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
}

.fig-card {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-width: 0;
}

.fig-page .sp-section-head h2 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

.fig-page .sp-section-head {
  margin-bottom: var(--space-3);
}

/* «Podobne minifigurki»: a price row of two lines in every tile, the price on the first, so «27,27 zł wg używanych» (two
   lines in a 160 px tile) does not lower its tile's price below its neighbours'. */
.fig-page .fig-tile__price {
  flex-wrap: wrap;
  align-content: flex-start;
  min-height: calc(var(--space-2) + 2.8em);
}

/* The questions: two columns from 700 px, the question in the text's weight, the answer muted. */
.fig-faq__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4) var(--space-6);
}

.fig-faq__q {
  margin: 0 0 var(--space-1);
  font-size: var(--text-md);
  font-weight: 700;
}

.fig-faq__a {
  margin: 0;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* The trail and the series' previous / next by number on one line (task 244). */
.fig-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.fig-crumbs > .sp-crumbs {
  margin: 0;
}

.fig-neighbours {
  display: flex;
  gap: var(--space-2);
  font-variant-numeric: tabular-nums;
}

/* ── The head (task 271, Figma 224:3): three cards of one height – the photo (288 px, its 248 px frame centred), who it
   is (the rest) and the price card (432 px: SetMine's two buttons need 392 inside). 20 px inside each, 12 between the
   who card's lines. ── */
.fig-hero {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr) 432px;
  gap: var(--space-4);
  align-items: stretch;
}

.fig-hero__photo {
  display: grid;
  place-items: center;
  padding: var(--space-5);
}

.fig-hero__frame {
  position: relative;
  display: block;
  width: 100%;
  max-width: 248px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: var(--radius-3);
  background: var(--figure-photo-bg);
  cursor: zoom-in;
}

.fig-hero__frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: var(--figure-photo-blend);
}

.fig-hero__frame:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.fig-hero__who {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-5);
}

.fig-hero__eyebrow {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

.fig-hero__title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}

.fig-hero__state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.fig-hero__state > [data-page-tools] {
  margin: 0;
}

/* The reader's part of the price card (Figma's SetMine): its two lines, then the buttons sharing the row (each grows),
   an administrator's «⋯» after them. A phone stacks them (below). */
.fig-mine__text {
  display: grid;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.fig-mine__title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 600;
}

.fig-mine__line {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.fig-mine__buttons {
  display: flex;
  gap: var(--space-2);
}

.fig-mine__buttons > .ui-btn {
  flex: 1 1 0;
  gap: var(--space-2);
  min-width: 0;
}

.fig-mine__buttons > .fig-mine__wished {
  flex: 0 0 auto;
}

.fig-mine__buttons .ui-icon,
.fig-mine__buttons svg {
  width: 18px;
  height: 18px;
}

.fig-mine__wished svg {
  fill: currentColor;
}

.fig-mine__buttons > .fig-more {
  flex: none;
}

/* A block's title (Figma: lg Bold), «Jak zdobyć sw0002», «Atrakcyjność inwestycyjna sw0002». */
.fig-block__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.35;
}

/* «Jak zdobyć» (task 271, Figma 233:7057): three tiles of one height on surface-2 – the figure alone, the cheapest set with
   «Kup zestaw ↗», the verdict; a 48 px picture, the label (xs 500 muted), the price (xl 700), a line (xs muted). */
.fig-get {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
}

.fig-get__tiles {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: var(--space-3);
}

.fig-get__tile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  min-height: 110px;
  padding: var(--space-4);
  border-radius: var(--radius-2);
  background: var(--surface-2);
}

.fig-get__tile--verdict {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-2);
}

.fig-get__thumb {
  display: block;
  flex: none;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: var(--radius-2);
  background: var(--photo-bg);
}

.fig-get__thumb--figure {
  background: var(--figure-photo-bg);
}

.fig-get__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fig-get__thumb--figure img {
  mix-blend-mode: var(--figure-photo-blend);
}

.fig-get__text {
  display: grid;
  flex: 1 1 auto;
  gap: var(--space-1);
  min-width: 0;
}

.fig-get__label {
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

.fig-get__label a {
  color: inherit;
  text-decoration: none;
}

.fig-get__tile--set:has(.fig-get__label a:hover) {
  background: var(--surface-3);
}

.fig-get__value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fig-get__line,
.fig-get__share {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.fig-get__share {
  color: var(--text);
  font-size: var(--text-sm);
}

.fig-get__buy {
  flex: none;
}

/* «Atrakcyjność inwestycyjna» (task 271, Figma 233:7078): the score's Stat tile (200 px) beside the parts, three across,
   24 px apart; the parts left out under them. */
.fig-score {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
}

.fig-score__body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.fig-score__parts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fig-score__total .ui-stat__value small {
  margin-left: 2px;
}

.fig-score__missing {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.fig-faq__summary {
  margin: 0;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* 901–1 280 px: the price card keeps its 432 px (its buttons), the photo's column narrows. */
@media (max-width: 1280px) {
  .fig-hero {
    grid-template-columns: 220px minmax(0, 1fr) 400px;
  }
}

/* The desktop page on a tablet (≤ 1 100 px): the photo beside who it is, the price card under them the full width; the
   ways and the score's parts one under another. */
@media (max-width: 1100px) {
  .fig-hero {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .fig-hero > .ui-figure-price {
    grid-column: 1 / -1;
  }

  .fig-get__tiles {
    grid-auto-flow: row;
  }

  .fig-get__tile {
    min-height: 0;
  }

  .fig-score__body {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

/* ── The phone's head (Figma 225:473): the 104 px photo beside the number and theme, the H1 (xl Bold) and the state; the
   price card, the facts and every block a card 16 px inside, 12 px apart. The buttons stack, the full width. ── */
.fig-m-who {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.fig-m-who__photo {
  flex: none;
  width: 104px;
  height: 104px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-3);
  background: var(--figure-photo-bg);
}

.fig-m-who__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: var(--figure-photo-blend);
}

.fig-m-who__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  min-width: 0;
}

.fig-m-who__title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.fig-m .ui-figure-price,
.fig-m .fig-get,
.fig-m .fig-score,
.fig-m-facts {
  padding: var(--space-4);
}

.fig-m .fig-get {
  gap: var(--space-2);
}

.fig-m .fig-get__buy {
  width: 100%;
}

.fig-m .fig-mine__buttons {
  flex-direction: column;
}

.fig-m .fig-mine__buttons > .ui-btn {
  flex: none;
  width: 100%;
}

.fig-m .fig-score {
  gap: var(--space-2);
}

.fig-m .fig-score__body,
.fig-m .fig-score__parts {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.fig-m .fig-score__body {
  gap: var(--space-2);
}


.fig-get__chip {
  justify-self: start;
}

/* A fact's link under a finger: 44 px to touch (task 105's floor) without making the 33 px row taller (Figma 225:549). */
@media (hover: none), (max-width: 900px) {
  .fig-facts a {
    position: relative;
  }

  .fig-facts a::after {
    content: "";
    position: absolute;
    inset: -13px -8px;
  }
}
