/**
 * JC Lalnunsanga child theme - homepage.
 *
 * Loaded only on the front page (see jcl_child_enqueue_styles in functions.php),
 * so it costs nothing on the other 280-odd pages.
 *
 * Two rules govern this file:
 *
 * 1. Every colour comes from the tokens already defined in theme-colors.css
 *    (--bg-color, --card-bg, --heading-color, --link-color and friends). Those
 *    tokens are redefined under body.dark-mode, so dark mode works here for
 *    free. Never hardcode a colour - it would only be right in one mode.
 *
 * 2. Every class is prefixed jcl-. Kadence renders <main id="inner-wrap"
 *    class="wrap kt-clear">, so an unprefixed .wrap in here would style
 *    Kadence's own main element and constrain the whole page. The same risk
 *    applies to .section, .row and .count against block markup.
 *
 * --link-color is doing deliberate work as the readable accent: it is navy in
 * light mode and gold in dark. Gold measures 2.07:1 on white, which fails WCAG
 * badly, so gold appears in light mode only as rules, borders and stripes -
 * never as text. In dark mode it reaches 8.61:1 and becomes the link colour.
 */

/* Homepage-only extras that theme-colors.css does not define. */
:root {
	--jcl-rule-strong: #cfc7b8;
	--jcl-home-measure: 68ch;
}

body.dark-mode {
	--jcl-rule-strong: #445a8a;
}

/* ---------- Shared layout ---------- */

.jcl-wrap {
	width: 100%;
	max-width: 1120px;
	margin-inline: auto;
	padding-inline: 24px;
}

.jcl-section {
	padding-block: 52px;
}

.jcl-section-head {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	align-items: baseline;
	justify-content: space-between;
	padding-bottom: 13px;
	margin-bottom: 28px;
	border-bottom: 2px solid var( --heading-color );
}

.jcl-section-head h2 {
	font-size: clamp( 21px, 2.6vw, 26px );
	margin: 0;
}

.jcl-section-head .jcl-aside {
	font-size: 14px;
	color: var( --muted-color );
}

.jcl-section-head a {
	color: var( --link-color );
	font-weight: 600;
	font-size: 14.5px;
}

/* ---------- Introduction ---------- */

.jcl-intro {
	background: var( --card-bg );
	border-bottom: 1px solid var( --border-color );
}

.jcl-intro > .jcl-wrap {
	padding-block: 44px;
}

.jcl-intro-grid {
	display: grid;
	gap: 34px 44px;
	grid-template-columns: 232px minmax( 0, 1fr );
	align-items: start;
}

.jcl-portrait {
	margin: 0;
	border-radius: var( --jcl-radius );
	overflow: hidden;
	border: 1px solid var( --border-color );
	background: var( --raised-bg );
	aspect-ratio: 4 / 5;
}

.jcl-portrait img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 22%;
}

.jcl-intro h1 {
	font-size: clamp( 26px, 3.6vw, 36px );
	line-height: 1.18;
	margin: 0 0 6px;
}

.jcl-intro .jcl-tagline {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .13em;
	text-transform: uppercase;
	color: var( --muted-color );
	margin: 0 0 16px;
}

.jcl-intro .jcl-lede {
	margin: 0 0 22px;
	max-width: var( --jcl-home-measure );
	font-size: 17.5px;
}

/* Credentials - a record, not marketing tiles. Hairline dividers, no boxes. */
.jcl-creds {
	display: grid;
	gap: 1px;
	grid-template-columns: repeat( auto-fit, minmax( 158px, 1fr ) );
	background: var( --border-color );
	border: 1px solid var( --border-color );
	border-radius: var( --jcl-radius );
	overflow: hidden;
}

.jcl-cred {
	background: var( --card-bg );
	padding: 15px 17px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.jcl-cred .jcl-big {
	font-family: 'Playfair Display', serif;
	font-size: 27px;
	line-height: 1.05;
	font-weight: 600;
	color: var( --heading-color );
	font-variant-numeric: tabular-nums;
}

.jcl-cred .jcl-what {
	font-size: 13.5px;
	color: var( --muted-color );
	line-height: 1.4;
}

/* ---------- Rulings ---------- */

.jcl-rulings {
	display: grid;
	gap: 32px 44px;
	grid-template-columns: minmax( 0, 1.35fr ) minmax( 0, 1fr );
	align-items: start;
}

/* Citation line: court, date, and whether the order itself is attached. */
.jcl-cite {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 9px;
}

.jcl-court {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .11em;
	text-transform: uppercase;
	color: var( --heading-color );
	border: 1px solid var( --jcl-rule-strong );
	border-left: 3px solid var( --gold );
	border-radius: var( --jcl-radius-sm );
	padding: 3px 9px 3px 8px;
	background: var( --raised-bg );
	text-decoration: none;
}

a.jcl-court:hover {
	background: var( --card-bg );
}

.jcl-when {
	font-size: 13px;
	color: var( --muted-color );
	font-variant-numeric: tabular-nums;
}

.jcl-has-pdf {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var( --muted-color );
	border: 1px dashed var( --jcl-rule-strong );
	border-radius: var( --jcl-radius-sm );
	padding: 2px 7px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.jcl-has-pdf::before {
	content: "\25A4";
	font-size: 12px;
	color: var( --gold );
}

.jcl-lead figure {
	margin: 0 0 17px;
	border-radius: var( --jcl-radius );
	overflow: hidden;
	border: 1px solid var( --border-color );
	background: var( --raised-bg );
	aspect-ratio: 16 / 9;
}

.jcl-lead figure img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.jcl-lead h3 {
	font-size: clamp( 22px, 2.9vw, 30px );
	line-height: 1.22;
	margin: 0 0 11px;
}

.jcl-lead h3 a,
.jcl-index h4 a {
	text-decoration: none;
	color: inherit;
}

.jcl-lead h3 a:hover,
.jcl-index h4 a:hover {
	text-decoration: underline;
	text-decoration-color: var( --gold );
	text-underline-offset: 4px;
}

.jcl-lead p {
	margin: 0;
	color: var( --text-color );
	max-width: var( --jcl-home-measure );
	font-size: 16.5px;
}

.jcl-index {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
}

.jcl-index li {
	padding-block: 16px;
	border-top: 1px solid var( --border-color );
}

.jcl-index li:first-child {
	border-top: 0;
	padding-top: 0;
}

.jcl-index h4 {
	font-size: 17.5px;
	line-height: 1.34;
	margin: 0;
}

/* ---------- Archive ---------- */

.jcl-archive {
	background: var( --card-bg );
	border-block: 1px solid var( --border-color );
}

.jcl-routes {
	display: grid;
	gap: 1px;
	grid-template-columns: repeat( auto-fit, minmax( 190px, 1fr ) );
	background: var( --border-color );
	border: 1px solid var( --border-color );
	border-radius: var( --jcl-radius );
	overflow: hidden;
}

.jcl-route {
	background: var( --card-bg );
	padding: 21px 20px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	text-decoration: none;
	color: inherit;
}

.jcl-route:hover {
	background: var( --raised-bg );
}

.jcl-route .jcl-count {
	font-family: 'Playfair Display', serif;
	font-size: 33px;
	line-height: 1;
	font-weight: 600;
	color: var( --heading-color );
	font-variant-numeric: tabular-nums;
}

.jcl-route .jcl-what {
	font-size: 15px;
	font-weight: 600;
	color: var( --heading-color );
}

.jcl-route .jcl-note {
	font-size: 13.5px;
	color: var( --muted-color );
	line-height: 1.45;
}

/* ---------- Practice ---------- */

.jcl-practice-grid {
	display: grid;
	gap: 26px 40px;
	grid-template-columns: repeat( auto-fit, minmax( 250px, 1fr ) );
}

.jcl-area {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 16px;
	border-top: 3px solid var( --gold );
}

.jcl-area h3 {
	font-size: 19px;
	margin: 0;
}

.jcl-area p {
	margin: 0;
	font-size: 15.5px;
}

/* ---------- Legal awareness ---------- */

.jcl-awareness ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1px;
	background: var( --border-color );
	border-block: 1px solid var( --border-color );
}

.jcl-awareness li {
	background: var( --bg-color );
	padding: 15px 0;
}

.jcl-awareness .jcl-row {
	display: grid;
	gap: 4px 26px;
	grid-template-columns: 140px minmax( 0, 1fr );
	align-items: baseline;
}

.jcl-awareness h4 {
	font-size: 17px;
	line-height: 1.35;
	margin: 0;
}

.jcl-awareness h4 a {
	text-decoration: none;
	color: inherit;
}

.jcl-awareness h4 a:hover {
	text-decoration: underline;
	text-decoration-color: var( --gold );
	text-underline-offset: 3px;
}

/* ---------- Chambers and credentials (Rule 36 disclosure) ---------- */

.jcl-chambers {
	background: var( --card-bg );
	border-top: 1px solid var( --border-color );
}

.jcl-facts {
	display: grid;
	gap: 0;
	border: 1px solid var( --border-color );
	border-radius: var( --jcl-radius );
	overflow: hidden;
	margin: 0;
}

.jcl-fact {
	display: grid;
	grid-template-columns: 148px minmax( 0, 1fr );
	gap: 4px 16px;
	padding: 13px 16px;
	border-top: 1px solid var( --border-color );
	font-size: 14.5px;
	align-items: baseline;
}

.jcl-fact:first-child {
	border-top: 0;
}

.jcl-fact dt {
	color: var( --muted-color );
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.jcl-fact dd {
	margin: 0;
	color: var( --text-color );
}

.jcl-fact dd em {
	font-style: normal;
	color: var( --muted-color );
	font-size: 13px;
	display: block;
}

/* ---------- Responsive ---------- */

@media ( max-width: 900px ) {
	.jcl-intro-grid {
		grid-template-columns: 180px minmax( 0, 1fr );
		gap: 26px 32px;
	}
}

@media ( max-width: 760px ) {
	.jcl-rulings {
		grid-template-columns: minmax( 0, 1fr );
		gap: 28px;
	}

	.jcl-intro-grid {
		grid-template-columns: minmax( 0, 1fr );
	}

	/*
	 * Show the photograph whole on a phone rather than cropping it.
	 *
	 * This used to force aspect-ratio: 3 / 2 - a landscape box - on an image
	 * that is 1079x1562, a tall portrait. Cover-cropping a 0.69 ratio into a
	 * 1.5 one throws away most of the picture, which is why he appeared cut
	 * off. With no forced ratio the image keeps its own, and there is plenty
	 * of vertical room once the layout is a single column.
	 */
	.jcl-portrait {
		aspect-ratio: auto;
		max-width: 260px;
		margin-inline: auto;
	}

	.jcl-portrait img {
		height: auto;
	}
}

@media ( max-width: 620px ) {
	.jcl-wrap {
		padding-inline: 18px;
	}

	.jcl-section {
		padding-block: 38px;
	}

	.jcl-intro > .jcl-wrap {
		padding-block: 32px;
	}

	.jcl-awareness .jcl-row {
		grid-template-columns: minmax( 0, 1fr );
		gap: 3px;
	}

	.jcl-fact {
		grid-template-columns: minmax( 0, 1fr );
		gap: 2px;
	}
}
