/* Journal. B&W brutalist, matches maloudongelmans.com style.
   Green neon accent is a single CSS var; swap the hex or remove the rule
   to take it away entirely. */

:root {
    --accent: #00FF41;
    --border: 3px solid #000;
    --max-width: 720px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url('/chezmalou_cursor.png') 25 25, auto;
}

html, body { height: auto; }

body {
    font-family: 'BDO Grotesk', Arial, sans-serif;
    background: white;
    color: black;
    line-height: 1.55;
    font-size: 18px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
}
a:hover {
    background: var(--accent);
    text-decoration: none;
}

/* Header, matches existing site */
.site-header {
    padding: 30px 40px;
    border-bottom: var(--border);
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}
.site-header .home-link {
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
}
.site-header nav a {
    margin-left: 2rem;
    text-decoration: none;
}

/* Main content */
main {
    flex: 1;
    padding: 40px;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Journal index */
.journal-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}
.journal-header p {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

.post-list { list-style: none; }
.post-list li {
    padding: 2rem 0;
    border-bottom: 1px solid #000;
    display: grid;
    grid-template-columns: 4rem 1fr;
    gap: 1.5rem;
    align-items: start;
}
.post-list li:first-child { padding-top: 0; }
.post-list .episode-num {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
}
.post-list time {
    font-size: 0.85rem;
    opacity: 0.65;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
    .post-list li { grid-template-columns: 3rem 1fr; gap: 1rem; }
    .post-list .episode-num { font-size: 1.8rem; }
}
.post-list h2 {
    font-size: 1.6rem;
    margin: 0.3rem 0 0.6rem;
    line-height: 1.2;
}
.post-list h2 a { text-decoration: none; }
.post-list h2 a:hover { background: var(--accent); }
.post-list p {
    font-size: 1rem;
    opacity: 0.85;
    text-align: justify;
    hyphens: auto;
}

/* Visual palette block (used for art / design posts) */
.palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0 2rem;
}
.palette-swatch {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.75rem;
    font-size: 0.8rem;
    line-height: 1.3;
    border: 1px solid #000;
    color: inherit;
    text-align: left;
    hyphens: none;
}
.palette-swatch b { display: block; font-size: 0.95rem; margin-bottom: 0.25rem; }
.palette-swatch code { font-size: 0.72rem; background: transparent; padding: 0; opacity: 0.85; }

/* Post page */
.post-header { margin-bottom: 2.5rem; }
.post-header .post-meta-line {
    font-size: 0.9rem;
    opacity: 0.7;
    margin: 0 0 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
}
.post-header .episode-label {
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.post-header time {
    font-variant-numeric: tabular-nums;
}
.post-header h1 {
    font-size: 2.6rem;
    line-height: 1.1;
}
.post-body h2 {
    font-size: 1.6rem;
    margin: 2.5rem 0 1rem;
}
.post-body h3 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
}
.post-body p {
    margin: 1em 0;
    text-align: justify;
    hyphens: auto;
}
.post-body ul, .post-body ol {
    margin: 1em 0;
    padding-left: 2rem;
}
.post-body li {
    margin: 0.4em 0;
    text-align: justify;
    hyphens: auto;
}
.post-body pre {
    background: #000;
    color: #fff;
    padding: 1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    border: var(--border);
}
.post-body code {
    background: #f4f4f4;
    padding: 0.15em 0.35em;
    border: 1px solid #000;
    font-size: 0.9em;
    font-family: 'Courier New', Courier, monospace;
}
.post-body pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}
.post-body blockquote {
    border-left: var(--border);
    margin: 1.5rem 0;
    padding-left: 1.5rem;
    font-style: italic;
}
.post-body em, .post-body i { font-style: italic; }
.post-body strong, .post-body b { font-weight: 700; }

/* Subscribe block */
.subscribe-block {
    margin: 4rem 0 2rem;
    padding: 2rem;
    border: var(--border);
}
.subscribe-block h3 {
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
}
.subscribe-block p {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    opacity: 0.85;
}
.subscribe-form {
    display: flex;
    gap: 0;
}
.subscribe-form input {
    flex: 1;
    padding: 0.85rem 1rem;
    border: var(--border);
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: black;
}
.subscribe-form input:focus {
    outline: none;
    background: #f4f4f4;
}
.subscribe-form button {
    padding: 0.85rem 1.75rem;
    border: var(--border);
    border-left: none;
    font-size: 1rem;
    font-family: inherit;
    background: black;
    color: white;
    font-weight: 700;
    cursor: pointer;
    text-transform: lowercase;
}
.subscribe-form button:hover {
    background: var(--accent);
    color: black;
}

/* Post footer */
.post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: var(--border);
}
.post-footer a {
    text-decoration: none;
    font-weight: 700;
}

/* Site footer */
.site-footer {
    margin-top: 4rem;
    padding: 2rem;
    border-top: var(--border);
    text-align: center;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
    }
    .site-header nav a:first-child { margin-left: 0; }
    main { padding: 1.5rem; }
    .post-header h1 { font-size: 2rem; }
    .journal-header h1 { font-size: 2.2rem; }
    .subscribe-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    .subscribe-form button {
        border-left: var(--border);
    }
}

/* Glossary drawer, slides in from the left below the header */
.glossary-toggle {
    display: inline-block;
    margin: 0 0 3rem;
    padding: 0.6rem 1.1rem;
    background: #000;
    color: white;
    border: 2px solid #000;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0;
}
.glossary-toggle:hover { background: var(--accent); color: #000; }

.glossary-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.22s ease;
    z-index: 20;
}
.glossary-backdrop.open { opacity: 1; }

.glossary-drawer {
    position: fixed;
    top: 92px;
    left: 0;
    bottom: 0;
    width: 440px;
    max-width: 92vw;
    background: white;
    border-right: var(--border);
    border-top: var(--border);
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    z-index: 30;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}
.glossary-drawer.open { transform: translateX(0); }

.glossary-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #000;
    background: white;
    position: sticky;
    top: 0;
    z-index: 1;
}
.glossary-drawer-header h2 {
    font-size: 1.6rem;
    margin: 0;
    line-height: 1;
}
.glossary-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.4rem;
    color: #000;
}
.glossary-close:hover { background: var(--accent); }

.glossary-drawer-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
}
.glossary-intro {
    margin: 0 0 1.5rem;
    opacity: 0.75;
    font-size: 0.95rem;
    line-height: 1.5;
}

.glossary-search { display: block; margin-bottom: 2rem; }
#glossary-search {
    width: 100%;
    padding: 1.15rem 1.25rem;
    border: 2px solid #000;
    background: white;
    font: inherit;
    font-size: 1.05rem;
    border-radius: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
#glossary-search:focus { outline: none; background: var(--accent); }

.glossary-list { margin: 0; display: block; }
.glossary-entry {
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}
.glossary-entry:first-child { padding-top: 0; }
.glossary-entry:last-child { border-bottom: none; padding-bottom: 0; }
.glossary-entry dt {
    font-size: 1rem;
    margin-bottom: 0.45rem;
    line-height: 1.4;
}
.glossary-term {
    background: var(--accent);
    color: #000;
    padding: 0.1em 0.35em;
    font-weight: 700;
    border-radius: 0;
}
.glossary-full {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.9rem;
    margin-left: 0.3em;
}
.glossary-entry dd {
    margin: 0;
    line-height: 1.55;
    font-size: 0.95rem;
    text-align: justify;
    hyphens: auto;
}
.glossary-ep {
    font-size: 0.82rem;
    opacity: 0.65;
    margin-left: 0.35em;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.glossary-ep:hover { background: var(--accent); text-decoration: none; opacity: 1; }
.glossary-empty { opacity: 0.6; font-style: italic; }

body.glossary-open { overflow: hidden; }

@media (max-width: 600px) {
    .glossary-drawer { top: 76px; width: 100vw; max-width: 100vw; border-right: none; }
    .glossary-drawer-body { padding: 1.25rem; }
}
