/* ══════════════════════════════════════════════
   Neutral Blog Theme — Custom CSS
   Complements Tailwind utility classes
   ══════════════════════════════════════════════ */

/* ── Base Reset ─────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--foreground, #404040);
    background: var(--background, #ffffff);
}

/* ── Sticky Navigation ──────────────────────── */
.nav-sticky {
    position: sticky;
    top: 0;
    z-index: 40;
}

@media (max-width: 767px) {
    .mob-sticky {
        position: sticky;
        top: 0;
        z-index: 20;
    }
}

/* ── Sticky Sidebar ─────────────────────────── */
.hc-sticky {
    position: sticky;
    top: 5rem;
}

/* ── Scroll to Top ──────────────────────────── */
.back-top {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.back-top.show {
    opacity: 1;
    pointer-events: auto;
}

/* ── Dropdown Animation ─────────────────────── */
.dropdown-menu {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* ── Post Card Hover Effects ────────────────── */
article.grid:hover img {
    transform: scale(1.03);
    transition: transform 0.5s ease;
}

article.grid img {
    transition: transform 0.5s ease;
}

/* ── Prose Overrides for Post Content ───────── */
.post-prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--foreground);
}

.post-prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.post-prose p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.post-prose img {
    border-radius: 0.25rem;
    margin: 1.5rem auto;
    max-width: 100%;
}

.post-prose blockquote {
    border-left: 3px solid var(--primary, #404040);
    padding-left: 1.25rem;
    font-style: italic;
    color: var(--muted-foreground, #737373);
    margin: 1.5rem 0;
}

.post-prose pre {
    background: #0d1117;
    color: #c9d1d9;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-prose code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.post-prose a {
    color: var(--primary, #404040);
    text-decoration: underline;
}

.post-prose ul,
.post-prose ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.post-prose li {
    margin-bottom: 0.25rem;
    line-height: 1.7;
}

/* ── Component Builder Styles (for post content) ── */
.comp-hero {
    background: linear-gradient(135deg, var(--primary, #333), color-mix(in srgb, var(--primary, #333) 70%, black));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    margin: 1.5rem 0;
}

.comp-hero h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
}

.comp-hero p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    color: white;
}

.comp-hero a {
    display: inline-block;
    background: white;
    color: var(--primary, #333);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.2s;
}

.comp-hero a:hover {
    transform: scale(1.05);
}

.comp-button {
    text-align: center;
    padding: 1rem 0;
}

.comp-button a {
    display: inline-block;
    background: var(--primary, #333);
    color: var(--primary-foreground, #fff);
    padding: 0.7rem 2rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.comp-button a:hover {
    opacity: 0.9;
}

.comp-quote {
    border-left: 3px solid var(--primary, #333);
    padding: 1rem 1.5rem;
    background: var(--muted, #f5f5f5);
    margin: 1.5rem 0;
}

.comp-quote blockquote {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.comp-quote cite {
    font-size: 0.85rem;
    color: var(--muted-foreground, #737373);
}

.comp-imagetext {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin: 1.5rem 0;
}

.comp-imagetext img {
    width: 50%;
    object-fit: cover;
}

.comp-imagetext .it-content {
    flex: 1;
}

.comp-imagetext .it-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.comp-imagetext .it-content p {
    line-height: 1.7;
}

.comp-spacer {
    height: 60px;
}

.comp-divider hr {
    border: none;
    border-top: 1px solid var(--border, #e5e5e5);
    margin: 1.5rem 0;
}

.comp-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1.5rem 0;
}

.comp-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.comp-image {
    margin: 1.5rem 0;
}

.comp-image img {
    width: 100%;
    display: block;
}

@media (max-width: 640px) {
    .comp-imagetext {
        flex-direction: column;
    }

    .comp-imagetext img {
        width: 100%;
    }
}

/* ── Pagination ─────────────────────────────── */
.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px dashed var(--border, #e5e5e5);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
    background: var(--foreground, #171717);
    color: var(--background, #fff);
    border-style: solid;
}