:root {
    /* Brand Colors - Official Pantone Values (2012 Logo by Laura)
     * Primary: PANTONE 7466 U (Uncoated)
     * CMYK: 70/0/23/0
     * sRGB: #00B2A9 (fallback for standard displays)
     * Note: The previous #1fbeca was close but not brand-accurate
     */
    --primary: #00B2A9;
    --primary-dark: #008c85;

    --text: #1a1a1a;
    --text-muted: #666;
    --border: #d4d4d4;
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --bg-image: #f5f5f5;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    /* Typography */
    --font-base: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    --line-height: 1.6;
    --line-height-tight: 1.3;
}

/* Wide-gamut display support for more accurate Pantone 7466 U representation
 * Standard displays use sRGB (#00B2A9)
 * Modern MacBooks, iPhones, iPad Pros render Display P3 more accurately
 * Ultra-wide displays can use LAB for device-independent color
 */
@media (color-gamut: p3) {
    :root {
        /* Display P3 color space - closer to true Pantone 7466 U */
        --primary: color(display-p3 0 0.698 0.662);
        --primary-dark: color(display-p3 0 0.549 0.522);
    }
}

@media (color-gamut: rec2020) {
    :root {
        /* LAB color space - device-independent perceptual color
         * Closest to how Pantone 7466 U actually looks in real life
         */
        --primary: lab(69% -38 -3);
        --primary-dark: lab(54% -30 -2);
    }
}

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

* {
    margin: 0;
    padding: 0;
}

/* Base */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-base);
    line-height: var(--line-height);
    color: var(--text);
    background: var(--bg);
}

/* Layout - 70/30 split with sidebar */
.site-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

.site-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

@media (min-width: 1024px) {
    .site-content {
        grid-template-columns: 1fr 320px;
    }
}

.main-content {
    min-width: 0; /* Prevent grid blowout */
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
}

/* Utility bar — matches WordPress #extraHeaderInfo */
.header-utility {
    background: #32373c;
    padding: 0.4rem 0;
    font-size: 0.8rem;
}

.header-utility ul {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    list-style: none;
    align-items: center;
}

.header-utility,
.header-utility a {
    color: #ccc;
    text-decoration: none;
}

.header-utility a:hover {
    color: #fff;
}

/* Main header — logo + nav */
.header-main {
    background: #fff;
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
}

.header-main .site-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo img {
    height: 50px;
    width: auto;
}

.site-nav > ul {
    display: flex;
    gap: var(--space-md);
    list-style: none;
    align-items: center;
}

.site-nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a:focus {
    color: var(--primary);
    outline: none;
}

.nav-current {
    color: var(--primary) !important;
    font-weight: 600;
}

/* Dropdown menus */
.has-dropdown {
    position: relative;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    padding: 0.5rem 0;
    z-index: 200;
    list-style: none;
}

.has-dropdown:hover > .dropdown {
    display: block;
}

.dropdown li {
    width: 100%;
}

.dropdown a {
    display: block;
    padding: 0.4rem 1rem;
    font-size: 0.875rem !important;
    white-space: nowrap;
    color: var(--text) !important;
}

.dropdown a:hover {
    background: var(--bg-alt);
    color: var(--primary) !important;
}

/* Mobile nav */
@media (max-width: 768px) {
    .header-utility ul {
        justify-content: center;
        gap: var(--space-sm);
    }

    .header-main .site-wrapper {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .site-nav > ul {
        gap: var(--space-sm);
        flex-wrap: wrap;
        justify-content: center;
    }

    .site-nav a {
        font-size: 0.85rem;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: var(--line-height-tight);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    margin-bottom: var(--space-md);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: var(--space-lg) 0 var(--space-sm);
}

h2:first-child {
    margin-top: 0;
}

h2 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

h2 a:hover,
h2 a:focus {
    color: var(--primary);
}

h3 {
    font-size: 1.5rem;
    margin: var(--space-md) 0 var(--space-sm);
}

h4 {
    font-size: 1.25rem;
    margin: var(--space-md) 0 var(--space-xs);
}

p {
    margin-bottom: var(--space-sm);
}

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

a:hover,
a:focus {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Post list */
.post-list {
    list-style: none;
}

.post-preview {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.post-preview:last-child {
    border-bottom: none;
}

.post-meta {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.post-meta .separator {
    opacity: 0.5;
}

.post-categories {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.post-categories a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-alt);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.post-categories a:hover {
    background: var(--primary);
    color: white;
    text-decoration: none;
}

.post-excerpt {
    color: var(--text-muted);
    margin: var(--space-sm) 0;
}

.read-more {
    display: inline-block;
    margin-top: var(--space-xs);
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.read-more:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.read-more::after {
    content: ' →';
}

/* Sticky post highlight */
.post-preview.sticky {
    background: var(--bg-alt);
    padding: var(--space-md);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.sticky-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    margin-bottom: var(--space-sm);
}

/* Individual post */
.post-header {
    margin-bottom: var(--space-lg);
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.75;
}

.post-content > * {
    margin-bottom: var(--space-sm);
}

.post-content h2 {
    margin-top: var(--space-xl);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    background: var(--bg-image);
    margin: var(--space-lg) 0;
}

.post-content a {
    font-weight: 500;
}

/* Code blocks */
.post-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-alt);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.post-content pre {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-md);
    overflow-x: auto;
    margin: var(--space-md) 0;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
}

/* Lists */
.post-content ul,
.post-content ol {
    margin-left: var(--space-md);
    margin-bottom: var(--space-sm);
}

.post-content li {
    margin-bottom: var(--space-xs);
}

/* Blockquotes */
.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: var(--space-md);
    margin: var(--space-md) 0;
    color: var(--text-muted);
    font-style: italic;
}

/* Post tags */
.post-tags {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.post-tags .tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-alt);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
}

.post-tags .tag:hover {
    background: var(--primary);
    color: white;
}

/* Post navigation */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.post-nav a {
    display: block;
    padding: var(--space-md);
    background: var(--bg-alt);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

.post-nav a:hover {
    background: var(--border);
}

.post-nav .nav-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

@media (max-width: 768px) {
    .post-nav {
        grid-template-columns: 1fr;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: var(--space-xl) 0;
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border);
}

.pagination a {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-alt);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.pagination a:hover {
    background: var(--primary);
    color: white;
}

.pagination .page-number {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: calc(90px + var(--space-md));
    height: fit-content;
}

.sidebar-section {
    margin-bottom: var(--space-xl);
}

.sidebar-section h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
    color: var(--text);
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section li {
    margin-bottom: var(--space-xs);
}

.sidebar-section a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.sidebar-section a:hover {
    color: var(--primary);
}

/* Newsletter signup */
.newsletter-signup {
    padding: var(--space-md);
    background: var(--bg-alt);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.newsletter-signup h3 {
    margin-top: 0;
}

.newsletter-signup p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.newsletter-signup input {
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-base);
    font-size: 0.95rem;
    margin-bottom: var(--space-xs);
}

.newsletter-signup button {
    width: 100%;
    padding: var(--space-xs) var(--space-md);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: var(--font-base);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-signup button:hover {
    background: var(--primary-dark);
}

/* Archive list */
.archive-list {
    max-height: 300px;
    overflow-y: auto;
}

.archive-list::-webkit-scrollbar {
    width: 8px;
}

.archive-list::-webkit-scrollbar-track {
    background: var(--bg-alt);
    border-radius: 4px;
}

.archive-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Footer */
.site-footer {
    margin-top: var(--space-xl);
    padding: var(--space-xl) 0 var(--space-lg);
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
}

.footer-content {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    list-style: none;
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

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

/* Mobile refinements */
@media (max-width: 768px) {
    .site-content {
        margin-top: var(--space-md);
    }

    .post-content {
        font-size: 1rem;
    }

    .sidebar {
        margin-top: var(--space-xl);
        position: static;
    }
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
