/**
 * Learn archives: /learn/ (all masechtos by seder), a masechta's perakim, and a
 * perek's mishnayos. A navy hero over a sky body of white tiles.
 *
 * Sections carry mish-lrn-top (breadcrumb + title), mish-lrn-sub (Hebrew title,
 * description, search) and mish-lrn-body (the tiles), set in the Bricks
 * templates. The tile markup itself comes from Code elements, so it is styled
 * here by its own classes (.mishnah-archive__card and friends).
 *
 * Specificity: Bricks gives every section its own padding at one class, so the
 * section rules below are doubled up (.brxe-section.mish-lrn-*) to win.
 */

/* ---- Hero ---------------------------------------------------------------- */
.brxe-section.mish-lrn-top {
	padding: 22px var(--space-m, 24px) 4px;
	background: #0a1a2e;
	color: #fff;
}

.brxe-section.mish-lrn-sub {
	padding: 0 var(--space-m, 24px) 52px;
	background: #0a1a2e;
	color: #b6c4d8;
}

.mish-lrn-top > .brxe-container,
.mish-lrn-sub > .brxe-container,
.mish-lrn-body > .brxe-container {
	width: 100%;
	max-width: 1280px;
	margin-inline: auto;
}

.mish-lrn-top > .brxe-container {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
}

/* Breadcrumb / back arrow, light on navy. */
.mish-lrn-top .mishnah-breadcrumbs,
.mish-lrn-top .mishnah-breadcrumbs a {
	color: #8fa3bd;
	font: 500 14px/1.4 Inter, sans-serif;
	text-decoration: none;
}

.mish-lrn-top .mishnah-back-arrow:hover {
	color: var(--secondary, #ffd36b);
}

.mish-lrn-top div.mishnah-back-arrow__arrow::before,
.mish-lrn-top div.mishnah-back-arrow__arrow::after {
	border-color: currentColor;
}

/* Title. On /learn/ the sub section carries the visible title, so the bar's
   own "Learn Mishnayos" heading is hidden rather than shown twice. */
.mish-lrn-top h1,
.mish-lrn-sub h1.brxe-heading {
	margin: 0;
	font-family: "Mishnah Display", Georgia, serif;
	font-size: clamp(42px, 6vw, 68px);
	font-weight: 400;
	line-height: 1.06;
	color: #fff;
}

.mish-lrn-top h1::before,
.mish-lrn-sub h1.brxe-heading::before {
	content: "";
	display: block;
	width: 44px;
	height: 3px;
	margin-bottom: 18px;
	border-radius: 2px;
	background: var(--secondary, #ffd36b);
}

.mish-lrn-top--learn h1 {
	display: none;
}

/* Hebrew title and description (masechta / perek pages). */
.mish-lrn-sub .mishnah-subtitle.hebrew {
	display: block;
	margin: 0 0 10px;
	font-family: var(--mishnah-font-text, "Taamey D", serif);
	font-size: 30px;
	line-height: 1.3;
	color: var(--secondary, #ffd36b);
	text-align: start;
	direction: inherit;
	unicode-bidi: isolate;
}

.mish-lrn-sub p,
.mish-lrn-sub .brxe-text-basic {
	max-width: 640px;
	margin: 0;
	color: #b6c4d8;
	font: 400 17px/1.65 Inter, sans-serif;
}

/* /learn/ search box. */
.mish-lrn-sub .search-field-wrapper {
	max-width: 520px;
	margin-top: 24px;
	padding: 4px 6px 4px 14px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 99px;
	background: rgba(255, 255, 255, .08);
}

.mish-lrn-sub .search-field-wrapper svg {
	width: 22px;
	height: 22px;
	fill: #b6c4d8;
}

.mish-lrn-sub .search-field-wrapper .chart-search-input {
	flex: 1;
	min-width: 0;
	height: 44px;
	padding: 0 12px;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: #fff;
	font: 400 16px Inter, sans-serif;
}

.mish-lrn-sub .search-field-wrapper .chart-search-input::placeholder {
	color: #b6c4d8;
	opacity: .8;
}

.mish-lrn-sub .search-field-wrapper:focus-within {
	border-color: var(--secondary, #ffd36b);
}

/* ---- Body ---------------------------------------------------------------- */
.brxe-section.mish-lrn-body {
	padding: 44px var(--space-m, 24px) var(--section-space-m, 64px);
	background: #eef4fc;
}

/* /learn/: the seder blocks stack, each a heading over a tile grid. */
/* ACSS forces display:grid !important on the wrapper class, so match it. */
.mish-lrn-body .brxe-code > div:has(> .learn__seder) {
	display: block !important;
}

.mish-lrn-body .learn__seder {
	margin-bottom: 36px;
}

.mish-lrn-body .learn__seder h2 {
	margin: 0 0 16px;
	font-family: "Mishnah Display", Georgia, serif;
	font-size: clamp(26px, 3vw, 32px);
	font-weight: 400;
	line-height: 1.15;
	color: #0a1a2e;
}

.mish-lrn-body .learn__seder ul,
.mish-lrn-body ul.mishnah-archive__card-cont {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mish-lrn-body .learn__seder li,
.mish-lrn-body .mishnah-archive__card-cont li {
	display: block;
	margin: 0;
	list-style: none;
}

/* The tile. Hebrew name (the <p>) is a small watermark in the corner. */
.mish-lrn-body .mishnah-archive__card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	width: 100%;
	max-width: none;
	min-height: 118px;
	padding: 22px 24px 20px;
	overflow: hidden;
	border: 0;
	border-radius: 22px;
	background: #fff;
	color: #0a1a2e;
	text-decoration: none;
	transition: transform .25s, box-shadow .25s;
}

.mish-lrn-body .mishnah-archive__card:hover {
	transform: translateY(-4px);
	box-shadow: 0 20px 36px -22px rgba(10, 26, 46, .55);
}

.mish-lrn-body .mishnah-archive__card h2,
.mish-lrn-body .mishnah-archive__card h3 {
	margin: 0;
	font-family: "Mishnah Display", Georgia, serif;
	font-size: 26px;
	font-weight: 400;
	line-height: 1.15;
	color: #0a1a2e;
}

.mish-lrn-body .mishnah-archive__card p {
	position: absolute;
	top: 12px;
	inset-inline-end: 18px;
	max-width: 62%;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font: 400 34px/1.1 var(--mishnah-font-text, "Taamey D", serif);
	color: rgba(46, 119, 209, .22);
	transition: color .25s;
}

.mish-lrn-body .mishnah-archive__card:hover p {
	color: #e7b73c;
}

.mish-lrn-body .mishnah-archive__card span {
	margin-top: 4px;
	font: 400 13px/1.4 Inter, sans-serif;
	color: #697a90;
}

/* ---- Perek page: previous / next ----------------------------------------- */
.mish-lrn-body .mishnah-nav__link {
	padding: 16px 24px;
	border: 0;
	border-radius: 99px;
	background: #fff;
	color: #0a1a2e;
	font-weight: 600;
}

.mish-lrn-body .mishnah-nav__link--next {
	background: var(--secondary, #ffd36b);
}

.mish-lrn-body .mishnah-nav__link--next,
.mish-lrn-body .mishnah-nav__link--next .mishnah-nav__label,
.mish-lrn-body .mishnah-nav__link--next .mishnah-nav__detail,
.mish-lrn-body .mishnah-nav__link--next .mishnah-nav__chevron {
	color: #0a1a2e;
}

.mish-lrn-body .mishnah-nav__link--disabled {
	background: rgba(255, 255, 255, .6);
	color: #8394a8;
	opacity: .7;
}

.mish-lrn-body .mishnah-nav__link:not(.mishnah-nav__link--disabled):hover {
	box-shadow: 0 14px 28px -18px rgba(10, 26, 46, .5);
}

.mish-lrn-body .mishnah-nav__progress {
	background: #d3e1f6;
}

.mish-lrn-body .mishnah-nav__progress-fill {
	background: var(--primary, #2e77d1);
}

/* ---- Small screens: two tiles across ------------------------------------- */
@media (max-width: 900px) {
	.mish-lrn-body .learn__seder ul,
	.mish-lrn-body ul.mishnah-archive__card-cont {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
}

@media (max-width: 767px) {
	.brxe-section.mish-lrn-sub {
		padding-bottom: 36px;
	}

	.brxe-section.mish-lrn-body {
		padding-top: 30px;
	}

	.mish-lrn-body .mishnah-archive__card {
		min-height: 100px;
		padding: 16px;
		border-radius: 16px;
	}

	.mish-lrn-body .mishnah-archive__card h2,
	.mish-lrn-body .mishnah-archive__card h3 {
		font-size: 21px;
	}

	.mish-lrn-body .mishnah-archive__card p {
		top: 10px;
		inset-inline-end: 12px;
		font-size: 24px;
	}

	.mish-lrn-sub .mishnah-subtitle.hebrew {
		font-size: 24px;
	}
}

/* ---- Hero figures ([mishnah_learn_stats]) -------------------------------- */
.mish-learn-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 40px;
	margin-top: 26px;
}

.mish-learn-stats__item {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mish-learn-stats__value {
	font: 400 36px/1 "Mishnah Display", Georgia, serif;
	color: #fff;
}

.mish-learn-stats__label {
	font: 600 11.5px/1.3 Inter, sans-serif;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #8fa3bd;
}

@media (max-width: 767px) {
	.mish-learn-stats {
		gap: 14px 28px;
	}

	.mish-learn-stats__value {
		font-size: 30px;
	}
}
