/**
 * Ban Jungle Blog & Gutenberg Editorial Typography
 *
 * Scoped styles for .bj-prose ensuring native WordPress blocks render
 * with pixel-perfect fidelity matching the Ban Jungle design system.
 */

/* Headings scale */
.bj-prose h1, .bj-prose h2, .bj-prose h3, .bj-prose h4, .bj-prose h5, .bj-prose h6 {
	font-family: var(--font-heading, "Plus Jakarta Sans", sans-serif);
	color: #102B21;
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.25;
}

.bj-prose h2 {
	font-size: 1.625rem;
	margin-top: 2rem;
	margin-bottom: 0.75rem;
	padding-top: 0.5rem;
}

@media (min-width: 640px) {
	.bj-prose h2 {
		font-size: 1.875rem;
	}
}

.bj-prose h3 {
	font-size: 1.25rem;
	margin-top: 1.5rem;
	margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
	.bj-prose h3 {
		font-size: 1.4rem;
	}
}

.bj-prose h4 {
	font-size: 1.125rem;
	margin-top: 1.25rem;
	margin-bottom: 0.5rem;
	font-weight: 600;
}

/* Paragraphs & Text */
.bj-prose p {
	font-size: 0.9375rem;
	line-height: 1.75;
	color: #4A5568;
	margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
	.bj-prose p {
		font-size: 1rem;
	}
}

.bj-prose p.bj-lead,
.bj-prose .has-large-font-size {
	font-size: 1.125rem;
	line-height: 1.6;
	color: #2D3748;
}

/* Links */
.bj-prose a:not([class*="bj-btn"]) {
	color: #204E38;
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 500;
	transition: color 0.15s ease;
}

.bj-prose a:not([class*="bj-btn"]):hover {
	color: #102B21;
}

/* Lists */
.bj-prose ul:not(.is-style-checklist ul):not(.wp-block-gallery) {
	list-style-type: disc;
	padding-left: 1.5rem;
	margin-bottom: 1.25rem;
	color: #4A5568;
}

.bj-prose ol {
	list-style-type: decimal;
	padding-left: 1.5rem;
	margin-bottom: 1.25rem;
	color: #4A5568;
}

.bj-prose li {
	margin-bottom: 0.5rem;
	line-height: 1.6;
}

/* Blockquotes */
.bj-prose blockquote,
.bj-prose .wp-block-quote {
	border-left: 3px solid #204E38;
	background-color: #FAF8F5;
	padding: 1rem 1.25rem;
	border-radius: 0 0.75rem 0.75rem 0;
	margin: 1.5rem 0;
	font-style: italic;
	color: #2D3748;
}

.bj-prose blockquote cite,
.bj-prose .wp-block-quote cite {
	display: block;
	font-size: 0.8125rem;
	font-style: normal;
	font-weight: 600;
	color: #718096;
	margin-top: 0.5rem;
}

/* Tables */
.bj-prose .wp-block-table {
	width: 100%;
	overflow-x: auto;
	margin: 1.75rem 0;
	border-radius: 1rem;
	border: 1px solid rgba(229, 231, 235, 0.8);
	background: #ffffff;
}

.bj-prose table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 0.875rem;
}

.bj-prose th {
	background-color: #FAF8F5;
	color: #102B21;
	font-weight: 700;
	padding: 0.875rem 1rem;
	border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.bj-prose td {
	padding: 0.875rem 1rem;
	border-bottom: 1px solid rgba(243, 244, 246, 0.8);
	color: #4A5568;
	vertical-align: top;
}

.bj-prose tr:last-child td {
	border-bottom: none;
}

/* Images & Figures */
.bj-prose figure {
	margin: 1.75rem 0;
}

.bj-prose img {
	max-width: 100%;
	height: auto;
	border-radius: 1rem;
}

.bj-prose figcaption,
.bj-prose .wp-element-caption {
	font-size: 0.8125rem;
	color: #718096;
	text-align: center;
	margin-top: 0.5rem;
}

/* Galleries */
.bj-prose .wp-block-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin: 1.75rem 0;
	padding: 0;
	list-style: none;
}

.bj-prose .wp-block-gallery figure {
	margin: 0;
}

.bj-prose .wp-block-gallery img {
	width: 100%;
	height: 100%;
	aspect-ratio: 16/10;
	object-fit: cover;
	border-radius: 0.875rem;
}

/* Separators */
.bj-prose hr,
.bj-prose .wp-block-separator {
	border: none;
	border-top: 1px solid #E5E7EB;
	margin: 2rem 0;
}

/* Responsive Embeds (Videos) */
.bj-prose .wp-block-embed,
.bj-prose .wp-block-embed-youtube {
	margin: 1.75rem 0;
	max-width: 100%;
}

.bj-prose .wp-block-embed__wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: 16/9;
	border-radius: 1rem;
	overflow: hidden;
}

.bj-prose .wp-block-embed__wrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Custom Block Style: Callout */
.wp-block-group.is-style-callout,
.bj-prose .is-style-callout {
	background-color: #FAF8F5;
	border: 1px solid rgba(229, 231, 235, 0.85);
	border-left: 4px solid #204E38;
	border-radius: 1rem;
	padding: 1.25rem 1.5rem;
	margin: 1.5rem 0;
}

.wp-block-group.is-style-callout p:last-child,
.bj-prose .is-style-callout p:last-child {
	margin-bottom: 0;
}

/* Custom Block Style: Checklist */
.wp-block-group.is-style-checklist,
.bj-prose .is-style-checklist {
	background-color: #FAF8F5;
	border: 1px solid rgba(229, 231, 235, 0.85);
	border-radius: 1rem;
	padding: 1.25rem 1.5rem;
	margin: 1.5rem 0;
}

.wp-block-group.is-style-checklist ul,
.bj-prose .is-style-checklist ul {
	list-style: none !important;
	padding-left: 0 !important;
	margin: 0 !important;
}

.wp-block-group.is-style-checklist li,
.bj-prose .is-style-checklist li {
	position: relative;
	padding-left: 1.75rem;
	margin-bottom: 0.625rem;
	font-size: 0.9375rem;
	color: #374151;
}

.wp-block-group.is-style-checklist li:last-child,
.bj-prose .is-style-checklist li:last-child {
	margin-bottom: 0;
}

.wp-block-group.is-style-checklist li::before,
.bj-prose .is-style-checklist li::before {
	content: "✓";
	position: absolute;
	left: 0;
	top: 0.1em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.15rem;
	height: 1.15rem;
	border-radius: 9999px;
	background-color: #EBF4E0;
	color: #204E38;
	font-size: 0.75rem;
	font-weight: 800;
	line-height: 1;
}
