/*
Theme Name: Olafnitz Editorial
Theme URI: https://olafnitz.net
Author: Antigravity
Description: A premium, dark editorial WordPress theme based on the Olafnitz Design System. Inspired by Rara Business functionality but with a sophisticated, high-end design.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: olafnitz-editorial
*/

:root {
    /* Colors */
    --bg-base: #000000;
    --bg-elevated: #0a0a0a;
    --ink-primary: #f4f4f2;
    --ink-dim: #9a9a96;
    --ink-faint: #5a5a56;
    --accent-primary: #1ca0eb;
    --accent-glow: rgba(28, 160, 235, 0.35);
    --rule-border: #1f1f1f;

    /* Typography */
    --font-serif: "Fraunces", serif;
    --font-sans: "Inter Tight", sans-serif;
    --font-mono: "JetBrains Mono", monospace;

    /* Layout */
    --gutter: 6vw;
    --section-v: 14vh;
    --prose-max-width: 68ch;
    --asymmetric-offset: 240px;
}

/* Base Styles */
* { box-sizing: border-box; }

body {
    background-color: var(--bg-base);
    color: var(--ink-primary);
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: 20px;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
    min-height: 100vh;
    
    /* Dark Blue Background Glow */
    background-image: radial-gradient(circle at 50% -20%, #001e31 0%, #000000 70%);
    background-attachment: fixed;
}

/* Grain Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
}

/* Layout Containers */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.asymmetric-layout {
    display: grid;
    grid-template-columns: var(--asymmetric-offset) 1fr;
    gap: 4rem;
}

.chapter-side, .entry-side, .content-side, .footer-side {
    text-align: right;
}

@media (max-width: 1024px) {
    .asymmetric-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .chapter-side, .entry-side, .content-side, .footer-side {
        text-align: left;
    }
}

/* Typography Scale */
h1, h2, h3, h4 {
    margin: 0 0 2rem 0;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--ink-primary);
}

.hero-title {
    font-size: clamp(48px, 10vw, 132px);
    line-height: 0.95;
    margin-bottom: 4rem;
}

h2, .section-title {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 400;
    margin-top: 6rem;
}

h3, .subheading {
    font-size: 32px;
    font-weight: 500;
    margin-top: 4rem;
    color: var(--ink-primary);
    border-bottom: 1px solid var(--rule-border);
    padding-bottom: 0.5rem;
}

h4 {
    font-size: 24px;
    font-weight: 500;
    margin-top: 3rem;
}

.lead {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.5;
    max-width: var(--prose-max-width);
    color: var(--ink-primary);
}

p {
    margin-bottom: 2rem;
}

/* Links - Editorial Style */
a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(28, 160, 235, 0.2);
}

a:hover {
    color: #91cdff;
    border-bottom-color: #91cdff;
}

a:active, a:focus {
    color: var(--accent-primary) !important;
    outline: none;
}

/* Navigation */
.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 3rem;
}

.masthead .logo a {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.05em;
}

.masthead .logo a span {
    color: var(--accent-primary);
}

.main-nav a {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-dim);
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    padding-bottom: 4px;
    position: relative;
}

.main-nav a:hover {
    color: #ffffff;
}

.main-nav .current-menu-item a {
    color: var(--accent-primary);
}

.main-nav .current-menu-item a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-primary);
}

/* Site Title / Logo */
.site-title {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 28px;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    margin: 0;
}

.site-title a {
    color: #ffffff;
    border: none;
    text-decoration: none;
}

.site-title .accent-dot {
    color: var(--accent-primary);
}

/* Components */
.masthead {
    padding: 3vh var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Very subtle line */
    background: rgba(0, 0, 0, 0.4); /* Subtle background lift */
    backdrop-filter: blur(15px); /* Modern frosted effect */
    position: sticky;
    top: 0;
    z-index: 1000;
    max-width: 100%; /* Spans full width for the line */
}

.chapter-header {
    padding: var(--section-v) 0;
    border-top: 1px solid var(--rule-border);
}

.chapter-number {
    font-size: 140px;
    color: var(--accent-primary);
    opacity: 0.8;
}

.pull-quote {
    font-size: 42px;
    font-style: italic;
    border-left: 8px solid var(--accent-primary);
    padding-left: 3rem;
    margin: 4rem 0;
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ink-faint);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1.2rem 2.4rem;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #1ca0eb, #004b72);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(28, 160, 235, 0.3);
}

/* Editorial Lists */
.entry-content ul {
    list-style: none;
    padding-left: 0;
    margin: 3rem 0;
}

.entry-content ul li {
    position: relative;
    padding: 1.5rem 0 1.5rem 3rem;
    border-bottom: 1px solid var(--rule-border);
    line-height: 1.6;
}

.entry-content ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2.2rem;
    width: 1.5rem;
    height: 1px;
    background-color: var(--accent-primary);
}

.entry-content ol {
    padding-left: 1.5rem;
    margin: 3rem 0;
}

.entry-content ol li {
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-serif);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--rule-border);
    padding: var(--section-v) 0 6vh 0;
    margin-top: 10vh;
}

/* Experience Boxes */
.experience-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 4rem 0;
}

.experience-card {
    background: #0f1418;
    padding: 3rem;
    border: 1px solid #1f1f1f;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease;
    text-align: left; /* Always left aligned in cards */
}

.experience-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
}

.experience-card::before {
    content: "";
    position: absolute;
    top: 2rem;
    left: 3rem;
    width: 2rem;
    height: 2px;
    background-color: var(--accent-primary);
}

.experience-card .card-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-primary);
    margin-top: 1rem;
    display: block;
}

.experience-card .card-title {
    font-size: 32px;
    font-weight: 500;
    margin: 0.5rem 0;
    color: #ffffff;
    font-family: var(--font-serif);
}

.experience-card .card-subtitle {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-dim);
    margin: 0;
}

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

/* Blog Archive */
.blog-article-preview .entry-title a:hover {
    color: var(--accent-primary);
}

.pagination-area .nav-links {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pagination-area a {
    border: none;
    color: var(--ink-dim);
}

.pagination-area a:hover {
    color: #ffffff;
}

/* Focus List Section */
.focus-list {
    display: flex;
    flex-direction: column;
    gap: 4vh;
}

.focus-item {
    margin-bottom: 4vh;
}

.focus-item-header {
    display: flex;
    align-items: center; /* Perfect vertical centering */
    gap: 16px;
    margin-bottom: 0.5rem;
}

.focus-marker {
    display: block;
    width: 24px;
    height: 1px;
    background: var(--accent-primary);
    flex-shrink: 0;
}

.focus-item-title {
    font-family: var(--font-ui);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0; /* Remove default margin for flex alignment */
    color: #ffffff;
}

.focus-item-desc {
    padding-left: 40px; /* Align description with the start of the title text */
    font-family: var(--font-ui);
    font-size: 18px;
    color: var(--ink-dim);
    line-height: 1.5;
    max-width: 680px;
}

/* Responsive Refinements */
@media (max-width: 1024px) {
    :root {
        --gutter: 5vw;
    }
    
    .asymmetric-layout {
        grid-template-columns: 140px 1fr;
        gap: 40px;
    }

    .hero-title {
        font-size: 72px;
    }
}

@media (max-width: 768px) {
    :root {
        --gutter: 24px; /* More breathing room on sides */
    }

    /* Reduce massive vertical spacing for mobile and ENSURE horizontal padding */
    section.container {
        padding: 6vh var(--gutter) !important;
        box-sizing: border-box;
    }

    .hero-section.container {
        padding: 8vh var(--gutter) !important;
        box-sizing: border-box;
    }

    .asymmetric-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .chapter-side {
        padding-bottom: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 10px;
    }

    .chapter-number {
        font-size: 48px;
    }

    .hero-title {
        font-size: 48px;
    }

    .section-title {
        font-size: 36px;
    }

    .masthead {
        flex-direction: column;
        gap: 20px;
        padding: 3vh var(--gutter);
        text-align: center;
        background: rgba(0, 0, 0, 0.8); /* Stronger background for mobile readability */
    }

    .masthead .logo a {
        font-size: 20px;
    }

    .main-nav ul {
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }

    .experience-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .focus-item-desc {
        padding-left: 0;
        margin-top: 10px;
    }
    
    .footer-side {
        margin-bottom: 10px;
    }

    /* Ensure no text "sticks" to the edges */
    .container {
        padding-left: var(--gutter);
        padding-right: var(--gutter);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 40px;
    }
    
    .section-title {
        font-size: 30px;
    }
    
    .lead {
        font-size: 18px;
    }
}

/* Micro-interactions & Animations */
@keyframes revealFade {
    from {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.hero-title, 
.hero-tagline,
.section-title,
.post-entry-title,
.page-header-title,
.entry-title {
    animation: revealFade 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-tagline {
    animation-delay: 0.2s;
    opacity: 0; /* Handled by animation */
}

.hero-title:hover,
.section-title:hover,
.post-entry-title:hover,
.page-header-title:hover,
.entry-title:hover {
    color: var(--accent-primary);
    transition: color 0.6s ease, transform 0.6s ease;
    cursor: default;
}

.post-entry-link {
    transition: all 0.4s ease;
    display: inline-block;
}

.post-entry:hover .post-entry-link {
    transform: translateX(10px);
    color: #ffffff;
}

.focus-item-title,
.experience-title {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-block;
}

.focus-item:hover .focus-item-title,
.experience-item:hover .experience-title {
    color: var(--accent-primary);
    transform: translateX(8px);
}

.focus-marker {
    transition: width 0.4s ease, background 0.4s ease;
}

.focus-item:hover .focus-marker {
    width: 40px;
    background: #ffffff;
}

.masthead .logo a {
    transition: letter-spacing 0.5s ease;
}

.masthead .logo a:hover {
    letter-spacing: 0.1em;
}

/* Button micro-interaction */
.btn-primary {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 163, 255, 0.3);
}

/* Editorial Canvas Template */
.editorial-content-canvas {
    width: 100%;
}

.editorial-content-canvas section {
    padding: 14vh 0;
}

@media (max-width: 768px) {
    .editorial-content-canvas section {
        padding: 8vh 0;
    }
}
