/* Reset & base variables */
:root {
    --font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --max-width: 680px;
    --color-bg: #ffffff;
    --color-text: #1d1d1f;
    --color-link: #007aff;
    --color-link-hover: #0056b3;
    --color-nav: #1d1d1f;
    --color-nav-hover: #424245;
    --color-border: #d2d2d7;
    --color-link-secondary: #6e6e73;
    --color-link-secondary-hover: #86868b;
    --color-text-secondary: #424245;
    --spacing: 1.5rem;
    --font-size: 16px;
}

html {
    font-size: var(--font-size);
}

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

a {
    color: var(--color-link);
}

a:visited {
    color: var(--color-link);
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    padding: 0 1.5rem;
}

img {
    max-width: 100%;
    height: auto;
}

/* MAIN CONTAINER */
#site-wrapper {
    max-width: var(--max-width);
    margin: 1rem auto;
    padding: 0;
    display: grid;
    gap: 0;
}

#site-header { order: 10; }
#site-nav    { order: 20; }
#site-main   { order: 30; }
#site-plugins { order: 40; }
#site-social { order: 50; }
#site-footer { order: 60; }

/* HEADER */
#site-header {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

#site-identity {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#site-identity hgroup {
    padding-bottom: .5rem;
}

#site-logo-wrapper {
    margin-bottom: auto;
}
#site-logo {
    max-width: 120px;
    max-height: 80px;
    height: auto;
    width: auto;
    border-radius: .6rem;
}

#site-title {
    font-weight: 600;
}
#site-title a {
    text-decoration: none;
    color: var(--color-text);
}
#site-title a:hover {
    text-decoration: underline;
}

#site-slogan {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-top: -0.2rem;
}


/* NAVIGATION */
#site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.5rem;
}
#site-nav a {
    color: var(--color-nav);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    padding-bottom: 0.2rem;
}
#site-nav a:hover {
    border-bottom-color: var(--color-nav-hover);
}
#site-nav a[aria-current="page"] {
    border-bottom-color: var(--color-text);
    font-weight: 500;
}

/* social links */

#site-social {
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.site-social {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem 1.5rem;
}

.site-social a.social {
    color: var(--color-link-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom-style: dotted;
}
.site-social a.social:hover {
    color: var(--color-link-secondary-hover);
    border-bottom-color: var(--color-link-secondary-hover);
}
.site-social a.rss {
    color: var(--color-link-secondary);
}
.site-social a.rss:hover {
    color: var(--color-link-secondary-hover);
}

/* MAIN CONTENT */
#site-main {
    min-height: 60vh;
    margin-bottom: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

/* POST LIST (HOMEPAGE) */
.list-heading {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
}
.home-intro {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

.category-description {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}
.post-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}
.post-item:last-of-type {
    border-bottom: none;
}
.post-item-title {
    font-weight: 500;
    margin-bottom: 0.2rem;
}
.post-item-title a {
    color: var(--color-text);
    text-decoration: none;
}
.post-item-title a:hover {
    text-decoration: underline;
}
.post-item-meta {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}
.post-item-description {
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}
.post-item-excerpt {
    color: var(--color-text);
}
.post-item-readmore {
    margin-top: 0.6rem;
}
.post-item-readmore a {
    font-size: 0.9rem;
    color: var(--color-link);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
}
.post-item-readmore a:hover {
    border-bottom-color: var(--color-text);
}

/* SINGLE POST / PAGE */
#post-title, #page-title {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}
#post-meta {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    display: block;
}

#post-breadcrumbs {
    font-size: 0.90rem;
    margin-bottom: 1.5rem;
}

#post-breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

#post-breadcrumbs li {
    display: inline-flex;
    align-items: center;
}

#post-breadcrumbs li + li::before {
    content: "/";
    margin: 0 0.5rem;
    color: var(--color-text-secondary);
}

#post-breadcrumbs a {
    color: var(--color-link-secondary);
    text-decoration: none;
}

#post-breadcrumbs a:hover {
    color: var(--color-link-secondary-hover);
    text-decoration: underline;
}

#post-breadcrumbs [aria-current="page"] {
    color: var(--color-text);
}

.page-description {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
    font-style: italic;
}
.page-cover-image {
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
}
.page-cover-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

#post-content, #page-content {
    font-size: 1.05rem;
    margin-top: 1.5rem;
}
#post-content a, #page-content a {
    color: var(--color-link);
    text-decoration: underline;
}
#post-content a:hover, #page-content a:hover {
    color: var(--color-link-hover);
}
#post-content h3, #page-content h3 { margin-top: 1.5rem; }
#post-content p, #page-content p { margin-bottom: 1.2rem; }
#post-content img, #page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}
#post-content blockquote, #page-content blockquote {
    border-left: 4px solid var(--color-border);
    padding-left: 1.2rem;
    font-style: italic;
    color: var(--color-text-secondary);
}

#page-tags {
    margin-top: 2rem;
}

#page-tags span {
    margin-right: .6rem;
}

/*TAXONOMIES */
.taxonomy-tag + .taxonomy-tag {
    margin-left: .6rem;
}
.taxonomy-badge {
    color: var(--color-link);
    text-decoration: none;
}
.taxonomy-badge:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

/* PAGINATION */
#pagination {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
}
.pagination-prev,
.pagination-next {
    color: var(--color-link);
    text-decoration: none;
    font-size: 0.95rem;
}
.pagination-prev:hover,
.pagination-next:hover {
    text-decoration: underline;
}

/* FOOTER */
#site-footer {
    display: flex;
    justify-content: center;
    gap: 1rem 2rem;
    flex-wrap: wrap;
    font-size: 0.90rem;
    text-align: center; 
}

/* SKIP LINK (Accessibility) */
#skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: #000;
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
}
#skip-link:focus {
    top: 0;
}

/* UTILITY */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

/* PLUGINS */
.plugin {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

#site-plugins {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* POST ACTIONS */
#post-actions {
    display: flex;
    justify-content: space-evenly;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}
.post-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 1.2rem;
    font-size: 0.96rem;
    font-family: inherit;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    transition: background 0.15s, border-color 0.15s;
}
.post-action-btn:hover {
    background: var(--color-border);
}
.reply-email-btn {
    transform: none;
}

/* Comments Plugin */
#bludit-comments {
    margin-top: 2rem;
}

/* ───────────────────────────────────────────────────
   DARK THEME
   Overrides CSS variables + hardcoded colors.
   Activated via <html data-theme="dark">
   ─────────────────────────────────────────────────── */
[data-theme="dark"] {
    --color-bg: #0c0c0e;
    --color-text: #ffffff;
    --color-link: #007aff;
    --color-link-hover: #0056b3;
    --color-link-secondary: #a1a1a6;
    --color-link-secondary-hover: #68686f;
    --color-border: #38383a;
    --color-text-secondary: #c7c7cc;
}

[data-theme="dark"] body {
    background-color: var(--color-bg);
    color: var(--color-text);
}

[data-theme="dark"] #site-title a {
    color: var(--color-text);
}

[data-theme="dark"] #site-slogan {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .list-heading {
    color: var(--color-text);
}

[data-theme="dark"] .category-description {
    color: var(--color-text-secondary);
}

[data-theme="dark"] #site-nav a {
    color: var(--color-link);
}
[data-theme="dark"] #site-nav a:hover,
[data-theme="dark"] #site-nav a[aria-current="page"] {
    border-bottom-color: var(--color-link);
    color: var(--color-link-hover);
}

[data-theme="dark"] .site-social a.social {
    color: var(--color-link-secondary);
}
[data-theme="dark"] .site-social a.social:hover {
    color: var(--color-link-secondary-hover);
}
[data-theme="dark"] .site-social a.rss {
    color: var(--color-link-secondary);
}
[data-theme="dark"] .site-social a.rss:hover {
    color: var(--color-link-secondary-hover);
}

[data-theme="dark"] .post-item-title a {
    color: var(--color-text);
}

[data-theme="dark"] .post-item-description {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .post-item-readmore a {
    color: var(--color-link);
    border-bottom-color: var(--color-border);
}
[data-theme="dark"] .post-item-readmore a:hover {
    border-bottom-color: var(--color-link);
}

[data-theme="dark"] #post-title,
[data-theme="dark"] #page-title {
    color: var(--color-text);
}

[data-theme="dark"] .taxonomy-badge {
    color: var(--color-link);
}
[data-theme="dark"] .taxonomy-badge:hover {
    color: var(--color-link-hover);
}

[data-theme="dark"] #post-content,
[data-theme="dark"] #page-content {
    color: var(--color-text);
}
[data-theme="dark"] #post-content blockquote,
[data-theme="dark"] #page-content blockquote {
    border-left-color: var(--color-border);
    color: var(--color-text-secondary);
}

[data-theme="dark"] #pagination a,
[data-theme="dark"] .pagination-prev,
[data-theme="dark"] .pagination-next {
    color: var(--color-link);
}

[data-theme="dark"] #site-footer {
    border-top-color: var(--color-border);
}

[data-theme="dark"] #skip-link {
    background: var(--color-link);
    color: #1a1a2e;
}

/* ───────────────────────────────────────────────────
   DARK THEME — Comments plugin
   ─────────────────────────────────────────────────── */

[data-theme="dark"] .bludit-comments {
    border-top-color: var(--color-border);
}

[data-theme="dark"] .bludit-comments h3 {
    color: var(--color-text);
}

[data-theme="dark"] .bludit-comments-count {
    color: #888;
}

[data-theme="dark"] .bludit-comments-flash {
    background: #1a2a3a;
    border-color: #2a4a6a;
    color: #8eb8e0;
}

[data-theme="dark"] .bludit-comments-empty,
[data-theme="dark"] .bludit-comments-closed {
    color: #999;
}

[data-theme="dark"] .bludit-comment {
    border-bottom-color: var(--color-border);
}

[data-theme="dark"] .bludit-comment-author strong {
    color: var(--color-text);
}

[data-theme="dark"] .bludit-comment-date {
    color: #777;
}

[data-theme="dark"] .bludit-comment-badge {
    background: #444;
    color: #ddd;
}

[data-theme="dark"] .bludit-comment-body {
    color: var(--color-text);
}

[data-theme="dark"] .bludit-comment-body a {
    color: var(--color-link);
}

/* ── Comments form ── */

[data-theme="dark"] .bludit-comment-form {
    background: #1e1e36;
    border-color: var(--color-border);
}

[data-theme="dark"] .bludit-comment-form h4 {
    color: var(--color-text);
}

[data-theme="dark"] .bludit-comment-form-logged {
    color: #999;
}

[data-theme="dark"] .bludit-comment-form-row label {
    color: #bbb;
}

[data-theme="dark"] .bludit-comment-form-row input,
[data-theme="dark"] .bludit-comment-form-row textarea {
    background: #121224;
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .bludit-comment-form-row input:focus,
[data-theme="dark"] .bludit-comment-form-row textarea:focus {
    border-color: var(--color-link);
    outline: none;
}

[data-theme="dark"] .bludit-comment-form-row small {
    color: #777;
}

[data-theme="dark"] .bludit-comment-form-actions button {
    background: var(--color-link);
    color: #1a1a2e;
}

[data-theme="dark"] .bludit-comment-form-actions button:hover {
    background: var(--color-link-hover);
}

/* ── Paginator ── */

[data-theme="dark"] .bludit-comments-paginator li a,
[data-theme="dark"] .bludit-comments-paginator li span {
    border-color: var(--color-border);
    color: var(--color-link);
    background: transparent;
}

[data-theme="dark"] .bludit-comments-paginator li.active span {
    background: var(--color-link);
    border-color: var(--color-link);
    color: #1a1a2e;
} 

[data-theme="dark"] .bludit-comments-paginator li a:hover {
    background: #252545;
}

/* ── Edit this page button ── */

#edit-fab {
    position: fixed;
    bottom: 4.5rem;
    right: 1.5rem;
    z-index: 999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ebebeb;
    border: 1px solid var(--color-border);
    padding-top: 5px;
    color: var(--color-text);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
#edit-fab:hover {
    opacity: 1;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
    color: var(--color-text);
}

[data-theme="dark"] #edit-fab {
    background: #2a2a48;
    border-color: var(--color-border);
    color: var(--color-text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
[data-theme="dark"] #edit-fab:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.55);
    color: var(--color-text);
}

/* ── Floating dashboard button ── */

#dashboard-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ebebeb;
    border: 1px solid var(--color-border);
    padding-top: 5px;
    color: var(--color-text);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
#dashboard-fab:hover {
    opacity: 1;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
    color: var(--color-text);
}

[data-theme="dark"] #dashboard-fab {
    background: #2a2a48;
    border-color: var(--color-border);
    color: var(--color-text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
[data-theme="dark"] #dashboard-fab:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.55);
    color: var(--color-text);
}

/* Hide duplicate search plugin output (theme renders it inside main) */
body > .container { display: none; }

/* Search results */
.search-results-header {
    padding: 2rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}
.search-results-header h1 { font-size: 1.75rem; margin: 0 0 0.5rem 0; }
.search-results-header .search-query { color: var(--color-link); font-weight: 600; }
.search-results-header .search-count { color: var(--color-nav); font-size: 0.9375rem; margin: 0; }

.search-no-results { text-align: center; padding: 3rem 1rem; }
.search-no-results h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.search-no-results p { color: var(--color-nav); margin-bottom: 1.5rem; }
.search-no-results .search-suggestions { text-align: left; max-width: 400px; margin: 0 auto; }
.search-no-results .search-suggestions ul { padding-left: 1.25rem; color: var(--color-nav); }

.search-result-excerpt { color: var(--color-text); line-height: 1.6; margin-top: 0.5rem; }

.search-highlight {
    background-color: rgba(255, 230, 0, 0.4);
    padding: 0.1em 0.2em;
    border-radius: 2px;
}
[data-theme="dark"] .search-highlight { background-color: rgba(255, 214, 10, 0.3); }

.search-inline-form { max-width: 400px; margin: 1.5rem auto 0; }
.search-inline-form input[type="search"],
.plugin-search .search-plugin-form input[type="search"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
}
.search-inline-form input[type="search"]:focus,
.plugin-search .search-plugin-form input[type="search"]:focus {
    outline: none;
    border-color: var(--color-link);
}
.plugin-search .search-plugin-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.plugin-search .search-plugin-form input[type="search"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    max-width: 100%;
}

/* ───────────────────────────────────────────────────
   FEEDROLL
   ─────────────────────────────────────────────────── */
.feedroll-entry {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}
.feedroll-entry:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.feedroll-meta {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    display: block;
    margin-bottom: 0.2rem;
}
.feedroll-source {
    color: var(--color-link-secondary);
    text-decoration: none;
    font-weight: 500;
}
.feedroll-source:hover {
    color: var(--color-link-secondary-hover);
    text-decoration: underline;
}
.feedroll-excerpt {
    margin-top: 0.25rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}
.feedroll-intro {
    margin-bottom: 2.5rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-size: 1.15rem;
}
