/* ============================================================
   Page header (.page-header)
   ------------------------------------------------------------
   Reusable list/detail page header: icon badge + title + meta
   (count / separator) on the left, primary action on the right.
   Consumes --ph-* theme tokens (theme/tokens.css).
   ============================================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--ph-border);
    border-radius: 0.5rem;
    background: var(--ph-bg);
    box-shadow: var(--ph-shadow);
}

.page-header__main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.85rem;
}

.page-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--ph-icon-border);
    border-radius: 0.5rem;
    background: var(--ph-icon-bg);
    color: var(--ph-icon-text);
    font-size: 1.05rem;
}

.page-header__copy {
    min-width: 0;
}

.page-header__title {
    margin: 0;
    color: var(--ph-title);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.page-header__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.25rem;
    color: var(--ph-meta);
    font-size: 0.84rem;
    font-weight: 500;
}

.page-header__count {
    display: inline-flex;
    align-items: center;
    min-height: 1.35rem;
    padding: 0.12rem 0.46rem;
    border-radius: 999px;
    background: var(--ph-count-bg);
    color: var(--ph-count-text);
    font-size: 0.76rem;
    font-weight: 800;
}

.page-header__separator {
    color: var(--ph-separator);
}

.page-header__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 1.15rem;
    border: 1px solid var(--ph-action-border);
    border-radius: 0.5rem;
    background: var(--ph-action-bg);
    color: var(--ph-action-text);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 2px var(--ph-action-shadow);
    transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.page-header__action i {
    font-size: 0.82rem;
}

.page-header__action:hover {
    border-color: var(--ph-action-hover-border);
    background: var(--ph-action-hover-bg);
    color: var(--ph-action-text);
    box-shadow: 0 6px 14px var(--ph-action-shadow);
    transform: translateY(-1px);
}

.page-header__action:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px var(--ph-action-shadow);
}

/* ── Accent variant (.page-header--accent) ──
   Opt-in emphasized primary action: gradient fill, inner highlight,
   hover glow, visible focus ring. Scoped via the modifier so the
   plain .page-header__action on other pages stays untouched. */
.page-header--accent .page-header__action {
    border: none;
    background: linear-gradient(180deg, var(--ph-action-grad-top), var(--ph-action-grad-bottom));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 1px 2px var(--ph-action-shadow),
        0 6px 16px var(--ph-action-shadow);
}

.page-header--accent .page-header__action:hover {
    background: linear-gradient(180deg, var(--ph-action-grad-top-hover), var(--ph-action-grad-bottom-hover));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 8px 20px var(--ph-action-shadow);
    transform: translateY(-1px);
}

.page-header--accent .page-header__action:focus-visible {
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 1px 2px var(--ph-action-shadow),
        0 0 0 0.22rem var(--ph-action-ring);
}

.page-header--accent .page-header__action:active {
    background: linear-gradient(180deg, var(--ph-action-grad-bottom), var(--ph-action-grad-bottom));
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.22);
    transform: translateY(0);
}

.page-header--accent .page-header__action i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.7rem;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header__action {
        width: fit-content;
    }
}

@media (max-width: 575.98px) {
    .page-header__main {
        align-items: flex-start;
    }

    .page-header__action {
        width: 100%;
    }
}
