/* Modern shell — only with body.layout-modern (old pages unchanged). */

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600&family=The+Nautigal:wght@700&display=swap');

body.layout-modern {
	margin: 0;
	background: #f0f0f0;
	/* style.css uses 0.80em (1024-era); +25% for modern screens. Header uses rem → unchanged. */
	font-size: 1em;
}

body.layout-modern #container {
	position: relative;
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	left: auto !important;
	top: auto !important;
	zoom: 1;
	box-sizing: border-box;
	padding: 0 12px 32px;
}

/* Header */
body.layout-modern .site-header {
	--header-ink: linear-gradient(115deg,
			color-mix(in srgb, var(--theme-accent, #415356) 72%, black) 0%,
			var(--theme-accent, #415356) 55%,
			color-mix(in srgb, var(--theme-accent, #415356) 80%, black) 100%);
	position: relative;
	height: clamp(180px, 28vw, 280px);
	overflow: hidden;
	margin: 0 -12px;
	width: calc(100% + 24px);
}

body.layout-modern .site-header .header-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
}

body.layout-modern .site-header .header-sample {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

body.layout-modern .site-header .school-title,
body.layout-modern .site-header .header-quote,
body.layout-modern .site-header .header-quote .quote-author {
	background: var(--header-ink);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	z-index: 2;
}

body.layout-modern .site-header .school-title {
	position: absolute;
	top: clamp(10px, 1.8vw, 18px);
	left: clamp(16px, 3vw, 36px);
	margin: 0;
	font-family: 'The Nautigal', cursive;
	font-size: clamp(2.4rem, 5.5vw, 3.8rem);
	font-weight: 700;
	line-height: 1.35;
	padding: 0 0 0.2em;
}

body.layout-modern .site-header .header-quote {
	position: absolute;
	right: clamp(16px, 3vw, 40px);
	bottom: clamp(27px, 6vw, 44px);
	margin: 0;
	max-width: calc(100% - 222px);
	width: max-content;
	text-align: right;
	font-family: 'Dancing Script', cursive;
	font-size: clamp(1.15rem, 2.4vw, 1.8rem);
	font-weight: 600;
	line-height: 1.3;
}

/* Keep attribution on one line; quote text wraps only when the viewport forces it */
body.layout-modern .site-header .header-quote .quote-author {
	white-space: nowrap;
}

body.layout-modern #content h1 {
	line-height: 1.2;
}

/* Shell: content card in front, nav behind */
body.layout-modern .page-shell {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	position: relative;
	z-index: 3;
	margin-top: -36px;
}

body.layout-modern #navigation {
	position: relative;
	z-index: 1;
	width: 210px;
	flex: 0 0 210px;
	background: transparent;
	padding: 2.4em 18px 2em 0;
	margin-right: -18px;
	box-sizing: border-box;
}

body.layout-modern #navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

body.layout-modern #navigation a {
	display: block;
	padding: 0.2em 0.75em;
	text-decoration: none;
	background-image: none;
}

body.layout-modern #navigation li ul {
	font-size: 0.85em;
	text-indent: 0.4em;
}

body.layout-modern #navigation_space {
	display: block;
	height: 0.35em;
	background: transparent;
}

body.layout-modern #navigation_mobile {
	display: none;
	width: 100%;
	padding: 0.75em 1em 0;
	box-sizing: border-box;
	background: transparent !important;
	background-image: none !important;
}

body.layout-modern #navigation_mobile a {
	display: block;
	font-size: 1.05em;
	font-weight: bold;
	text-decoration: none;
	color: #555;
	padding: 0.75em 1em;
	text-align: center;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid #ccc;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

body.layout-modern #content {
	position: relative;
	z-index: 2;
	flex: 1 1 0%;
	width: auto;
	min-width: 0;
	padding: 1.5em 1.75em 2em;
	background: #fff;
	border-radius: 28px;
	box-shadow: 0 5px 30px rgba(0, 0, 0, 0.23);
	box-sizing: border-box;
}

body.layout-modern #content img,
body.layout-modern #content iframe {
	max-width: 100%;
}

/* Equal cards that wrap/stack when the row is too narrow — no per-page hacks */
body.layout-modern .card-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 1.25em 1em;
	margin: 0.5em 0 1em;
}

body.layout-modern .card-row .photo {
	margin-top: 0.75em;
	aspect-ratio: 4 / 3;
	background-position: center 20%;
}

body.layout-modern .site-footer {
	margin-top: 1.25em;
	padding: 0.75em 0.5em;
	font-size: smaller;
	color: #808080;
}

@media screen and (max-width: 919px) {
	body.layout-modern #container {
		padding: 0 0 24px;
	}

	body.layout-modern .site-header {
		margin: 0;
		width: 100%;
		height: clamp(160px, 42vw, 240px);
	}

	body.layout-modern .site-header .school-title {
		left: 14px;
		font-size: clamp(2.1rem, 8vw, 3rem);
	}

	body.layout-modern .site-header .header-quote {
		right: 12px;
		bottom: clamp(28px, 8vw, 43px);
		max-width: calc(100% - 24px);
		font-size: clamp(1rem, 3.4vw, 1.35rem);
	}

	body.layout-modern .page-shell {
		margin-top: 0;
		flex-direction: column;
		align-items: stretch;
	}

	body.layout-modern #navigation {
		display: none !important;
	}

	body.layout-modern #navigation_mobile {
		display: block !important;
		order: -1;
		z-index: 4;
		width: 100%;
		max-width: 100%;
		flex: 0 0 auto;
		margin: -34px 0 0.6em;
		padding: 0 1em;
		background: transparent !important;
		background-image: none !important;
	}

	body.layout-modern #content {
		flex: 0 0 auto;
		width: 100% !important;
		max-width: 100% !important;
		min-height: min-content;
		overflow-x: auto;
		overflow-y: visible;
		padding: 1em 1.1em 1.75em;
		border-radius: 22px;
	}

	body.layout-modern #content iframe {
		width: 100% !important;
		aspect-ratio: 16 / 9;
		min-height: 200px;
	}

	body.layout-modern #content table {
		width: 100% !important;
		max-width: 100%;
		table-layout: fixed;
	}

	body.layout-modern #content td,
	body.layout-modern #content th {
		overflow-wrap: anywhere;
		word-break: break-word;
	}

	body.layout-modern .float_left,
	body.layout-modern .float_right {
		float: none !important;
		margin: 0 0 1em !important;
		display: block;
		max-width: 100%;
	}
}

@media print {
	body.layout-modern .site-header .header-bg {
		display: none;
	}

	body.layout-modern .site-header {
		height: auto;
	}

	body.layout-modern .site-header .school-title,
	body.layout-modern .site-header .header-quote {
		position: static;
		color: #000;
		background: none;
		-webkit-text-fill-color: #000;
	}

	body.layout-modern .page-shell {
		margin-top: 0;
	}

	body.layout-modern #content {
		box-shadow: none;
		border-radius: 0;
	}

	body.layout-modern #navigation,
	body.layout-modern #navigation_mobile {
		display: none !important;
	}
}
