@import url('https://fonts.googleapis.com/css2?family=Borel&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');


/* base = #9580ff */

html[data-theme="light"] {
    --bg-color-highlight: #beb3f7;
    --bg-color-normal: #e8e7f1;
    --text-color: #3c3859;
    --text-muted: #8d89a8;
    --shadow-color: #8d89a8;
    --card-bg-highlight: #ffffff;
    --card-bg-normal: #ffffff;
    --highlight-color: #9580ff;
    --highlight-color-light: #d2cafa;

    --python-color: #b4fece;
    --sql-color: #fee4a1;
}

html[data-theme="dark"] {
    --bg-color-highlight: #1c1825;
    --bg-color-normal: #16131c;
    --text-color: #e2e1e9;
    --text-muted: #8d89a8;
    --shadow-color: black;
    --card-bg-highlight: #312567;
    --card-bg-normal: #201b35;
    --highlight-color: #9580ff;
    --highlight-color-light: #4a3899;

    --python-color: #1b4d32;
    --sql-color: #826619;
}

* {
    box-sizing: border-box;
}

body {
    /* font-family: "Borel", cursive; */
    font-family: "Inter", sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color 0.2s ease;
    background:
        radial-gradient(circle at -15% -15%, var(--bg-color-highlight) 0%, transparent 40%),
        radial-gradient(circle at 115% 115%, var(--bg-color-highlight) 0%, var(--bg-color-normal) 40%);
    background-repeat: no-repeat;
    /* background-attachment: fixed; */
}

pre {
    font-family: "JetBrains Mono", monospace;
    padding: 0;
    overflow-x: auto;    
    margin: 0.5rem;
}


.code-block {
    background-color: var(--card-bg-normal);
    border-radius: 0 1rem 1rem 0;
    border-left: 0.3rem solid var(--highlight-color-light);
    font-size: 1rem;
}

code {
    font-family: "JetBrains Mono", monospace;
    background-color: var(--card-bg-normal);
    font-size: 1rem;
}



.normal {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.container {
    padding: 0 1.25rem;
    margin: 0 auto;
    max-width: 720px;
}

/* --- Mobile First Header & Nav --- */
.site-header {
    background-color: var(--card-bg-normal);
    padding: 0.75rem 0;
    box-shadow: 0 0 2rem -1rem var(--shadow-color);
}

.header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.site-logo {
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--text-color);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    font-weight: 700;
    background-color: var(--bg-color-normal);
    border-radius: 0.5rem;
    transition: 0.2s;
}

.nav-link:hover {
    background-color: var(--highlight-color-light);
}

.nav-link.active {
    background-color: var(--highlight-color-light);
}

/* --- Python/SQL Topic Filters --- */
.topic-filter {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 1.5rem 0 0.5rem;
}

.filter-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}


/* --- Post Cards Layout --- */
.post-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1rem;
}

.post-card {
    background:
        radial-gradient(circle at -15% -15%, var(--card-bg-highlight) 0%, transparent 40%),
        radial-gradient(circle at 115% 115%, var(--card-bg-highlight) 0%, var(--card-bg-normal) 40%);
    box-shadow: 0 0 2rem -1rem var(--shadow-color);
    border-radius: 1rem;
    padding: 1.25rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.card-badge {
    font-weight: bold;
    background-color: transparent;
    color: var(--text-muted);
}

.topic-badge {
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 0.3rem;
    text-decoration: none;
    color: var(--text-color);
    background-color: var(--card-bg-normal);
}

.topic-badge:hover {
    background-color: var(--highlight-color-light);
}

.topic-badge.active {
    background-color: var(--highlight-color);
}


.card-title {
    margin: 0.5rem 0 0 0;
    font-size: 1.5rem;
    font-weight: 900;
    text-decoration: var(--highlight-color-light) underline;
}

.card-title:hover {
    text-decoration: var(--highlight-color) underline;
}

.card-title a {
    color: var(--highlight-color);
    text-decoration: none;
}

.card-summary {
    margin: 0;
    color: var(--text-color);
    font-size: 1rem;
}

/* --- Pagination Elements --- */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2.5rem 0;
    gap: 0.5rem;
}

.pag-btn {
    background-color: var(--card-bg-normal);
    color: var(--text-color);
    padding: 0.6rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
}

.pag-btn:hover {
    background-color: var(--highlight-color-light);
}

.pag-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pag-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Custom Theme Button Switcher --- */
.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    padding: 0.6rem;
}

html[data-theme="light"] .sun-icon {
    display: none;
}

html[data-theme="light"] .moon-icon {
    display: block;
}

html[data-theme="dark"] .sun-icon {
    display: block;
}

html[data-theme="dark"] .moon-icon {
    display: none;
}

/* --- Responsive Media Queries (Scaling Up to Desktop) --- */
@media (min-width: 576px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
    }

    .site-nav {
        gap: 1rem;
    }

    .container {
        max-width: 1050px;
    }

    .post-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* --- Post Card Cover Images --- */
.post-card {
    display: flex;
    flex-direction: column;
    /* Stack image on top of text on mobile screens */
    overflow: hidden;
    /* Ensures image corners match the card border-radius */
    background-color: var(--card-bg-normal);
    border-radius: 8px;
}

.card-cover img {
    width: 100%;
    height: 180px;
    /* Fixed height bound for compact mobile presentation */
    object-fit: cover;
    /* Crops nicely without stretching out proportion dimensions */
    display: block;
    transition: opacity 0.2s ease;
}

.card-cover img:hover {
    opacity: 0.9;
}

.card-body {
    padding: 1.25rem;
    /* Keeps uniform inner spacing around text blocks */
}

a {
    color: var(--highlight-color);
    text-decoration: var(--highlight-color) underline;
}

img {
    width: 100%;
}
