@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=Questrial&family=Cutive+Mono&display=swap');
@import url('color.css');
@import url('nav.css');
@import url('footer.css');

/* =======================
   Typography
======================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    font-size: 19px;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    line-height: 1.15;
    margin-top: 0;
    margin-bottom: clamp(0.5rem, 1.5vw, 0.8rem);
    color: var(--dark-blue-text);
}

p, li, span, a {
    font-family: 'Questrial', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    color: var(--mid-blue-text);
}

time, code, pre {
    font-family: 'Cutive Mono', monospace;
}

/* =======================
   Blog Post Layout
======================= */

.post-container {
    display: block;
    max-width: 100%;
    margin: 0;
    padding: clamp(1.5rem, 3vw, 3rem);
    padding-left: calc(200px + clamp(1.5rem, 3vw, 3rem));
    position: relative;
    min-height: 100vh;
}

.post-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    width: 200px;
    height: 100%;
    padding: 1.5rem;
    overflow: hidden;
    display: block;
    border-right: 1px solid var(--color-cerulean);
    background: var(--light-blue-bg);
}

.post-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-cerulean);
    text-decoration: none;
    font-family: 'Questrial', sans-serif;
    font-size: 0.95rem;
    padding: 0.75rem;
    border: 1.5px solid var(--color-cerulean);
    border-radius: 0.35rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(63, 169, 245, 0.08);
    text-decoration: underline;
}

.sidebar-posts {
    margin-top: 1.5rem;
}

.sidebar-posts h3 {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.sidebar-posts ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sidebar-posts li {
    margin: 0;
}

.sidebar-posts a {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--mid-blue-text);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.4;
}

.sidebar-posts a:hover {
    color: var(--color-cerulean);
    border-left-color: var(--color-cerulean);
    background: rgba(63, 169, 245, 0.05);
}

.blog-post {
    max-width: 820px;
    margin: 0 auto;
}

/* =======================
   Post Header
======================= */

.post-header {
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.post-title {
    font-size: clamp(2.6rem, 5vw, 3.4rem);
    margin-bottom: 0.6rem;
}

.post-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.4rem);
    color: var(--mid-blue-text);
    opacity: 0.8;
}

.post-meta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.8rem;
    font-family: 'Cutive Mono', monospace;
    font-size: 0.8rem;
    opacity: 0.7;
}

.post-meta span::before {
    content: "•";
    margin-right: 0.4rem;
    opacity: 0.6;
}

/* =======================
   Featured Image
======================= */

.post-cover {
    margin: 1.8rem 0 2.2rem;
}

.post-cover img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1.5px solid var(--color-cerulean);
}

/* =======================
   Article Content
======================= */

.post-content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.post-content p {
    font-size: clamp(1.15rem, 1.6vw, 1.3rem);
    line-height: 1.65;
}

.post-content h2 {
    margin-top: 2.2rem;
}

.post-content h3 {
    margin-top: 1.8rem;
}

/* =======================
   Lists
======================= */

.post-content ul,
.post-content ol {
    padding-left: 1.4rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

/* =======================
   Links
======================= */

.post-content a {
    color: var(--color-cerulean);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content a:hover {
    opacity: 0.85;
}

/* =======================
   Blockquotes
======================= */

.post-content blockquote {
    margin: 1.8rem 0;
    padding: 1rem 1.2rem;
    border-left: 4px solid var(--color-cerulean);
    background: #eff7ff;
    font-style: italic;
    color: var(--dark-blue-text);
}

/* =======================
   Code Blocks
======================= */

.post-content pre {
    background: #0e2a47;
    color: #e6f1ff;
    padding: 1rem 1.2rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Cutive Mono', monospace;
    font-size: 0.85rem;
}

.post-content code {
    background: rgba(0, 100, 180, 0.08);
    padding: 0.15rem 0.3rem;
    border-radius: 0.25rem;
    font-family: 'Cutive Mono', monospace;
    font-size: 0.85rem;
}

/* =======================
   Images Inside Content
======================= */

.post-content img {
    max-width: 100%;
    border-radius: 0.4rem;
    border: 1px solid var(--color-cerulean);
    margin: 1.5rem 0;
}

/* =======================
   Divider
======================= */

.post-content hr {
    border: none;
    height: 1px;
    background: var(--color-cerulean);
    opacity: 0.4;
    margin: 2.5rem 0;
}

/* =======================
   Post Footer
======================= */

.post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-cerulean);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-tags {
    display: flex;
    gap: 0.4rem;
}

.post-tags span {
    font-family: 'Cutive Mono', monospace;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-cerulean);
    color: var(--color-cerulean);
}

/* =======================
   Responsive
======================= */

@media (max-width: 768px) {
    .post-sidebar {
        display: none;
    }

    .post-container {
        padding: 1.4rem;
    }

    .blog-post {
        padding: 0;
    }

    .post-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}