/*
Theme Name: Etsbox theme
Description: Modern editorial blog — Swiss Modernism 2025
Version: 2.0
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    /* Colors — logo blues + warm contrast */
    --c-bg:           #F4F8FB;
    --c-bg-card:      #FFFFFF;
    --c-bg-code:      #EBF3F9;
    --c-text:         #0A1628;   /* near-black navy */
    --c-text-muted:   #4A6880;
    --c-text-light:   #7A9BB5;
    --c-primary:      #1E4E6E;   /* dark navy — footer, buttons */
    --c-secondary:    #3E82B0;   /* mid blue */
    --c-accent:       #E07B2A;   /* warm orange contrast */
    --c-accent-hover: #C4631A;
    --c-border:       #C8DFED;
    --c-border-light: #E3F0F8;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Type scale */
    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  1.875rem;
    --text-4xl:  2.25rem;
    --text-5xl:  3rem;

    /* Spacing */
    --sp-1:  0.25rem;
    --sp-2:  0.5rem;
    --sp-3:  0.75rem;
    --sp-4:  1rem;
    --sp-5:  1.25rem;
    --sp-6:  1.5rem;
    --sp-8:  2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;
    --sp-16: 4rem;
    --sp-20: 5rem;
    --sp-24: 6rem;

    /* Layout */
    --header-h:   64px;
    --max-content: 720px;
    --max-site:   1200px;
    --max-wide:   1400px;

    /* Effects */
    --radius-sm:  3px;
    --radius:     8px;
    --radius-lg:  12px;
    --radius-xl:  20px;
    --shadow-sm:  0 1px 2px rgba(0,0,0,.06);
    --shadow:     0 4px 12px rgba(0,0,0,.08);
    --shadow-lg:  0 12px 32px rgba(0,0,0,.1);
    --transition: 150ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.75;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--c-accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover, a:focus { color: var(--c-accent-hover); }
a:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ============================================================
   HEADER — Sticky glass nav
   ============================================================ */
#branding {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--c-border);
    height: var(--header-h);
}
/* The blur lives on a pseudo-element: a backdrop-filter on #branding itself makes it the containing
   block of the fixed mobile menu (#access.is-open), which then gets clipped to the 64px header. */
#branding::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(250, 250, 250, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.site-header-inner {
    max-width: var(--max-site);
    margin: 0 auto;
    padding: 0 var(--sp-6);
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: var(--sp-8);
}

/* Site name */
.site-branding {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.site-name-link {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--c-text);
    letter-spacing: -0.02em;
    text-decoration: none;
    transition: opacity var(--transition);
}
.site-name-link:hover { color: var(--c-text); opacity: 0.7; }

.site-logo { display: flex; align-items: center; flex-shrink: 0; }
.site-logo a,
.custom-logo-link { display: block; }

img.custom-logo,
.site-logo img,
.custom-logo-link img {
    display: block !important;
    height: 36px !important;
    width: auto !important;
    max-width: unset !important;
    max-height: 36px !important;
}

.site-name-text { white-space: nowrap; }

/* Nav */
#access {
    flex: 1;
    min-width: 0;
}

#access .primary-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    flex-wrap: wrap;
}

#access .primary-menu li { position: relative; }

#access .primary-menu a {
    display: block;
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--c-secondary);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

#access .primary-menu a:hover,
#access .primary-menu .current-menu-item > a,
#access .primary-menu .current_page_item > a {
    color: var(--c-text);
    background: var(--c-border-light);
}

/* Dropdown */
#access .primary-menu .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + var(--sp-2));
    left: 0;
    list-style: none;
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 50;
    padding: var(--sp-2) 0;
}
#access .primary-menu li:hover > .sub-menu,
#access .primary-menu li:focus-within > .sub-menu { display: block; }
#access .primary-menu .sub-menu a {
    padding: var(--sp-2) var(--sp-4);
    border-radius: 0;
    display: block;
    font-size: var(--text-sm);
    color: var(--c-secondary);
}
#access .primary-menu .sub-menu a:hover { color: var(--c-text); background: var(--c-bg); }

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-shrink: 0;
}

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

/* Hide hamburger on desktop */
.menu-toggle { display: none; }

/* Search bar drop-down */
.header-search-bar {
    max-height: 0;
    overflow: hidden;
    background: var(--c-bg-card);
    border-bottom: 1px solid transparent;
    transition: max-height var(--transition-slow), border-color var(--transition-slow), padding var(--transition-slow);
}
.header-search-bar.is-open {
    max-height: 80px;
    border-bottom-color: var(--c-border);
    padding: var(--sp-3) 0;
}
.header-search-bar .site-header-inner {
    height: auto;
    padding-top: var(--sp-2);
    padding-bottom: var(--sp-2);
}

/* ============================================================
   SEARCH FORM
   ============================================================ */
#searchform {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    width: 100%;
}

#searchform label { display: none; }

#searchform .field,
#searchform input[type="text"] {
    flex: 1;
    height: 40px;
    padding: 0 var(--sp-4);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--c-text);
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
#searchform .field:focus,
#searchform input[type="text"]:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(236,72,153,.12);
}

#searchform .submit,
#searchform input[type="submit"] {
    height: 40px;
    padding: 0 var(--sp-5);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    color: #fff;
    background: var(--c-primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    white-space: nowrap;
}
#searchform .submit:hover,
#searchform input[type="submit"]:hover { background: var(--c-secondary); }
#searchform .submit:active,
#searchform input[type="submit"]:active { transform: scale(0.97); }

/* ============================================================
   LAYOUT — Main wrapper
   ============================================================ */
#page { min-height: 100vh; display: flex; flex-direction: column; }

#main {
    flex: 1;
    width: 100%;
    max-width: var(--max-site);
    margin: 0 auto;
    padding: var(--sp-12) var(--sp-6);
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--sp-12);
    align-items: start;
}

/* No sidebar — single column */
body.no-sidebar #main,
body.page #main {
    grid-template-columns: 1fr;
    max-width: var(--max-content);
}

/* ============================================================
   PRIMARY CONTENT AREA
   ============================================================ */
#primary { min-width: 0; }
#content { min-width: 0; }

/* ============================================================
   POST CARDS — Blog index / archive
   ============================================================ */
.home #content,
.archive #content,
.search #content,
.blog #content {
    display: grid;
    gap: var(--sp-8);
}

/* Post card */
.home .hentry,
.archive .hentry,
.search .hentry,
.blog .hentry {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: box-shadow var(--transition-slow), transform var(--transition-slow);
}

/* Stretch the title link to cover the whole card */
.home .entry-title a::after,
.archive .entry-title a::after,
.search .entry-title a::after,
.blog .entry-title a::after {
    content: '';
    position: absolute;
    inset: 0;
}

/* Keep secondary links (tags, comments) clickable on top */
.home .hentry .entry-meta a,
.home .hentry .entry-footer a,
.home .hentry .tags-links a,
.archive .hentry .entry-meta a,
.archive .hentry .entry-footer a,
.archive .hentry .tags-links a,
.blog .hentry .entry-meta a,
.blog .hentry .entry-footer a,
.blog .hentry .tags-links a,
.search .hentry .entry-meta a,
.search .hentry .entry-footer a,
.search .hentry .tags-links a {
    position: relative;
    z-index: 1;
}
.home .hentry:hover,
.archive .hentry:hover,
.search .hentry:hover,
.blog .hentry:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Featured image in card */
.home .hentry .entry-thumbnail,
.archive .hentry .entry-thumbnail,
.blog .hentry .entry-thumbnail {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.home .hentry .entry-thumbnail img,
.archive .hentry .entry-thumbnail img,
.blog .hentry .entry-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.home .hentry:hover .entry-thumbnail img,
.archive .hentry:hover .entry-thumbnail img,
.blog .hentry:hover .entry-thumbnail img { transform: scale(1.03); }

/* Card body */
.home .hentry .entry-header,
.archive .hentry .entry-header,
.blog .hentry .entry-header {
    padding: var(--sp-6) var(--sp-6) var(--sp-4);
}

.home .hentry .entry-content,
.archive .hentry .entry-content,
.blog .hentry .entry-content,
.home .hentry .entry-summary,
.archive .hentry .entry-summary,
.blog .hentry .entry-summary {
    padding: 0 var(--sp-6) var(--sp-6);
}

/* Entry title */
.entry-title {
    font-size: var(--text-xl);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-3);
}

.home .entry-title,
.archive .entry-title,
.blog .entry-title { font-size: var(--text-2xl); }

.entry-title a {
    color: var(--c-text);
    text-decoration: none;
    transition: color var(--transition);
}
.entry-title a:hover { color: var(--c-accent); }

/* Entry meta */
.entry-meta {
    font-size: var(--text-xs);
    color: var(--c-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    align-items: center;
    margin-bottom: var(--sp-3);
}

.entry-meta a {
    color: var(--c-text-muted);
    font-weight: 500;
}
.entry-meta a:hover { color: var(--c-accent); }

.entry-meta .sep { opacity: 0.4; }

/* Category badge */
.cat-links a,
.entry-meta .cat-links a {
    display: inline-block;
    padding: 2px var(--sp-2);
    background: var(--c-border-light);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--c-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cat-links a:hover,
.entry-meta .cat-links a:hover {
    background: var(--c-accent);
    color: #fff;
}

/* Entry summary / excerpt */
.entry-summary p,
.home .entry-content p:first-of-type,
.archive .entry-content p:first-of-type {
    color: var(--c-text-muted);
    font-size: var(--text-sm);
    line-height: 1.7;
    margin-bottom: var(--sp-4);
}

.entry-summary ul,
.entry-summary ol {
    padding-left: var(--sp-5);
    margin-bottom: var(--sp-4);
    font-size: var(--text-sm);
    color: var(--c-text-muted);
    line-height: 1.7;
}
.entry-summary ul { list-style: disc; }
.entry-summary ol { list-style: decimal; }
.entry-summary li { margin-bottom: var(--sp-1); }

/* Read more link */
.more-link,
a.more-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--c-accent);
    text-decoration: none;
    transition: gap var(--transition);
}
.more-link:hover, a.more-link:hover {
    color: var(--c-accent-hover);
    gap: var(--sp-3);
}
.more-link::after, a.more-link::after { content: none; }

/* Entry footer (tags, etc.) */
.entry-footer,
.home .hentry .entry-footer,
.archive .hentry .entry-footer {
    padding: var(--sp-4) var(--sp-6);
    border-top: 1px solid var(--c-border-light);
    font-size: var(--text-xs);
    color: var(--c-text-light);
}

/* ============================================================
   SINGLE POST — Reading view
   ============================================================ */
.single #content,
.page #content { max-width: var(--max-content); }

/* Edit button — top of article */
.edit-link-top {
    margin-bottom: var(--sp-4);
}
.edit-link-top a {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--c-text-muted);
    background: var(--c-bg-code);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: color var(--transition), border-color var(--transition);
}
.edit-link-top a:hover {
    color: var(--c-accent);
    border-color: var(--c-accent);
}

.single .entry-title,
.page .entry-title {
    font-size: var(--text-4xl);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--c-text);
    margin-top: var(--sp-4);
    margin-bottom: var(--sp-4);
}

.single .entry-meta {
    font-size: var(--text-sm);
    margin-bottom: 0;
}

/* Author avatar row */
.single .author-avatar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
}
.single .author-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Featured image — single */
.single .entry-thumbnail,
.page .entry-thumbnail {
    margin-bottom: var(--sp-8);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.single .entry-thumbnail img,
.page .entry-thumbnail img {
    width: 100%;
    height: auto;
}

/* Post body */
.single .entry-content,
.page .entry-content {
    font-size: var(--text-lg);
    line-height: 1.8;
    color: var(--c-text);
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-10) var(--sp-10);
}

.single .entry-content > *,
.page .entry-content > * { margin-bottom: var(--sp-6); }

.single .entry-content > *:last-child,
.page .entry-content > *:last-child { margin-bottom: 0; }

/* Headings in content */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--c-text);
    margin-top: var(--sp-10);
    margin-bottom: var(--sp-4);
}

.entry-content h2 { font-size: var(--text-2xl); }
.entry-content h3 { font-size: var(--text-xl); }
.entry-content h4 { font-size: var(--text-lg); }

/* Paragraphs */
.entry-content p { margin-bottom: var(--sp-6); }

/* Links in content */
.entry-content a {
    color: var(--c-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.entry-content a:hover { text-decoration-thickness: 2px; }

/* Lists */
.entry-content ul,
.entry-content ol {
    padding-left: var(--sp-6);
    margin-bottom: var(--sp-6);
}
.entry-content li { margin-bottom: var(--sp-2); }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

/* Blockquote */
.entry-content blockquote {
    margin: var(--sp-8) 0;
    padding: var(--sp-6) var(--sp-8);
    border-left: 4px solid var(--c-accent);
    background: var(--c-bg);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    font-size: var(--text-xl);
    color: var(--c-secondary);
    line-height: 1.6;
}
.entry-content blockquote cite {
    display: block;
    margin-top: var(--sp-3);
    font-size: var(--text-sm);
    font-style: normal;
    font-weight: 600;
    color: var(--c-text-muted);
}

/* Code */
.entry-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--c-bg-code);
    color: var(--c-text);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border);
}

.entry-content pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    background: var(--c-primary);
    color: #e4e4e7;
    padding: var(--sp-6);
    border-radius: var(--radius);
    overflow-x: auto;
    line-height: 1.6;
    margin-bottom: var(--sp-6);
}
.entry-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Tables */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    margin-bottom: var(--sp-6);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--c-border);
}
.entry-content th {
    background: var(--c-bg-code);
    padding: var(--sp-3) var(--sp-4);
    text-align: left;
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-secondary);
    border-bottom: 1px solid var(--c-border);
}
.entry-content td {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--c-border-light);
    vertical-align: top;
}
.entry-content tr:last-child td { border-bottom: none; }
.entry-content tr:nth-child(even) td { background: rgba(0,0,0,.02); }

/* Images in content */
.entry-content img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.entry-content figure {
    margin: var(--sp-8) 0;
}
.entry-content figcaption {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--c-text-muted);
    margin-top: var(--sp-3);
}

/* YouTube embeds (a bare YouTube link on its own line); Shorts are vertical */
.entry-content .video-embed {
    margin: var(--sp-8) auto;
    aspect-ratio: 16 / 9;
}
.entry-content .video-embed--short {
    aspect-ratio: 9 / 16;
    max-width: 360px;
}
.entry-content .video-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Horizontal rule — hidden on post pages */
.single .entry-content hr,
.page .entry-content hr {
    display: none;
}

/* ============================================================
   ENTRY FOOTER — Single
   ============================================================ */
.single .entry-footer {
    margin-top: var(--sp-10);
    padding-top: var(--sp-8);
    font-size: var(--text-sm);
    color: var(--c-text-muted);
}

.tags-links a {
    display: inline-block;
    margin: var(--sp-1);
    padding: var(--sp-1) var(--sp-3);
    background: var(--c-bg-code);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--c-secondary);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.tags-links a:hover {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
}

/* Post navigation */
.nav-single,
.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-6);
}

.nav-previous a,
.nav-next a,
.nav-links a {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: var(--sp-4) var(--sp-5);
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: box-shadow var(--transition), border-color var(--transition);
}
.nav-previous a:hover,
.nav-next a:hover,
.nav-links a:hover {
    border-color: var(--c-accent);
    box-shadow: var(--shadow);
}
.nav-previous a::before { content: "← Previous"; font-size: var(--text-xs); color: var(--c-text-muted); font-weight: 500; }
.nav-next a::before    { content: "Next →"; font-size: var(--text-xs); color: var(--c-text-muted); font-weight: 500; text-align: right; }
.nav-next { text-align: right; }


/* ============================================================
   PAGINATION
   ============================================================ */
.nav-below,
.paging-navigation,
.posts-navigation,
nav.navigation.pagination {
    margin-top: var(--sp-12);
}

nav.navigation.pagination .nav-links,
.paging-navigation .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--sp-3);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--c-border);
    color: var(--c-secondary);
    background: var(--c-bg-card);
    text-decoration: none;
    transition: all var(--transition);
}
.page-numbers:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
}
.page-numbers.current {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}
.page-numbers.dots { border: none; background: none; }

/* ============================================================
   SIDEBAR
   ============================================================ */
#secondary {
    position: sticky;
    top: calc(var(--header-h) + var(--sp-6));
    align-self: start;
}

.widget {
    margin-bottom: var(--sp-8);
    padding: var(--sp-6);
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
}

.widget:last-child { margin-bottom: 0; }

.widget-title {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-text-muted);
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--c-border);
}

.widget ul { list-style: none; }

.widget ul li {
    padding: var(--sp-2) 0;
    border-bottom: 1px solid var(--c-border-light);
    font-size: var(--text-sm);
}
.widget ul li:last-child { border-bottom: none; padding-bottom: 0; }

.widget ul li a {
    color: var(--c-secondary);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color var(--transition);
}
.widget ul li a:hover { color: var(--c-accent); }

.widget_search { padding: var(--sp-4); }
.widget_search #searchform { gap: var(--sp-2); }

/* ============================================================
   COMMENTS
   ============================================================ */
#comments {
    margin-top: var(--sp-8);
    padding-top: 0;
}

#comments-title {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-8);
}

.commentlist {
    list-style: none;
}

.comment {
    margin-bottom: var(--sp-6);
}

.comment-body {
    padding: var(--sp-5);
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-3);
}
.comment-author .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}
.comment-author .fn { font-weight: 600; font-size: var(--text-sm); }
.comment-author .url { text-decoration: none; color: var(--c-text); }
.comment-author .url:hover { color: var(--c-accent); }

.comment-meta { font-size: var(--text-xs); color: var(--c-text-muted); margin-bottom: var(--sp-3); }
.comment-content { font-size: var(--text-sm); line-height: 1.7; }
.comment-content p { margin-bottom: var(--sp-3); }

.children {
    margin-left: var(--sp-8);
    margin-top: var(--sp-4);
    list-style: none;
}

.reply { margin-top: var(--sp-3); }
.reply a {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--c-text-muted);
    text-decoration: none;
    transition: color var(--transition);
}
.reply a:hover { color: var(--c-accent); }

/* Comment form */
#respond {
    margin-top: var(--sp-12);
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-8);
}

#reply-title {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-6);
}

.comment-form label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--c-secondary);
    margin-bottom: var(--sp-2);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--c-text);
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: var(--sp-3) var(--sp-4);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    margin-bottom: var(--sp-4);
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(236,72,153,.12);
}

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

.comment-form .form-submit { margin-bottom: 0; }

.comment-form .submit,
.comment-form input[type="submit"] {
    padding: var(--sp-3) var(--sp-6);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    color: #fff;
    background: var(--c-primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}
.comment-form .submit:hover,
.comment-form input[type="submit"]:hover { background: var(--c-secondary); }

/* ============================================================
   PAGE HEADER — archive/search titles
   ============================================================ */
.page-header {
    margin-bottom: var(--sp-10);
    padding-bottom: var(--sp-8);
    border-bottom: 1px solid var(--c-border);
}

.page-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--c-text);
    margin-bottom: var(--sp-3);
}

.page-title span { color: var(--c-accent); }

.archive-description {
    font-size: var(--text-base);
    color: var(--c-text-muted);
    max-width: 60ch;
    line-height: 1.7;
}

/* Posts navigation */
.posts-navigation,
.post-navigation {
    margin-top: var(--sp-12);
    display: flex;
    justify-content: space-between;
    gap: var(--sp-4);
}

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

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

.posts-navigation a,
.post-navigation a {
    display: inline-block;
    padding: var(--sp-3) var(--sp-5);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--c-secondary);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-bg-card);
    text-decoration: none;
    transition: border-color var(--transition), color var(--transition);
}
.posts-navigation a:hover,
.post-navigation a:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
}

/* ============================================================
   FOOTER
   ============================================================ */
#colophon {
    background: var(--c-primary);
    color: #e4e4e7;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-site);
    margin: 0 auto;
    padding: 0 var(--sp-6);
}

.footer-top {
    padding: var(--sp-12) 0;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-8);
}

.footer-widgets .widget {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}

.footer-widgets .widget-title {
    color: #71717a;
    border-bottom-color: rgba(255,255,255,.1);
}

.footer-widgets .widget ul li {
    border-bottom-color: rgba(255,255,255,.06);
}

.footer-widgets .widget ul li a {
    color: #a1a1aa;
}
.footer-widgets .widget ul li a:hover { color: #fff; }

.footer-widgets p { color: #a1a1aa; font-size: var(--text-sm); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: var(--sp-6) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-6);
    flex-wrap: wrap;
}

.site-info {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: var(--text-sm);
    color: #71717a;
    flex-wrap: wrap;
}

.footer-site-name {
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    font-size: var(--text-base);
    transition: opacity var(--transition);
}
.footer-site-name:hover { opacity: 0.7; color: #fff; }

.footer-sep { opacity: 0.3; }

.site-info a { color: #a1a1aa; text-decoration: none; }
.site-info a:hover { color: #fff; }

.footer-nav .footer-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
}
.footer-nav .footer-menu a {
    font-size: var(--text-sm);
    color: #a1a1aa;
    text-decoration: none;
    transition: color var(--transition);
}
.footer-nav .footer-menu a:hover { color: #fff; }

/* ============================================================
   UTILITY — Screen reader text
   ============================================================ */
.assistive-text,
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   GUTENBERG BLOCKS alignment
   ============================================================ */
.alignleft  { float: left;  margin-right: var(--sp-6); margin-bottom: var(--sp-4); max-width: 50%; }
.alignright { float: right; margin-left:  var(--sp-6); margin-bottom: var(--sp-4); max-width: 50%; }
.aligncenter { text-align: center; margin: var(--sp-6) auto; }
.single .entry-content .alignwide,
.page .entry-content .alignwide  { margin-left: calc(-1 * var(--sp-10)); margin-right: calc(-1 * var(--sp-10)); }
.single .entry-content .alignfull,
.page .entry-content .alignfull  { margin-left: calc(-1 * var(--sp-10)); margin-right: calc(-1 * var(--sp-10)); border-radius: 0; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ============================================================
   RESPONSIVE — Tablet (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {
    #main {
        grid-template-columns: 1fr;
        padding: var(--sp-10) var(--sp-6);
    }

    #secondary {
        position: static;
    }

    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   RESPONSIVE — Mobile (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    /* Header */
    .site-header-inner { gap: var(--sp-4); }

    #access { display: none; }
    #access.is-open {
        display: block;
        position: fixed;
        inset: var(--header-h) 0 0 0;
        background: var(--c-bg-card);
        border-top: 1px solid var(--c-border);
        overflow-y: auto;
        padding: var(--sp-6);
        z-index: 90;
    }
    #access.is-open .primary-menu {
        flex-direction: column;
        gap: var(--sp-2);
    }
    #access.is-open .primary-menu a {
        padding: var(--sp-3) var(--sp-4);
        font-size: var(--text-base);
    }
    #access.is-open .sub-menu {
        position: static;
        display: block;
        box-shadow: none;
        border: none;
        background: var(--c-bg);
        border-radius: var(--radius);
        margin-top: var(--sp-2);
        padding: var(--sp-2) 0;
    }

    .menu-toggle { display: flex; }
    /* The menu is hidden here, so nothing pushes the buttons right: logo left, buttons right */
    .header-actions { margin-left: auto; }

    /* Layout */
    #main {
        padding: var(--sp-8) var(--sp-3);
    }

    /* Post body card: 40px inside + the page gutter left the text ~275px wide on a phone */
    .single .entry-content,
    .page .entry-content {
        padding: var(--sp-6) var(--sp-4);
    }

    /* Single post */
    .single .entry-title,
    .page .entry-title {
        font-size: var(--text-3xl);
    }

    /* Post cards */
    .home .entry-title,
    .archive .entry-title,
    .blog .entry-title { font-size: var(--text-xl); }

    /* Nav */
    .nav-single, .nav-links {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-widgets { grid-template-columns: 1fr; }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-4);
    }

    /* Alignments */
    .alignleft, .alignright {
        float: none;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .alignwide, .alignfull {
        margin-left: calc(-1 * var(--sp-4));
        margin-right: calc(-1 * var(--sp-4));
    }

    /* Comments indent */
    .children { margin-left: var(--sp-4); }
}

/* ============================================================
   RESPONSIVE — Small mobile (≤480px)
   ============================================================ */
@media (max-width: 480px) {
    :root { --header-h: 56px; }

    .single .entry-title,
    .page .entry-title { font-size: var(--text-2xl); }

    #main { padding: var(--sp-6) var(--sp-3); }
    #respond { padding: var(--sp-6); }
}
