/* ==========================================================================
   /version-control.php — TAIL_VERSION_CONTROL (V95, Sprint 11 handoff
   "Version Control", part CH). The house style of /vulnerability-scan.php:
   orange prompt headline, Source Code Pro headings, #fdfdfc panels, thin
   teal rules, no rounded cards, emojis or shadows. Order: build line, intro,
   Manual Update Protocol, roadmap (Phase 7–9), changelog (DB rows).
   The changelog body_html (admin/seed HTML) keeps its markup: its lists and
   the v0.0.1 .incident-report render in this page style below.
   Secondary text uses --text-dim (#666, 5.6:1 on #fdfdfc) where the draft
   wrote the off-palette slate #475569.
   ========================================================================== */

.vc-main {
    text-align: left;
    padding-bottom: 40px;
}

.vc-section {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
    color: var(--text-main);
    font-size: 1.05rem;
}

/* base.css styles every h1 as the centered lowercase brand flex row —
   this one is a plain left-aligned headline (vulnerability-scan.css pattern) */
.vc-title {
    display: block;
    font-family: var(--font-code);
    font-weight: 700;
    font-size: clamp(1.3rem, 3.5vw, 1.7rem);
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
    text-align: left;
    text-wrap: balance;
    overflow-wrap: break-word;   /* TAIL_VERSION_CONTROL is one long token */
    color: var(--brand-orange);
    margin: 0 0 18px;
}

.vc-title-sub {
    font-weight: 400;
    color: #2F7A86;
}

/* the build line: CURRENT BUILD v<manuscript_version> BUILD DATE <manuscript_date> */
.vc-build {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin: 0 0 32px;
    padding: 10px 16px;
    background: var(--bg-light);
    border: 1px solid rgba(var(--brand-blue-rgb), 0.2);
    border-radius: 6px;
    font-family: var(--font-code);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-dim);
}

.vc-build-key {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.08em;
}

.vc-build-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-orange);
    animation: vc-pulse 2.5s ease-in-out infinite;
}

@keyframes vc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.vc-build-value {
    font-size: 0.95rem;
    color: var(--dark-teal);
}

.vc-intro {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.vc-intro p,
.manual-update-panel p,
.vc-history-intro {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-main);
    text-wrap: pretty;
}

/* Manual Update Protocol: one framed block, the CTA + its subline in a row */
.manual-update-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 32px 0 0;
    padding: 20px 22px;
    background: rgba(var(--brand-blue-rgb), 0.04);
    border: 1px solid rgba(var(--brand-orange-rgb), 0.35);
    border-radius: 6px;
}

.manual-update-chip {
    font-family: var(--font-code);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--brand-orange);
    text-transform: uppercase;
}

.manual-update-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-top: 4px;
}

.cta-button {
    display: inline-block;
    background: var(--dark-teal);
    color: #fff;
    font-family: var(--font-code);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    padding: 14px 22px;
    border-radius: 4px;
    white-space: nowrap;   /* one line at 320px too (the closing "]" never wraps alone) */
    transition: background 0.2s ease;
}

.cta-button:hover,
.cta-button:focus-visible {
    background: var(--brand-blue);
    color: #fff;
}

.cta-sub {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.vc-heading {
    margin: 48px 0 14px;
    font-family: var(--font-code);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--brand-orange);
    text-transform: uppercase;
    text-align: left;
    text-wrap: balance;
    overflow-wrap: break-word;
}

/* Roadmap: one row per phase — label + time left, title — sentence right */
.roadmap-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(var(--brand-blue-rgb), 0.2);
}

.roadmap-row {
    display: grid;
    grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr);
    gap: 2px 24px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(var(--brand-blue-rgb), 0.2);
}

.roadmap-row-phase {
    display: flex;
    flex-direction: column;
    gap: 0 10px;
    font-family: var(--font-code);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.7;
    color: var(--brand-orange);
    white-space: nowrap;
}

.roadmap-row-when {
    font-weight: 400;
    color: var(--text-dim);
}

.roadmap-row-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dim);
    text-wrap: pretty;
}

.roadmap-row-title {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--dark-teal);
}

/* Changelog: compact rows that open in place (details/summary: keyboard
   and screen reader toggle for free) */
.vc-history-intro {
    margin-bottom: 16px;
}

.vc-history-panel {
    padding: 4px 22px;
    background: var(--bg-light);
    border: 1px solid rgba(var(--brand-blue-rgb), 0.2);
    border-radius: 6px;
}

.history-log {
    list-style: none;
    margin: 0;
    padding: 0;
}

.history-log > li + li {
    border-top: 1px dashed rgba(var(--brand-blue-rgb), 0.3);
}

.history-row-head {
    display: grid;
    grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr) auto;
    gap: 4px 24px;
    align-items: baseline;
    padding: 18px 0;
    cursor: pointer;
    list-style: none; /* removes the default <summary> triangle */
    transition: background 0.2s ease;
}

.history-row-head::-webkit-details-marker {
    display: none;
}

.history-row--static .history-row-head {
    cursor: default;
}

.history-row-head:hover {
    background: rgba(var(--brand-blue-rgb), 0.04);
}

.history-row-head:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

.history-row-version {
    font-family: var(--font-code);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--brand-orange);
    white-space: nowrap;
}

.history-row-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.history-row-title {
    font-family: var(--font-code);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--dark-teal);
}

.history-row-period {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.history-row-copy {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dim);
    text-wrap: pretty;
}

/* Explicit text label "[ SHOW DETAILS ▾ ]" / "[ HIDE DETAILS ▾ ]": both
   labels are real text; CSS swaps which one shows on open. */
.history-row-toggle {
    align-self: start;
    font-family: var(--font-code);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #2F7A86;
    white-space: nowrap;
}

.history-row-toggle-hide,
.history-row[open] .history-row-toggle-show {
    display: none;
}

.history-row[open] .history-row-toggle-hide {
    display: inline;
}

.history-row-chevron {
    display: inline-block;
    transition: transform 0.2s ease;
}

.history-row[open] .history-row-chevron {
    transform: rotate(180deg);
}

/* the opened log, indented to the title column */
.history-row-body {
    padding: 0 0 18px calc(8.5em + 24px);
    color: var(--text-main);
}

.history-row-body p {
    margin: 0 0 14px 0;
    font-size: 1rem;
    line-height: 1.7;
    text-wrap: pretty;
}

.history-row-body > p.history-row-status {
    margin: 0 0 12px 0;
    font-family: var(--font-code);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.6;
    color: #2F7A86;
}

.history-row-status span {
    color: var(--dark-teal);
}

/* Log lists read at body-copy size with the site's ">" marker, classed
   (.list-protocol, whose base.css li is 1.1rem / 20px) or not (the admin
   BODY takes raw HTML). The `ul li`/`ol li` form (0,1,2) is deliberate: it
   must outrank base.css's `.list-protocol li` (0,1,1) regardless of order. */
.history-row-body ul,
.history-row-body ol {
    list-style: none;
    padding: 0;
    margin: 0 0 14px 0;
    font-size: 1rem;
    line-height: 1.7;
}

.history-row-body ul li,
.history-row-body ol li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.7;
}

.history-row-body ul li::before,
.history-row-body ol li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--brand-blue);
    font-weight: 900;
}

/* the v0.0.1 incident report (body_html markup) in the page style:
   a framed #fdfdfc block with a teal header bar */
.incident-report {
    margin: 20px 0 8px;
    background: var(--bg-light);
    border: 1px solid rgba(var(--brand-blue-rgb), 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.incident-report-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 14px;
    padding: 8px 16px;
    background: #2F7A86;
    color: #fff;
    font-family: var(--font-code);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.incident-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    padding: 14px 20px 0;
    font-family: var(--font-code);
    font-size: 0.78rem;
    color: var(--text-dim);
}

.incident-report-body {
    padding: 14px 20px 4px;
}

@media (max-width: 640px) {
    .roadmap-row {
        grid-template-columns: minmax(0, 1fr);
    }
    .roadmap-row-phase {
        flex-direction: row;
        flex-wrap: wrap;
    }
    /* the version label moves above its title; the toggle keeps its own
       column, spanning both rows */
    .history-row-head {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 12px;
    }
    .history-row-version,
    .history-row-main {
        grid-column: 1;
    }
    /* a range label ("v0.1.x – v0.4.x") wraps at its spaces; nowrap ran it
       19px under the toggle at 320px (live review 2026-10-14) */
    .history-row-version {
        white-space: normal;
    }
    .history-row-toggle {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    .history-row-body {
        padding-left: 0;
    }
}

/* the one-line CTA (nowrap) fits the panel's content box down to 320px */
@media (max-width: 340px) {
    .cta-button {
        padding: 14px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vc-build-dot { animation: none; }
    .cta-button,
    .history-row-head,
    .history-row-chevron { transition: none; }
}

/* House rule: every element given a CSS display keeps [hidden] working. */
.vc-title[hidden],
.vc-build[hidden],
.vc-build-key[hidden],
.vc-build-dot[hidden],
.vc-intro[hidden],
.manual-update-panel[hidden],
.manual-update-cta[hidden],
.cta-button[hidden],
.roadmap-row[hidden],
.roadmap-row-phase[hidden],
.history-row-head[hidden],
.history-row-main[hidden],
.history-row-chevron[hidden],
.history-row-toggle-hide[hidden],
.history-row[open] .history-row-toggle-hide[hidden],
.incident-report-header[hidden],
.incident-report-meta[hidden] {
    display: none;
}
