/* Sirona Page Title — general title bar: icon badge, subtitle, chip and actions */

sirona-page-title {
    display: block;
}

/* Reserve the bar's space before the script upgrades the element, so the page doesn't jump. */
sirona-page-title:not(:defined) {
    min-height: 4.5rem;
    background: linear-gradient(90deg, #186FB5 0%, #1a7cc4 100%);
    border-top-left-radius: 0.375em;
    border-top-right-radius: 0.375em;
}

flex-row.title.spt {
    align-items: center;
    gap: 0.875rem;
}

/* ─── Back arrow ──────────────────────────────────────────────────────────── */

/* Same size as the icon badge so the two sit evenly; borderless so it reads as a control, not a badge. */
.spt__back {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6rem;
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.spt__back:hover {
    background-color: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.spt__back:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ─── Icon badge ──────────────────────────────────────────────────────────── */

.spt__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    background-color: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 1.05rem;
}

/* ─── Heading & subtitle ──────────────────────────────────────────────────── */

.spt__text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.spt__text > h1 {
    color: #fff !important;
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.025em;
}

.spt__subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Chip ────────────────────────────────────────────────────────────────── */

/* A flat status label, deliberately not button-like: no border, faint tint, small caps. */
.spt__chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.25rem;
    background-color: rgba(0, 0, 0, 0.14);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

.spt__chip i {
    font-size: 0.65rem;
    opacity: 0.85;
}

/* ─── Actions (author-supplied children) ────────────────────────────────── */

.spt__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ─── Narrow screens ──────────────────────────────────────────────────────── */

@media (max-width: 576px) {
    .spt__icon { width: 2rem; height: 2rem; font-size: 0.9rem; }
    .spt__subtitle { display: none; }
}

/* ─── High contrast ───────────────────────────────────────────────────────── */

[data-theme="high-contrast"] .spt__icon,
[data-theme="high-contrast"] .spt__chip {
    background: #000 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}

[data-theme="high-contrast"] .spt__text > h1,
[data-theme="high-contrast"] .spt__subtitle {
    color: #fff !important;
}
