/*
Theme Name: Charlie Monroe 2026
Theme URI: https://software.charliemonroe.net
Author: Charlie Monroe Software
Description: Lightweight blog theme matching the 2026 Charlie Monroe Software site. Light and dark modes, no dependencies.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: charliemonroe2026
*/

/* ─── Design tokens (mirrors site2026 header.php) ─────────────── */
:root {
    --ink:      #fafafa;
    --surface:  #ffffff;
    --card:     #ffffff;
    --rim:      rgba(10, 10, 20, .09);
    --rim-hi:   rgba(10, 10, 20, .18);
    --text:     #16161d;
    --muted:    #6b6b80;
    --link:     #5c34c2;
    --header-bg: rgba(250, 250, 250, .85);
    --code-bg:  rgba(10, 10, 20, .05);
    --r-pill:   999px;
    --r-card:   16px;
    --ff-head:  'Outfit', sans-serif;
    --ff-body:  'DM Sans', sans-serif;
    --grad:     linear-gradient(90deg, #FF5236, #dc3893, #AA84EC, #4FAAFF, #85BA64);
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink:      #0b0b12;
        --surface:  #111119;
        --card:     #17171f;
        --rim:      rgba(255, 255, 255, .07);
        --rim-hi:   rgba(255, 255, 255, .14);
        --text:     #ededf4;
        --muted:    #787892;
        --link:     #AA84EC;
        --header-bg: rgba(11, 11, 18, .85);
        --code-bg:  rgba(255, 255, 255, .06);
    }
}

/* Manual toggle overrides (set on <html> by theme.js) */
html[data-theme="light"] {
    --ink:      #fafafa;
    --surface:  #ffffff;
    --card:     #ffffff;
    --rim:      rgba(10, 10, 20, .09);
    --rim-hi:   rgba(10, 10, 20, .18);
    --text:     #16161d;
    --muted:    #6b6b80;
    --link:     #5c34c2;
    --header-bg: rgba(250, 250, 250, .85);
    --code-bg:  rgba(10, 10, 20, .05);
}
html[data-theme="dark"] {
    --ink:      #0b0b12;
    --surface:  #111119;
    --card:     #17171f;
    --rim:      rgba(255, 255, 255, .07);
    --rim-hi:   rgba(255, 255, 255, .14);
    --text:     #ededf4;
    --muted:    #787892;
    --link:     #AA84EC;
    --header-bg: rgba(11, 11, 18, .85);
    --code-bg:  rgba(255, 255, 255, .06);
}

/* ─── Base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: var(--ff-body);
    font-size: 17px;
    line-height: 1.7;
    transition: background .2s, color .2s;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--ff-head);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    margin: 1.6em 0 .5em;
}
h1 { font-size: 2.2rem; margin-top: 0; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

/* ─── Header (mirrors .cm-header on site2026) ─────────────────── */
.cm-header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--rim);
}
.cm-header__in {
    max-width: 1120px; margin: 0 auto; padding: 0 48px;
    display: flex; align-items: center; gap: 24px; height: 60px;
}
.cm-header__logo {
    font-family: var(--ff-head); font-weight: 800; font-size: 16px;
    color: var(--text); flex-shrink: 0;
}
.cm-header__logo:hover { text-decoration: none; }
.cm-header__logo span {
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.cm-nav {
    display: flex; align-items: center; gap: 4px;
    list-style: none; margin: 0; padding: 0; flex: 1;
}
.cm-nav li { margin: 0; }
.cm-nav a {
    display: block; padding: 6px 12px; border-radius: var(--r-pill);
    font-family: var(--ff-head); font-size: 13.5px; font-weight: 700;
    color: var(--muted);
    transition: color .18s, background .18s;
}
.cm-nav a:hover { color: var(--text); background: var(--code-bg); text-decoration: none; }
.cm-nav a.active,
.cm-nav .current-menu-item a { color: var(--text); background: var(--code-bg); }
.cm-header__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.theme-toggle {
    background: none; border: 1px solid var(--rim); border-radius: var(--r-pill);
    width: 32px; height: 32px; cursor: pointer; color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px; line-height: 1; padding: 0;
    transition: color .18s, border-color .18s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--rim-hi); }

.cm-header__burger {
    display: none; flex-direction: column; gap: 5px;
    cursor: pointer; padding: 6px;
    background: none; border: none;
}
.cm-header__burger span {
    display: block; width: 22px; height: 2px;
    background: var(--muted); border-radius: 2px;
}
@media (max-width: 700px) {
    .cm-header__in { padding: 0 20px; }
    .cm-nav { display: none; }
    .cm-nav.open {
        display: flex; flex-direction: column; align-items: stretch; gap: 2px;
        position: absolute; top: 60px; left: 0; right: 0;
        background: var(--surface); border-bottom: 1px solid var(--rim);
        padding: 12px 16px 16px;
    }
    .cm-header__burger { display: flex; }
}

/* ─── Layout ──────────────────────────────────────────────────── */
.site-main {
    max-width: 1120px; margin: 0 auto; padding: 48px;
}
@media (max-width: 700px) { .site-main { padding: 24px 20px; } }

.page-title { font-size: 2rem; margin: 0 0 4px; }
.page-subtitle { color: var(--muted); margin: 0 0 32px; }

/* Category pills row */
.cat-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 36px; padding: 0; list-style: none; }
.cat-pills a {
    display: block; padding: 8px 18px;
    border: 1px solid var(--rim); border-radius: var(--r-pill);
    font-family: var(--ff-head); font-weight: 700; font-size: 14px;
    color: var(--text); background: var(--card);
    transition: border-color .18s;
}
.cat-pills a:hover { border-color: var(--rim-hi); text-decoration: none; }

/* ─── Post cards ──────────────────────────────────────────────── */
.post-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px;
}
@media (max-width: 800px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
    background: var(--card);
    border: 1px solid var(--rim);
    border-radius: var(--r-card);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: border-color .18s, transform .18s;
}
.post-card:hover { border-color: var(--rim-hi); transform: translateY(-2px); }
.post-card__thumb { display: block; aspect-ratio: 1.9; overflow: hidden; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__meta { font-size: 13px; color: var(--muted); }
.post-card__pin { color: var(--link); font-family: var(--ff-head); font-weight: 700; }
.post-card.sticky { border-color: var(--rim-hi); }
.post-card__title { margin: 0; font-size: 1.35rem; }
.post-card__title a { color: var(--text); }
.post-card__title a:hover { text-decoration: none; }
.post-card__excerpt { margin: 0; color: var(--muted); font-size: 15px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin: 48px 0 0; font-family: var(--ff-head); font-weight: 700; }
.pagination .page-numbers {
    padding: 6px 14px; border-radius: var(--r-pill);
    border: 1px solid var(--rim); color: var(--muted);
}
.pagination .page-numbers.current { color: var(--text); border-color: var(--rim-hi); }
.pagination a.page-numbers:hover { color: var(--text); text-decoration: none; }

/* ─── Single article ──────────────────────────────────────────── */
.article { max-width: 760px; margin: 0 auto; }
.article__meta { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.article__title { font-size: 2.4rem; margin: 0 0 16px; }
.article__hero { border-radius: var(--r-card); overflow: hidden; margin: 24px 0; border: 1px solid var(--rim); }
.article__hero img { display: block; width: 100%; }

/* Content typography — lists get visible bullets, unlike the old theme. */
.entry-content { font-size: 17px; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content ul,
.entry-content ol {
    margin: 0 0 1.2em;
    padding-left: 1.5em;
    list-style-position: outside;
}
.entry-content ul { list-style-type: disc; }
.entry-content ul ul { list-style-type: circle; }
.entry-content ol { list-style-type: decimal; }
.entry-content li { margin: .35em 0; }
.entry-content li::marker { color: var(--muted); }
.entry-content blockquote {
    margin: 1.4em 0; padding: .1em 1.2em;
    border-left: 3px solid var(--rim-hi);
    color: var(--muted);
}
.entry-content code, .entry-content pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .9em;
    background: var(--code-bg);
    border-radius: 6px;
}
.entry-content code { padding: 2px 6px; }
.entry-content pre { padding: 16px; overflow-x: auto; }
.entry-content pre code { padding: 0; background: none; }
.entry-content img { border-radius: 12px; }
.entry-content a { text-decoration: underline; text-decoration-color: var(--rim-hi); }
.entry-content hr { border: none; border-top: 1px solid var(--rim); margin: 2em 0; }
.entry-content table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; }
.entry-content th, .entry-content td { border: 1px solid var(--rim); padding: 8px 12px; text-align: left; }

/* Tags */
.article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; }
.article__tags a {
    padding: 4px 14px; border: 1px solid var(--rim); border-radius: var(--r-pill);
    font-size: 13px; font-family: var(--ff-head); font-weight: 700;
    color: var(--muted);
    transition: color .18s, border-color .18s;
}
.article__tags a:hover { color: var(--text); border-color: var(--rim-hi); text-decoration: none; }

/* Prev / next */
.post-nav {
    display: flex; justify-content: space-between; gap: 16px;
    margin: 48px auto 0; max-width: 760px;
    border-top: 1px solid var(--rim); padding-top: 24px;
    font-family: var(--ff-head); font-weight: 700; font-size: 14px;
}
.post-nav a { color: var(--muted); max-width: 48%; }
.post-nav a:hover { color: var(--text); text-decoration: none; }

/* ─── Comments ────────────────────────────────────────────────── */
.comments-area { max-width: 760px; margin: 56px auto 0; border-top: 1px solid var(--rim); padding-top: 32px; }
.comments-title { font-size: 1.3rem; margin-top: 0; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-body {
    background: var(--card); border: 1px solid var(--rim); border-radius: var(--r-card);
    padding: 16px 20px; margin-bottom: 16px;
}
.comment-meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.comment-meta b { color: var(--text); font-family: var(--ff-head); }
.comment-content { font-size: 15px; }
.comment-content p:last-child { margin-bottom: 0; }
.reply { font-size: 13px; font-family: var(--ff-head); font-weight: 700; }
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea,
.search-field {
    width: 100%; padding: 10px 14px;
    background: var(--card); color: var(--text);
    border: 1px solid var(--rim); border-radius: 10px;
    font-family: var(--ff-body); font-size: 15px;
}
.comment-respond input:focus, .comment-respond textarea:focus, .search-field:focus {
    outline: none; border-color: var(--rim-hi);
}
.comment-form p { margin: 0 0 14px; }
.submit, .search-submit, .wp-block-button__link {
    display: inline-block; padding: 10px 24px;
    background: var(--text); color: var(--ink);
    border: none; border-radius: var(--r-pill);
    font-family: var(--ff-head); font-weight: 700; font-size: 14px;
    cursor: pointer;
}
.submit:hover, .search-submit:hover { opacity: .85; }

/* ─── Footer ──────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--rim);
    margin-top: 64px;
}
.site-footer__in {
    max-width: 1120px; margin: 0 auto; padding: 32px 48px;
    display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
    color: var(--muted); font-size: 14px;
}
@media (max-width: 700px) { .site-footer__in { padding: 24px 20px; } }
.site-footer__in a { color: var(--muted); }
.site-footer__in a:hover { color: var(--text); }

/* ─── Search page / archives ──────────────────────────────────── */
.search-form { display: flex; gap: 10px; max-width: 480px; margin-bottom: 36px; }

/* WordPress core alignment classes */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 0 auto 1em; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: var(--muted); text-align: center; }
