/*
 * Modern, responsive layer for the site, loaded after style.css.
 *
 * It changes no markup: the top tabs, the main menu, the sidebar menus and the
 * footer keep their items, order, colours and behaviour. What it changes:
 * fluid widths and spacing, readable type, a compact header, a menu that
 * wraps instead of stacking on tablets and phones, a sidebar that fits
 * tablets, a standards table that reflows, touch-sized links and visible
 * keyboard focus.
 */

:root {
	--tcs-navy: #00344f;
	--tcs-navy-2: #003a58;
	--tcs-green: #96b01e;
	--tcs-orange: #f78a0a;
	--tcs-orange-text: #b85c00;
	--tcs-gold: #efb31a;
	--tcs-gold-light: #fdcb4e;
	--tcs-ink: #1f2428;
	--tcs-muted: #56606a;
	--tcs-rule: #e4e1da;
	--tcs-gutter: clamp(16px, 4vw, 32px);
	--tcs-sidebar: 260px;
	--tcs-gap: 32px;
}
@media (min-width: 1030px) {
	:root { --tcs-sidebar: 300px; --tcs-gap: 56px; }
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
	color: var(--tcs-ink);
	font-family: "Lato Regular", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) { body { font-size: 18px; } }

.wrap {
	box-sizing: border-box;
	max-width: 1180px;
	min-width: 0;
	padding-left: var(--tcs-gutter);
	padding-right: var(--tcs-gutter);
	width: auto;
}

img, video, iframe { max-width: 100%; }
#main img { height: auto; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
	outline: 3px solid var(--tcs-gold);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- Header: same tabs and Spanish link, without the blank logo band ---------- */
#top-nav a { padding-top: 4px; padding-bottom: 4px; }
.header > .wrap {
	align-items: center;
	display: flex;
	justify-content: space-between;
	min-height: 0;
	padding-bottom: 12px;
	padding-top: 12px;
}
#logo { margin: 0; order: 1; }
/* The logo image is blank: keep its link (it goes home, as before) but stop it taking up a band of empty space. */
#logo a { height: 60px; max-width: 40vw; width: 302px; }
#spanish_link { margin: 0 0 0 auto; order: 2; position: static; right: auto; }
#spanish_link a { margin: 0; }
@media (min-width: 768px) {
	/* leave room for the tabs that hang down from the green bar */
	.header > .wrap { padding-top: 40px; }
	#spanish_link a { height: 50px; width: 210px; }
}
@media (min-width: 1030px) {
	#spanish_link a { height: 60px; width: 248px; }
}
@media (max-width: 767px) {
	#top-nav a { padding-bottom: 8px; padding-top: 8px; }
	.header > .wrap { justify-content: center; padding-bottom: 10px; padding-top: 10px; }
	#logo { display: none; }
	#spanish_link { margin: 0 auto; }
	#spanish_link a { height: 46px; margin: 0 auto; width: 200px; }
}

/* ---------- Main menu: same items and order, wraps instead of stacking ---------- */
#menu-main-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	list-style: none;
	margin: 0 0 0 -8px;
	padding: 2px 0;
}
body.home #menu-main-menu { justify-content: center; margin-left: 0; }
/* the old float-clearing pseudo-elements would become empty flex/grid items */
#menu-main-menu:before, #menu-main-menu:after { content: none; display: none; }
#menu-main-menu > li { display: block; position: relative; }
#menu-main-menu > li > a {
	display: block;
	font-size: 13px;
	letter-spacing: .03em;
	line-height: 1.3;
	padding: 13px 9px;
}
#menu-main-menu > li + li:before {
	color: #fff;
	content: "\2219";
	left: -4px;
	line-height: 1;
	position: absolute;
	text-shadow: 1px 1px 1px #555;
	top: 50%;
	transform: translateY(-50%);
}
/* Dropdowns: as before on hover, and now also for keyboard focus. */
#menu-main-menu .sub-menu {
	background: var(--tcs-navy);
	box-shadow: 0 6px 18px rgba(0, 32, 48, .35);
	left: 0;
	padding: 4px 0;
	position: absolute;
	text-align: left;
	top: 100%;
	width: 280px;
	z-index: 10;
}
#menu-main-menu .sub-menu a { font-size: 13px; padding: 10px 16px; }
#menu-main-menu li:focus-within .sub-menu { display: block; }
@media (min-width: 1030px) {
	#menu-main-menu > li > a { font-size: 13.5px; padding: 14px 11px; }
	#menu-main-menu > li + li:before { left: -3px; }
}
@media (min-width: 600px) and (max-width: 1029px) {
	/* Tablets: the six items in two tidy rows of three instead of a tall stack. */
	#menu-main-menu {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		margin: 0;
		padding: 4px 0;
	}
	#menu-main-menu > li + li:before { content: none; }
	#menu-main-menu > li > a { padding: 11px 8px; text-align: center; }
}
@media (max-width: 599px) {
	/* Phones: all six items stay visible, two per row, instead of a tall stack. */
	#menu-main-menu {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		margin: 0;
		padding: 6px 0;
	}
	#menu-main-menu > li + li:before { content: none; }
	#menu-main-menu > li > a { font-size: 12.5px; padding: 11px 6px; text-align: center; }
	#menu-main-menu .sub-menu { display: none !important; }
}

/* ---------- Page layout: content + sidebar ---------- */
#inner-content { display: flow-root; }
.article-header { margin-top: 32px; }
.article-header h1, h1, .h1 {
	font-size: clamp(28px, 1.6vw + 20px, 40px);
	line-height: 1.2;
	margin: 0 0 4px;
}
a.download-link, a.print-link { line-height: 44px; margin-right: 28px; margin-top: 0; }
#main { margin-bottom: 56px; }

@media (min-width: 768px) {
	#main.columns { padding-right: 0; width: calc(100% - var(--tcs-sidebar) - var(--tcs-gap)); }
	#sidebar.columns { width: var(--tcs-sidebar); }
	.article-header { margin-top: 44px; }
}
@media (max-width: 767px) {
	#sidebar { margin-bottom: 40px; }
	.identifiers .cell, .identifiers .cell:first-child, .identifiers .cell:last-child { padding: 4px 0; }
	.photo { float: none; margin: 0 auto 1.5em; max-width: calc(100% - 30px); }
	.photo img { width: 100%; }
	#main table { display: block; overflow-x: auto; }
}

/* ---------- Content typography ---------- */
h2, .h2 { font-size: 22px; margin: 1.6em 0 .6em; padding: 6px 0; }
h3, .h3 { font-size: 19px; margin: 1.5em 0 .4em; }
h4, .h4 { color: var(--tcs-navy-2); font-size: 1em; line-height: 1.4; margin: 1.8em 0 .5em; }
#main p, #main li { max-width: 46em; }
blockquote { margin-left: 0; margin-right: 0; }

/* Standards and their identifiers */
.identifier, .identifier:visited, .identifier:focus {
	color: var(--tcs-muted);
	font-size: 12.5px;
	letter-spacing: .03em;
}
.standard, .substandard { margin-bottom: 1.25em; }
.standard > .identifier { display: inline-block; margin-bottom: 2px; }

/* "Standards in this domain" table: reflows into as many columns as fit */
.identifiers {
	border-top: 1px solid var(--tcs-rule);
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
	column-gap: 20px;
	margin: 0 0 1.5em;
}
.identifiers .row { display: contents; }
.identifiers .cell,
.identifiers .cell:first-child,
.identifiers .cell:last-child {
	border: 0;
	border-bottom: 1px solid var(--tcs-rule);
	display: block;
	padding: 7px 0;
	width: auto;
}
.identifiers .identifier { display: block; padding: 3px 0; }

p.citation { color: var(--tcs-muted); font-size: 15px; }

/* ---------- Sidebar standards menus: same colours, roomier, touch-sized ---------- */
.standards-nav .widget-title { font-size: 22px; line-height: 1.25; padding: 12px 20px 10px; }
.standards-nav .widget-title:first-child { padding-top: 40px; }
.standards-nav .menu { padding: 6px 0; }
.standards-nav li a {
	font-size: 16px;
	line-height: 1.4;
	padding: 6px 20px;
	transition: background-color .15s;
}
.standards-nav li a:hover, .standards-nav li a:focus-visible { background: rgba(255, 255, 255, .28); }
.standards-nav .sub-menu { padding: 4px 0; }
.standards-nav .sub-menu li a { font-size: 15px; padding-left: 38px; }
.standards-nav .sub-menu .current-menu-item > a:before,
.standards-nav .sub-menu .current-page-ancestor > a:before,
.standards-nav .sub-menu li a:hover:before {
	font-family: system-ui, sans-serif;
	font-size: 9px;
	left: 24px;
	line-height: 1;
	top: 12px;
}
.standards-nav .textwidget { font-size: 15px; line-height: 1.5; padding: 8px 20px 14px; }
@media (max-width: 767px) {
	.standards-nav .widget-title:first-child { padding-top: 14px; }
	.standards-nav li a { padding-bottom: 9px; padding-top: 9px; }
}

/* ---------- Footer: same text and links, easier to read ---------- */
.footer { font-size: 14px; line-height: 1.65; }
#inner-footer { padding-bottom: 20px; }
#footer-links { margin: 0 auto; max-width: 880px; }
#menu-footer-links { display: flex; flex-wrap: wrap; justify-content: center; list-style: none; padding: 0; }
#menu-footer-links li { display: inline-block; }
#menu-footer-links li + li:before { content: "|"; }
#footer-links u a { margin: 0; }
@media (max-width: 480px) { #menu-footer-links li + li:before { content: none; } }
#menu-footer-links a, #a11y-toggle { display: inline-block; margin: 0 12px; padding: 8px 0; }
.footer .copyright { color: #c4d3db; font-size: 13px; margin: 8px 0 0; }

/* ---------- Home page: same three sections, laid out with the space available ---------- */
@media (min-width: 768px) {
	body.home #inner-content {
		align-items: flex-start;
		display: flex;
		flex-wrap: wrap;
		gap: 0 28px;
		justify-content: center;
		padding-bottom: 64px;
	}
	body.home h1 { flex: 0 0 100%; font-size: clamp(44px, 4vw, 56px); line-height: 1.1; margin: 48px auto 32px; max-width: 820px; }
	body.home .facet { flex: 0 1 290px; width: auto; }
}
@media (max-width: 767px) {
	body.home h1 { font-size: 30px; line-height: 1.2; margin: 28px 0 8px; }
	body.home .facet { background-size: auto 160px; margin-bottom: 28px; padding-top: 168px; }
	body.home h2 { font-size: 22px; line-height: 1.3; }
}

/* ---------- Video pop-up ---------- */
.modal-dialog { margin: 12vh auto; max-width: 730px; width: calc(100% - 32px); }
.modal-content iframe { aspect-ratio: 16 / 9; display: block; height: auto; width: 100%; }

/* ---------- Phones: link at the top of ELA/Math pages down to the standards menu ---------- */
/* Hidden inline in layout.php (so it never shows in print or on wider screens); shown here on phones. */
@media (max-width: 767px) {
	a.standards-jump {
		align-items: center;
		background: var(--tcs-gold);
		color: #202020;
		display: flex !important;
		font-family: "Lato Bold", system-ui, sans-serif;
		font-size: 15px;
		justify-content: space-between;
		margin: 16px 0 0;
		min-height: 46px;
		padding: 0 16px;
		text-decoration: none;
	}
	a.standards-jump:after {
		border-bottom: 2px solid currentColor;
		border-right: 2px solid currentColor;
		content: "";
		height: 8px;
		margin: -5px 2px 0 12px;
		transform: rotate(45deg);
		width: 8px;
	}
	a.standards-jump:hover, a.standards-jump:focus { background: var(--tcs-gold-light); color: #202020; }
	#sidebar { scroll-margin-top: 8px; }
}
