/*
 * /sample-grammar-lesson/
 *
 * Hand-written, unlike its neighbours in this directory: those were generated from Elementor's
 * stored values by migrations/wordpress-import/fetch-and-convert.py, and this page never existed
 * in WordPress. So there is no "re-run the extractor" here -- edit it.
 *
 * Deliberately short. site.css already supplies the reading column, the heading scale, the
 * .kk-pattern box, the .kk-example grouping and the furigana rules; this adds only what a lesson
 * page needs on top of them.
 */

/* ------------------------------------------------------------------ header */

.kk-sample__eyebrow {
	margin: 0 0 .5rem;
	font-family: var(--kk-font-widget);
	font-size: .8333rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--kk-primary);
}

/*
 * Left-aligned, not centered, and clamped to the same --kk-measure the prose below it uses.
 *
 * site.css gives .kk-page__header no text-align, so every other page on this site sets its
 * heading flush left inside the 1152px .kk-page box, with the prose column beneath it also flush
 * left. Centering this one would have put a centered standfirst directly above a left-aligned
 * first paragraph.
 */
.kk-sample__header {
	max-width: var(--kk-measure);
}

.kk-sample__standfirst {
	margin: 1rem 0 0;
	color: var(--kk-muted);
	font-size: 1.1111rem;
	line-height: 1.6;
}

/*
 * The lesson's vital statistics, as a row of labelled facts rather than a list of bullets. It is
 * marked up as a <ul> because it is a list; the bullets and the indent are what is dropped.
 */
.kk-sample__meta {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.75rem;
	margin: 1.5rem 0 0;
	padding: 0;
	list-style: none;
	font-size: .9444rem;
	color: var(--kk-muted);
}

.kk-sample__meta strong { color: var(--kk-text); }

/* ------------------------------------------------- worked examples */

/*
 * An example block, set off from the prose. The grammar posts leave these unboxed, inheriting
 * only the line grouping from site.css; a page carrying twelve of them between long stretches of
 * explanation needs the eye to find them, so they get the surface tint and a rule in the brand
 * colour down the leading edge.
 *
 * padding-inline-start rather than padding-left, and border-inline-start rather than
 * border-left: the rest of this site uses logical properties (see .kk-feature--inline-start in
 * site.css) and mixing the two is how a layout ends up correct in only one writing direction.
 */
.kk-prose .kk-example--ruby {
	margin: 1.75rem 0;
	padding: 1.25rem 1.5rem;
	background: var(--kk-surface);
	border-inline-start: 4px solid var(--kk-primary);
	border-radius: var(--kk-radius);
}

.kk-prose .kk-example--ruby .kk-example__label {
	margin: 0 0 .75rem;
	font-family: var(--kk-font-widget);
	font-size: .8333rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--kk-muted);
}

/*
 * The Japanese line.
 *
 * **line-height is the whole reason this file needs a rule here.** <rt> is rendered above the
 * base text and is taken out of the line box in most engines, so at a normal line-height the
 * furigana of one line overlaps the line above it -- and with a 1.6667rem sentence that collision
 * is unmissable. 2.1 leaves room for the reading. site.css sizes this line already, via
 * `.kk-example > p:first-of-type`, which is why no font-size is set here: the example renderer
 * emits the label as an h3 precisely so that selector still lands on this paragraph.
 */
.kk-prose .kk-example--ruby .kk-example__jp {
	line-height: 2.1;
	font-family: var(--kk-font);
}

/* Furigana a touch larger than the .6em site.css gives a post: this page is a sample shown to
   people who may not read kana fluently yet, and the reading is the point of it. */
.kk-prose .kk-example--ruby rt {
	font-size: .5em;
	color: var(--kk-muted);
	font-weight: 400;
}

.kk-prose .kk-example--ruby .kk-example__romaji {
	margin-top: .35rem;
	color: var(--kk-muted);
	font-style: italic;
}

.kk-prose .kk-example--ruby .kk-example__en {
	margin-top: .5rem;
	font-size: 1.0556rem;
}

.kk-prose .kk-example--ruby .kk-example__en em { font-style: normal; }

/* ------------------------------------------------- pattern formulas */

/* The gloss under a formula -- "I just ate." -- is a translation of the pattern, not part of it. */
.kk-prose .kk-pattern__gloss {
	margin-top: .5rem;
	color: var(--kk-muted);
	font-size: .9444rem;
}

/* --------------------------------------------------- the recap table */

.kk-prose .kk-sample__recap {
	width: 100%;
	margin: 1.5rem 0;
	border-collapse: collapse;
	font-size: 1rem;
}

.kk-prose .kk-sample__recap th,
.kk-prose .kk-sample__recap td {
	padding: .75rem 1rem;
	text-align: start;
	vertical-align: top;
	border-bottom: 1px solid var(--kk-border);
}

.kk-prose .kk-sample__recap thead th {
	font-family: var(--kk-font-widget);
	font-size: .8333rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--kk-muted);
	border-bottom: 2px solid var(--kk-border);
}

/* The form, in the row header column. Kept to a sensible share of the table so the meaning
   beside it is not squeezed into a column two words wide. */
.kk-prose .kk-sample__recap tbody th {
	width: 42%;
	font-weight: 700;
}

/* ------------------------------------------------------------- narrow */

@media (max-width: 600px) {
	/* A two-column table of Japanese forms and English meanings cannot shrink to a phone without
	   one column or the other breaking mid-word, so each row becomes a stacked pair. */
	.kk-prose .kk-sample__recap thead { display: none; }

	.kk-prose .kk-sample__recap tbody th,
	.kk-prose .kk-sample__recap tbody td {
		display: block;
		width: auto;
		border-bottom: 0;
		padding: 0 0 .25rem;
	}

	.kk-prose .kk-sample__recap tbody tr {
		display: block;
		padding: .75rem 0;
		border-bottom: 1px solid var(--kk-border);
	}

	.kk-prose .kk-example--ruby {
		padding: 1rem 1.1rem;
	}
}
