/* =============================================================================
   Main stylesheet for catherinebrewer.github.io (Jekyll version)
   =============================================================================
   This is the single CSS file used across all pages via the default layout.
   To change the colour scheme, edit the --variable values in :root / :root.dark.
   To change the font, edit the font-family in html {}.
   ============================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Colour palette (light mode) -------------------------------------------
   Change these variables to retheme the whole site at once. */
:root {
    --text: #2c3e50;
    --background: #fffef5;
    --accent: #a8968a;
    --secondary: #8b8680;
    --link: #0000EE;
    --max-width: 660px;
}

/* --- Colour palette (dark mode) -------------------------------------------- */
:root.dark {
    --text: #e8e6e3;
    --background: #2a2826;
    --accent: #9b8b7e;
    --secondary: #a8a098;
    --link: #8AB4F8;
}

/* --- Per-layout width and alignment overrides ------------------------------
   The body gets a class matching the layout name (set in _layouts/default.html).
   This lets post pages be wider and top-aligned while the home page stays
   compact and centred. To change the width of a section, edit here. */

/* Daily posts */
body.post {
    --max-width: 720px;
    align-items: flex-start; /* start from top, not vertically centred */
    padding-top: 4rem;
}

/* WIP posts */
body.wip_post {
    --max-width: 700px;
    align-items: flex-start;
    padding-top: 4rem;
}

/* --- Base typography -------------------------------------------------------- */
html {
    font-size: 18px;
    line-height: 1;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    color: var(--text);
    background: var(--background);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

body::before {
    display: none;
}

/* --- Main content container ------------------------------------------------
   Controls the max width of all page content.
   Change --max-width in :root to widen/narrow the content column. */
.container {
    max-width: var(--max-width);
    width: 100%;
    position: relative;
    z-index: 1;
}

/* --- Headings -------------------------------------------------------------- */
h1 {
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    display: inline-block;
    transition: transform 0.5s ease;
}

/* Fun wiggle on hover — remove if you want it more serious */
h1:hover {
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

h2 {
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

/* --- Body text ------------------------------------------------------------- */
.subtitle {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* .bio is used on the home page paragraphs */
.bio {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* --- Links ----------------------------------------------------------------- */
a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
    padding-bottom: 2px;
}

a:hover {
    border-bottom-color: var(--link);
}

/* --- Navigation link row (home page) --------------------------------------- */
.links {
    color: var(--link);
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    font-size: 0.95rem;
}

.links a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
    padding-bottom: 2px;
}

.links a:hover {
    border-bottom-color: var(--link);
}

/* --- Post list (daily writing, WIP index) ---------------------------------- */
/* A plain <ul> with no bullets, used to list posts by date */
.post-list {
    list-style: none;
    margin-top: 2rem;
}

.post-list li {
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* The date prefix, e.g. "2024-12-29" — styled in muted colour, monospaced digits */
.post-date {
    color: var(--secondary);
    font-size: 0.95rem;
    margin-right: 1rem;
    font-variant-numeric: tabular-nums;
}

/* --- Individual post styling ------------------------------------------------ */
/* The header block at the top of each post (date + title) */
.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--secondary);
}

.post-date-header {
    color: var(--secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0;
}

/* The body of a post */
.post-content {
    margin-top: 2rem;
}

/* Lists inside posts.
   IMPORTANT: the global `* { padding: 0 }` reset strips the browser's default
   padding-left on <ul>, which is what creates space for the bullet marker.
   We restore it here with padding-left — do not change this to margin-left
   or bullets will be clipped/invisible. */

/* Top-level lists */
.post-content ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.post-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Nested lists — Google Docs-style clean indentation.
   No vertical line; just indent and change markers per level. */
.post-content li > ul,
.post-content li > ol {
    padding-left: 1.5rem;
    margin-left: 0.2rem;
    margin-top: 0.3rem;
    margin-bottom: 0.1rem;
}

/* Ordered list sub-levels: 1 → a → i */
.post-content ol ol { list-style-type: lower-alpha; }
.post-content ol ol ol { list-style-type: lower-roman; }

/* Unordered list sub-levels: disc → circle */
.post-content ul ul { list-style-type: circle; }

.post-content li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
    font-size: 1.05rem;
}

/* Blockquotes — used for pull quotes, epigraphs, etc. */
.post-content blockquote {
    border-left: 2px solid var(--accent);
    padding: 0.2rem 0 0.2rem 1.5rem;
    margin: 1.5rem 0;
    color: var(--secondary);
    font-style: italic;
}

.post-content blockquote p {
    margin-bottom: 0.4rem;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Images inside posts */
.post-content img {
    max-width: 580px;
    height: auto;
    display: block;
    margin: 1rem 0;
}

/* --- Back link (bottom of posts and secondary pages) ----------------------- */
.back-link {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--secondary);
}

/* --- Dark/light mode toggle button (top-right corner) ---------------------- */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.theme-toggle:hover {
    background: var(--text);
    color: var(--background);
    transform: scale(1.05);
}

/* --- Home page headshot layout ---------------------------------------------
   Image sits to the left of the bio text in a flex row.
   On narrow screens it stacks vertically. */
.home-intro {
    display: flex;
    gap: 2rem;
    align-items: stretch;       /* both columns grow to the same height */
    margin-bottom: 0;
}

.headshot-figure {
    flex-shrink: 0;
    text-align: center;
    display: flex;
    flex-direction: column;     /* image on top, caption below */
}

.headshot-figure img {
    width: 130px;
    flex: 1;                    /* fill the figure's height (= text column height) */
    min-height: 0;              /* allow flex shrinking below natural image size */
    object-fit: cover;
    object-position: center top;
    border-radius: 4px;
    display: block;
}

.headshot-caption {
    font-size: 0.78rem;
    color: var(--secondary);
    font-style: italic;
    margin-top: 0.4rem;
    max-width: 130px;
    line-height: 1.3;
}

/* Stack on mobile — image goes below text */
@media (max-width: 768px) {
    .home-intro {
        flex-direction: column-reverse;
    }
}

/* --- Optional circular profile photo (old, kept for reference) ------------- */
.photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 2rem;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.photo:hover {
    filter: grayscale(0%);
}

/* --- Footer ---------------------------------------------------------------- */
.footer {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Mobile responsive ----------------------------------------------------- */
@media (max-width: 600px) {
    html {
        font-size: 18px;
    }

    body {
        padding-top: 5rem; /* push content below the fixed toggle button */
    }

    h1 {
        font-size: 1.8rem;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }

    .art {
        right: -30%;
        opacity: 0.05;
    }

    /* Wrap nav links on small screens */
    .links {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* --- Print styles ---------------------------------------------------------- */
@media print {
    .theme-toggle, .art, .footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}

/* --- Footnotes ------------------------------------------------------------- */
.footnotes {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--secondary);
}
