/* Custom CSS for PaperModX */

/* =========================================
   1. GLOBAL HELPERS & UTILITIES
   ========================================= */

/* Hide all RSS links globally */
a[href$="index.xml"],
a[href$="/index.xml"],
a[href*="rss"],
a[title="RSS"],
.rss-link {
    display: none !important;
}

/* Hide anchor links globally */
.anchor {
    display: none !important;
}

/* Reset background for standard content pages */
body:not(.kind-home):not(:has(.about-page-content)) {
    background-image: none !important;
}

/* =========================================
   CODE BLOCK VISIBILITY FIX
   ========================================= */

/* Light mode colors */
:root {
    --code-bg: #f5f5f5;
    --code-text: #2d2d2d;
    --inline-code-bg: #e8e8e8;
    --inline-code-text: #d73a49;
}

/* Dark mode colors */
[data-theme="dark"] {
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
    --inline-code-bg: #2d2d2d;
    --inline-code-text: #ff79c6;
}

/* Code block containers */
pre,
.highlight pre {
    background-color: var(--code-bg) !important;
    color: var(--code-text) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

/* Inline code (backticks) */
code {
    background-color: var(--inline-code-bg) !important;
    color: var(--inline-code-text) !important;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Code inside pre blocks - reset background only */
pre code {
    background-color: transparent !important;
    padding: 0;
}

/* Remove backgrounds from syntax highlighting in light mode */
.highlight span {
    background-color: transparent !important;
}

/* DARK MODE: Force all code text to be bright */
[data-theme="dark"] pre,
[data-theme="dark"] pre *,
[data-theme="dark"] code,
[data-theme="dark"] code * {
    color: #d4d4d4 !important;
}





/* =========================================
   2. HOMEPAGE STYLES (body.kind-home)
   ========================================= */

/* Hero Background */
body.kind-home {
    background-image: url('/images/hero.png') !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Profile Mode Card (with Photo) */
body.kind-home .profile {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    background-color: rgba(30, 30, 30, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 3rem;
    margin-top: 5vh;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Homepage Text Readability (Profile & Menu) */
body.kind-home .profile h1,
body.kind-home .profile .subtitle,
body.kind-home #menu a,
body.kind-home .entry-header h2 {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Recent Posts Header Box */
body.kind-home .home-info {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-color: rgba(20, 20, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.kind-home .home-info h1 {
    font-size: 1.75rem;
    margin: 0;
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Post Card Grid Layout */
body.kind-home .main .list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 0;
}

/* Post Card Styling */
body.kind-home .post-entry {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.95), rgba(30, 30, 40, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Hover Effects for Cards */
body.kind-home .post-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

body.kind-home .post-entry:hover::before {
    opacity: 1;
}

body.kind-home .post-entry:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Card Content Styling */
body.kind-home .post-entry .entry-header h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0;
    line-height: 1.4;
    color: #ffffff !important;
    text-shadow: none;
    /* Reset shadow for cards as they have their own background */
}

/* Hide Description/Summary on Homepage Cards */
body.kind-home .entry-content {
    display: none !important;
}

/* Metadata (Dates) Styling */
body.kind-home .entry-footer {
    display: block !important;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.kind-home .entry-footer .post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.875rem;
}


/* =========================================
   3. ABOUT ME PAGE STYLES (.about-page-content)
   ========================================= */

/* Hero Background (applied to body via :has selector) */
body:has(.about-page-content) {
    background-image: url('/images/hero.png') !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Glassmorphism Content Box */
.about-page-content {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-color: rgba(30, 30, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    color: #f0f0f0;
}


/* Content Text Readability */
.about-page-content .post-content h2,
.about-page-content .post-content h3,
.about-page-content .post-content p,
.about-page-content .post-content strong,
.about-page-content .post-content a {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Interactive Links */
.about-page-content .post-content a {
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.about-page-content .post-content a:hover {
    opacity: 0.8;
}

/* =========================================
   4. LANDING PAGE ENHANCEMENTS
   ========================================= */

/* Guide Grid Layout */
.guide-grid {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.guide-grid h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.guide-grid h3 a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.guide-grid h3 a:hover {
    color: var(--link);
    text-decoration: underline;
}

/* Post/Guide Metadata */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.75rem 0;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--secondary);
}

.post-meta em {
    font-style: normal;
}

/* Topic Tags */
.guide-grid p:has(strong:first-child) {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--secondary);
}

/* Callout Boxes */
blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--link);
    background-color: var(--code-bg);
    border-radius: 0 8px 8px 0;
}

blockquote p {
    margin: 0 !important;
}

/* Comparison Table Enhancement */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

table th {
    background-color: var(--code-bg);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

table tr:hover {
    background-color: var(--theme);
}

/* Section Dividers */
hr {
    margin: 3rem 0;
    border: none;
    border-top: 1px solid var(--border);
    opacity: 0.5;
}

/* Browse by Topic Links */
.post-content p:has(strong:first-child:contains("Browse")) {
    background-color: var(--code-bg);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

/* Coming Soon List */
ul li:contains("Coming Soon") {
    color: var(--secondary);
    font-style: italic;
}

/* Read Time Indicator */
.post-content p:has(em:contains("min read")) {
    color: var(--secondary);
    font-size: 0.9rem;
}

/* Category Badges */
.post-content em:contains("•") {
    font-style: normal;
    color: var(--secondary);
}

/* Enhanced Link Styling for Landing Pages */
.post-content a[href^="./"] {
    font-weight: 500;
}

.post-content a[href^="../"] {
    font-weight: 500;
}

/* Back to Home Link */
.post-content p:has(a:contains("Back to Home")) {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.95rem;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .guide-grid h3 a {
    color: #88c0ff;
}

[data-theme="dark"] table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}