/* Project cards: icons, badges, illustrations, hover effects */

.projects-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.75em;
	margin-top: 1em;
}

.project-card {
	--accent: #b8d96b;
	position: relative;
	display: flex;
	flex-direction: column;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-top: 4px solid var(--accent);
	border-radius: 10px;
	padding: 1.4em 1.4em 1.6em;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
	border-color: rgba(255, 255, 255, 0.18);
}

.project-card .illustration {
	width: 100%;
	height: 100px;
	margin-bottom: 0.9em;
	color: var(--accent);
}

.project-card .illustration svg {
	width: 100%;
	height: 100%;
	display: block;
}

.project-card h3 {
	display: flex;
	align-items: center;
	gap: 0.55em;
	margin: 0 0 0.6em;
	font-size: 1.05em;
}

.project-card h3 .icon {
	color: var(--accent);
}

.project-card p.desc {
	flex: 1;
	opacity: 0.85;
	font-size: 0.95em;
	line-height: 1.65;
	margin: 0 0 1.1em;
}

.tech-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
}

.tech-badges span {
	font-size: 0.72em;
	padding: 0.25em 0.7em;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: var(--accent);
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.project-card.cat-ai { --accent: #9b7bff; }
.project-card.cat-travel { --accent: #4fc3f7; }
.project-card.cat-rec { --accent: #f5c344; }
.project-card.cat-mobile { --accent: #5ddab4; }
.project-card.cat-chat { --accent: #ff7aa8; }

/* Writing: article list (home popup + /writing/ archive) */

.writing-intro p {
    max-width: 46rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.75;
}

.writing-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0 1.25rem;
}

#main article a.writing-card,
.page-shell a.writing-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.4rem 1.6rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

#main article a.writing-card.has-cover,
.page-shell a.writing-card.has-cover {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: center;
}

#main article a.writing-card:hover,
.page-shell a.writing-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(184, 217, 107, 0.55);
    transform: translateY(-2px);
}

.writing-card-cover {
    aspect-ratio: 1200 / 630;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.writing-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.writing-meta {
    margin: 0 0 0.4rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.writing-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #ffffff;
}

.writing-summary {
    margin: 0 0 0.9rem;
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

.writing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.writing-tags span {
    padding: 0.15rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.75);
}

.writing-read {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b8d96b;
}

.writing-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.85rem;
}

.writing-links a {
    color: #b8d96b;
}

.writing-empty {
    margin: 1.5rem 0;
    padding: 2.5rem 1.5rem;
    border: 1px dashed rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
}

.writing-empty .icon {
    display: inline-block;
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: #b8d96b;
    border: 0;
}

.writing-empty p {
    margin: 0;
}

@media screen and (max-width: 736px) {
    #main article a.writing-card.has-cover,
    .page-shell a.writing-card.has-cover {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    #main article a.writing-card,
    .page-shell a.writing-card {
        padding: 1.1rem 1.15rem;
    }
}

/* Standalone pages: single article + /writing/ archive */

body.page-standalone #bg:before {
    background-image: linear-gradient(to top, rgba(19, 21, 25, 0.88), rgba(19, 21, 25, 0.88));
}

.page-shell {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 50rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2rem;
}

.page-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0 1.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.page-topbar a {
    border-bottom: 0;
    color: rgba(255, 255, 255, 0.75);
}

.page-topbar a:hover {
    color: #ffffff;
}

.post {
    padding: 3rem 3.25rem 2.5rem;
    background: rgba(27, 31, 34, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.post-header {
    margin-bottom: 2.25rem;
}

.post-header h1 {
    margin: 0 0 1rem;
    font-size: 2.1rem;
    line-height: 1.25;
    letter-spacing: 0.01em;
    text-transform: none;
    color: #ffffff;
}

.post-lede,
.post-lede p {
    margin: 0 0 1.25rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
}

.post-cover {
    margin: 0 0 2.25rem;
}

.post-cover img {
    display: block;
    width: 100%;
    border-radius: 10px;
}

.post-cover figcaption,
.post-content figcaption {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
}

/* Article body typography: undo the theme's uppercase/letter-spaced headings */

.post-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.86);
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content pre,
.post-content table,
.post-content figure {
    margin: 0 0 1.5rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 2.5rem 0 1rem;
    line-height: 1.35;
    letter-spacing: 0.01em;
    text-transform: none;
    color: #ffffff;
}

.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1.05rem; }

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

.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }

.post-content li {
    margin-bottom: 0.45rem;
    padding-left: 0.25rem;
}

.post-content a {
    color: #b8d96b;
    border-bottom: 1px solid rgba(184, 217, 107, 0.4);
}

.post-content a:hover {
    border-bottom-color: #b8d96b;
}

.post-content strong {
    color: #ffffff;
}

.post-content blockquote {
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid #b8d96b;
    font-style: normal;
    color: rgba(255, 255, 255, 0.78);
}

.post-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
}

.post-content :not(pre) > code {
    margin: 0 0.1rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.88em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

.post-content pre {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
}

.post-content pre code {
    margin: 0;
    padding: 1.1rem 1.25rem;
    background: transparent;
    font-size: 0.85rem;
    line-height: 1.7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

.post-content table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.post-content th,
.post-content td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.post-content th {
    font-weight: 600;
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.post-content tbody tr:nth-child(2n + 1) {
    background: transparent;
}

.post-content hr {
    margin: 2.5rem 0;
}

/* Article footer: author + newer/older */

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-author img {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
}

.post-author p {
    margin: 0;
    line-height: 1.5;
}

.post-author-name {
    font-weight: 600;
    color: #ffffff;
}

.post-author-role {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

.post-pager {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.post-pager a {
    display: block;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #ffffff;
    line-height: 1.45;
}

.post-pager a:hover {
    border-color: rgba(184, 217, 107, 0.55);
}

.post-pager a span {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b8d96b;
}

.page-footer {
    padding: 2rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.45);
}

@media screen and (max-width: 736px) {
    .post {
        padding: 2rem 1.25rem 1.75rem;
    }

    .post-header h1 {
        font-size: 1.6rem;
    }

    .post-content {
        font-size: 1rem;
    }
}

/* Bio: profile card (portrait + identity) beside the bio copy */

#main article.bio-article {
    background: rgba(27, 31, 34, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

#main article.bio-article h2.major {
    margin-bottom: 2rem;
    color: #ffffff;
}

.bio-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    gap: 3rem;
}

/* Left column */

.bio-profile {
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.bio-photo-frame {
    width: 100%;
    aspect-ratio: 4 / 5;
    padding: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.bio-photo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 10px;
    /* soften the white studio backdrop against the dark panel */
    filter: brightness(0.96);
}

.bio-identity p {
    margin: 0;
    line-height: 1.4;
}

.bio-identity .bio-name {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: #ffffff;
}

.bio-identity .bio-role {
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: #b8d96b;
}

.bio-identity .bio-location {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.bio-identity .bio-location .icon {
    border: 0;
    margin-right: 0.25rem;
}

.bio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#main article .bio-actions a.bio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#main article .bio-actions a.bio-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}

#main article .bio-actions a.bio-btn-primary {
    flex: 1 1 100%;
    background: #b8d96b;
    border-color: #b8d96b;
    color: #1b1f22;
    font-weight: 600;
}

#main article .bio-actions a.bio-btn-primary:hover {
    background: #c9e585;
    border-color: #c9e585;
    color: #1b1f22;
}

#main article .bio-actions a.bio-btn:not(.bio-btn-primary) {
    flex: 1 1 0;
}

/* Right column */

.bio-copy {
    min-width: 0;
    color: rgba(255, 255, 255, 0.84);
}

.bio-copy p {
    font-size: 1rem;
    line-height: 1.8;
    margin: 0 0 1.25rem;
}

.bio-copy h3,
.bio-copy h4 {
    color: #b8d96b;
    margin: 2rem 0 0.8rem;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
}

.bio-copy ul {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

.bio-copy li {
    margin-bottom: 0.45rem;
    padding-left: 0.2rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.86);
}

.bio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bio-tags span {
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Tablet and phone: profile on top, centred */

@media screen and (max-width: 860px) {
    .bio-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .bio-profile {
        position: static;
        width: min(300px, 100%);
        margin: 0 auto;
        text-align: center;
    }

    .bio-actions {
        justify-content: center;
    }
}

/* Publications: stat tiles + year timeline */

.pub-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 1em;
	margin: 1.4em 0 2em;
}

.pub-stat {
	text-align: center;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	padding: 1.2em 0.8em;
}

.pub-stat-num {
	font-size: 2.2rem;
	font-weight: 600;
	line-height: 1;
	color: #b8d96b;
}

.pub-stat-num span {
	font-size: 1.3rem;
}

.pub-stat-label {
	font-size: 0.78em;
	opacity: 0.75;
	margin-top: 0.5em;
}

.pub-timeline {
	position: relative;
	padding-left: 1.8em;
}

.pub-timeline::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.35em;
	bottom: 0.35em;
	width: 2px;
	background: rgba(255, 255, 255, 0.15);
}

.pub-year {
	position: relative;
	margin-bottom: 2em;
}

.pub-year:last-child {
	margin-bottom: 0;
}

.pub-year-label {
	position: relative;
	margin: 0 0 1em;
	font-size: 1.05em;
	color: #b8d96b;
}

.pub-year-label::before {
	content: '';
	position: absolute;
	left: -1.86em;
	top: 0.4em;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #b8d96b;
}

.pub-card {
	display: flex;
	gap: 1em;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	padding: 1.1em 1.3em;
	margin-bottom: 1em;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pub-card:last-child {
	margin-bottom: 0;
}

.pub-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
	border-color: rgba(255, 255, 255, 0.26);
}

.pub-card-icon {
	color: #b8d96b;
	font-size: 1.25em;
	flex-shrink: 0;
	padding-top: 0.15em;
}

.pub-card-body h4 {
	margin: 0 0 0.6em;
	font-size: 0.98em;
	line-height: 1.5;
}

.pub-venue-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6em;
}

.pub-venue-name {
	font-size: 0.82em;
	opacity: 0.7;
}

.pub-badge {
	font-size: 0.72em;
	padding: 0.25em 0.7em;
	border-radius: 999px;
	border: 1px solid;
	white-space: nowrap;
}

.pub-badge-springer {
	color: #5ddab4;
	border-color: rgba(93, 218, 180, 0.5);
	background: rgba(93, 218, 180, 0.08);
}

.pub-badge-iccit {
	color: #4fc3f7;
	border-color: rgba(79, 195, 247, 0.5);
	background: rgba(79, 195, 247, 0.08);
}

.pub-badge-ieee {
	color: #ff9f5a;
	border-color: rgba(255, 159, 90, 0.5);
	background: rgba(255, 159, 90, 0.08);
}

.scholar-btn {
	display: inline-block;
	margin-top: 2em;
	padding: 0.7em 1.4em;
	border-radius: 999px;
	border: 1px solid #b8d96b;
	color: #b8d96b;
	text-decoration: none;
	font-size: 0.9em;
	transition: background 0.25s ease, color 0.25s ease;
}

.scholar-btn:hover {
	background: #b8d96b;
	color: #1b1f22;
}


/* Header menu (9 items): one row on wide screens, a 3x3 grid below that, a stack on phones */

#header nav ul li a {
    text-align: center;
    min-width: 0;
    padding: 0 1rem 0 1.15rem;
    letter-spacing: 0.17rem;
}

@media screen and (max-width: 1440px) {
    #header nav ul {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-width: min(40rem, 100%);
    }

    #header nav ul li {
        border-left: solid 1px #ffffff;
    }

    #header nav ul li:nth-child(3n + 1) {
        border-left: 0;
    }

    #header nav ul li:nth-child(n + 4) {
        border-top: solid 1px #ffffff;
    }
}

@media screen and (max-width: 480px) {
    #header nav ul {
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
    }

    #header nav ul li:nth-child(n) {
        border-left: 0;
        border-top: solid 1px #ffffff;
    }

    #header nav ul li:first-child {
        border-top: 0;
    }
}

/* Hero: one line per item, also on small screens (the theme hides <br> there) */

#header .content p.hero-lines span {
    display: block;
}

#header .content p.hero-lines span + span {
    margin-top: 0.35rem;
}


/* Bangla support: fall back to Noto Sans Bengali for Bangla characters everywhere */

body, input, select, textarea {
    font-family: "Source Sans Pro", "Noto Sans Bengali", sans-serif;
}

/* In Bangla text, use Noto Sans Bengali for the English words too, so mixed
   sentences ("Data Science interview-এর ...") have one consistent weight. */
[lang="bn"] {
    font-family: "Noto Sans Bengali", "Source Sans Pro", sans-serif;
}

.lang-block[data-lang-only="bn"],
.post-lede [data-lang-only="bn"],
.writing-card h3[lang="bn"],
.writing-card .writing-summary {
    font-weight: 400;
}

.writing-title-en {
    margin: -0.2rem 0 0.6rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Bilingual articles: show one language at a time (Bangla by default, also without JS) */

html:not([data-lang="en"]) [data-lang-only="en"],
html[data-lang="en"] [data-lang-only="bn"] {
    display: none !important;
}

.lang-toggle {
    display: inline-flex;
    margin-bottom: 1.4rem;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.lang-toggle button {
    height: auto;
    min-width: 5.5rem;
    padding: 0.4rem 1rem;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-transform: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-toggle button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.lang-toggle button[aria-pressed="true"],
html:not([data-lang="en"]) .lang-toggle button[data-set-lang="bn"] {
    background: #b8d96b;
    color: #1b1f22;
}

html[data-lang="en"] .lang-toggle button[data-set-lang="bn"]:not([aria-pressed="true"]) {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
}

/* Bangla reads better slightly larger with more line spacing */

.post-content .lang-block[data-lang-only="bn"] {
    font-size: 1.04em;
    line-height: 1.95;
}

.post-header h1 [data-lang-only="bn"] {
    line-height: 1.4;
}


/* ===================== Book ===================== */

body.page-book,
body.page-book .post,
body.page-book .post-content {
    font-family: "Noto Sans Bengali", "Source Sans Pro", sans-serif;
    font-weight: 400;
}

.page-shell-wide {
    max-width: 72rem;
}

.book-btn,
.page-shell a.book-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.page-shell a.book-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
}

.page-shell a.book-btn-primary {
    background: #b8d96b;
    border-color: #b8d96b;
    color: #1b1f22;
    font-weight: 600;
}

.page-shell a.book-btn-primary:hover {
    background: #c9e585;
    border-color: #c9e585;
}

.page-shell a.book-btn-small {
    width: 100%;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
}

.book-breadcrumb {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.book-breadcrumb a {
    color: rgba(255, 255, 255, 0.75);
    border-bottom-color: rgba(255, 255, 255, 0.25);
}

/* Book home */

.book-hero {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
    margin-bottom: 3rem;
}

.book-hero-cover {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
}

.book-badge {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.25rem 0.8rem;
    border: 1px solid rgba(184, 217, 107, 0.5);
    border-radius: 999px;
    font-size: 0.78rem;
    color: #b8d96b;
}

.book-hero-text h1,
.book-chapter h1,
.book-concept h1 {
    margin: 0 0 0.6rem;
    font-size: 2.1rem;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    color: #ffffff;
}

.book-subtitle {
    margin: 0 0 0.3rem;
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
}

.book-author {
    margin: 0 0 1.2rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
}

.book-summary {
    margin: 0 0 1.5rem;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.78);
}

.book-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.book-licence {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.book-licence a {
    color: rgba(255, 255, 255, 0.75);
}

.book-intro,
.book-toc {
    max-width: 46rem;
    margin: 0 auto 2.5rem;
}

.book-intro h2,
.book-toc h2 {
    margin: 0 0 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 1.35rem;
    letter-spacing: 0;
    text-transform: none;
    color: #ffffff;
}

.book-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.book-toc-chapters > li {
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.book-toc-chapter {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.9rem;
}

.book-toc-num {
    min-width: 5.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b8d96b;
}

.book-toc-chapter a,
.book-toc-chapter > span:nth-child(2) {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 0;
}

.book-toc-count {
    margin-left: auto;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
}

.book-toc-chapters > li.is-upcoming .book-toc-chapter > span:nth-child(2) {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

.book-toc-concepts {
    margin: 0.6rem 0 0 6.4rem !important;
}

.book-toc-concepts li {
    margin: 0.25rem 0;
}

.book-toc-concepts a {
    border-bottom: 0;
    color: rgba(255, 255, 255, 0.8);
}

.book-toc-concepts a:hover {
    color: #b8d96b;
}

.book-toc-concepts a span {
    display: inline-block;
    min-width: 1.6rem;
    color: rgba(255, 255, 255, 0.45);
}

/* Chapter page */

.book-concept-list {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.page-shell .book-concept-list a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.page-shell .book-concept-list a:hover {
    border-color: rgba(184, 217, 107, 0.55);
    background: rgba(255, 255, 255, 0.06);
}

.book-concept-num {
    flex: 0 0 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(184, 217, 107, 0.15);
    font-size: 0.85rem;
    font-weight: 600;
    color: #b8d96b;
}

.book-concept-title {
    flex: 1;
    font-size: 1.02rem;
}

.book-concept-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Concept page: sidebar + content */

.book-layout {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.book-sidebar {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(27, 31, 34, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}

.page-shell a.book-sidebar-title {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.45;
    color: #ffffff;
}

.book-sidebar-title img {
    width: 44px;
    height: auto;
    border-radius: 3px;
}

.book-nav-chapter {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.book-nav-chapter a {
    border-bottom: 0;
    color: #b8d96b;
}

.book-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.book-nav-list li {
    margin: 0;
    padding: 0;
}

.page-shell .book-nav-list a {
    display: block;
    padding: 0.4rem 0.6rem;
    border: 0;
    border-radius: 6px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.72);
}

.page-shell .book-nav-list a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.page-shell .book-nav-list li.is-current a {
    background: rgba(184, 217, 107, 0.14);
    color: #ffffff;
    font-weight: 600;
}

.book-nav-list a span {
    color: rgba(255, 255, 255, 0.45);
}

.book-mobile-toc {
    display: none;
}

.book-concept .post-content {
    font-size: 1.05rem;
    line-height: 1.95;
}

.book-concept .post-content .katex-display {
    margin: 1.5rem 0;
    padding: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.book-concept .post-content .katex {
    font-size: 1.05em;
}

.post-pager a.is-next {
    text-align: right;
}

.book-more {
    margin: 1.5rem 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.book-more a {
    color: #b8d96b;
}

.book-download {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.2rem 1.4rem;
    border: 1px solid rgba(184, 217, 107, 0.35);
    border-radius: 12px;
    background: rgba(184, 217, 107, 0.06);
}

.book-download p {
    margin: 0;
}

.book-download-title {
    font-weight: 600;
    color: #ffffff;
}

.book-download-text {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
}

.page-footer a {
    color: rgba(255, 255, 255, 0.6);
}

@media screen and (max-width: 980px) {
    .book-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .book-sidebar {
        display: none;
    }

    .book-mobile-toc {
        display: block;
        margin: -0.5rem 0 1.75rem;
        padding: 0.75rem 1rem;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.03);
    }

    .book-mobile-toc summary {
        cursor: pointer;
        font-size: 0.88rem;
        color: #b8d96b;
    }

    .book-mobile-toc .book-nav-chapter {
        display: none;
    }

    .book-mobile-toc .book-nav-list {
        margin-top: 0.75rem;
    }
}

@media screen and (max-width: 736px) {
    .book-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.75rem;
        text-align: center;
    }

    .book-hero-cover {
        width: min(200px, 60%);
        margin: 0 auto;
    }

    .book-actions {
        justify-content: center;
    }

    .book-hero-text h1,
    .book-chapter h1,
    .book-concept h1 {
        font-size: 1.6rem;
    }

    .book-toc-num {
        min-width: 0;
        width: 100%;
    }

    .book-toc-count {
        margin-left: 0;
    }

    .book-toc-concepts {
        margin-left: 0.5rem !important;
    }

    .book-concept-time {
        display: none;
    }
}

/* Letter-spacing and uppercase break joined Bangla letters: switch them off for Bangla */
.page-topbar a[lang="bn"],
.writing-meta [lang="bn"],
.book-toc-count {
    letter-spacing: 0;
    text-transform: none;
}

/* Pandoc writes "loose" lists (a paragraph per item): keep them compact */
.post-content li > p {
    margin: 0;
}

/* Books shelf (/books/) */

.book-shelf .post-header h1 {
    font-size: 2.1rem;
}

.book-shelf-list {
    display: grid;
    gap: 1.5rem;
}

.book-shelf-item {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.page-shell a.book-shelf-cover {
    display: block;
    border: 0;
}

.book-shelf-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.book-shelf-text h2 {
    margin: 0 0 0.4rem;
    font-size: 1.5rem;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
}

.book-shelf-text h2 a {
    border-bottom: 0;
    color: #ffffff;
}

.book-shelf-text .book-summary {
    margin-bottom: 1.2rem;
}

.book-shelf-text .book-actions {
    margin-bottom: 0;
}

@media screen and (max-width: 736px) {
    .book-shelf-item {
        grid-template-columns: minmax(0, 1fr);
        text-align: center;
    }

    .book-shelf-cover {
        width: min(180px, 60%);
        margin: 0 auto;
    }

    .book-shelf-text .book-actions {
        justify-content: center;
    }
}

/* Ongoing books: status badge, note and plain (unlinked) outline */

.book-badge.is-ongoing {
    border-color: rgba(255, 196, 102, 0.55);
    color: #ffc466;
}

.book-ongoing-note {
    margin: 0 0 1.2rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid #ffc466;
    background: rgba(255, 196, 102, 0.07);
    border-radius: 0 8px 8px 0;
    font-size: 0.92rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.82);
}

.book-ongoing-note a {
    color: #ffc466;
}

.book-toc-concepts.is-outline {
    color: rgba(255, 255, 255, 0.6);
}

.book-toc-concepts.is-outline li {
    padding-left: 0.2rem;
    font-size: 0.92rem;
}

.book-toc-chapters > li.is-upcoming .book-toc-chapter > span:nth-child(2) {
    color: rgba(255, 255, 255, 0.75);
}

/* Highlights: wide Foodi card on top, three linked cards below */

.highlight-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.highlight-card-wide {
    grid-column: 1 / -1;
}

#main article a.highlight-card,
#main article a.highlight-card:hover {
    color: inherit;
    border: solid 1px rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

#main article a.highlight-card:hover {
    border-color: #b8d96b;
}

.highlight-card .highlight-stat {
    margin-top: 1.5rem;
}

.highlight-card h3 {
    line-height: 1.45;
}

.highlight-card p em {
    font-style: normal;
    color: #ffffff;
}

.highlight-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    color: #b8d96b;
}

@media screen and (max-width: 1100px) {
    .highlight-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .highlight-card-wide {
        grid-column: auto;
    }
}

.highlight-card:not(.highlight-card-wide) {
    justify-content: flex-start;
}

.highlight-card:not(.highlight-card-wide) .highlight-link {
    margin-top: auto;
    padding-top: 0.5rem;
}

.highlight-card p em[lang="bn"] {
    font-weight: 400;
}

/* Books highlight: the two covers next to the number */

.highlight-stat-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.highlight-card .highlight-stat-row .highlight-stat {
    margin-top: 0;
}

.highlight-covers {
    display: flex;
    align-items: flex-end;
    padding-right: 0.25rem;
}

.highlight-covers img {
    width: 3.6rem;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
    transition: transform 0.25s ease;
}

.highlight-covers img:first-child {
    position: relative;
    z-index: 2;
    transform: rotate(-4deg);
}

.highlight-covers img + img {
    margin-left: -1.1rem;
    transform: rotate(5deg) translateY(-0.2rem);
}

a.highlight-card:hover .highlight-covers img:first-child {
    transform: rotate(-7deg) translateX(-0.2rem);
}

a.highlight-card:hover .highlight-covers img + img {
    transform: rotate(8deg) translate(0.2rem, -0.35rem);
}

/* keep the "132" level with the numbers in the other cards */
.highlight-stat-row {
    position: relative;
}

.highlight-covers {
    position: absolute;
    right: 0;
    bottom: 0;
}

.highlight-covers img {
    width: 3.1rem;
}
