/*
Theme Name: Baltazar
Theme URI: https://baltazarstudios.com
Author: Goran Devic
Author URI: https://baltazarstudios.com
Description: A minimal, project-focused theme for technical blogs. Features a project card grid homepage, chronological blog index, auto-generated table of contents, and clean typography with Inter.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: baltazar
*/

/* ==========================================================================
   0. Font Face
   ========================================================================== */

@font-face {
    font-family: 'Inter';
    src: url('./assets/fonts/inter-var.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   1. Custom Properties
   ========================================================================== */

:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-text-secondary: #6b7280;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-border: #e5e7eb;
    --color-bg-subtle: #f9fafb;
    --color-bg-code: #f3f4f6;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --max-width: 1200px;
    --content-width: 800px;
    --header-height: 64px;
    --radius: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: 0.2s ease;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */

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

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent-hover);
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3;
    font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin-top: 0;
    margin-bottom: 1.2em;
}

ul, ol {
    padding-left: 1.5em;
    margin-bottom: 1.2em;
}

blockquote {
    margin: 1.5em 0;
    padding: 0.75em 1.5em;
    border-left: 4px solid var(--color-accent);
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
}

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

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-bg-code);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

pre {
    overflow-x: auto;
    margin: 1.5em 0;
    padding: 1.25em;
    background: var(--color-bg-code);
    border-radius: var(--radius);
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.875em;
}

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2em 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

th, td {
    padding: 0.5em 0.75em;
    border: 1px solid var(--color-border);
    text-align: left;
}

th {
    background: var(--color-bg-subtle);
    font-weight: 600;
}

figure {
    margin: 1.5em 0;
}

figcaption {
    margin-top: 0.5em;
    font-size: 0.875em;
    color: var(--color-text-secondary);
    text-align: center;
}

/* ==========================================================================
   3. Layout
   ========================================================================== */

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.content-narrow {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* ==========================================================================
   4. Header
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-branding a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.site-branding a:hover {
    color: var(--color-accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Primary Navigation */

.primary-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.primary-navigation a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: 6px;
    transition: color var(--transition), background-color var(--transition);
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item a,
.primary-navigation .current_page_item a {
    color: var(--color-text);
    background-color: var(--color-bg-subtle);
}

/* Search Toggle */

.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-radius: 6px;
    transition: color var(--transition), background-color var(--transition);
}

.search-toggle:hover {
    color: var(--color-text);
    background-color: var(--color-bg-subtle);
}

.search-toggle svg {
    width: 20px;
    height: 20px;
}

/* Search Overlay */

.search-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: 1rem 1.5rem;
}

.search-overlay.is-active {
    display: block;
}

.search-overlay .search-form {
    max-width: var(--content-width);
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.search-overlay .search-field {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition);
}

.search-overlay .search-field:focus {
    border-color: var(--color-accent);
}

.search-overlay .search-submit {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: #fff;
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color var(--transition);
}

.search-overlay .search-submit:hover {
    background: var(--color-accent-hover);
}

/* Hamburger Menu */

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-radius: 6px;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.menu-toggle:hover {
    color: var(--color-text);
    background-color: var(--color-bg-subtle);
}

/* ==========================================================================
   5. Footer
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--color-text-secondary);
}

.footer-links a:hover {
    color: var(--color-accent);
}

/* ==========================================================================
   6. Project Cards Grid
   ========================================================================== */

.projects-intro {
    max-width: var(--content-width);
    margin: 0 auto 2rem;
    text-align: center;
}

.projects-intro h1 {
    margin-top: 0;
    font-size: 2rem;
}

.projects-intro p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

/* Sort Controls */

.sort-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.sort-controls span {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.sort-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--color-text-secondary);
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.sort-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.sort-btn.is-active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.sort-note {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Cards Grid */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.project-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg);
    transition: box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-card a {
    color: inherit;
    display: block;
}

.card-image {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--color-bg-subtle);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.project-card:hover .card-image img {
    transform: scale(1.03);
}

.card-body {
    padding: 1rem 1.25rem 1.25rem;
}

.card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    margin-bottom: 0.375rem;
}

.card-title {
    margin: 0 0 0.375rem;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
}

.card-excerpt {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   7. Blog Index
   ========================================================================== */

.blog-index {
    max-width: var(--content-width);
    margin: 0 auto;
}

.blog-index h1 {
    margin-top: 0;
}

.blog-year-heading {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-text);
}

.blog-year-heading:first-of-type {
    margin-top: 0;
}

.blog-entry {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.blog-entry:last-child {
    border-bottom: none;
}

.blog-date {
    flex-shrink: 0;
    width: 8.5em;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

.blog-title {
    font-size: 1rem;
    font-weight: 600;
}

.blog-title a {
    color: var(--color-text);
}

.blog-title a:hover {
    color: var(--color-accent);
}

.blog-excerpt {
    display: none;
}

/* ==========================================================================
   8. Series Navigation
   ========================================================================== */

.series-nav {
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.series-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.series-label {
    font-size: 0.9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

.series-count {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.series-chapters {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.series-chapters li {
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.series-chapters li.is-current span {
    font-weight: 700;
    color: var(--color-text);
}

.series-chapters a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.series-chapters a:hover {
    color: var(--color-accent);
}

.series-prevnext {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.series-prevnext a {
    font-weight: 600;
}

.series-next {
    text-align: right;
    margin-left: auto;
}

/* ==========================================================================
   9. Single Post / Page
   ========================================================================== */

.entry-header {
    margin-bottom: 2rem;
}

.entry-title {
    margin-top: 0;
    margin-bottom: 0.25rem;
    font-size: 2.25rem;
    line-height: 1.2;
}

.entry-meta {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.entry-meta a {
    color: var(--color-text-secondary);
}

.entry-meta a:hover {
    color: var(--color-accent);
}

.entry-meta span + span::before {
    content: "\00b7";
    margin: 0 0.5em;
}

.entry-content {
    margin-bottom: 2rem;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content img {
    border-radius: var(--radius);
}

.entry-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* WordPress alignment classes */
.entry-content .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.entry-content .alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1em;
}

.entry-content .alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.entry-content .wp-caption {
    max-width: 100%;
}

.entry-content .wp-caption-text {
    font-size: 0.875em;
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 0.5em;
}

/* Table of Contents */

.entry-toc {
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.entry-toc-title {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

.entry-toc ol {
    margin: 0;
    padding-left: 1.25rem;
}

.entry-toc li {
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.entry-toc li ol {
    margin-top: 0.25rem;
}

.entry-toc a {
    color: var(--color-text);
    text-decoration: none;
}

.entry-toc a:hover {
    color: var(--color-accent);
}

/* Post Navigation */

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.post-navigation a {
    font-weight: 600;
}

/* Entry Footer / Tags */

.entry-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.entry-footer .tag-links a {
    display: inline-block;
    padding: 0.2em 0.6em;
    margin: 0.15em 0.25em 0.15em 0;
    font-size: 0.8125rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-secondary);
}

.entry-footer .tag-links a:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ==========================================================================
   9. Comments
   ========================================================================== */

.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.comments-title {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

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

.comment-list .comment {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-border);
}

.comment-list .children {
    list-style: none;
    padding-left: 2rem;
    margin: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-meta .avatar {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.comment-author {
    font-weight: 700;
    font-size: 0.9375rem;
}

.comment-date {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.comment-date a {
    color: var(--color-text-secondary);
}

.comment-content {
    font-size: 0.9375rem;
}

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

.reply a {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Comment Form */

.comment-respond {
    margin-top: 2rem;
}

.comment-reply-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition);
    margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--color-accent);
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form .form-submit input {
    padding: 0.625rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: #fff;
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color var(--transition);
}

.comment-form .form-submit input:hover {
    background: var(--color-accent-hover);
}

/* ==========================================================================
   10. Search Results
   ========================================================================== */

.search-results-header {
    margin-bottom: 2rem;
}

.search-results-header h1 {
    margin-top: 0;
}

.search-result {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-border);
}

.search-result:first-child {
    padding-top: 0;
}

.search-result h2 {
    margin-top: 0;
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

.search-result .entry-meta {
    margin-bottom: 0.5rem;
}

.search-result .entry-summary {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

.search-result .entry-summary p {
    margin-bottom: 0;
}

/* ==========================================================================
   11. 404 Page
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: 4rem 0;
}

.error-404 h1 {
    font-size: 4rem;
    margin-bottom: 0.25rem;
}

.error-404 p {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
}

.error-404 .search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 2rem auto 0;
}

.error-404 .search-field {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    outline: none;
}

.error-404 .search-field:focus {
    border-color: var(--color-accent);
}

.error-404 .search-submit {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: #fff;
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

/* ==========================================================================
   12. Pagination
   ========================================================================== */

.pagination {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin: 0 0.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.pagination .page-numbers.current {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.pagination .page-numbers:hover:not(.current) {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ==========================================================================
   13. Plugin Compatibility
   ========================================================================== */

/* Jetpack Sharing */
.entry-content .sharedaddy {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* Urvanov Syntax Highlighter */
.entry-content .crayon-syntax {
    max-width: 100%;
    overflow-x: auto;
}

/* Buy Me a Coffee */
.bmc-btn-container {
    margin-top: 1rem;
}

/* ==========================================================================
   14. Utility Classes
   ========================================================================== */

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

.screen-reader-text:focus {
    background-color: var(--color-bg);
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: var(--color-text);
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   15. Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .site-content {
        padding: 1.5rem 1rem;
    }

    .header-inner {
        padding: 0 1rem;
    }

    /* Hamburger shows, nav hides */
    .menu-toggle {
        display: flex;
    }

    .primary-navigation {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        padding: 0.75rem 1rem;
    }

    .primary-navigation.is-active {
        display: block;
    }

    .primary-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .primary-navigation a {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    /* Grid to single column */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .entry-title {
        font-size: 1.75rem;
    }

    /* Blog entry: stack on mobile */
    .blog-entry {
        flex-direction: column;
        gap: 0;
    }

    .blog-date {
        width: auto;
        font-size: 0.8125rem;
    }

    /* Post navigation stack */
    .post-navigation {
        flex-direction: column;
    }

    .post-navigation .nav-next {
        text-align: left;
    }

    /* Footer stack */
    .footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Comment threading */
    .comment-list .children {
        padding-left: 1rem;
    }

    /* Sort controls wrap */
    .sort-controls {
        flex-wrap: wrap;
    }
}
