/*
Theme Name: bios
Theme URI: https://bios.net.za/
Author: Roger Young
Author URI: https://bios.net.za/
Description: A faithful recreation of the bios.net.za Write.as design (charcoal text, blue accents, centred header, pill buttons) rebuilt for WordPress — with native comments and author bylines added.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bios
Tags: blog, minimal, one-column, custom-menu
*/

/* ============================================================
   BASE (recreates the write.as foundations the custom CSS
   on bios.net.za was layered on top of)
   ============================================================ */

* { box-sizing: border-box; }

html {
    max-width: 100%;
    overflow-x: hidden;
    font-size: 100%;
}

body {
    font-size: 16px;
    line-height: 1.25;
    margin: 0 auto;
    padding: 0 1em;
    max-width: 100vw;
    overflow-x: hidden;
    background-color: #fff;
    color: #585858;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === GLOBAL FONT: everything sans-serif (per bios.net.za custom CSS) === */
html, body, header, nav, #blog-title, .post, article,
p, h1, h2, h3, h4, h5, h6,
.post-content, .e-content, .entry-content, #post-body,
a, span, div, li, .tags, .read-more, footer,
input, textarea, button, cite, blockquote, td, th {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

img, video, iframe, table, embed, object {
    max-width: 100% !important;
    height: auto !important;
}

::selection { background: #ffff00; }

p, h1, h2, h3, h4, h5, h6, .post-content, .e-content, .entry-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body h1, body h2, body h3 { line-height: 1.2; }

/* === HEADER === */

header,
#blog-title,
header nav {
    text-align: center;
}

header { margin: 1em; }

#blog-title {
    display: inline;
    font-size: 2em;
    font-weight: 700;
    margin: 0.67em 0;
}

#blog-title a {
    color: #585858;
    text-decoration: none;
}

#blog-title a:hover { color: #045FB4; }

header nav,
nav ul {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: visible;
    white-space: nowrap;
    gap: 0.3em;
    justify-content: center;
    align-items: center;
    margin: 0 1em;
    line-height: 2.4em;
}

header nav a {
    color: #767676;
    text-decoration: none;
    margin: 0 0 0 0.5em;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-block;
}

header nav a:first-child { margin-left: 0; }

header nav a:hover {
    text-decoration: underline;
    color: #045FB4;
}

/* === LAYOUT === */

#wrapper { margin: 1em 2em; }

article {
    max-width: 40rem;
    margin: 0 auto;
    text-align: left;
}

body.collection #wrapper article { margin-bottom: 4em; }

/* === TITLES + BYLINES === */

h2.post-title, h2#title {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 0 0.4em;
    line-height: 1.2;
}

body.post h2#title { margin-bottom: 0.3em; }

.post-title a {
    color: #333;
    text-decoration: none !important;
}

.post-title a:hover { color: #045FB4; }

/* The new WordPress byline — sized/spaced to match the site's old meta text */
.post-byline {
    font-size: 0.86em;
    color: #999;
    text-align: center;
    margin: 0 0 1.4em;
    font-style: italic;
}

.post-byline a {
    color: #767676;
    text-decoration: none;
}

.post-byline a:hover { color: #045FB4; text-decoration: underline; }

.post-byline .byline-sep { margin: 0 0.4em; color: #ccc; font-style: normal; }

/* === READING COLUMN (matches write.as' exact 36em / 576px measure) === */
h2.post-title, h2#title, .post-byline, .post-content, .e-content,
p.post-tags, #comments {
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.read-more-wrap {
    max-width: 36rem;
    margin: 1.5em auto 0;
}

/* === CONTENT === */

.post-content, .e-content { text-align: left; line-height: 1.5; }

.post-content p, .e-content p { line-height: 1.5; margin: 1.5em 0; }

.post-content > :first-child, .e-content > :first-child { margin-top: 0; }
.post-content > :last-child, .e-content > :last-child { margin-bottom: 0; }

article ul {
    margin: 0 0 1.5em;
    padding: 0 0 0 1em;
    line-height: 1.5;
}

article ol { margin: 0 0 1.5em; padding: 0 0 0 1.5em; line-height: 1.5; }

article li + li { margin-top: 0.4em; }

blockquote {
    border-left: 4px solid #ddd;
    padding: 0 1em;
    margin: 1.5em 0.5em;
    color: #767676;
}

blockquote p { margin: 0.5em 0; }

/* Inside articles, hr hugs its neighbours (as on write.as) */
article hr, .e-content hr, .post-content hr {
    height: 1px;
    border: 0;
    background: #ccc;
    max-width: 40em;
    margin: 1.5em auto;
}

hr {
    height: 1px;
    border: 0;
    background: #ccc;
    max-width: 40em;
    margin: 4em auto;
    text-align: center;
}

code {
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    padding: 0.2em 0.4em;
    font-size: 0.86em;
    border-radius: 0.25em;
    font-family: Menlo, Consolas, Monaco, monospace !important;
}

pre {
    max-width: 100%;
    margin: 1.5em 0;
    background: #f8f8f8;
    border: 1px solid #ccc;
    padding: 0.375em 0.625em;
    font-size: 0.86em;
    border-radius: 0.25em;
    overflow-x: auto;
}

pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: 1em;
    white-space: pre-wrap;
    word-wrap: break-word;
}

h5 { font-size: 0.83em; }

/* Article links: forced to charcoal with underline (per bios.net.za custom CSS) */
.collection article a,
.collection .post-content a,
.collection .e-content a,
.post article a,
.post .post-content a,
.post .e-content a,
.subpage article a,
article .entry-content a {
    color: #585858;
    text-decoration: underline;
}

.collection article a:hover,
.collection .post-content a:hover,
.post article a:hover,
.subpage article a:hover {
    color: #111111;
}

/* Never underline article titles or the blog header */
article h1 a, article h2 a, .post-title a,
#blog-title a {
    text-decoration: none !important;
}

/* === READ MORE PILL === */

a.read-more {
    display: inline-block;
    background: #585858;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 4px;
    border-radius: 7px;
    text-align: center;
}

a.read-more:hover {
    background: #045FB4 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 5px;
}

.read-more-wrap { text-align: left; }

/* === TAG PILLS === */

p.post-tags { margin: 1.5em 0; line-height: 2em; }

a.tags, .post-tags a {
    background-color: #fff;
    border-radius: 7px;
    border: 1px solid #585858;
    padding: 2px 5px;
    text-decoration: none !important;
    line-height: 2em;
    color: #585858 !important;
    margin-right: 0.3em;
}

a.tags:hover, .post-tags a:hover {
    background-color: #045FB4;
    color: #fff !important;
}

/* === PAGINATION (⇠ Older / Newer ⇢) === */

nav#paging {
    overflow: visible;
    padding: 1em 2em 0;
    max-width: 40rem;
    margin: 0 auto;
}

nav#paging a { color: #767676; text-decoration: none; }
nav#paging a:hover { color: #045FB4; text-decoration: underline; }
nav#paging .nav-older { float: left; }
nav#paging .nav-newer { float: right; }
nav#paging::after { content: ""; display: table; clear: both; }

/* === EMAIL SUBSCRIBE BOX === */

#emailsub {
    text-align: center;
    margin: 2em 0;
}

#emailsub input[type="email"] {
    max-width: 270px;
    width: 100%;
    height: 34px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 16px;
    margin: 0;
    box-sizing: border-box;
    text-align: left;
}

#emailsub input[type="submit"], #subscribe-btn {
    border: 1px solid #045FB4;
    background: #045FB4;
    color: #fff;
    height: 34px;
    border-radius: 4px;
    padding: 0 14px;
    cursor: pointer;
}

/* MailPoet integration — keeps the same look */
#emailsub .mailpoet_form { max-width: 420px; margin: 0 auto; }
#emailsub .mailpoet_paragraph { text-align: center; }
#emailsub input.mailpoet_text {
    max-width: 270px;
    height: 34px;
    background-color: #fff !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    padding: 0 8px !important;
    font-size: 16px !important;
}
#emailsub input.mailpoet_submit {
    border: 1px solid #045FB4 !important;
    background: #045FB4 !important;
    color: #fff !important;
    height: 34px;
    border-radius: 4px;
    padding: 0 14px;
}

/* === ARCHIVE / PAGE HEADINGS === */

body.subpage #wrapper h1.page-title,
.archive-title {
    font-size: 1.8em;
    text-align: center;
    max-width: 40rem;
    margin: 0 auto 1em;
    color: #585858;
}

.archive-title .tag-hash { color: #999; font-weight: 400; }

/* === SEARCH === */

.search-wrap { max-width: 40rem; margin: 0 auto 2em; text-align: center; }

#search .field, .search-wrap input[type="search"], .search-wrap input[type="text"] {
    width: 100%;
    max-width: 270px;
    height: 34px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0 8px;
    box-sizing: border-box;
    font-size: 16px !important;
    margin: 0;
    text-align: left;
}

.search-wrap input[type="submit"], .search-wrap button {
    border: 1px solid #585858;
    background: #585858;
    color: #fff;
    height: 34px;
    border-radius: 4px;
    padding: 0 14px;
    cursor: pointer;
}

.search-wrap input[type="submit"]:hover, .search-wrap button:hover {
    border-color: #045FB4;
    background: #045FB4;
}

/* === COMMENTS (new for WordPress — styled to match) === */

#comments {
    max-width: 40rem;
    margin: 0 auto;
    text-align: left;
}

#comments h3.comments-title, #comments h3#reply-title {
    text-align: center;
    font-size: 1.17em;
    color: #585858;
    margin: 1.5em 0 0.5em;
}

#comments h3#reply-title small a {
    color: #767676;
    font-size: 0.7em;
    margin-left: 0.5em;
}

#comments p.no-comments { text-align: center; color: #999; font-style: italic; }

ol.comment-list {
    list-style: none;
    margin: 0 0 2em;
    padding: 0;
}

ol.comment-list li.comment {
    margin: 0;
    padding: 1.2em 0;
}

ol.comment-list li.comment + li.comment { border-top: 1px solid #eee; }

ol.comment-list .children {
    list-style: none;
    margin: 0;
    padding-left: 1.5em;
    border-left: 2px solid #eee;
}

.comment-meta {
    font-size: 0.86em;
    color: #767676;
    margin-bottom: 0.5em;
}

.comment-meta .fn { font-weight: 700; color: #585858; }
.comment-meta a { color: #767676; text-decoration: none; }
.comment-meta a:hover { color: #045FB4; text-decoration: underline; }
.comment-meta .comment-awaiting-moderation { font-style: italic; color: #999; display: block; margin-top: 4px; }

.comment-body p { margin: 0.8em 0; line-height: 1.5; }
.comment-body p:last-child { margin-bottom: 0; }

.reply { margin-top: 0.6em; font-size: 0.86em; }

.reply a {
    color: #585858 !important;
    text-decoration: underline;
}

.reply a:hover { color: #045FB4 !important; }

/* Comment form */
.comment-form p { margin: 1em 0; }

.comment-form label {
    display: block;
    font-size: 0.86em;
    color: #767676;
    margin-bottom: 4px;
}

.comment-form .required { color: #c0392b; }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    max-width: 270px;
    height: 34px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.comment-form textarea {
    width: 100%;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    font-size: 16px;
    box-sizing: border-box;
    resize: vertical;
}

.comment-form input:focus, .comment-form textarea:focus { outline: 1px solid #045FB4; }

.comment-form input.submit {
    background: #585858;
    color: #fff;
    border: 0;
    padding: 6px 14px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 1em;
}

.comment-form input.submit:hover { background: #045FB4; }

.comment-form .comment-notes, .comment-form .logged-in-as {
    font-size: 0.86em;
    color: #767676;
}

.comment-form .comment-form-cookies-consent input { margin-right: 6px; }
.comment-form .comment-form-cookies-consent label { display: inline; }

/* === FOOTER === */

body > footer {
    text-align: center;
    padding: 0 1em;
    background-color: #f6f6f6;
}

body > footer hr { margin: 2em auto 0; }

body > footer nav {
    color: #444;
    background-color: #f6f6f6;
    padding-bottom: 48px;
    padding-top: 1em;
    margin-bottom: 0;
    display: block;
}

body > footer nav p { margin: 0.5em 0; font-size: 0.9em; }

body > footer nav a { color: #333; font-weight: 700; text-decoration: none; }
body > footer nav a:hover { color: #045FB4; text-decoration: underline; }

/* === ACCESSIBILITY === */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal;
}

/* WordPress core alignment helpers (kept invisible-ish, matching the minimal look) */
.alignleft { float: left; margin-right: 1em; }
.alignright { float: right; margin-left: 1em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption, .gallery-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.86em; color: #767676; text-align: center; }
.sticky, .bypostauthor { /* intentionally unstyled */ }

/* === WORDPRESS ADMIN BAR FIX === */
body.admin-bar header { margin-top: 1em; }

/* === MOBILE TWEAKS (as per bios.net.za custom CSS) === */

@media (max-width: 600px) {

    /* Mobile: 17px text + 60px side frame (was 16px / 40px) */
    body { font-size: 17px; }
    h2.post-title, h2#title { font-size: 1.25rem; } /* 20px — fits common titles on one line */
    h2.post-title, h2#title, .post-byline, .post-content, .e-content,
    p.post-tags, #comments {
        max-width: none;
        margin-left: 43px;
        margin-right: 43px;
    }
    .read-more-wrap { max-width: none; margin-left: 43px; margin-right: 43px; }
    body { padding: 0 0.5em; }
    body > footer { padding: 0 0.5em; }
    body > footer nav { padding-bottom: 24px; }

    #wrapper { margin: 1em 0.5em; }

    #search .field, .search-wrap input[type="search"] { max-width: 100%; }

    header nav, nav ul {
        gap: 0.2em;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 0;
        justify-content: center;
    }

    header nav a {
        font-size: 11px !important;
        padding: 0 2px !important;
        letter-spacing: -0.2px;
        margin-left: 0.3em;
    }

    header nav::-webkit-scrollbar, nav ul::-webkit-scrollbar {
        height: 0;
        background: transparent;
    }
}
