/* ===========================================================================
   GROTESK.GROUP // JOURNAL
   Reuses the existing "Corporate Brutalism" design system (see design.md):
   - Times New Roman for prose & headings (The Classical)
   - Space Mono / Courier for system labels (The Technical)
   - Palette: system grey #c0c0c0, system blue #000080, black, white
   - 3D bevels, hard borders, dotted rules
   No new design language is introduced — only a reading-friendly layout, since
   the SPA's style.css (overflow:hidden / 100vh) is unsuitable for long text.
   =========================================================================== */

@import url('/fonts/space-mono.css');

:root {
    --os2-grey: #c0c0c0;
    --os2-blue: #000080;
    --os2-border-light: #ffffff;
    --os2-border-dark: #808080;
    --os2-border-black: #000000;
    --dot: #808080;
    --paper: #ffffff;
    --ink: #000000;
    --mono: 'Space Mono', 'Courier New', Courier, monospace;
    --serif: "Times New Roman", Times, serif;
    --measure: 68ch; /* ~65–75 characters per line for body text */
}

* {
    box-sizing: border-box;
}

html {
    background: var(--os2-grey);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background:
        radial-gradient(circle at 50% 0%, #ffffff 0%, #eeeeee 55%, var(--os2-grey) 100%);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.6;
}

a {
    color: var(--os2-blue);
}

/* --- Minimal OS/2 loading strip (matches style.css on the main site) ------ */
#load-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 99999;
    background: var(--os2-grey);
    border-bottom: 1px solid var(--os2-border-black);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.15s ease;
}

#load-bar.active {
    opacity: 1;
}

#load-bar::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 32%;
    background: var(--os2-blue);
    animation: load-bar-slide 1s linear infinite;
}

@keyframes load-bar-slide {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(420%); }
}

/* --- Header: same system bar as buy.html's .shop-header ------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 2px solid var(--os2-border-black);
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
}

.site-header a {
    color: var(--ink);
    text-decoration: none;
}

.site-header .brand {
    font-weight: 700;
}

.site-header nav {
    display: flex;
    gap: 10px;
}

/* Real OS/2 push-buttons — identical bevel logic to .os2-btn in style.css */
.site-header nav a.os2-btn {
    background: var(--os2-grey);
    border: 2px solid;
    border-color: var(--os2-border-light) var(--os2-border-dark) var(--os2-border-dark) var(--os2-border-light);
    padding: 4px 12px;
    font-weight: 700;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.site-header nav a.os2-btn:active {
    border-color: var(--os2-border-dark) var(--os2-border-light) var(--os2-border-light) var(--os2-border-dark);
    transform: translate(1px, 1px);
    box-shadow: none;
}

.site-header nav a.os2-btn[aria-current="page"] {
    color: var(--os2-blue);
}

/* --- Main column --------------------------------------------------------- */
.journal {
    flex: 1 0 auto;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 40px 22px 64px;
}

/* OS/2 window title bar, reused from better.html's .window-bar ------------- */
.window-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    color: #fff;
    background: linear-gradient(180deg, #666 0%, #000 100%);
    border: 2px solid var(--os2-border-black);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    text-shadow: 1px 1px #000;
}

.window-buttons {
    display: flex;
    gap: 4px;
}

.window-buttons i {
    display: block;
    width: 13px;
    height: 13px;
    background: var(--os2-grey);
    border: 1px solid;
    border-color: var(--os2-border-light) var(--os2-border-dark) var(--os2-border-dark) var(--os2-border-light);
}

/* --- Journal index ------------------------------------------------------- */
.journal-index-head {
    margin: 22px 0 28px;
    padding-bottom: 14px;
    border-bottom: 2px dotted var(--dot);
}

.journal-index-head h1 {
    margin: 0;
    font-size: clamp(40px, 9vw, 74px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.9;
}

.journal-index-head .lede {
    margin: 12px 0 0;
    font-style: italic;
    color: #222;
}

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

.post-list-item {
    border-bottom: 1px dotted var(--dot);
}

.post-list-item a {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 6px 22px;
    padding: 18px 4px;
    color: inherit;
    text-decoration: none;
}

.post-list-item a:hover {
    background: rgba(0, 0, 128, 0.05);
}

.post-list-item time {
    grid-column: 1;
    grid-row: 1 / span 2;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--os2-blue);
    padding-top: 6px;
}

.post-list-title {
    grid-column: 2;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.post-list-desc {
    grid-column: 2;
    font-style: italic;
    color: #333;
}

.empty {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--os2-border-dark);
}

/* --- Individual post ----------------------------------------------------- */
.post-head {
    margin: 22px 0 30px;
    padding-bottom: 18px;
    border-bottom: 2px dotted var(--dot);
}

.post-kicker {
    margin: 0 0 14px;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
}

.post-kicker a {
    text-decoration: none;
}

.post-head h1 {
    margin: 0;
    font-size: clamp(34px, 7vw, 56px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.02;
}

.post-meta {
    margin: 16px 0 0;
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    color: var(--os2-blue);
}

.post-meta .sep {
    margin: 0 8px;
    color: var(--dot);
}

/* Reading column: ~65–75 characters per line */
.post-body {
    max-width: var(--measure);
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote {
    margin: 0 0 1.25em;
}

.post-body h2 {
    margin: 1.8em 0 0.5em;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.15;
}

.post-body h3 {
    margin: 1.6em 0 0.4em;
    font-size: 21px;
    font-weight: 700;
}

.post-body ul,
.post-body ol {
    padding-left: 1.4em;
}

.post-body li {
    margin-bottom: 0.4em;
}

.post-body blockquote {
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--os2-border-black);
    font-style: italic;
    color: #222;
}

.post-body a {
    overflow-wrap: anywhere;
}

.post-body code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 0 4px;
}

/* Video embed: an OS/2 media window inside the reading column ------------- */
.post-embed {
    margin: 1.8em 0;
}

.post-embed .embed-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 2px solid var(--os2-border-black);
    border-top: 0;
}

.post-embed iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Comment log: an OS/2 window of quoted audience reactions --------------- */
.post-comments {
    margin: 1.8em 0;
}

.post-comments .comment-list {
    padding: 0;
    margin: 0;
    background: #fff;
    border: 2px solid var(--os2-border-black);
    border-top: 0;
    list-style: none;
}

.post-comments .comment {
    padding: 12px 14px;
    border-bottom: 2px dotted var(--dot);
}

.post-comments .comment:last-child {
    border-bottom: 0;
}

.post-comments .comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin: 0 0 4px;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    color: #333;
}

.post-comments .comment-handle {
    font-weight: 700;
    color: var(--os2-blue);
}

.post-comments .comment-body {
    margin: 0;
    font-size: 0.95em;
}

.post-body hr {
    margin: 2em 0;
    border: 0;
    border-top: 2px dotted var(--dot);
}

/* --- Footer -------------------------------------------------------------- */
.site-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 18px;
    padding: 14px 14px;
    background: #fff;
    border-top: 2px solid var(--os2-border-black);
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    color: #333;
}

.site-footer a {
    color: var(--os2-blue);
    text-decoration: none;
}

/* --- Small screens ------------------------------------------------------- */
@media (max-width: 600px) {
    body {
        font-size: 17px;
    }

    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .post-list-item a {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .post-list-item time {
        grid-row: auto;
    }

    .post-list-title,
    .post-list-desc {
        grid-column: 1;
    }
}
