/*
 * Bongo World News Core - article page styles (v1.0.0)
 * All selectors start with .bwn-article / .bwn-* so they do not collide with Astra.
 * Bangla rules: generous line-height, no letter-spacing, no italics, no uppercase,
 * no justified text.
 */

.bwn-article {
	--bwn-font-body: "Noto Serif Bengali", "Noto Sans Bengali", "Hind Siliguri", "Kalpurush", "Siyam Rupali", system-ui, serif;
	--bwn-font-heading: "Noto Sans Bengali", "Hind Siliguri", "Kalpurush", "Siyam Rupali", system-ui, sans-serif;
	--bwn-fs-body: 1.125rem;
	--bwn-lh-body: 1.85;
	--bwn-lh-heading: 1.4;
	--bwn-color-text: #1c2024;
	--bwn-color-bg: #ffffff;
	--bwn-color-muted: #566069;
	--bwn-color-link: #0b5f7a;
	--bwn-color-rule: #d9dee3;
	--bwn-color-note-bg: #fbf4e3;
	--bwn-color-note-line: #b7791f;
	--bwn-gap: 1rem;

	box-sizing: border-box;
	max-width: 44rem;
	margin: 0 auto;
	padding: 1rem var(--bwn-gap) 2rem;
	color: var(--bwn-color-text);
	background: var(--bwn-color-bg);
	font-family: var(--bwn-font-body);
	font-size: var(--bwn-fs-body);
	line-height: var(--bwn-lh-body);
	letter-spacing: normal;
	overflow-wrap: break-word;
}

.bwn-article *,
.bwn-article *::before,
.bwn-article *::after {
	box-sizing: inherit;
}

.bwn-article em,
.bwn-article i,
.bwn-article cite {
	font-style: normal;
}

.bwn-article a {
	color: var(--bwn-color-link);
	text-underline-offset: 0.15em;
}

.bwn-article a:focus-visible,
.bwn-article button:focus-visible {
	outline: 3px solid var(--bwn-color-link);
	outline-offset: 2px;
}

/* Header */
.bwn-article__header {
	margin-bottom: 1rem;
}

.bwn-kicker {
	margin: 0 0 0.5rem;
	font-family: var(--bwn-font-heading);
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--bwn-color-muted);
}

.bwn-kicker__type {
	display: inline-block;
	margin-inline-end: 0.5rem;
	padding: 0 0.5rem;
	border: 1px solid var(--bwn-color-link);
	border-radius: 2px;
	text-decoration: none;
}

.bwn-article__title {
	margin: 0 0 0.75rem;
	font-family: var(--bwn-font-heading);
	font-size: clamp(1.6rem, 5.5vw, 2.4rem);
	font-weight: 700;
	line-height: var(--bwn-lh-heading);
	letter-spacing: normal;
	text-transform: none;
}

.bwn-article__summary {
	margin: 0 0 1rem;
	font-family: var(--bwn-font-heading);
	font-size: 1.15rem;
	line-height: 1.7;
	color: var(--bwn-color-muted);
}

.bwn-breadcrumbs {
	margin-bottom: 0.75rem;
	font-family: var(--bwn-font-heading);
	font-size: 0.9rem;
	color: var(--bwn-color-muted);
}

/* Byline block */
.bwn-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0;
	padding: 0.75rem 0;
	border-block: 1px solid var(--bwn-color-rule);
	list-style: none;
	font-family: var(--bwn-font-heading);
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--bwn-color-muted);
}

.bwn-meta__author {
	font-weight: 700;
}

.bwn-meta__label {
	margin-inline-end: 0.25rem;
}

/* Lead image */
.bwn-lead {
	margin: 1rem 0;
}

.bwn-lead__img {
	display: block;
	width: 100%;
	height: auto;
}

.bwn-lead__caption {
	margin-top: 0.5rem;
	font-family: var(--bwn-font-heading);
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--bwn-color-muted);
}

.bwn-lead__credit::before {
	content: "\00a0\2022\00a0";
}

/* Share */
.bwn-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	margin: 1rem 0;
	font-family: var(--bwn-font-heading);
	font-size: 0.95rem;
}

.bwn-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bwn-share__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
	padding: 0 0.9rem;
	border: 1px solid var(--bwn-color-link);
	border-radius: 4px;
	background: transparent;
	color: var(--bwn-color-link);
	font: inherit;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.bwn-share__btn[hidden] {
	display: none;
}

/* Content */
.bwn-article__content > * {
	margin-block: 0 1.25rem;
}

.bwn-article__content img,
.bwn-article__content video,
.bwn-article__content iframe {
	max-width: 100%;
	height: auto;
}

.bwn-article__content h2,
.bwn-article__content h3,
.bwn-article__content h4 {
	font-family: var(--bwn-font-heading);
	line-height: var(--bwn-lh-heading);
	margin-top: 2rem;
	text-transform: none;
	letter-spacing: normal;
}

.bwn-article__content blockquote {
	margin-inline: 0;
	padding-inline-start: 1rem;
	border-inline-start: 4px solid var(--bwn-color-rule);
	color: var(--bwn-color-muted);
}

.bwn-article__content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

/* Corrections */
.bwn-corrections {
	margin: 2rem 0 1.5rem;
	padding: 0.75rem 1rem;
	border-inline-start: 4px solid var(--bwn-color-note-line);
	background: var(--bwn-color-note-bg);
	font-family: var(--bwn-font-heading);
	font-size: 0.95rem;
	line-height: 1.7;
}

.bwn-corrections__title {
	margin: 0 0 0.5rem;
	font-size: 1.05rem;
	text-transform: none;
}

.bwn-corrections__list {
	margin: 0;
	padding-inline-start: 1.1rem;
}

/* Topics and related */
.bwn-topics {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1.5rem 0;
	font-family: var(--bwn-font-heading);
	font-size: 0.95rem;
}

.bwn-topics ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bwn-related {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--bwn-color-rule);
	font-family: var(--bwn-font-heading);
}

.bwn-related__title {
	margin: 0 0 0.5rem;
	font-size: 1.15rem;
	text-transform: none;
}

.bwn-related__list {
	margin: 0;
	padding-inline-start: 1.1rem;
	line-height: 1.7;
}

.bwn-related__list li {
	margin-bottom: 0.4rem;
}

/* Dark mode: follows the device only when <html data-bwn-os> is set (Settings > পাঠকের টুল), or force it with <html data-theme="dark"> */
@media (prefers-color-scheme: dark) {
	:root[data-bwn-os]:not([data-theme="light"]) .bwn-article {
		--bwn-color-text: #e8ecef;
		--bwn-color-bg: #14181c;
		--bwn-color-muted: #a3adb5;
		--bwn-color-link: #6cc4de;
		--bwn-color-rule: #2c343b;
		--bwn-color-note-bg: #2a2415;
		--bwn-color-note-line: #d9a441;
	}
}

:root[data-theme="dark"] .bwn-article {
	--bwn-color-text: #e8ecef;
	--bwn-color-bg: #14181c;
	--bwn-color-muted: #a3adb5;
	--bwn-color-link: #6cc4de;
	--bwn-color-rule: #2c343b;
	--bwn-color-note-bg: #2a2415;
	--bwn-color-note-line: #d9a441;
}

/*
 * v2.0.5: dark mode has to out-rank the theme's own colours. Astra paints the article card white and gives
 * every heading a colour of its own, so the variables above alone left light text on a white card. The
 * doubled class raises the weight without !important, and these rules apply in dark mode only, so the
 * light look is untouched.
 */
@media (prefers-color-scheme: dark) {
	:root[data-bwn-os]:not([data-theme="light"]) .bwn-article.bwn-article {
		background: var(--bwn-color-bg);
		color: var(--bwn-color-text);
	}

	:root[data-bwn-os]:not([data-theme="light"]) .bwn-article.bwn-article :is(h1, h2, h3, h4, h5, h6) {
		color: var(--bwn-color-text);
	}
}

:root[data-theme="dark"] .bwn-article.bwn-article {
	background: var(--bwn-color-bg);
	color: var(--bwn-color-text);
}

:root[data-theme="dark"] .bwn-article.bwn-article :is(h1, h2, h3, h4, h5, h6) {
	color: var(--bwn-color-text);
}

/* Print */
@media print {
	#masthead,
	#colophon,
	.site-header,
	.site-footer,
	.bwn-share,
	.bwn-related,
	.bwn-breadcrumbs,
	.bwn-topics {
		display: none !important;
	}

	.bwn-article {
		max-width: none;
		padding: 0;
		color: #000;
		background: #fff;
	}

	.bwn-article__content a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
	}

	.bwn-article::after {
		content: attr(data-bwn-url);
		display: block;
		margin-top: 1.5rem;
		font-size: 0.85em;
		word-break: break-all;
	}
}

/* Live coverage (v1.3.0) */
.bwn-live {
	margin: 1.5rem 0;
	padding: 0.75rem 1rem;
	border: 1px solid var(--bwn-color-rule);
	border-inline-start: 4px solid #9b1c1c;
	font-family: var(--bwn-font-heading);
	font-size: 1rem;
	line-height: 1.7;
}

.bwn-live--ended {
	border-inline-start-color: var(--bwn-color-muted);
}

.bwn-live__badge {
	display: inline-block;
	margin: 0 0 0.5rem;
	padding: 0 0.6rem;
	background: #9b1c1c;
	color: #ffffff;
	font-weight: 700;
	border-radius: 2px;
}

.bwn-live--ended .bwn-live__badge {
	background: var(--bwn-color-muted);
}

.bwn-live__new[hidden] {
	display: none;
}

.bwn-live__new-btn {
	min-height: 44px;
	margin: 0.5rem 0;
	padding: 0 1rem;
	border: 1px solid var(--bwn-color-link);
	border-radius: 4px;
	background: var(--bwn-color-link);
	color: var(--bwn-color-bg);
	font: inherit;
	cursor: pointer;
}

.bwn-live__entry {
	padding: 0.75rem 0;
	border-top: 1px solid var(--bwn-color-rule);
}

.bwn-live__entry--pinned {
	background: var(--bwn-color-note-bg);
	padding-inline: 0.75rem;
}

.bwn-live__meta {
	font-size: 0.9rem;
	color: var(--bwn-color-muted);
}

.bwn-live__body > :first-child {
	margin-top: 0.25rem;
}

.bwn-live__body img {
	max-width: 100%;
	height: auto;
}

.bwn-live__nav {
	margin: 0.75rem 0 0;
}

/* Reader tools (v1.5.0) */
.bwn-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.75rem 0;
	font-family: var(--bwn-font-heading);
	font-size: 0.95rem;
}

.bwn-actions__btn {
	min-height: 44px;
	padding: 0 0.9rem;
	border: 1px solid var(--bwn-color-link);
	border-radius: 4px;
	background: transparent;
	color: var(--bwn-color-link);
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
}

.bwn-actions__btn[hidden] {
	display: none;
}

.bwn-actions__btn[aria-pressed="true"] {
	background: var(--bwn-color-link);
	color: var(--bwn-color-bg);
}

@media print {
	.bwn-actions {
		display: none !important;
	}
}

/* Media and content-type layouts (v1.8.0) */
.bwn-video,
.bwn-audio {
	margin: 1rem 0;
}

.bwn-video__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #0d1114;
	overflow: hidden;
}

.bwn-video__frame .bwn-lead__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bwn-video__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.35);
	color: #ffffff;
	text-decoration: none;
	font-family: var(--bwn-font-heading);
	font-size: 1.1rem;
}

.bwn-video__play span {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 1.25rem;
	border: 2px solid #ffffff;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.6);
}

.bwn-video__play span::before {
	content: "\25B6\00a0";
}

.bwn-video__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.bwn-video__link {
	font-family: var(--bwn-font-heading);
}

.bwn-audio__title {
	margin-bottom: 0.25rem;
	font-family: var(--bwn-font-heading);
	font-size: 0.95rem;
	color: var(--bwn-color-muted);
}

.bwn-audio audio {
	display: block;
	width: 100%;
}

/* Photo story: wider page, two-column gallery on larger screens */
.bwn-article.bwn-type-photo-story {
	max-width: 64rem;
}

.bwn-type-photo-story .bwn-article__content .wp-block-gallery,
.bwn-type-photo-story .bwn-article__content .gallery {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem;
}

@media (min-width: 48rem) {
	.bwn-type-photo-story .bwn-article__content .wp-block-gallery,
	.bwn-type-photo-story .bwn-article__content .gallery {
		grid-template-columns: repeat(2, 1fr);
	}
}

.bwn-type-photo-story .bwn-article__content figure,
.bwn-type-photo-story .bwn-article__content .gallery-item {
	margin: 0;
}

.bwn-type-photo-story .bwn-article__content figcaption {
	font-family: var(--bwn-font-heading);
	font-size: 0.9rem;
	color: var(--bwn-color-muted);
}

/* Video type: the player leads, a little more room */
.bwn-article.bwn-type-video {
	max-width: 56rem;
}

@media print {
	.bwn-video__frame,
	.bwn-audio {
		display: none !important;
	}
}
