/* ═══════════════════════════════════════════════════
   THE SHAVER — Cyberpunk Matrix Theme
   Style: Dark, terminal, neon accents
   Version: 1.0.0
   ═══════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
    --matrix-green: #00ff41;
    --neon-cyan: #00d4ff;
    --neon-purple: #b829dd;
    --neon-pink: #ff2a6d;
    --dark-bg: #0a0a0f;
    --panel-bg: #1a1a2e;
    --darker-bg: #0f0f1a;
    --text-primary: #e0e0e0;
    --text-secondary: #7fdbca;
    --text-bright: #00ff41;
    --border-glow: rgba(0, 255, 65, 0.3);
    --scanline: rgba(0, 255, 65, 0.03);
    --font-mono: 'Courier New', 'Lucida Console', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition-speed: 0.2s;
    --max-width: 1200px;
    --header-height: 64px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    line-height: 1.6;
    background: var(--dark-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--text-bright); text-decoration: none; transition: color var(--transition-speed); }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── Scrollbar Styling ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--darker-bg); }
::-webkit-scrollbar-thumb {
    background: var(--panel-bg);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--matrix-green); }

/* ═══════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════ */
.gh-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.95);
    border-bottom: 1px solid var(--border-glow);
    backdrop-filter: blur(10px);
}

.gh-header-inner {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Desktop nav — visible on desktop, hidden on mobile */
.gh-desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gh-logo-link {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--matrix-green);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gh-logo-link:hover { color: var(--neon-cyan); }

.gh-logo {
    height: 32px;
    width: auto;
}

.gh-logo-text::after {
    content: '';
    animation: cursor-blink 1s step-end infinite;
}

.gh-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.gh-header-link {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.gh-header-link:hover {
    color: var(--matrix-green);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

.gh-search-btn {
    background: none;
    border: 1px solid var(--border-glow);
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 6px 12px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.gh-search-btn:hover {
    border-color: var(--matrix-green);
    color: var(--matrix-green);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

/* ── Menu Toggle (Mobile) ── */
.gh-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 8px;
}

.gh-menu-line {
    width: 24px;
    height: 2px;
    background: var(--matrix-green);
    transition: all var(--transition-speed);
}

.gh-menu-toggle.active .gh-menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.gh-menu-toggle.active .gh-menu-line:nth-child(2) {
    opacity: 0;
}

.gh-menu-toggle.active .gh-menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ═══════════════════════════════════════════════════
   NAVIGATION
   Dynamic: Styling applies to ALL items automatically
   ═══════════════════════════════════════════════════ */
.gh-navigation-list {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.gh-navigation-item {
    display: inline-block;
}

.gh-navigation-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: all var(--transition-speed) ease;
    position: relative;
}

.gh-navigation-link:hover {
    color: var(--matrix-green);
    border-color: var(--border-glow);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
    background: rgba(0, 255, 65, 0.03);
}

.gh-navigation-link.active {
    color: var(--matrix-green);
    border-bottom: 2px solid var(--matrix-green);
}

.nav-prefix {
    color: var(--text-secondary);
    opacity: 0.7;
}

.nav-cursor {
    opacity: 0;
    color: var(--matrix-green);
    animation: cursor-appear 0.2s ease forwards;
}

.gh-navigation-link:hover .nav-cursor {
    animation: cursor-blink 1s step-end infinite;
}

.gh-navigation-mobile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 24px;
}

.gh-navigation-mobile .gh-navigation-link {
    font-size: 1.125rem;
    padding: 12px 16px;
}

/* ═══════════════════════════════════════════════════
   MOBILE MENU OVERLAY
   ═══════════════════════════════════════════════════ */
.gh-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
}

.gh-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gh-menu-content {
    width: 100%;
    max-width: 400px;
    padding: 24px;
    position: relative;
}

.gh-menu-close {
    position: absolute;
    top: -16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-family: var(--font-mono);
    padding: 8px;
    cursor: pointer;
}

.gh-menu-close:hover {
    color: var(--matrix-green);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

/* ═══════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════ */
.gh-hero {
    position: relative;
    height: clamp(400px, 60vh, 700px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gh-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url("{{@site.cover_image}}");
    background-size: cover;
    background-position: center;
    filter: brightness(0.3) saturate(0.8);
}

/* Scanline overlay */
.gh-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.02) 2px,
        rgba(0, 255, 65, 0.02) 4px
    );
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

.gh-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    padding: 0 24px;
}

.gh-hero-title {
    font-family: var(--font-mono);
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--matrix-green);
    line-height: 1.3;
    margin-bottom: 32px;
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    letter-spacing: 1px;
}

.gh-subscribe-btn {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--matrix-green), var(--neon-cyan));
    color: var(--dark-bg);
    font-family: var(--font-mono);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.875rem;
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
    transition: all 0.3s ease;
}

.gh-subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.6);
    color: var(--dark-bg);
}

/* ═══════════════════════════════════════════════════
   POSTS FEED
   ═══════════════════════════════════════════════════ */
.gh-feed {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 24px;
}

.gh-heading-latest {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--neon-cyan);
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-glow);
    padding-bottom: 16px;
    letter-spacing: 3px;
}

.gh-post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

/* ═══════════════════════════════════════════════════
   POST CARD
   ═══════════════════════════════════════════════════ */
.gh-post-card {
    background: var(--panel-bg);
    border: 1px solid rgba(0, 255, 65, 0.1);
    border-radius: 4px;
    overflow: hidden;
    transition: all var(--transition-speed) ease;
}

.gh-post-card:hover {
    border-color: var(--matrix-green);
    box-shadow: 0 0 16px rgba(0, 255, 65, 0.15);
    transform: translateY(-2px);
}

.gh-post-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.gh-post-card-image {
    display: block;
    height: 200px;
    overflow: hidden;
    position: relative;
}

/* Anchor tag variant for feature images (no figure wrapper) */
a.gh-post-card-image {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gh-post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gh-post-card:hover .gh-post-card-image img {
    transform: scale(1.05);
}

.gh-post-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gh-post-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.gh-post-card-title {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.gh-post-card-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    flex: 1;
}

.gh-post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.gh-post-card-tag {
    padding: 4px 12px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 2px;
}

.read-more-arrow {
    font-size: 1.25rem;
    color: var(--matrix-green);
    opacity: 0;
    transform: translateX(-8px);
    transition: all var(--transition-speed) ease;
    margin-top: 8px;
}

.gh-post-card:hover .read-more-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ═══════════════════════════════════════════════════
   SINGLE POST / PAGE
   ═══════════════════════════════════════════════════ */
.gh-article {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px;
}

.gh-article-header {
    text-align: center;
    margin-bottom: 48px;
}

.gh-article-title {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 16px;
}

.gh-article-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.gh-meta-sep {
    margin: 0 8px;
    opacity: 0.5;
}

.gh-article-image {
    margin: 32px 0;
    text-align: center;
}

.gh-article-image img {
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border-glow);
}

.gh-article-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.gh-article-content h2 {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    color: var(--neon-cyan);
    margin: 24px 0 16px;
}

.gh-article-content p {
    margin-bottom: 16px;
}

.gh-article-content a {
    color: var(--neon-cyan);
    text-decoration: underline;
    text-decoration-color: rgba(0, 212, 255, 0.3);
}

.gh-article-content a:hover {
    text-decoration-color: var(--neon-cyan);
}

.gh-article-content pre,
.gh-article-content code {
    background: var(--darker-bg);
    border: 1px solid var(--border-glow);
    border-radius: 4px;
    font-family: var(--font-mono);
}

.gh-article-content code {
    padding: 2px 6px;
    font-size: 0.9em;
    color: var(--matrix-green);
}

.gh-article-content pre {
    padding: 16px;
    margin: 24px 0;
    overflow-x: auto;
}

.gh-article-content pre code {
    padding: 0;
    border: none;
    background: none;
}

.gh-article-content blockquote {
    border-left: 3px solid var(--matrix-green);
    padding-left: 24px;
    margin: 24px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.gh-article-content img {
    max-width: 100%;
    border-radius: 4px;
}

.gh-article-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-glow);
}

.gh-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.gh-tag {
    padding: 6px 16px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--matrix-green);
    border: 1px solid var(--border-glow);
    border-radius: 2px;
    transition: all var(--transition-speed);
}

.gh-tag:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: var(--matrix-green);
}

.gh-post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.gh-post-nav-prev,
.gh-post-nav-next {
    color: var(--neon-cyan);
}

.gh-post-nav-prev:hover,
.gh-post-nav-next:hover {
    color: var(--matrix-green);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
.gh-footer {
    background: var(--darker-bg);
    border-top: 1px solid var(--border-glow);
    padding: 48px 24px 24px;
    margin-top: 64px;
}

.gh-footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.gh-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.gh-footer-logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--matrix-green);
    margin-bottom: 12px;
}

.gh-footer-tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.gh-footer-heading {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--neon-cyan);
    margin-bottom: 16px;
}

.gh-footer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gh-footer-nav a {
    display: inline-block;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    padding: 4px 0;
}

.gh-footer-nav a::after {
    content: '';
    display: block;
    height: 1px;
    background: transparent;
    transition: background var(--transition-speed);
}

.gh-footer-nav a:hover {
    color: var(--matrix-green);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

.gh-footer-subscribe-btn {
    display: inline-block;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    border-radius: 2px;
    transition: all var(--transition-speed);
}

.gh-footer-subscribe-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 16px rgba(0, 255, 65, 0.3);
}

.gh-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border-glow);
}

.gh-footer-social {
    display: flex;
    gap: 16px;
}

.gh-social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 1px solid var(--border-glow);
    border-radius: 2px;
    transition: all var(--transition-speed);
}

.gh-social-link:hover {
    border-color: var(--matrix-green);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.3);
    transform: translateY(-2px);
}

.gh-footer-copyright {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.gh-powered-by a {
    color: var(--neon-cyan);
}

.gh-powered-by a:hover {
    color: var(--matrix-green);
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes cursor-appear {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes scanline {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-50%); }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE / MOBILE
   ═══════════════════════════════════════════════════ */
@media screen and (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .gh-header-inner {
        padding: 0 16px;
    }

    /* Hide desktop nav on mobile */
    .gh-desktop-nav {
        display: none;
    }

    /* Show hamburger toggle on mobile */
    .gh-menu-toggle {
        display: flex;
        z-index: 300;
    }

    /* Mobile Menu Overlay Styles */
    .gh-menu-overlay {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 200;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(15px);
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 10px;
        
        /* Mobile menu hidden by default */
        opacity: 0; 
        visibility: hidden;
        transition: all 0.3s ease;
        overflow-y: auto;
    }

    .gh-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Vertical stacking for mobile links */
    .gh-menu-overlay .gh-navigation-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
        max-width: 400px;
    }

    .gh-menu-overlay .gh-navigation-link {
        font-size: 1.25rem;
        padding: 16px;
        width: 100%;
        border-bottom: 1px solid var(--border-glow);
        white-space: normal;
    }
    
    .gh-menu-overlay .gh-navigation-link:hover {
        background: rgba(0, 255, 65, 0.05);
        padding-left: 24px; /* Indent on hover */
    }

    /* Mobile grid to single column */
    .gh-post-feed {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Footer to single column */
    .gh-footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .gh-footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    /* Smaller post cards */
    .gh-post-card-image {
        height: 160px;
    }

    /* Adjust hero */
    .gh-hero {
        height: clamp(300px, 50vh, 500px);
    }

    .gh-hero-title {
        font-size: clamp(1.25rem, 6vw, 2rem);
    }

    .gh-feed {
        padding: 32px 16px;
    }
}

@media screen and (max-width: 480px) {
    .gh-header-actions {
        gap: 8px;
    }

    .gh-search-btn {
        padding: 4px 8px;
    }

    .gh-article {
        padding: 24px 16px;
    }

    .gh-article-title {
        font-size: clamp(1.5rem, 7vw, 2.5rem);
    }

    .gh-post-card-content {
        padding: 16px;
    }
}

/* ═══════════════════════════════════════════════════
   PAGINATION (Ghost default styling + cyber theme)
   ═══════════════════════════════════════════════════ */
.gh-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 0;
    margin-top: 24px;
}

.gh-pagination a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--panel-bg);
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    border-radius: 2px;
    transition: all var(--transition-speed);
}

.gh-pagination a:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: var(--matrix-green);
    color: var(--matrix-green);
}

.gh-pagination .older {
    margin-right: 16px;
}

.gh-pagination .newer {
    margin-left: 16px;
}

/* ── Ghost Koenig Editor Classes ── */
.kg-width-wide {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.kg-width-full {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.kg-width-wide img,
.kg-width-full img {
    width: 100%;
    height: auto;
}

.kg-card {
    margin: 24px 0;
}

.kg-embed-card {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

/* ═══════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

:focus {
    outline: 2px solid var(--matrix-green) !important;
    outline-offset: 2px !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
