/**
 * K MANGA Chapters landing page (page-templates/k-manga-chapters.php).
 *
 * Intro reuses .split-section (css/components/split-section.css) for the
 * title-left / copy-right layout; the series grid below is a 3-up card grid.
 * BEM blocks: .kmanga-chapters (page), .kmanga-series-card (grid card).
 */

/* No top padding — like /library/, the title sits directly under the site
   header's own offset. */
.kmanga-chapters {
	padding-bottom: var(--section-gap);
}

/* Intro
--------------------------------------------- */
.kmanga-chapters__intro {
	/* Rule beneath the intro, like the mock's divider */
	padding-bottom: var(--section-gap);
	border-bottom: 3px solid var(--color-black);
}

.kmanga-chapters__brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.5rem;
}

.kmanga-chapters__title {
	/* Sits above the logo instead of spanning the row */
	align-self: auto;
}

/* Logo / mascot slot. */
.kmanga-chapters__logo {
	width: 100%;
	max-width: 200px;
}

.kmanga-chapters__logo-img {
	display: block;
	width: 100%;
	height: auto;
}

/* "→ Visit kmanga.kodansha.com" — smallcaps link with a leading arrow */
.kmanga-chapters__visit {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--color-text);
	text-decoration: none;
}

.kmanga-chapters__visit-arrow {
	font-family: "Maax";
	letter-spacing: 0;
	font-size: 1rem;
	line-height: 1;
}

.kmanga-chapters__visit-text {
	text-decoration-line: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2rem;
}

.kmanga-chapters__visit:hover {
	color: var(--color-gray-dark);
}

/* Blurb column — editable page content; the [kmanga_titles] shortcode drops the
   linked series list in wherever the editor places it.
   Font size inherits .split-section__content (1.2rem) to match other pages. */
.kmanga-chapters__blurb p {
	margin: 0 0 1.25em;
}

.kmanga-chapters__blurb p:last-child {
	margin-bottom: 0;
}

.kmanga-chapters__blurb a {
	color: inherit;
	text-decoration-line: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.15rem;
}

.kmanga-chapters__blurb a:hover {
	color: var(--color-gray-dark);
}

/* [kmanga_titles] list — same rhythm as the paragraphs around it. */
.kmanga-chapters__titles {
	margin: 0 0 1.25em;
	padding-left: 1.25em;
	list-style: disc;
}

.kmanga-chapters__titles:last-child {
	margin-bottom: 0;
}

.kmanga-chapters__titles-item {
	margin: 0 0 0.35em;
}

/* Series grid
--------------------------------------------- */
.kmanga-chapters__series {
	margin-top: var(--section-gap);
}

.kmanga-chapters__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 3.5rem 2.5rem;
}

.kmanga-chapters__grid-item {
	margin: 0;
	min-width: 0;
}

.kmanga-chapters__empty {
	margin: 0;
	font-size: 1.25rem;
	color: var(--color-text-2);
}

/* Series card
--------------------------------------------- */
.kmanga-series-card {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	height: 100%;
}

/* 4:3 image with the series-color tint (.u-colorize sets the tint; this
   block owns the crop). */
.kmanga-series-card__cover {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--color-background-2);
}

.kmanga-series-card__cover picture {
	display: block;
	width: 100%;
	height: 100%;
}

/* Re-assert the crop — the .u-colorize img utility sets height: auto. */
.kmanga-series-card__cover .kmanga-series-card__img,
.kmanga-series-card__cover.u-colorize .kmanga-series-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kmanga-series-card__img.is-placeholder {
	object-fit: contain;
	padding: 2rem;
}

.kmanga-series-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
	flex: 1;
}

.kmanga-series-card__title {
	margin: 0;
	font-family: "Maax Bold";
	font-weight: 400;
	font-size: 1.5rem;
	line-height: 1.05;
	letter-spacing: -0.5px;
	color: var(--color-text);
}

.kmanga-series-card__title a {
	color: inherit;
	text-decoration: none;
}

.kmanga-series-card__title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.15rem;
}

.kmanga-series-card__creators {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.3;
	color: var(--color-text);
}

.kmanga-series-card__meta {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	font-size: 0.9375rem;
	line-height: 1.3;
	color: var(--color-text);
}

.kmanga-series-card__meta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.35rem;
}

.kmanga-series-card__meta dt,
.kmanga-series-card__meta dd {
	margin: 0;
}

.kmanga-series-card__synopsis {
	margin: 0.5rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--color-text-2);
}

/* "View all chapters" — pinned to the bottom of the card */
.kmanga-series-card__link {
	margin-top: auto;
	padding-top: 0.75rem;
	color: var(--color-text);
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2rem;
}

.kmanga-series-card__link:hover {
	color: var(--color-gray-dark);
}

/* Responsive
--------------------------------------------- */
@media (max-width: 1024px) {
	.kmanga-chapters__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 3rem 2rem;
	}
}

@media (max-width: 768px) {
	.kmanga-chapters__intro {
		padding-bottom: 2rem;
	}

	.kmanga-chapters__brand {
		gap: 1rem;
	}

	.kmanga-chapters__logo {
		max-width: 120px;
	}

	.kmanga-chapters__series {
		margin-top: 2rem;
	}
}

@media (max-width: 600px) {
	.kmanga-chapters__grid {
		grid-template-columns: 1fr;
		gap: 2rem;
	}
}
