/* ══════════════════════════════════════════════════════════════════════════
   publicne.ws — Shared components
   Used across operators (index), admin, and stylebook.
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── Floating pill nav ──────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 14px;
    background: color-mix(in oklab, var(--bg) 82%, transparent);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--line);
    border-radius: 100px;
    font-family: var(--f-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.04em;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.03),
        0 10px 30px -16px rgba(0, 0, 0, 0.2);
    max-width: calc(100vw - 2 * max(14px, env(safe-area-inset-left)));
}

.nav__mark {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    border-right: 1px solid var(--line);
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    color: var(--fg);
}
.nav__mark b {
    font-weight: 600;
}
.nav__mark .sep {
    color: var(--red);
    font-weight: 600;
}

.nav__dot {
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    animation: pulse 2s var(--ease) infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in oklab, var(--red) 50%, transparent);
    }
    70% {
        box-shadow: 0 0 0 8px color-mix(in oklab, var(--red) 0%, transparent);
    }
    100% {
        box-shadow: 0 0 0 0 color-mix(in oklab, var(--red) 0%, transparent);
    }
}

.nav__links {
    display: none;
    gap: 16px;
    padding: 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.nav__links a {
    color: var(--fg-muted);
    transition: color 200ms var(--ease);
}
.nav__links a:hover,
.nav__links a[aria-current="page"] {
    color: var(--fg);
}
.nav__links a[aria-current="page"] {
    color: var(--red);
}

.nav__theme {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--fg);
    transition:
        background 200ms var(--ease),
        transform 300ms var(--ease);
}
.nav__theme:hover {
    background: var(--bg-3);
    transform: rotate(-25deg);
}
.nav__theme i {
    font-size: 15px;
}
.nav__theme .ph-sun,
.nav__theme .ph-fill.ph-sun {
    display: none;
}
[data-theme="dark"] .nav__theme .ph-moon {
    display: none;
}
[data-theme="dark"] .nav__theme .ph-sun,
[data-theme="dark"] .nav__theme .ph-fill.ph-sun {
    display: block;
}

@media (min-width: 760px) {
    .nav__links {
        display: flex;
    }
}

/* ─── Metadata strip (4-cell) ───────────────────────────────────────── */
.strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    font-family: var(--f-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.04em;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.strip__item {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-right: 1px solid var(--line);
    min-width: 0;
}
.strip__item:nth-child(2n) {
    border-right: 0;
}
.strip__item span {
    color: var(--fg-muted);
    text-transform: uppercase;
}
.strip__item b {
    color: var(--fg);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.strip__item b.live {
    color: var(--red);
}

@media (min-width: 760px) {
    .strip {
        grid-template-columns: repeat(4, 1fr);
    }
    .strip__item {
        border-right: 1px solid var(--line);
    }
    .strip__item:last-child {
        border-right: 0;
    }
}

/* ─── Chips ──────────────────────────────────────────────────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-family: var(--f-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid var(--line-2);
    border-radius: 99px;
    color: var(--fg-soft);
    white-space: nowrap;
}
.chip--type {
    border-color: var(--fg);
    color: var(--fg);
}
.chip--status {
    padding-left: 6px;
}

/* ─── Dots (status) ─────────────────────────────────────────────────── */
.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.dot--live {
    background: var(--red);
    animation: tinyPulse 1.8s var(--ease) infinite;
}
.dot--standby {
    background: var(--amber);
}
.dot--idle {
    background: var(--fg-muted);
}
.dot--alert {
    background: var(--red);
    animation: tinyPulse 1.6s var(--ease) infinite;
}

@keyframes tinyPulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in oklab, var(--red) 55%, transparent);
    }
    70% {
        box-shadow: 0 0 0 6px color-mix(in oklab, var(--red) 0%, transparent);
    }
    100% {
        box-shadow: 0 0 0 0 color-mix(in oklab, var(--red) 0%, transparent);
    }
}

/* ─── Section head (operators + stylebook chapters) ─────────────────── */
.head {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-5);
    margin-bottom: var(--s-8);
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--fg);
}
.head__eyebrow {
    font-family: var(--f-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-muted);
    display: flex;
    gap: 10px;
    align-items: center;
}
.head__eyebrow b {
    color: var(--red);
    font-weight: 600;
}
.head__title {
    margin: 0;
    font-family: var(--f-display);
    font-weight: 800;
    font-size: var(--fs-2xl);
    line-height: 0.9;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.head__title .red {
    color: var(--red);
}
.head__meta {
    font-family: var(--f-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

@media (min-width: 760px) {
    .head {
        grid-template-columns: 1fr auto;
        align-items: end;
        gap: var(--s-6);
    }
}

/* ─── Colophon (footer) ─────────────────────────────────────────────── */
.colophon {
    border-top: 2px solid var(--fg);
    padding: var(--s-8) 0 calc(var(--s-6) + env(safe-area-inset-bottom));
    font-family: var(--f-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.04em;
    color: var(--fg-muted);
}
.colophon__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-5);
}
.colophon__col h4 {
    margin: 0 0 10px;
    font-family: var(--f-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg);
}
.colophon__col p,
.colophon__col ul {
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 1.8;
}
.colophon__col li a {
    transition: color 180ms var(--ease);
}
.colophon__col li a:hover {
    color: var(--red);
}
.colophon__brand {
    margin-top: var(--s-8);
    padding-top: var(--s-4);
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.colophon__brand b {
    color: var(--fg);
    font-weight: 600;
}
.colophon__brand .red {
    color: var(--red);
}

@media (min-width: 760px) {
    .colophon__grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: var(--s-8);
    }
}
