/* Figure page (item-page.html). Builds on home-format.css for the navbar, tokens,
   sections, card rows, price range bar and footer. No boxed panels: the photo and the
   price lead, and the rest is sections separated by hairlines. */

.ip-status {
    margin: 40px 0;
    text-align: center;
    color: var(--ff-text-secondary);
}

.ip-status[hidden] {
    display: none;
}

.ip-status a {
    color: var(--ff-text);
}

.ip-muted {
    margin: 0;
    font-size: 14px;
    color: var(--ff-text-secondary);
}

/* ===== Breadcrumb + title ===== */
.ip-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--ff-text-secondary);
}

.ip-crumbs a {
    color: var(--ff-text-secondary);
    text-decoration: none;
}

.ip-crumbs a:hover {
    color: var(--ff-text);
}

.ip-crumbs [aria-current] {
    color: var(--ff-text);
}

.ip-head h1 {
    max-width: 30ch;
    margin: 0;
    font-size: clamp(24px, 2.8vw, 34px);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.ip-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 10px 0 0;
    font-size: 15px;
}

.ip-sub a {
    color: var(--ff-text-secondary);
    text-decoration: none;
}

.ip-sub a:hover {
    color: var(--ff-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ip-sub a.ip-sub__series {
    font-weight: 600;
    color: var(--ff-text);
}

.ip-sub__dot {
    color: var(--ff-text-secondary);
}

/* ===== Top: photos | price, actions, counts, where to buy ===== */
.ip-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
    margin-top: 28px;
}

.ip-gallery__main {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--ff-photo);
    border-radius: 4px;
}

.ip-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ip-gallery__strip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.ip-thumbs {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 3px;
    scrollbar-width: none;
}

.ip-thumb {
    flex: 0 0 56px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    background: var(--ff-photo);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

.ip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

.ip-thumb:hover {
    opacity: 1;
}

.ip-thumb:focus-visible {
    opacity: 1;
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.ip-thumb[aria-current="true"] {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--ff-text);
}

/* 44px so they're easy to tap */
.ip-arrow {
    flex: 0 0 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--ff-text);
    background: transparent;
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    cursor: pointer;
}

.ip-arrow:hover {
    border-color: var(--ff-text-secondary);
}

.ip-arrow:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.ip-arrow[hidden] {
    display: none;
}

.ip-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== The price ===== */
.ip-quote__label {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ff-text-secondary);
}

.ip-quote__line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 16px;
    margin: 0 0 6px;
}

.ip-quote__value {
    font-size: clamp(36px, 4vw, 48px);
    font-weight: 650;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.ip-quote__value.is-empty {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ff-text-secondary);
}

/* "▲ +139% vs RRP": direction colours, never gold */
.ip-change {
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ip-change[hidden] {
    display: none;
}

.ip-change--up   { color: var(--ff-up); }
.ip-change--down { color: var(--ff-down); }

.ip-retail {
    margin: 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--ff-text-secondary);
}

/* Where the exchange rates come from, under the prices */
.ip-rates {
    margin: 0;
    font-size: 12px;
    color: var(--ff-text-secondary);
}

.ip-rates:empty {
    display: none;
}

.ip-range {
    margin-top: 22px;
}

/* The headline above already says "RRP → average (change)", so the bar's own summary
   line is kept for screen readers only here */
.ip-range .hm-range__summary {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.ip-range[hidden],
.ip-muted[hidden] {
    display: none;
}

.ip-quote > .ip-muted {
    margin-top: 14px;
}

/* ⓘ beside "eBay average". The note opens on hover, keyboard focus, or a tap (.is-open,
   set by details.js since touch screens don't hover); Escape closes it (.is-dismissed).
   It hangs from the heading row, not the icon, so it never runs off a phone screen. */
.ip-quote__head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
}

.ip-quote__head .ip-quote__label {
    margin: 0;
}

.ip-info__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ff-text-secondary);
    cursor: help;
}

.ip-info__btn:hover,
.ip-info.is-open .ip-info__btn {
    color: var(--ff-text);
}

.ip-info__btn:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.ip-info__tip {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    width: max-content;
    max-width: min(300px, 100%);
    padding: 10px 12px;
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    background: var(--ff-card);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);   /* lifts it off the gold button below */
    font-size: 13px;
    line-height: 1.45;
    color: var(--ff-text);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.12s, visibility 0.12s;
}

.ip-info:hover .ip-info__tip,
.ip-info:has(.ip-info__btn:focus-visible) .ip-info__tip,
.ip-info.is-open .ip-info__tip {
    visibility: visible;
    opacity: 1;
}

.ip-info.is-dismissed .ip-info__tip {
    visibility: hidden;
    opacity: 0;
}

/* Phones give every button a 44px tap area; negative margins keep the icon's look */
@media (max-width: 767px) {
    .ip-info__btn {
        margin: -11px;
    }
}

/* ===== Collect | Favourite | Share ===== */
.ip-actions {
    display: flex;
    gap: 8px;
}

.ip-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--ff-text);
    background: transparent;
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s ease, filter 0.15s ease;
}

.ip-btn:hover {
    border-color: var(--ff-text-secondary);
}

/* Add to collection: the one primary (gold) action on the page */
.ip-btn--primary {
    flex: 2;
    color: #0E0F11;
    background: var(--ff-gold);
    border-color: var(--ff-gold);
}

.ip-btn--primary:hover {
    border-color: var(--ff-gold);
    filter: brightness(1.08);
}

/* Favourite: a secondary toggle. Pressed shows a filled heart, never the gold fill. */
.ip-btn--heart .ip-heart {
    color: var(--ff-heart);
}

.ip-btn--heart.is-on {
    border-color: var(--ff-heart);
}

.ip-btn--heart.is-on .ip-heart {
    fill: currentColor;
}

.ip-btn--icon {
    flex: 0 0 44px;
    padding: 0;
}

.ip-btn:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

/* "4 owners · 7 favourites · 2 public collections" */
.ip-social {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin: -8px 0 0;
    font-size: 13px;
    color: var(--ff-text-secondary);
}

.ip-social b {
    font-weight: 600;
    color: var(--ff-text);
}

.ip-social[hidden] {
    display: none;
}

/* With the counts line hidden too, the nudge takes its place under the buttons */
.ip-first + .ip-social:not([hidden]) {
    margin-top: -14px;
}

/* ===== Sections under a hairline (Where to buy, Price history, Details) ===== */
.ip-block {
    padding-top: 18px;
    border-top: 1px solid var(--ff-line);
}

.ip-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.ip-block__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ip-block > .ip-block__title {
    margin-bottom: 8px;
}

/* Where to buy: ledger rows */
.ip-buy {
    display: flex;
    flex-direction: column;
}

.ip-listing {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: var(--ff-text);
    text-decoration: none;
    border-bottom: 1px solid var(--ff-line);
}

.ip-listing:hover .ip-listing__title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ip-listing:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.ip-listing__src {
    flex: 0 0 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--ff-text-secondary);
    border: 1px solid var(--ff-card-border);
    border-radius: 4px;
}

.ip-listing__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ip-listing__title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ip-listing__meta {
    font-size: 12px;
    color: var(--ff-text-secondary);
}

.ip-listing__price {
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ip-buy > .ip-muted {
    padding: 4px 0;
}

/* ===== Add to collection dialog ===== */
.ip-dialog {
    width: min(460px, calc(100vw - 32px));
    padding: 0;
    color: var(--ff-text);
    background: var(--ff-card);
    border: 1px solid var(--ff-card-border);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.ip-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.ip-dialog__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
}

.ip-dialog__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.ip-dialog__sub {
    margin: 0;
    font-size: 14px;
    color: var(--ff-text-secondary);
}

.ip-dialog__list {
    display: flex;
    flex-direction: column;
    max-height: min(50vh, 360px);
    margin: 4px 0 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    border-top: 1px solid var(--ff-line);
}

.ip-pick {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--ff-line);
    cursor: pointer;
}

.ip-pick input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ff-gold);
}

.ip-pick:has(input:focus-visible) {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.ip-pick__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ip-pick__text strong {
    font-size: 15px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.ip-pick__text small {
    font-size: 13px;
    color: var(--ff-text-secondary);
}

.ip-dialog__status {
    min-height: 1.2em;
    margin: 0;
    font-size: 14px;
}

.ip-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
}

.ip-dialog__btn {
    min-height: 44px;
    padding: 0 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--ff-text);
    background: transparent;
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    cursor: pointer;
}

.ip-dialog__btn:hover {
    border-color: var(--ff-text-secondary);
}

.ip-dialog__btn--gold {
    color: #0E0F11;
    background: var(--ff-gold);
    border-color: var(--ff-gold);
}

.ip-dialog__btn--gold:hover {
    border-color: var(--ff-gold);
}

.ip-dialog__btn:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

/* While a report is sending the button stays focusable (so focus isn't lost), it just
   looks and acts inactive */
.ip-dialog__btn[aria-disabled="true"] {
    opacity: 0.6;
    cursor: progress;
}

/* ===== Report a problem (report-problem.js) ===== */
/* A quiet text link: it's there when needed, never competing with the price */
.ip-report-link {
    align-self: flex-start;
    padding: 0;
    font: inherit;
    font-size: 13px;
    color: var(--ff-text-secondary);
    background: none;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.ip-report-link:hover {
    color: var(--ff-text);
}

.ip-report-link:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
    border-radius: 2px;
}

.ip-quote > .ip-report-link {
    display: block;
    margin-top: 14px;
}

.ip-report__reasons {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 4px 0 0;
    padding: 0;
    border: 0;
}

/* The rule goes under the legend, not on the fieldset, where it would run into it */
.ip-report__legend {
    padding: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.ip-report__reasons .ip-pick:first-of-type {
    border-top: 1px solid var(--ff-line);
}

.ip-report__reasons .ip-pick {
    min-height: 44px;
}

.ip-report__label {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
}

.ip-report__optional {
    font-weight: 400;
    color: var(--ff-text-secondary);
}

.ip-report__note {
    width: 100%;
    min-height: 76px;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ff-text);
    background: var(--ff-track);
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    resize: vertical;
    color-scheme: dark;
}

.ip-report__note::placeholder {
    color: var(--ff-text-secondary);
}

.ip-report__note:hover {
    border-color: var(--ff-text-secondary);
}

.ip-report__note:focus {
    outline: none;
    border-color: var(--ff-gold);
}

.ip-report__count {
    margin: -4px 0 0;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--ff-text-secondary);
}

.ip-report__error {
    color: var(--ff-down);
}

.ip-report__error:empty {
    min-height: 0;
}

/* ===== Middle: price history | details ===== */
.ip-mid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
    margin-top: 48px;
}

.ip-ranges {
    display: flex;
    gap: 2px;
}

.ip-ranges button {
    min-width: 40px;
    padding: 5px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--ff-text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
}

.ip-ranges button:hover {
    color: var(--ff-text);
}

.ip-ranges button.is-active {
    color: var(--ff-text);
    border-color: var(--ff-card-border);
}

.ip-ranges button:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.ip-chart {
    position: relative;
    min-height: 220px;
}

/* Not enough history: one line of text, not a big empty box */
.ip-chart.is-empty {
    min-height: 0;
}

.ip-chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.ip-chart__grid { stroke: var(--ff-line); }
.ip-chart__axis { fill: var(--ff-text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
.ip-chart__area { fill: rgba(237, 238, 240, 0.06); }
.ip-chart__line { fill: none; stroke: var(--ff-text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ip-chart__dot { fill: var(--ff-text); }
.ip-chart__rrp { stroke: var(--ff-gold); stroke-width: 1.5; stroke-dasharray: 6 5; }

.ip-chart__empty {
    margin: 0;
    padding: 4px 0;
    font-size: 14px;
    color: var(--ff-text-secondary);
}

.ip-chart-note {
    margin-top: 10px;
    font-size: 13px;
}

.ip-chart-note b {
    font-weight: 600;
    color: var(--ff-text);
}

/* Details: label | value rows under hairlines */
.ip-specs {
    margin: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    font-size: 14px;
}

.ip-specs dt,
.ip-specs dd {
    padding: 10px 0;
    border-bottom: 1px solid var(--ff-line);
}

.ip-specs dt {
    padding-right: 16px;
    color: var(--ff-text-secondary);
}

.ip-specs dd {
    margin: 0;
    font-weight: 500;
    text-align: right;
    overflow-wrap: anywhere;
}

.ip-specs dd a {
    color: var(--ff-text);
    text-decoration: underline;
    text-decoration-color: var(--ff-card-border);
    text-underline-offset: 3px;
}

.ip-specs dd a:hover {
    text-decoration-color: var(--ff-text);
}

/* ===== Card rows ===== */
/* "38% overlap" on Collectors also own cards, in place of the product line tag */
.ip-overlap {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ff-text);
    background: var(--ff-pill-bg);
    border-radius: 3px;
}

/* ===== Public collections ===== */
.ip-collections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.ip-collection {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ip-collection__preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 4px;
}

.ip-collection__preview > * {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--ff-photo);
    border-radius: 3px;
}

.ip-collection__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

.ip-collection__preview .is-this {
    outline: 2px solid var(--ff-gold);
    outline-offset: -2px;
}

.ip-collection__more {
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #0E0F11;
}

.ip-collection__name {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.ip-collection__meta {
    font-size: 13px;
    color: var(--ff-text-secondary);
}

/* ===== Smaller screens ===== */
@media (max-width: 900px) {
    .ip-top,
    .ip-mid {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
}

@media (max-width: 600px) {
    .ip-top {
        margin-top: 20px;
    }

    .ip-btn__label {
        font-size: 13px;
    }

    .ip-ranges button {
        min-width: 44px;
        min-height: 44px;
    }

    /* Series / character / maker links: 44px tall to tap */
    .ip-sub a,
    .ip-specs a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .ip-report-link {
        min-height: 44px;
    }

    .ip-quote > .ip-report-link {
        margin-top: 4px;
    }

    /* The report dialog uses more of a phone screen, so the reason hints still fit */
    .ip-report__form {
        padding: 20px 16px;
    }

    .ip-report__form .ip-dialog__btn {
        flex: 1 1 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ip-thumb,
    .ip-btn {
        transition: none;
    }
}
