/* 
    doug.css - Streamlined & Variable-Driven
    Nord Palette:
    Nord0:  #2E3440 (Dark BG)
    Nord4:  #D8DEE9 (Dark Text / Light Mode Meta)
    Nord6:  #ECEFF4 (Light Text / Dark Mode Link Hover)
    Nord9:  #81A1C1 (Light BG)
    Nord10: #5E81AC (Light Mode Pill / Icon)
    Nord13: #EBCB8B (Dark Mode Accent / Link)
*/

/* 1. VARIABLES & THEME CONFIGURATION */
:root {
    --font-sans: Helvetica, Arial, sans-serif;

    /* --- LIGHT MODE DEFAULTS (Nord9 Based) --- */
    --bg-color: #81A1C1;          /* Nord9 */
    --text-color: #FFFFFF;
    --meta-color: rgba(255, 255, 255, 0.8);
    --border-color: rgba(255, 255, 255, 0.3);

    /* Links & Accents */
    --link-color: #ECEFF4;        /* Nord6 (Subtle in light mode) */
    --link-hover: #FFFFFF;
    
    /* Navigation Pills (Visible) */
    --pill-bg: #5E81AC;           /* Nord10 */
    --pill-fg: #FFFFFF;
    --pill-bg-hover: #ECEFF4;
    --pill-fg-hover: #5E81AC;

    /* Tags (Text Only - Transparent) */
    --tag-fg: #FFFFFF;
    --tag-bg: transparent;
    --tag-hover-fg: #ECEFF4;
}

/* 2. DARK MODE (System + Toggle Override) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #2E3440;      /* Nord0 */
        --text-color: #ECEFF4;    /* Nord6 */
        --meta-color: #D8DEE9;    /* Nord4 */
        --border-color: #4C566A;  /* Nord3 */

        --link-color: #EBCB8B;    /* Nord13 (Orange/Yellow) */
        --link-hover: #FFFFFF;

        /* Nav Pills (Orange) */
        --pill-bg: #EBCB8B;       
        --pill-fg: #2E3440;
        --pill-bg-hover: rgba(235, 203, 139, 0.1);
        --pill-fg-hover: #EBCB8B;

        /* Tags (Text Only) */
        --tag-fg: #FFFFFF;
        --tag-hover-fg: #EBCB8B;
    }
}

/* Forced Dark Mode (Overrides System) */
[data-theme="dark"] {
    --bg-color: #2E3440 !important;
    --text-color: #ECEFF4 !important;
    --meta-color: #D8DEE9 !important;
    --border-color: #4C566A !important;
    --link-color: #EBCB8B !important;
    --link-hover: #FFFFFF !important;
    
    --pill-bg: #EBCB8B !important;
    --pill-fg: #2E3440 !important;
    --pill-bg-hover: rgba(235, 203, 139, 0.1) !important;
    --pill-fg-hover: #EBCB8B !important;

    --tag-fg: #FFFFFF !important;
    --tag-bg: transparent !important;
    --tag-hover-fg: #EBCB8B !important;
}

/* Forced Light Mode (Overrides System) */
[data-theme="light"] {
    --bg-color: #81A1C1 !important;
    --text-color: #FFFFFF !important;
    --meta-color: rgba(255, 255, 255, 0.8) !important;
    --border-color: rgba(255, 255, 255, 0.3) !important;
    --link-color: #ECEFF4 !important;
    --link-hover: #FFFFFF !important;

    --pill-bg: #5E81AC !important;
    --pill-fg: #FFFFFF !important;
    --pill-bg-hover: #ECEFF4 !important;
    --pill-fg-hover: #5E81AC !important;

    --tag-fg: #FFFFFF !important;
    --tag-bg: transparent !important;
    --tag-hover-fg: #ECEFF4 !important;
}

/* --------------------------------------------------------- */
/* BASE & LAYOUT */
/* --------------------------------------------------------- */

*, *:before, *:after { box-sizing: border-box; }

html {
    font: 1.35em var(--font-sans);
    background: var(--bg-color);
    min-height: 100vh;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5em;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 690px;
    margin: 0 auto;
    padding: 5% 20px;
}

/* --------------------------------------------------------- */
/* HEADER */
/* --------------------------------------------------------- */
header {
    position: relative;
    margin-bottom: 2em;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.site-title {
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
}

.site-logo-icon {
    fill: currentColor;
    opacity: 0.9;
}

/* Nav (Pills) */
nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap; 
}

nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--pill-fg);
    background: var(--pill-bg);
    text-decoration: none;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 0.8em;
    height: 32px;
    transition: all 0.2s ease;
}

nav a:hover, nav a.nav-current {
    background: var(--pill-bg-hover);
    color: var(--pill-fg-hover);
}

/* Header Utilities (RSS & Toggle) */
.header-utils {
    position: absolute;
    top: 2px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.util-link,
.util-button {
    color: var(--meta-color);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.util-link svg { width: 18px; height: 18px; display: block; }
.util-button { font-size: 1.2em; line-height: 1; }

.util-link:hover, .util-button:hover {
    color: var(--text-color);
}

/* --------------------------------------------------------- */
/* POST LIST (Minimalist) */
/* --------------------------------------------------------- */
.post-list {
    list-style: none;
    padding: 0;
    margin-top: 2em;
}

.post-item {
    display: flex;
    align-items: baseline; 
    gap: 15px;             
    padding: 4px 0;        
    border-bottom: 1px dashed var(--border-color);
}
.post-item:last-child { border-bottom: none; }

.post-date {
    font-family: monospace, var(--font-sans); 
    font-size: 0.85em;
    color: var(--meta-color);
    white-space: nowrap;      
    min-width: 90px;          
    text-align: right;        
}

.post-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
}
.post-link:hover {
    text-decoration: underline;
    text-decoration-color: var(--meta-color);
}

/* --------------------------------------------------------- */
/* SINGLE POST & CONTENT */
/* --------------------------------------------------------- */
.post-header { margin-bottom: 2em; }

.article-title {
    margin-top: 0;
    margin-bottom: 0.2em;
    line-height: 1.2;
    font-weight: 700;
}

.article-meta {
    font-size: 0.7em;
    color: var(--meta-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Tags (Variable Driven - Text Only) */
.article-meta a {
    color: var(--tag-fg) !important;
    background: var(--tag-bg) !important;
    text-decoration: none !important;
    font-weight: 700;
    padding: 0 !important;
    transition: all 0.2s ease;
}
.article-meta a:hover {
    color: var(--tag-hover-fg) !important;
    text-decoration: underline !important;
}

/* Content Typography */
.gh-content { font-weight: 400; }
.gh-content p { margin-bottom: 1em; }
.gh-content h2 { color: var(--text-color); margin-top: 1.5em; font-weight: 700; }
.gh-content h3 { font-weight: 500; }

/* Content Links (Variable Driven) */
.gh-content a {
    color: var(--link-color);
    background: none;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}
.gh-content a:hover {
    color: var(--link-hover);
}

/* Content Elements */
.gh-content blockquote {
    position: relative;
    margin: 1.5em 0;
    padding-left: 20px;
    font-size: 0.8em;
    border: 0;
}
.gh-content blockquote::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--text-color);
}

.gh-content ul, .gh-content ol { margin-left: 1.2em; padding-left: 0; }
.gh-content li { padding-bottom: 0.8em; }

.gh-content img { display: block; width: 100%; height: auto; margin: 0 auto; }
.gh-content figcaption {
    color: var(--meta-color);
    font-size: 0.85em;
    margin-top: 0.5em;
    text-align: center;
}

.gh-content hr {
    border: 0;
    border-top: 1px dashed var(--text-color);
    margin: 2em 0;
    opacity: 0.6;
}

/* --------------------------------------------------------- */
/* FOOTER */
/* --------------------------------------------------------- */
footer {
    margin-top: 3em;
    padding-top: 2em;
    border-top: 1px dashed var(--border-color);
    text-align: center;
    font-size: 0.7em;
    color: var(--meta-color);
}
footer a {
    color: var(--link-color);
    text-decoration: underline;
}
footer a:hover { color: var(--link-hover); }

/* --------------------------------------------------------- */
/* MOBILE */
/* --------------------------------------------------------- */
@media (max-width: 600px) {
    html { font-size: 1.1em; }
    .container { padding: 5% 15px; }
    
    .post-item { flex-direction: column; gap: 2px; padding: 8px 0; }
    .post-date { text-align: left; font-size: 0.75em; }
    
    .header-utils {
        position: static;
        margin-top: 10px;
        align-self: flex-end;
    }
}

