/* 
  Theme: Cyberpunk Engineering
  Author: Ghost Experimenter
*/

/* --- Variables & Reset --- */
:root {
    --color-bg: #050505;
    --color-bg-alt: #0e0e10;
    --color-primary: #FCEE0A; /* Cyber Yellow */
    --color-secondary: #00E5FF; /* Neon Blue */
    --color-accent: #FF003C; /* Error Red */
    --color-text: #e0e0e0;
    --color-text-muted: #888888;
    
    --font-heading: 'Rajdhani', sans-serif;
    --font-body: 'Share Tech Mono', monospace;
    --font-code: 'Fira Code', monospace;

    --gap: 2rem;
    --border-width: 2px;
}

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

html {
    font-size: 80%; /* Mimic ~75-80% zoom (approx 12.8px base) */
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0;
    color: #fff;
}

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

a:hover {
    color: var(--color-secondary);
    text-shadow: 0 0 8px var(--color-secondary);
}

/* --- Layout --- */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-image: 
        linear-gradient(rgba(5, 5, 5, 0.95), rgba(5, 5, 5, 0.95)),
        url("https://images.unsplash.com/photo-1555680202-c86f0e12f086?q=80&w=2670&auto=format&fit=crop"); /* Placeholder cyberpunk bg */
    background-size: cover;
    background-attachment: fixed;
}

.site-main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--gap);
}

/* --- Header & Nav --- */
.site-header {
    background-color: var(--color-bg-alt);
    border-bottom: var(--border-width) solid var(--color-primary);
    padding: 1rem 0;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 98% 100%, 0 100%);
}

.site-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--gap);
}

.site-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.site-logo a {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    text-shadow: 2px 2px 0px var(--color-accent);
}

.site-tagline {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.8rem; /* Increased spacing */
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    
    /* "Analog Drift" Effect */
    animation: analog-drift 4s infinite; /* Increased frequency */
}

@keyframes analog-drift {
    0%, 95% {
        text-shadow: none;
        opacity: 1;
        transform: translate(0);
    }
    96% {
        text-shadow: 2px 0 var(--color-secondary), -2px 0 var(--color-accent);
        opacity: 0.8;
        transform: translate(-1px, 0);
    }
    97% {
        text-shadow: -2px 0 var(--color-secondary), 2px 0 var(--color-accent);
        opacity: 0.9;
        transform: translate(1px, 0);
    }
    98% {
        text-shadow: none;
        opacity: 1;
        transform: translate(0);
    }
    99% {
        text-shadow: 1px 0 var(--color-secondary);
        opacity: 0.5;
    }
    100% {
        text-shadow: none;
        opacity: 1;
    }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 700px) {
    .site-nav {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center; /* Enforce global flex centering */
    }

    .site-logo {
        width: 100%; /* Ensure container spans full width */
        align-items: center !important; /* Force flex center alignment */
        text-align: center !important; /* Force text center alignment */
    }

    .site-tagline {
        display: block; /* Ensure it respects text-align */
        width: 100%;
        text-align: center;
    }

    .site-nav ul,
    .nav,
    .nav-list {
        flex-direction: row !important; /* Keep side-by-side on mobile */
        flex-wrap: wrap !important;
        justify-content: center;
        gap: 1.5rem;
        width: 100%;
        margin-top: 1rem;
    }

    .site-nav ul li,
    .nav li,
    .nav-list li {
        margin-right: 0 !important;
        width: auto !important; /* Allow natural width */
        text-align: center;
    }
}

/* Navigation: Target Generic UL, Ghost Default .nav, and my .nav-list */
.site-nav ul, 
.nav, 
.nav-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    list-style: none !important;
    list-style-type: none !important;
    margin: 0;
    padding: 0;
    gap: 2rem;
    align-items: center;
}

.site-nav ul li,
.nav li,
.nav-list li {
    list-style: none !important;
    margin: 0;
    padding: 0;
    display: block;
}

.site-nav ul li:not(:last-child),
.nav li:not(:last-child),
.nav-list li:not(:last-child) {
    margin-right: 2rem;
}

.site-nav ul li a,
.nav li a,
.nav-list li a {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    position: relative;
    padding: 0.5rem;
    transition: all 0.3s ease;
    font-family: var(--font-code);
    text-transform: uppercase;
    text-decoration: none !important;
}

/* Bracket HUD animation */
.site-nav ul li a::before,
.nav li a::before,
.nav-list li a::before,
.site-nav ul li a::after,
.nav li a::after,
.nav-list li a::after {
    display: inline-block;
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--color-primary);
}

.site-nav ul li a::before,
.nav li a::before, 
.nav-list li a::before {
    content: '[ ';
    transform: translateX(10px);
}

.site-nav ul li a::after,
.nav li a::after,
.nav-list li a::after {
    content: ' ]';
    transform: translateX(-10px);
}

.site-nav ul li a:hover::before,
.site-nav ul li a:hover::after,
.site-nav ul li.nav-current a::before,
.site-nav ul li.nav-current a::after,
.nav li a:hover::before,
.nav li a:hover::after,
.nav li.nav-current a::before,
.nav li.nav-current a::after,
.nav-list li a:hover::before,
.nav-list li a:hover::after,
.nav-list li.nav-current a::before,
.nav-list li.nav-current a::after {
    opacity: 1;
    transform: translateX(0);
}

.site-nav ul li a:hover,
.site-nav ul li.nav-current a,
.nav li a:hover,
.nav li.nav-current a,
.nav-list li a:hover,
.nav-list li.nav-current a {
    color: var(--color-primary);
    text-shadow: 0 0 2px var(--color-primary); /* Tightened glow */
}

/* --- Mobile Responsiveness --- */
@media (max-width: 700px) {
    .site-nav {
        flex-direction: column;
        gap: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .nav-list {
        width: 100%;
        justify-content: center;
        gap: 1.5rem;
    }
}

/* --- Post Grid (Index) --- */
.post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
}

.post-card {
    background-color: var(--color-bg-alt);
    border: 1px solid #333;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.2s;
    
    /* Cyberpunk Angled Corner */
    clip-path: polygon(
        10px 0, 100% 0, 
        100% calc(100% - 10px), calc(100% - 10px) 100%, 
        0 100%, 0 10px
    );
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-secondary);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.post-card::before {
    /* Decorative line */
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--color-primary);
    border-right: 2px solid var(--color-primary);
}

.post-card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.post-card-excerpt {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.post-card-tags {
    color: var(--color-secondary);
    font-family: var(--font-code);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.3rem;
}

.post-card-tags a {
    color: var(--color-secondary);
}

.article-tags a {
    color: var(--color-accent);
}


.post-card-content-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.post-card-content-link:hover {
    text-decoration: none;
    color: inherit;
}

.post-card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: var(--color-primary);
}

/* --- Single Post --- */
.article {
    background-color: rgba(14, 14, 16, 0.9);
    padding: 3rem;
    border-left: 4px solid var(--color-primary);
    position: relative;
}

.article-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1rem;
}

.article-title {
    font-size: 3rem;
    color: var(--color-primary);
}

.article-meta {
    color: var(--color-secondary);
    font-family: var(--font-code);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.gh-content {
    font-size: 1.2rem;
}

.gh-content p {
    margin-bottom: 1.5rem;
}

/* Code Blocks */
.gh-content pre {
    /* Overlay default prism theme */
    background: #000 !important;
    border: 1px solid #333;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: var(--font-code) !important;
    border-radius: 4px;
    position: relative;
    margin: 2rem 0;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.gh-content pre::before {
    content: 'SYS.LOG';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 0.7rem;
    color: #555;
    z-index: 10;
}

/* Clean up Ghost default code styling if any */
.gh-content code {
    background: rgba(255,255,255,0.1);
    color: var(--color-primary);
    padding: 0.1rem 0.3rem;
}

.gh-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    text-shadow: none !important;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--color-bg-alt);
    padding: 2rem;
    text-align: center;
    border-top: 2px solid #222;
    margin-top: 4rem;
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: #666;
}

/* --- Cyberpunk Visual Enhancements --- */

/* --- Cyberpunk Visual Enhancements --- */

/* 1. Glitch Text Effect */
h1:hover, .post-card-title a:hover {
    text-shadow: 
        2px 0 var(--color-accent), 
        -2px 0 var(--color-secondary);
    animation: glitch-anim 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
}

@keyframes glitch-anim {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) }
    60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) }
    100% { transform: translate(0) }
}

/* 2. System Boot Animation */
.site-wrapper {
    animation: system-boot 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes system-boot {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: scale(0.98);
    }
    10% {
        opacity: 0.5;
        filter: blur(4px);
    }
    50% {
        opacity: 0.8;
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

/* --- Ghost Koenig Editor Support --- */
.gh-content {
    /* Removed forced centering/width to restore original layout */
    width: 100%;
}

.gh-content > * {
    /* Allow content to fill the article card */
    max-width: 100%;
}

.kg-width-wide {
    width: 100%;
}

.kg-width-full {
    width: 100%;
}

.kg-image-card img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 4rem; /* Balanced spacing */
    font-family: var(--font-heading);
    color: var(--color-primary); /* Themed Cyber Yellow */
    text-shadow: 0 0 2px var(--color-primary); /* Subtle glow */
}

/* --- Tag Filter Deck --- */
.tag-filter-container {
    max-width: 1200px;
    margin: 2rem auto 3rem;
    padding: 0 var(--gap);
    text-align: center;
}

.tag-filter-label {
    font-family: var(--font-code);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-bottom: 1rem;
    opacity: 0.7;
    letter-spacing: 0.1em;
}

.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.tag-filter-item {
    font-family: var(--font-heading);
    color: var(--color-text);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.tag-filter-item .tag-bracket {
    color: var(--color-text-muted);
    font-weight: 300;
    transition: color 0.2s ease;
}

.tag-filter-item .tag-count {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    vertical-align: 1px;
    opacity: 0.6;
}

.tag-filter-item:hover {
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(252, 238, 10, 0.6);
}

.tag-filter-item:hover .tag-bracket {
    color: var(--color-secondary);
}

.tag-filter-item:hover .tag-count {
    color: var(--color-secondary);
    opacity: 1;
}

/* Active State (Current Tag or Home) */
.tag-filter-item.nav-current {
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(252, 238, 10, 0.8);
}

.tag-filter-item.nav-current .tag-bracket {
    color: var(--color-secondary);
    font-weight: 700;
}

/* --- Inline Glitch (Hijacking <mark>) --- */
mark {
    background-color: transparent;
    color: var(--color-secondary); /* Neon Blue */
    font-family: var(--font-code);
    padding: 0 0.2rem;
    display: inline-block;
    position: relative;
    text-shadow: 2px 0 var(--color-accent);
    animation: analog-drift 3s infinite; /* Reusing the glitch animation */
}
