/* ==========================================================================
   Caption area (M-Caption): object title + subtitle + breadcrumb.
   Sits below the navigation and above the content (view-caption-area shell row).
   Token-based (light theme only). Migrated from inradr-app and
   modernized (no Bootstrap utilities; the breadcrumb-* classes are consolidated here
   and extended with ellipsis + responsive variants).
   ========================================================================== */

/* Shell row: auto height so it never consumes the single scroll surface (.inradr-content-body).
   Same horizontal gutter as the content toolbar and body, so the title lines up with the content.
   .view-caption-area is also the product-tour anchor (ProductTourSelectorBuilder.CaptionAreaSelector). */
.view-caption-area {
    flex: 0 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--inradr-space-sm);
    padding: var(--inradr-space-md) var(--inradr-content-gutter) var(--inradr-space-sm);
}

.inradr-caption {
    display: flex;
    flex-direction: column;
    gap: var(--inradr-space-sm);
}

/* Title on one row. */
.inradr-caption-heading {
    display: flex;
    align-items: center;
    gap: var(--inradr-space-lg);
}

.inradr-caption-title {
    margin: 0; /* rendered as h1 (WP-22) */
    font-size: var(--inradr-text-display-size);
    font-weight: var(--inradr-text-display-weight);
    line-height: 1.2; /* A's caption line box; the display token stays at 1 for its other uses */
    color: var(--inradr-color-text-heading);
    white-space: pre-wrap;
    word-break: break-word;
}

.inradr-caption-subtitle {
    font-size: var(--inradr-text-body-size);
    font-weight: var(--inradr-text-body-weight);
    line-height: var(--inradr-text-body-line-height);
    color: var(--inradr-color-text-muted);
    white-space: pre-wrap;
    word-break: break-word;
}

/* --- Breadcrumb ---------------------------------------------------------
   The design system's breadcrumb bar (story 86ca0v86t, which supersedes OQ-04 "the whole path accent"): an
   ordered list in a labelled nav; ancestors are accent links, menu groups and the current page heading-coloured text,
   a ">" in the heading colour between the items, 8px either side (Dark: see below). Only the clickable ancestors react to hover. */
.inradr-breadcrumb {
    display: flex;
    align-items: center;
    font-size: var(--inradr-text-h1-size);
    font-weight: var(--inradr-text-h1-weight);
    line-height: var(--inradr-text-h1-line-height);
    color: var(--inradr-color-text-heading);
}

.inradr-breadcrumb__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Generated with an empty alternative text, so a screen reader announces the list, not the separators. */
.inradr-breadcrumb__item + .inradr-breadcrumb__item::before {
    content: ">";
    content: ">" / "";
    margin-inline: var(--inradr-space-xs);
    color: var(--inradr-color-text-heading);
}

/* A menu group (no view of its own) and the current page: text, not links. */
.inradr-breadcrumb__group,
.inradr-breadcrumb-current {
    color: var(--inradr-color-text-heading);
}

/* Clickable ancestor segment — native button reset to inherit the breadcrumb typography. */
.inradr-breadcrumb-link {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: var(--inradr-color-accent);
    cursor: pointer;
}
.inradr-breadcrumb-link:hover {
    color: var(--inradr-color-accent-hover);
    text-decoration: underline;
}
.inradr-breadcrumb-link:focus-visible {
    outline: var(--inradr-focus-ring-width) solid var(--inradr-focus-ring-color);
    outline-offset: var(--inradr-focus-ring-offset);
}

/* Dark appearance (spec): clickable ancestors in Accent Blue Light, also on hover; groups, separators and the
   current page take the heading colour through --inradr-color-text-heading above. */
:root[data-theme="dark"] .inradr-breadcrumb-link,
:root[data-theme="dark"] .inradr-breadcrumb-link:hover {
    color: var(--inradr-color-accent-light);
}

.inradr-breadcrumb-ellipsis {
    user-select: none;
}

/* --- Responsive: desktop full · tablet first+…+last · mobile last only --- */
.inradr-breadcrumb--tablet,
.inradr-breadcrumb--mobile {
    display: none;
}

@media (max-width: 1024px) {
    .inradr-breadcrumb--desktop {
        display: none;
    }
    .inradr-breadcrumb--tablet {
        display: flex;
    }
}

@media (max-width: 640px) {
    .inradr-breadcrumb--tablet {
        display: none;
    }
    .inradr-breadcrumb--mobile {
        display: flex;
    }
    .inradr-breadcrumb {
        font-size: var(--inradr-text-h2-size);
    }
}
