:root {
    color-scheme: light;
    font-family: "Tajawal", "Segoe UI", sans-serif;
    color: #171717;
    background: #f4f3f0;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: #f4f3f0;
    background-image: radial-gradient(#17171712 0.7px, transparent 0.7px);
    background-size: 7px 7px;
}

a {
    color: #a8182a;
    text-underline-offset: 4px;
}

.blog-header,
.blog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px max(6vw, calc((100vw - 1080px) / 2));
    background: #f4f3f0ee;
    border-bottom: 2px solid #171717;
}

.brand {
    color: #171717;
    font-size: 1.3rem;
    font-weight: 900;
    text-decoration: none;
}

.blog-header nav {
    display: flex;
    gap: 22px;
}

.blog-header nav a,
.blog-footer a {
    color: #171717;
    font-weight: 700;
}

.blog-main {
    width: min(900px, calc(100% - 36px));
    min-height: 70vh;
    margin: 64px auto;
}

.blog-intro {
    margin-bottom: 42px;
    padding: 36px;
    background: #fff;
    border: 2px solid #171717;
    box-shadow: 8px 8px 0 #171717;
}

.eyebrow {
    margin: 0 0 10px;
    color: #a8182a;
    font: 700 0.82rem/1.5 "Space Grotesk", sans-serif;
    letter-spacing: 0.12em;
}

.blog-intro h1,
.article-header h1 {
    margin: 0;
    font-size: clamp(2.2rem, 7vw, 4rem);
    line-height: 1.15;
}

.blog-intro > p:last-child {
    margin-bottom: 0;
    color: #555;
    font-size: 1.15rem;
}

.post-list {
    display: grid;
    gap: 20px;
}

.post-card {
    padding: 26px 30px;
    background: #fff;
    border: 2px solid #171717;
    box-shadow: 5px 5px 0 #171717;
}

.post-card h2 {
    margin: 6px 0 10px;
    font-size: 1.8rem;
}

.post-card h2 a {
    color: #171717;
    text-decoration-thickness: 2px;
}

.post-card > p:not(.post-date) {
    color: #555;
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-date {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.post-engagement {
    display: flex;
    gap: 16px;
    color: #666;
    font-size: 0.92rem;
}

.article-engagement {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.article-engagement > p {
    margin: 0;
}

.view-count {
    color: #555;
}

.like-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    color: #171717;
    font: inherit;
    font-weight: 700;
    background: #fff;
    border: 2px solid #171717;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.like-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.like-button.is-liked {
    color: #fff;
    background: #a8182a;
    border-color: #a8182a;
}

.like-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.like-button:focus-visible {
    outline: 3px solid #a8182a;
    outline-offset: 3px;
}

.interaction-status {
    flex-basis: 100%;
    color: #a8182a;
    font-size: 0.9rem;
}

.read-more {
    font-weight: 700;
}

.empty-state {
    padding: 24px;
    background: #fff;
    border: 1px solid #bbb;
    text-align: center;
}

.blog-article {
    padding: clamp(24px, 6vw, 58px);
    background: #fff;
    border: 2px solid #171717;
    box-shadow: 8px 8px 0 #171717;
}

.breadcrumbs {
    display: flex;
    gap: 10px;
    margin-bottom: 36px;
    font-size: 0.95rem;
}

.article-header {
    padding-bottom: 26px;
    border-bottom: 1px solid #ddd;
}

.article-header h1 {
    margin: 8px 0 16px;
}

.article-summary {
    margin: 18px 0 0;
    color: #555;
    font-size: 1.2rem;
    line-height: 1.8;
}

.article-content {
    overflow-wrap: anywhere;
    font-size: 1.12rem;
    line-height: 2;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 1.8em 0 0.5em;
    line-height: 1.4;
}

.article-content pre {
    overflow-x: auto;
    padding: 18px;
    direction: ltr;
    text-align: left;
    color: #f4f3f0;
    background: #171717;
    border-radius: 6px;
}

.article-content code {
    font-family: Consolas, monospace;
    font-size: 0.9em;
}

.article-content :not(pre) > code {
    padding: 2px 6px;
    color: #a8182a;
    background: #f4f3f0;
    border-radius: 4px;
}

.article-content blockquote {
    margin: 1em 0;
    padding: 4px 18px;
    border-inline-start: 4px solid #a8182a;
    color: #555;
}

.article-content table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

.article-content th,
.article-content td {
    padding: 8px 12px;
    border: 1px solid #bbb;
}

.blog-footer {
    border-top: 2px solid #171717;
    border-bottom: 0;
}

@media (max-width: 600px) {
    .blog-header,
    .blog-footer {
        padding: 16px 18px;
    }

    .blog-header nav {
        gap: 12px;
    }

    .blog-main {
        margin: 34px auto;
    }

    .blog-intro {
        padding: 24px;
    }

    .post-card {
        padding: 22px;
    }
}
