:root {
    --bg: #ffffff;
    --ink: #111111;
    --muted: #6f6f6f;
    --soft: #f7f7f5;
    --line: #e8e8e4;
    --accent: #0a84ff;
    --max: 1280px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    color: var(--ink);
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Bengali", "Noto Sans", Helvetica, Arial, sans-serif;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

main {
    min-height: 58vh;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10;
    background: var(--ink);
    color: var(--bg);
    padding: .75rem 1rem;
}

.skip-link:focus {
    top: 1rem;
}

.site-header {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(18px);
}

.site-header__inner,
.site-footer__inner {
    width: min(var(--max), calc(100% - 48px));
    margin: 0 auto;
}

.site-header__inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 750;
}

.brand__mark {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    border: 2px solid var(--ink);
    font-weight: 800;
    line-height: 1;
}

.brand__logo {
    max-height: 28px;
    width: auto;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #333333;
    font-size: .92rem;
}

.nav li {
    margin: 0;
}

.nav-current {
    color: var(--ink);
    font-weight: 700;
}

.home-shell {
    width: min(var(--max), calc(100% - 48px));
    margin: 48px auto 72px;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 48px;
}

.home-sidebar {
    border-right: 1px solid var(--line);
}

.home-sidebar__sticky {
    position: sticky;
    top: 96px;
    padding-right: 32px;
}

.eyebrow,
.post-card__tag {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.4;
}

.home-sidebar h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.4rem, 3.2vw, 3.4rem);
    line-height: .96;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.site-description {
    margin: 18px 0 32px;
    color: var(--muted);
    line-height: 1.6;
}

.topic-list {
    display: grid;
    gap: 12px;
    color: var(--muted);
    font-size: .96rem;
}

.topic-list a:hover,
.post-card h2 a:hover,
.footer-links a:hover,
.article-tags a:hover {
    color: var(--accent);
}

.post-grid,
.archive-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 42px 48px;
}

.post-card {
    min-width: 0;
}

.post-card__media {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 8.4;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--soft);
    margin-bottom: 16px;
    max-height: 270px;
}

.post-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card__placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 28px;
    color: #c8c8c0;
    font-size: clamp(1.4rem, 4vw, 3.6rem);
    font-weight: 800;
    text-align: center;
    overflow-wrap: anywhere;
}

.post-card h2 {
    margin: 0 0 8px;
    font-size: clamp(1.18rem, 1.45vw, 1.42rem);
    line-height: 1.28;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.post-card__excerpt {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.post-card__meta,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 16px;
    color: var(--muted);
    font-size: .84rem;
}

.post-card__meta img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 24px;
    color: var(--muted);
}

.pagination a,
.pagination span {
    min-width: 30px;
    min-height: 30px;
    display: inline-grid;
    place-items: center;
}

.pagination .page-number {
    border: 1px solid var(--line);
}

.article,
.archive-header,
.error-page {
    width: min(860px, calc(100% - 48px));
    margin: 64px auto;
}

.article-header h1,
.archive-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4.2vw, 3.8rem);
    line-height: 1.12;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.archive-header p,
.article-content {
    color: #242424;
    line-height: 1.76;
    font-size: 1.08rem;
    overflow-wrap: anywhere;
}

.article-image {
    margin: 40px 0;
}

.article-image img {
    width: 100%;
}

.article-image figcaption {
    margin-top: 10px;
    color: var(--muted);
    font-size: .9rem;
}

.article-content :where(h2, h3, h4) {
    color: var(--ink);
    line-height: 1.2;
    margin-top: 2em;
}

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

.article-content :where(p, ul, ol, blockquote, pre, figure) {
    margin: 1.2em 0;
}

.kg-width-wide {
    width: min(1100px, calc(100vw - 48px));
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.kg-width-full {
    width: 100vw;
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.kg-width-wide img,
.kg-width-full img {
    width: 100%;
}

.article-content blockquote {
    border-left: 3px solid var(--ink);
    padding-left: 18px;
    color: #444444;
}

.article-content .wp-shortcode-quote {
    margin: 2rem 0;
    padding: 1.4rem 1.5rem 1.2rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--ink);
    background: var(--soft);
    color: var(--ink);
}

.article-content .wp-shortcode-quote p {
    margin: 0;
    font-size: clamp(1.15rem, 1.2rem + .2vw, 1.45rem);
    line-height: 1.65;
}

.article-content .wp-shortcode-quote p::before {
    content: "“";
}

.article-content .wp-shortcode-quote p::after {
    content: "”";
}

.article-content .wp-shortcode-quote cite {
    display: block;
    margin-top: 1rem;
    color: var(--muted);
    font-size: .92rem;
    font-style: normal;
}

.article-content .wp-shortcode-quote cite::before {
    content: "— ";
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 48px;
}

.article-tags a {
    border: 1px solid var(--line);
    padding: 7px 10px;
    color: var(--muted);
    font-size: .9rem;
}

.archive-grid {
    width: min(1100px, calc(100% - 48px));
    margin: 0 auto 72px;
}

.error-page {
    text-align: center;
    min-height: 56vh;
    display: grid;
    place-content: center;
}

.error-page h1 {
    margin: 0;
    color: #d3dce2;
    font-size: clamp(6rem, 17vw, 12rem);
    line-height: .9;
}

.error-page p {
    margin: 12px 0;
    font-size: 1.5rem;
    color: #41515b;
}

.error-page a {
    color: var(--accent);
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 40px 0;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 32px;
    align-items: start;
    color: var(--muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
}

.copyright {
    margin: 0;
    text-align: right;
}

@media (max-width: 980px) {
    .home-shell {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .home-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding-bottom: 28px;
    }

    .home-sidebar__sticky {
        position: static;
        padding-right: 0;
    }

    .topic-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .site-header__inner,
    .site-footer__inner,
    .home-shell,
    .article,
    .archive-header,
    .archive-grid,
    .error-page {
        width: min(100% - 32px, var(--max));
    }

    .site-header__inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 0;
    }

    .nav {
        justify-content: flex-start;
    }

    .post-grid,
    .archive-grid {
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
    }

    .copyright {
        text-align: left;
    }
}
