/* ============================================================
   DEVLOG (/devlog)
   ------------------------------------------------------------
   A log sheet clipped to the machine: a left rail of dates and
   a right column of entries, ruled off from each other by the
   same hairline the rest of the gate uses. Palette, type and
   spacing come from reset.css — this file adds no colours of
   its own beyond the four change tags, which have to be told
   apart at a glance and so borrow the semantic tokens.

   Loaded after auth.css and before touch.css/responsive.css,
   so its own breakpoints sit at the same widths as the gate's
   (900px = tablet and below, 600px = phone).
   ============================================================ */

.auth-logpage .auth-section { text-align: left; }
.auth-logpage .auth-board-head { text-align: center; }

.auth-log {
    list-style: none;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3vh, 34px);
}

/**
 * One entry.
 *
 * Two columns on a wide window: when it happened, and what happened. The date
 * column is fixed rather than sized to content so every entry's prose starts on
 * the same vertical line — a ragged left edge down a page of paragraphs is what
 * makes a log look like a pile of notes.
 */
.auth-log-entry {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: clamp(16px, 2.4vw, 32px);
    padding: clamp(18px, 2.4vw, 26px);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--bg-2), var(--bg-1) 65%);
}

/* The newest entry is the one the page exists to show */
.auth-log-entry:first-child { border-color: var(--accent-dim); }

.auth-log-when {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    align-items: flex-start;
    /* The date follows a long entry down the screen instead of scrolling away
       from the paragraph it belongs to. */
    position: sticky;
    top: 84px;
    align-self: start;
}

.auth-log-date {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
    white-space: nowrap;
}

.auth-log-entry:first-child .auth-log-date { color: var(--accent); }

/* A hash, set as one: mono, quiet, and never wrapped mid-word */
.auth-log-commit {
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-inset);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: var(--text-3);
    white-space: nowrap;
}

.auth-log-body { min-width: 0; }

.auth-log-title {
    font-family: var(--font-display);
    font-size: clamp(19px, 2.1vw, 24px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: var(--text-1);
    margin-bottom: var(--sp-3);
    overflow-wrap: anywhere;
}

.auth-log-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}

/**
 * Who wrote it.
 *
 * A filled chip rather than an outlined one, so it does not read as another
 * tag: the tags say what the entry is about, this says who is speaking.
 */
.auth-log-author {
    padding: 3px 8px;
    border-radius: var(--radius);
    background: var(--bg-3);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
}

.auth-log-author[data-role="agent"] { color: var(--accent-strong); }

.auth-log-tag {
    padding: 3px 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}

.auth-log-summary {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-2);
    max-width: 68ch;
    margin-bottom: var(--sp-4);
}

.auth-log-changes {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    border-top: 1px solid var(--line);
    padding-top: var(--sp-4);
}

/**
 * A change line: what kind, then what.
 *
 * The tag column is fixed for the same reason the date column is — four ragged
 * tags down the left of a list is noise where a straight edge costs nothing.
 */
.auth-log-change {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: var(--sp-3);
    align-items: baseline;
}

.auth-log-type {
    justify-self: start;
    padding: 2px 7px;
    border: 1px solid currentColor;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Four states, four semantic colours. Nothing else on the page is coloured, so
   the tag carries the meaning without a legend. */
.auth-log-type[data-type="added"]   { color: var(--ok); }
.auth-log-type[data-type="changed"] { color: var(--info); }
.auth-log-type[data-type="fixed"]   { color: var(--warn); }
.auth-log-type[data-type="removed"] { color: var(--bad); }

.auth-log-change-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-2);
    overflow-wrap: anywhere;
}

/* ---------- Tablet and below ---------- */

@media (max-width: 900px) {
    /* The date column costs a third of the width to say six characters, so the
       stamp folds onto one line above the entry and the prose gets the page. */
    .auth-log-entry {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--sp-3);
    }

    .auth-log-when {
        position: static;
        flex-direction: row;
        align-items: center;
        gap: var(--sp-3);
        padding-bottom: var(--sp-2);
        border-bottom: 1px solid var(--line);
    }

    .auth-log { max-width: 660px; }
    .auth-log-summary { max-width: none; }
}

/* ---------- Phone ---------- */

@media (max-width: 600px) {
    .auth-log { gap: var(--sp-5); }

    .auth-log-entry {
        padding: var(--sp-4);
        /* Edge-to-edge at this width: side borders on a 360px screen cost more
           reading width than the framing is worth. */
        border-inline: 0;
        border-radius: 0;
        margin-inline: calc(-1 * var(--sp-3));
    }

    .auth-log-title { font-size: 18px; }
    .auth-log-summary { font-size: 14px; }

    /* A fixed tag column leaves ~26 characters for the text beside it. The tag
       goes above its line instead, which is the only way this reads as prose
       rather than as a narrow table. */
    .auth-log-change {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--sp-1);
    }

    .auth-log-change-text { font-size: 13.5px; }

    /* Tap targets are irrelevant here — nothing in an entry is interactive —
       so the metadata row shrinks rather than growing. */
    .auth-log-meta { gap: 6px; }
}

/* The entries are the page's whole content; on a short landscape phone the
   headline block above them is what has to give way. */
@media (max-height: 520px) and (orientation: landscape) {
    .auth-logpage .auth-board-head { padding-bottom: var(--sp-3); }
    .auth-logpage .auth-section-sub { margin-bottom: var(--sp-4); }
}
