/*
Theme Name: CaseyLamm
Theme URI: https://caseylamm.net
Author: Casey Lamm
Author URI: https://caseylamm.net
Description: Minimal dark-mode-first developer blog theme with card grid layout.
Version: 1.0.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: caseylamm
Tags: dark, minimal, blog, one-column, custom-colors
*/

/* ==========================================================================
   Typography
   ========================================================================== */

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 17.6px !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

code, pre, kbd, samp {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

:root {
    --caseylamm-accent-glow: rgba(239, 115, 55, 0.15);
    --color-bg: #0d1117;
    --color-bg-secondary: #161b22;
    --color-text: #c9d1d9;
    --color-text-secondary: #8b949e;
    --color-text-tertiary: #6e7681;
    --color-border: #30363d;
    --color-border-light: rgba(255, 255, 255, 0.3);
    --color-accent: #ef7337;
}

body.is-dark-mode {
    color-scheme: dark;
    background: #0d1117 !important;
}

/* Light Mode Styles */
body:not(.is-dark-mode) {
    color-scheme: light;
    background: #fafafa !important;
    color: #1a1a1a !important;
    --color-bg: #fafafa;
    --color-bg-secondary: #f0f0f0;
    --color-text: #1a1a1a;
    --color-text-secondary: #444444;
    --color-text-tertiary: #555555;
    --color-border: #d0d0d0;
    --color-border-light: rgba(0, 0, 0, 0.12);
    --color-accent: #2563eb;
}

/* Light mode - ALL text elements need dark colors */
body:not(.is-dark-mode),
body:not(.is-dark-mode) h1,
body:not(.is-dark-mode) h2,
body:not(.is-dark-mode) h3,
body:not(.is-dark-mode) h4,
body:not(.is-dark-mode) h5,
body:not(.is-dark-mode) h6,
body:not(.is-dark-mode) p,
body:not(.is-dark-mode) span,
body:not(.is-dark-mode) a,
body:not(.is-dark-mode) li,
body:not(.is-dark-mode) div {
    color: #1a1a1a !important;
}

/* Light mode - header and nav */
body:not(.is-dark-mode) .site-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

body:not(.is-dark-mode) .site-header a,
body:not(.is-dark-mode) .site-header .wp-block-site-title a,
body:not(.is-dark-mode) .site-header .wp-block-navigation a {
    color: #1a1a1a !important;
}

body:not(.is-dark-mode) .site-header .wp-block-navigation a:hover {
    color: #2563eb !important;
}

/* Light mode - hero section */
body:not(.is-dark-mode) .hero-title,
body:not(.is-dark-mode) .hero-subtitle,
body:not(.is-dark-mode) .wp-block-heading {
    color: #1a1a1a !important;
}

body:not(.is-dark-mode) .hero-subtitle {
    color: #555555 !important;
}

/* Light mode card styling */
body:not(.is-dark-mode) .post-card {
    background: #ffffff !important;
    border: 1px solid #d0d0d0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

body:not(.is-dark-mode) .post-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    border-color: #b0b0b0 !important;
}

/* Light mode card content - EXPLICIT dark text */
body:not(.is-dark-mode) .post-card__content {
    background: #ffffff !important;
}

body:not(.is-dark-mode) .post-card__title,
body:not(.is-dark-mode) .post-card__title a {
    color: #1a1a1a !important;
}

body:not(.is-dark-mode) .post-card__title a:hover {
    color: #2563eb !important;
}

body:not(.is-dark-mode) .post-card__excerpt,
body:not(.is-dark-mode) .post-card__excerpt p {
    color: #444444 !important;
}

body:not(.is-dark-mode) .post-card__meta,
body:not(.is-dark-mode) .post-card__meta span,
body:not(.is-dark-mode) .post-card__meta a,
body:not(.is-dark-mode) .post-card__meta time {
    color: #666666 !important;
}

/* Light mode card image background */
body:not(.is-dark-mode) .post-card__image {
    background: #f0f0f0 !important;
}

/* Light mode footer */
body:not(.is-dark-mode) .site-footer,
body:not(.is-dark-mode) .site-footer__bar {
    background: #ffffff !important;
    border-top: 1px solid #e0e0e0 !important;
}

body:not(.is-dark-mode) .site-footer a,
body:not(.is-dark-mode) .site-footer p,
body:not(.is-dark-mode) .footer-links a {
    color: #444444 !important;
}

body:not(.is-dark-mode) .footer-links a:hover {
    color: #2563eb !important;
}

/* Light mode code blocks */
body:not(.is-dark-mode) code,
body:not(.is-dark-mode) pre {
    background: #f5f5f5 !important;
    border: 1px solid #d0d0d0 !important;
    color: #1a1a1a !important;
}

/* Light mode timeline circles */
body:not(.is-dark-mode) .timeline-label::after {
    background: #ffffff !important;
    border-color: #d0d0d0 !important;
    box-shadow: 0 0 0 6px #fafafa !important;
}

body:not(.is-dark-mode) .timeline-item:has(> .wp-block-group:hover) .timeline-label::after {
    background: #2563eb !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.3), 0 0 0 6px #fafafa !important;
}

/* Light mode timeline line */
body:not(.is-dark-mode) .timeline::before,
body:not(.is-dark-mode) .wp-block-group.timeline::before {
    background: #d0d0d0 !important;
}

/* Light mode theme toggle button */
body:not(.is-dark-mode) .theme-toggle {
    color: #1a1a1a !important;
    border-color: #d0d0d0 !important;
}

body:not(.is-dark-mode) .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    border-color: #666 !important;
    color: #1a1a1a !important;
}

/* Override NFD/Plugin inline styles */
figure.wp-block-post-featured-image {
    background: transparent !important;
    margin-bottom: 0 !important;
    aspect-ratio: 16 / 9 !important;
}

figure.nfd-rounded {
    border-radius: 0 !important;
}

figure[style*="margin-bottom"] {
    margin-bottom: 0 !important;
}

figure[style*="aspect-ratio"] {
    aspect-ratio: 16 / 9 !important;
}

.nfd-gap-xl {
    gap: 1.5rem !important;
}

/* Override WordPress default body bg */
body {
    background: #0d1117 !important;
}

html,
body,
.wp-site-blocks {
    min-height: 0 !important;
    height: auto !important;
}

.wp-site-blocks {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
}

/* Prevent sticky footer layout from WordPress */
body.page .wp-site-blocks,
body.single .wp-site-blocks {
    display: block !important;
    min-height: 0 !important;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: relative;
    z-index: 100;
    border-bottom: 1px solid #222 !important;
}

.site-title,
.wp-block-site-title {
    font-weight: 650 !important;
    font-size: 1.4rem !important;
    letter-spacing: -0.02em !important;
    text-transform: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif !important;
}

.site-title a,
.wp-block-site-title a {
    text-decoration: none !important;
    transition: opacity 0.2s ease !important;
}

.site-title a:hover,
.wp-block-site-title a:hover {
    opacity: 0.7 !important;
}

/* Navigation block styling */
.wp-block-navigation,
.header-nav-list,
.header-nav-group {
    display: flex !important;
    align-items: center;
    gap: 2rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.wp-block-navigation ul,
.header-nav-list {
    display: flex !important;
    align-items: center;
    gap: 2rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.wp-block-navigation li,
.header-nav-list > li {
    margin: 0 !important;
    padding: 0 !important;
}

.header-nav-link {
    margin: 0 !important;
    padding: 0 !important;
}

.wp-block-navigation a,
.header-nav-list a,
.header-nav-link a {
    font-size: 1rem !important;
    letter-spacing: -0.01em !important;
    text-transform: none !important;
    font-weight: 500 !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif !important;
    text-decoration: none !important;
    color: var(--color-text-secondary) !important;
    transition: opacity 0.2s ease !important;
    display: block;
    padding: 0;
}

.wp-block-navigation a:hover,
.header-nav-list a:hover,
.header-nav-link a:hover {
    opacity: 0.7 !important;
}

.site-header .wp-block-navigation {
    display: none !important;
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--wp--preset--color--border, #30363d);
    color: var(--wp--preset--color--text, #c9d1d9);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 6px;
    line-height: 1;
    transition: border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    
    margin-left: 1.5rem;
}

.theme-toggle:hover {
    border-color: var(--wp--preset--color--accent, #ef7337);
    color: var(--wp--preset--color--accent, #ef7337);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

body:not(.is-dark-mode) .theme-toggle .icon-sun { display: inline; }
body:not(.is-dark-mode) .theme-toggle .icon-moon { display: none; }
body.is-dark-mode .theme-toggle .icon-sun { display: none; }
body.is-dark-mode .theme-toggle .icon-moon { display: inline; }

/* ==========================================================================
   Post Grid / Cards
   ========================================================================== */

/* Fix the large gap between hero and query */
.wp-block-query.alignwide {
    margin-top: 0 !important;
    padding-top: 1rem !important;
}

/* Post template grid */
.wp-block-post-template.is-layout-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.wp-block-post-template.is-layout-grid > li {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    display: contents !important;
}

/* Card wrapper - use more specific selectors */
.wp-block-post .wp-block-group.post-card,
.wp-block-group.post-card {
    border: 1px solid #1a1a1a !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    background: #111 !important;
    height: 100% !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

.wp-block-post:hover .wp-block-group.post-card,
.wp-block-group.post-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

/* Image zoom on hover */
.wp-block-post:hover .wp-block-group.post-card .post-card__image img,
.wp-block-group.post-card:hover .post-card__image img {
    transform: scale(1.08) !important;
    transition: transform 0.4s ease !important;
}

/* Featured image inside card */
.post-card__image {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    display: block !important;
    border-radius: 12px 12px 0 0 !important;
    background: #161b22 !important;
}

.post-card__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.4s ease !important;
}

.post-card__image .wp-block-post-featured-image,
.wp-block-post .wp-block-post-featured-image {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: block !important;
}

/* Hide broken image alt text */
.wp-block-post-featured-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.wp-block-post-featured-image img[alt]:not([src]),
.wp-block-post-featured-image img:not([src]) {
    font-size: 0 !important;
    color: transparent !important;
}

.post-card__image img,
.post-card__image .wp-block-post-featured-image img,
.wp-block-post .wp-block-post-featured-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
}

.post-card__image a,
.wp-block-post .wp-block-post-featured-image a {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

/* Card content area */
.post-card__content {
    padding: 1rem 1.25rem 1.25rem !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.post-card__meta {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: var(--color-text-secondary) !important;
    letter-spacing: 0.08em !important;
    margin-bottom: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
}

.post-card__meta * {
    color: var(--color-text-secondary) !important;
    text-decoration: none !important;
    font-weight: 700 !important;
}

.post-card__meta .wp-block-post-terms {
    display: flex;
    align-items: center;
}

.post-card__meta .wp-block-post-terms::after {
    content: "•";
    margin-left: 0.5rem;
    color: var(--color-text-secondary);
}

.post-card__title {
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
    margin: 0 0 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
}

.post-card__title a {
    text-decoration: none !important;
    color: var(--color-text) !important;
}

.post-card__title a:hover {
    color: var(--color-accent) !important;
}

.post-card__excerpt {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    color: var(--color-text-secondary) !important;
    margin: 0 !important;
    flex: 1 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* ==========================================================================
   Homepage Title Area
   ========================================================================== */

.wp-block-heading {
    font-size: clamp(2rem, 5vw, 3.25rem) !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
}

.wp-block-site-tagline {
    font-size: 1.1rem !important;
    color: #8b949e !important;
}

/* Hero padding */
.wp-block-group.alignwide {
    padding-top: 2.5rem !important;
    padding-bottom: 1rem !important;
    padding-left: 9rem !important;
    padding-right: 9rem !important;
}

/* Pages: reduce gap between header and intro text */
.page .wp-site-blocks > .wp-block-group.alignwide {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* No gap between content wrapper and footer */
.wp-site-blocks > div[style*="padding-top"] + footer.site-footer,
.wp-site-blocks > .wp-block-group.alignwide + footer.site-footer {
    margin-top: 0 !important;
}

/* Kill WordPress inline layout-flow margin on the footer */
:where(.wp-site-blocks) > footer.site-footer {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}

:root :where(.is-layout-flow) > footer.site-footer {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}

:root :where(.is-layout-constrained) > footer.site-footer {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}

/* Zero gap on the timeline wrapper */
.page :where(.wp-site-blocks) > :last-child {
    margin-block-end: 0 !important;
}

/* ==========================================================================
   Single Post
   ========================================================================== */

/* Single post header section */
.single-post-header-section {
    padding-top: 2rem !important;
    padding-left: 9rem !important;
    padding-right: 9rem !important;
    padding-bottom: 1rem !important;
}

.single-post-header {
    margin-bottom: 0 !important;
}

.single-post-header h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem) !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 0.75rem !important;
}

.single-post-meta {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: var(--color-text-secondary) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-bottom: 0.75rem !important;
}

.single-post-meta * {
    color: var(--color-text-secondary) !important;
    text-decoration: none !important;
}

.single-post-meta .wp-block-post-terms::after {
    content: "•";
    margin-left: 0.5rem;
}

.single-post-image,
.single-post-image .wp-block-post-featured-image {
    width: 100% !important;
    max-width: 800px !important;
    margin: 0 0 2rem 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    aspect-ratio: 16 / 9 !important;
}

.single-post-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 12px !important;
}

/* Single post content section */
.single-post-content-section {
    padding-left: 9rem !important;
    padding-right: 9rem !important;
    padding-bottom: 4rem !important;
}

/* Post content images - much smaller */
.entry-content img,
.entry-content .wp-block-image img {
    max-width: 420px !important;
    height: auto !important;
    border-radius: 8px !important;
    margin: 1.5rem 0 !important;
}

.entry-content .wp-block-image {
    max-width: 420px !important;
}

.entry-content {
    max-width: none !important;
    margin-left: 0 !important;
    width: 100% !important;
}

.entry-content p {
    font-size: 1rem !important;
    line-height: 1.75 !important;
    margin-bottom: 1.25rem !important;
    color: var(--color-text-secondary) !important;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
    color: var(--color-text) !important;
    margin-top: 2.5rem !important;
    margin-bottom: 0.75rem !important;
}

.entry-content h2 {
    font-size: 1.6rem !important;
}

.entry-content h3 {
    font-size: 1.3rem !important;
}

.entry-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px !important;
    margin: 1.5rem 0 !important;
}

.entry-content a {
    color: var(--color-text) !important;
    text-decoration: underline !important;
    text-decoration-color: var(--color-text-secondary) !important;
    text-underline-offset: 3px !important;
}

.entry-content a:hover {
    color: var(--color-accent) !important;
    text-decoration-color: var(--color-accent) !important;
}

.entry-content code {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-size: 0.9em !important;
    background: var(--color-bg-secondary) !important;
    padding: 0.2em 0.4em !important;
    border-radius: 4px !important;
}

.entry-content pre {
    background: var(--color-bg-secondary) !important;
    padding: 1.25rem !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    margin: 1.5rem 0 !important;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.25rem !important;
    padding-left: 1.5rem !important;
}

.entry-content li {
    margin-bottom: 0.5rem !important;
    line-height: 1.7 !important;
    color: var(--color-text-secondary) !important;
}

.entry-content blockquote {
    border-left: 3px solid var(--color-border) !important;
    padding-left: 1.5rem !important;
    margin: 1.5rem 0 !important;
    font-style: italic !important;
    color: var(--color-text-tertiary) !important;
}

.entry-content h2 {
    
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.entry-content a {
    color: #ef7337;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content pre {
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.entry-content blockquote {
    border-left: 3px solid #ef7337;
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #8b949e;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    margin-top: 0 !important;
    padding: 0 !important;
    position: relative;
    z-index: 10;
    background: transparent !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

footer.wp-block-template-part {
    margin-block-start: 0.5rem !important;
    margin-block-end: 0 !important;
    padding: 0 !important;
}

.site-footer__bar {
    align-items: center !important;
    border-top: 1px solid #30363d !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    height: 32px !important;
    min-height: 0 !important;
    padding: 0 9rem !important;
    padding-bottom: 1.5rem !important;
}

/* Page footer matches homepage footer width */
.page .site-footer__bar {
    /* inherits .site-footer__bar padding: 0 9rem */
}

.footer-copyright {
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    color: #8b949e !important;
    margin: 0 !important;
}

.footer-links {
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}

.footer-links a {
    color: #8b949e !important;
    text-decoration: none !important;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #ef7337 !important;
}

/* ==========================================================================
   Search
   ========================================================================== */

.wp-block-search__input {
    background: #161b22 !important;
    color: #c9d1d9 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
}

.wp-block-search__button {
    background: #ef7337 !important;
    color: #0d1117 !important;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.wp-block-query-pagination {
    display: flex !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    margin-top: 3rem !important;
}

.wp-block-query-pagination .wp-block-query-pagination-next,
.wp-block-query-pagination .wp-block-query-pagination-previous {
    
    font-size: 0.85rem !important;
    padding: 0.5rem 1rem !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #c9d1d9 !important;
    transition: border-color 0.2s;
    background: none !important;
}

.wp-block-query-pagination .wp-block-query-pagination-next:hover,
.wp-block-query-pagination .wp-block-query-pagination-previous:hover {
    border-color: #ef7337 !important;
}

/* ==========================================================================
   Archive Heading
   ========================================================================== */

.wp-block-query-title {
    font-size: clamp(2rem, 5vw, 3rem) !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   Timeline — line on each .wp-block-group::before, circle on
   .timeline-label::after. Both in the same reference frame (the grid row).
   No overlapping lines, just one segment per row.
   ========================================================================== */

.timeline,
.wp-block-group.timeline,
.wp-block-group.timeline.is-layout-flow {
    --timeline-line-left: 177px;
    position: relative !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-bottom: 0 !important;
}

/* Kill all old pseudo elements */
.timeline::before,
.timeline::after,
.wp-block-group.timeline::before,
.wp-block-group.timeline::after,
.wp-block-group.timeline.is-layout-flow::before,
.wp-block-group.timeline.is-layout-flow::after,
.timeline-item::before,
.timeline-item::after,
.timeline-label::before {
    display: none !important;
}

/* Single line on the container, capped at the first and last circle centers.
   Uses CSS counters to find the number of items, then positions the line
   between the first and last circles via JS-set custom properties.
   Fallback: line from top:9px to bottom:9px of the .timeline container. */
.timeline::before,
.wp-block-group.timeline::before,
.wp-block-group.timeline.is-layout-flow::before {
    content: '' !important;
    display: block !important;
    position: absolute;
    left: var(--timeline-line-left);
    top: var(--timeline-line-top, 9px);
    bottom: var(--timeline-line-bottom, 9px);
    width: 1px;
    background: rgba(255,255,255,0.2);
    pointer-events: none;
}

.timeline-item {
    position: relative;
    padding: 0 !important;
    margin: 24px 0 0 0 !important;
}

.timeline-item:first-child {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Row: 3-column grid — label | spacer | content */
.timeline-item > .wp-block-group {
    display: grid !important;
    grid-template-columns: 140px 40px minmax(0, 1fr) !important;
    column-gap: 20px !important;
    align-items: baseline !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
}

/* Kill per-row pseudo elements */
.timeline-item > .wp-block-group::before,
.timeline-item > .wp-block-group::after {
    display: none !important;
}

/* Label */
.timeline-label {
    position: relative !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.12em !important;
    color: var(--color-text-tertiary) !important;
    margin: 0 !important;
    width: 140px !important;
    padding: 0 24px 0 0 !important;
    line-height: 1 !important;
    text-align: right !important;
}

/* Circle on .timeline-label::after — centered on the vertical line using the same var.
   Circle left = line-left - 9 (half of 18px) so center aligns with the 1px line.
   box-shadow halo masks the line through the circle. */
.timeline-label::after {
    content: '';
    position: absolute;
    left: calc(var(--timeline-line-left) - 9px);
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    box-sizing: border-box;
    background: var(--color-bg);
    border: 2px solid var(--color-border-light);
    border-radius: 50%;
    box-shadow: 0 0 0 6px var(--color-bg);
    pointer-events: none;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Hover fills circle */
.timeline-item:has(> .wp-block-group:hover) .timeline-label::after {
    background: var(--color-text);
    border-color: var(--color-text);
    box-shadow: 0 0 8px rgba(255,255,255,0.25), 0 0 0 6px var(--color-bg);
}

/* Label grid placement */
.timeline-item > .wp-block-group > .timeline-label,
.timeline-item > .wp-block-group > .wp-block-group:first-child {
    grid-column: 1 !important;
}

/* Content: title vertically aligned with label (no padding needed) */
.timeline-content,
.timeline-item > .wp-block-group > .wp-block-group.is-layout-flow {
    padding-left: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    grid-column: 3 !important;
}

.timeline-title {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: var(--color-text) !important;
    margin: 0 !important;
    padding: 0 !important;
    letter-spacing: -0.02em;
    line-height: 1.3 !important;
}

.timeline-desc {
    font-size: 13px !important;
    line-height: 1.45 !important;
    color: var(--color-text-secondary) !important;
    margin-top: 6px !important;
}

/* Kill WordPress margin overrides */
:root :where(.timeline-item.is-layout-flow) > * {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}
:root :where(.timeline-item .wp-block-group.is-layout-flow) > * {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}
.timeline-item > .wp-block-group[style*="is-layout-flex"] {
    gap: 0 !important;
}
.timeline-item .wp-block-group.is-layout-flow {
    gap: 0 !important;
}

/* Fade up animation */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Introduction text */
.intro-text {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Navigation visibility
   ========================================================================== */

.site-header .wp-block-navigation,
.site-footer .wp-block-navigation {
    display: flex !important;
}

/* ==========================================================================
   Desktop-only overrides for About page
   ========================================================================== */

@media (min-width: 1025px) {
    /* Pixel-perfect header padding across all pages */
    .site-header .wp-block-group.alignwide {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
        padding-left: 9rem !important;
        padding-right: 9rem !important;
    }

    /* Smaller intro title on desktop */
    .page .intro-text {
        font-size: clamp(1.5rem, 2.5vw, 2rem) !important;
    }

    /* Consistent padding - 1rem on all page types */
    .page .wp-site-blocks > .wp-block-group.alignwide {
        padding-top: 1rem !important;
    }

    .single-post-header-section {
        padding-top: 1rem !important;
    }

    .page .intro-text {
        margin-top: 0 !important;
    }

    /* Homepage heading matches About intro exactly (size, weight, alignment, spacing) */
    .home .wp-block-heading {
        font-size: clamp(1.5rem, 2.5vw, 2rem) !important;
        font-weight: 600 !important;
        text-align: center !important;
        max-width: 800px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 0 !important;
    }

    .home .wp-block-site-tagline {
        text-align: center !important;
        max-width: 800px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Homepage - consistent padding with other pages */
    .home > .wp-site-blocks > .wp-block-group.alignwide {
        padding-top: 1rem !important;
        padding-bottom: 0 !important;
    }
    
    /* Reset header inner padding on homepage to match other pages */
    .home .site-header .wp-block-group.alignwide {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {

    /* ---- Global side padding ---- */
    .wp-block-group.alignwide,
    .single-post-header-section,
    .single-post-content-section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Header inner group padding - consistent on all pages */
    .site-header .wp-block-group.alignwide {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Navigation */
    .site-header .wp-block-navigation {
        display: flex !important;
    }

    .wp-block-navigation,
    .header-nav-list,
    .header-nav-group {
        gap: 1rem !important;
    }

    .wp-block-navigation a,
    .header-nav-list a,
    .header-nav-link a {
        font-size: 0.8rem !important;
    }

    /* Post grid: single column */
    .wp-block-post-template.is-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Homepage and About page: reduced top padding on mobile */
    .home .wp-site-blocks > .wp-block-group.alignwide,
    .page .wp-site-blocks > .wp-block-group.alignwide {
        padding-top: 1rem !important;
        padding-bottom: 0.75rem !important;
    }

    .single-post-header-section {
        padding-top: 1rem !important;
    }

    .wp-block-heading {
        font-size: 1.6rem !important;
    }

    /* Single post */
    .single-post-header h1 {
        font-size: 1.3rem !important;
    }

    .entry-content h2 {
        font-size: 1.2rem !important;
    }

    .entry-content h3 {
        font-size: 1.05rem !important;
    }

    .entry-content img {
        max-width: 100% !important;
    }

    /* Timeline: stack vertically */
    .timeline,
    .wp-block-group.timeline,
    .wp-block-group.timeline.is-layout-flow {
        margin-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: 0 !important;
        --timeline-line-left: 9px;
    }

    /* Container line */
    .timeline::before,
    .wp-block-group.timeline::before,
    .wp-block-group.timeline.is-layout-flow::before {
        left: var(--timeline-line-left) !important;
    }

    .timeline-item {
        padding: 20px 0 0 0 !important;
        padding-left: 36px !important;
    }

    .timeline-item:first-child {
        padding-top: 0 !important;
    }

    /* Circle at line position */
    .timeline-label::after {
        left: -36px !important;
    }

    /* Stack grid */
    .timeline-item > .wp-block-group {
        display: block !important;
        grid-template-columns: 1fr !important;
    }

    .timeline-item > .wp-block-group[style*="is-layout-flex"],
    .timeline-item > .wp-block-group.is-layout-flex {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .timeline-item > .wp-block-group.is-layout-flex > .wp-block-group.is-layout-flow {
        display: block !important;
    }

    .timeline-label {
        width: auto !important;
        margin-bottom: 0.2rem !important;
        padding-top: 0 !important;
        padding-right: 0 !important;
        text-align: left !important;
        flex: none !important;
    }

    .timeline-content {
        padding-left: 0 !important;
        padding-top: 0 !important;
    }

    .timeline-title {
        font-size: 1.1rem !important;
    }

    .timeline-desc {
        font-size: 0.85rem !important;
    }

    /* Footer */
    .site-footer__bar {
        padding: 0 1rem !important;
        padding-bottom: 1.5rem !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        height: auto !important;
        min-height: 28px !important;
        gap: 0.5rem !important;
    }

    .page .site-footer__bar {
        max-width: 100% !important;
    }

    .footer-copyright,
    .footer-links {
        font-size: 0.75rem !important;
    }

    /* Pagination */
    .wp-block-query-pagination {
        margin-top: 1.5rem !important;
    }

    /* Query alignwide (homepage cards) */
    .wp-block-query.alignwide {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Post card content */
    .post-card__content {
        padding: 0.75rem 1rem 1rem !important;
    }

    .post-card__title {
        font-size: 1rem !important;
    }

    /* Page content wrapper */
    .page .wp-site-blocks > .wp-block-group.alignwide {
        padding-bottom: 0 !important;
    }
}
