/* ==========================================================================
   The LGTM — Gradient overrides for Casper
   ========================================================================== */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #d946ef);
    --gradient-hover: linear-gradient(135deg, #4f46e5, #7c3aed, #c026d3);
    --gradient-subtle: linear-gradient(135deg, #eef2ff, #f5f3ff, #fdf4ff);
    --gradient-text: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    --lgtm-accent: #8b5cf6;
    --lgtm-accent-dark: #7c3aed;
    --lgtm-radius: 12px;
    --color-darkmode: #0b0f1a;
}

.dark-mode,
.auto-color {
    --gradient: linear-gradient(135deg, #818cf8, #a78bfa, #e879f9);
    --gradient-subtle: linear-gradient(135deg, #1e1b4b, #2e1065, #3b0764);
    --gradient-text: linear-gradient(135deg, #a5b4fc, #c4b5fd, #f0abfc);
    --lgtm-accent: #a78bfa;
    --color-darkmode: #0b0f1a;
}

@media (prefers-color-scheme: dark) {
    .auto-color {
        --gradient: linear-gradient(135deg, #818cf8, #a78bfa, #e879f9);
        --gradient-subtle: linear-gradient(135deg, #1e1b4b, #2e1065, #3b0764);
        --gradient-text: linear-gradient(135deg, #a5b4fc, #c4b5fd, #f0abfc);
        --lgtm-accent: #a78bfa;
        --color-darkmode: #0b0f1a;
    }
}

/* ==========================================================================
   Dark mode — deep navy background, better contrast
   ========================================================================== */
html.dark-mode body {
    background: #0b0f1a !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

html.dark-mode .post-card {
    background: #141927 !important;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

html.dark-mode .post-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.12);
}

html.dark-mode .post-card-title {
    color: #f1f5f9 !important;
}

html.dark-mode .post-card-excerpt {
    color: rgba(255, 255, 255, 0.55);
}

html.dark-mode .site-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
}

html.dark-mode .gh-content {
    color: rgba(255, 255, 255, 0.8);
}

html.dark-mode .gh-content h2,
html.dark-mode .gh-content h3,
html.dark-mode .gh-content h4 {
    color: #f1f5f9;
}

html.dark-mode .gh-article-title {
    color: #fff !important;
}

html.dark-mode .post-card-image {
    opacity: 0.92;
}

/* ==========================================================================
   Font — Inter everywhere
   ========================================================================== */
body,
.gh-head,
.gh-article,
.gh-content,
.post-card,
.site-footer {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.is-title,
.gh-article-title,
.post-card-title,
h1, h2, h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Header — fix position, colors, logo (all pages)
   ========================================================================== */
.gh-head,
.has-cover .gh-head,
.has-cover:not(.home-template) .gh-head,
:is(.home-template,.paged).has-cover .gh-head {
    position: relative !important;
    background: #fff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

html.dark-mode .gh-head,
html.dark-mode .has-cover .gh-head,
html.dark-mode .has-cover:not(.home-template) .gh-head,
.dark-mode .gh-head,
.dark-mode .has-cover .gh-head {
    background: #0d1120 !important;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Force correct text colors in header (all pages) */
.gh-head,
.gh-head a,
.has-cover .gh-head,
.has-cover .gh-head a,
.has-cover:not(.home-template) .gh-head,
.has-cover:not(.home-template) .gh-head a,
#gh-head .gh-head-menu .nav li a,
.gh-head .gh-head-link,
.gh-head .gh-icon-btn {
    color: #18181b !important;
}

html.dark-mode .gh-head,
html.dark-mode .gh-head a,
html.dark-mode .has-cover .gh-head,
html.dark-mode .has-cover .gh-head a,
html.dark-mode .has-cover:not(.home-template) .gh-head,
html.dark-mode .has-cover:not(.home-template) .gh-head a,
html.dark-mode #gh-head .gh-head-menu .nav li a,
html.dark-mode .gh-head .gh-head-link,
html.dark-mode .gh-head .gh-icon-btn,
.dark-mode .gh-head,
.dark-mode .gh-head a {
    color: #e2e8f0 !important;
}

/* Nav link style — #gh-head ID needed to beat Casper's specificity */
#gh-head .gh-head-menu .nav li a,
#gh-head .nav a {
    font-size: 1.6rem !important;
    font-weight: 500;
    opacity: 0.6;
    transition: opacity 0.2s;
}

#gh-head .gh-head-menu .nav li a:hover,
#gh-head .nav a:hover {
    opacity: 1;
}

/* Logo — always show on homepage, gradient accent */
.is-head-left-logo.home-template .gh-head:not(.is-header-hidden) .gh-head-logo {
    display: flex !important;
}

.is-head-left-logo.home-template .gh-head:not(.is-header-hidden) .gh-head-menu {
    margin-left: 16px !important;
}

.gh-head-logo {
    font-weight: 800 !important;
    font-size: 2.4rem !important;
    letter-spacing: -0.03em;
}

/* Theme toggle */
.lgtm-theme-toggle {
    color: #18181b !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

html.dark-mode .lgtm-theme-toggle,
.dark-mode .lgtm-theme-toggle {
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================================================
   Subscribe button — gradient pill
   ========================================================================== */
.gh-head-button,
.footer-cta-button {
    background: var(--gradient) !important;
    color: #fff !important;
    border-radius: 999px !important;
    border: none !important;
    padding: 8px 20px !important;
    font-weight: 600 !important;
    transition: opacity 0.2s, transform 0.2s !important;
}

.gh-head-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ==========================================================================
   Article tags — gradient pills
   ========================================================================== */
.post-card-tags > a,
.gh-article-tag {
    background: var(--gradient);
    color: #fff !important;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ==========================================================================
   Post cards — sizing, padding, rounded, hover effects
   ========================================================================== */
.post-card {
    border-radius: var(--lgtm-radius);
    transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
}

.post-card-image-link {
    border-radius: var(--lgtm-radius) var(--lgtm-radius) 0 0;
    overflow: hidden;
}

.post-card-image {
    transition: transform 0.4s ease;
}

.post-card:hover .post-card-image {
    transform: scale(1.03);
}

/* Card content padding — tight gap to image */
.post-card-content {
    padding: 0.8rem 1.2rem 1.2rem !important;
}

/* Card content link — remove default padding */
.post-card-content-link {
    padding: 0 !important;
}

/* Card title sizing */
.post-card-title {
    font-size: 1.8rem !important;
    line-height: 1.3 !important;
    margin-top: 0 !important;
}

.post-card-large .post-card-title {
    font-size: 2.6rem !important;
    line-height: 1.15 !important;
}

.post-card.dynamic .post-card-title {
    font-size: 2rem !important;
}

.post-card-full .post-card-title {
    font-size: 3.2rem !important;
}

/* Card excerpt sizing */
.post-card-excerpt {
    font-size: 1.4rem !important;
    line-height: 1.5 !important;
    margin-top: 6px !important;
}

/* Card tags spacing */
.post-card-tags {
    margin-bottom: 4px !important;
    font-size: 1.2rem !important;
}

/* Card meta — tighter */
.post-card-meta {
    margin-top: 8px !important;
    padding-top: 8px !important;
    font-size: 1.2rem !important;
}

/* Large card — content padding (side-by-side layout on wide screens) */
.post-card-large .post-card-content {
    padding: 2rem 2.4rem 2rem 1.6rem !important;
    justify-content: center;
}

.post-card-large .post-card-tags {
    margin-bottom: 8px !important;
}

.post-card-large .post-card-excerpt {
    margin-top: 12px !important;
}

.post-card-large .post-card-meta {
    margin-top: 16px !important;
}

/* Dynamic card content */
.post-card.dynamic .post-card-content {
    padding: 0.8rem 1.2rem 1.2rem !important;
}

/* Post card title hover — gradient text */
.post-card-title:hover {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   Content — links, blockquotes
   ========================================================================== */
.gh-content a:not(.kg-bookmark-container) {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: underline;
    text-decoration-color: var(--lgtm-accent);
    text-underline-offset: 3px;
}

.gh-content a:not(.kg-bookmark-container):hover {
    text-decoration-color: transparent;
}

.gh-content blockquote:not([class]) {
    border-left: 3px solid transparent;
    border-image: var(--gradient) 1;
}

/* ==========================================================================
   Layout spacing — tighter, cleaner
   ========================================================================== */

/* Reduce post feed top padding and grid gap */
.post-feed {
    padding-top: 2.4rem !important;
    gap: 3rem 2.4rem !important;
}

/* Reduce outer padding on smaller screens */
.outer {
    padding: 0 max(3vmin, 16px) !important;
}

/* Site main — remove excess top space */
.site-main {
    padding-top: 0;
}

/* Footer — reduce huge top margin */
.site-footer {
    margin-top: 4rem !important;
    padding-top: 2.4rem !important;
    padding-bottom: 2.4rem !important;
}

/* Post card meta — tighter */
.post-card-meta {
    margin-top: 8px !important;
    font-size: 1.3rem !important;
}

/* Large card — reduce inner gap */
.post-card-large .post-card-content {
    padding: 0.6rem 1.6rem 1.6rem !important;
}

/* ==========================================================================
   Misc — radius, pagination
   ========================================================================== */
.gh-subscribe-input {
    border-radius: var(--lgtm-radius) !important;
}

.pagination {
    margin-top: 1rem;
}

.pagination a {
    border-radius: 999px;
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: var(--lgtm-accent);
    color: var(--lgtm-accent);
}

.site-footer a:hover {
    color: var(--lgtm-accent);
}

.kg-bookmark-card {
    border-radius: var(--lgtm-radius);
}

.gh-content pre {
    border-radius: var(--lgtm-radius);
}

/* Article page — tighter spacing */
.gh-article-header {
    padding-top: 2.4rem !important;
}

.gh-article-meta {
    margin-top: 1.2rem !important;
}

/* Footer — cleaner layout */
.site-footer .inner {
    font-size: 1.4rem !important;
}

/* "Powered by Ghost" — hidden */
.gh-powered-by {
    display: none !important;
}
