/*
 * Course and chapter guides (lessonPlan.php?curriculum=...[&chapter=...]) in the site's page
 * design: the Contents menu on the left in the side-menu look (blue bar, yellow items, gold
 * for the part shown), the gold title bar with its tools underneath, and one white card with a
 * gray heading per part. On phones the menu becomes a button that opens the list.
 * Markup: templates/html/coursePlan.html.twig and chapterPlan.html.twig. The parts keep their
 * inline colors from before, hence the !important below.
 */

.rb-plan {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	font-family: Roboto, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
.rb-plan-content {
	flex: 1 1 0;
	min-width: 0;
}

/* The menu stays in view while the page scrolls (position: sticky). AdminLTE's .wrapper hides
   sideways overflow with overflow-x: hidden, which also makes it a scroll box of its own that
   the menu would stick to; clip hides the same overflow without that. */
.wrapper:has(.rb-plan) {
	overflow-x: clip !important;
	overflow-y: visible !important;
}

/* ---- Contents menu ------------------------------------------------------------- */
.rb-plan-menu-col {
	flex: 0 0 240px;
	width: 240px;
	position: sticky;
	top: 10px;
	max-height: calc(100vh - 20px);
	overflow-y: auto;
}
.rb-plan-menu-head {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin: 0 0 2px;
	padding: 12px 14px;
	border: 0;
	border-radius: 8px 8px 0 0;
	background: #2495eb;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	text-align: left;
	cursor: default;
}
.rb-plan-menu-title {
	flex: 1 1 auto;
}
.rb-plan-menu-icon {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: #fff;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.rb-plan-menu-burger {
	display: none;
}
/* The arrow at the end of the Contents bar (wide screens) hides the menu down to a thin strip
   with the arrow turned around, like the Portal Menu (css/rb-page.css). */
.rb-plan-menu {
	position: relative;
}
.rb-plan-menu-collapse {
	position: absolute;
	top: 0;
	right: 0;
	height: 44px;
	padding: 0 14px;
	border: 0;
	background: none;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.rb-plan-menu-collapse:hover {
	color: #FFECB2;
}
.rb-plan-menu-collapse:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}
@media (min-width: 901px) {
	.rb-plan-menu-head {
		padding-right: 48px;
	}
	.rb-plan-menu-col {
		transition: flex-basis .25s ease, width .25s ease;
	}
	.rb-plan-menu-col.rb-plan-menu-collapsed {
		flex-basis: 50px;
		width: 50px;
		overflow: hidden;
	}
	.rb-plan-menu-collapsed .rb-plan-menu-head {
		padding: 0;
		border-radius: 8px;
		margin: 0;
		height: 44px;
	}
	.rb-plan-menu-collapsed .rb-plan-menu-head > *,
	.rb-plan-menu-collapsed .rb-plan-menu-list {
		display: none;
	}
	.rb-plan-menu-collapsed .rb-plan-menu-collapse {
		left: 0;
		padding: 0;
	}
	.rb-plan-menu-collapsed .rb-plan-menu-collapse .fa {
		transform: rotate(180deg);
	}
}
.rb-plan-menu-list {
	margin: 0;
	padding: 0;
	list-style: none;
}
.rb-plan-menu-list > li {
	margin: 0 0 2px;
	background: #FFECB2;
}
.rb-plan-menu-list > li > a {
	display: block;
	padding: 8px 14px;
	color: #022851 !important;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
	cursor: pointer;
}
.rb-plan-menu-list > li > a:hover,
.rb-plan-menu-list > li > a:focus-visible {
	background: #FFD24C;
	color: #022851 !important;
	text-decoration: none;
}
.rb-plan-menu-list > li.current_page_item > a {
	background: #FFBF00;
}
/* Show All and the PDF file a little apart from the parts. */
.rb-plan-menu-list > li.rb-plan-menu-all {
	margin-top: 8px;
}
.rb-plan-menu-list > li.rb-plan-menu-pdf > a .fa {
	margin-right: 4px;
}

/* ---- Title bar ------------------------------------------------------------------ */
.rb-plan-main {
	background: #fff;
	border: 1px solid #E1E7ED;
	border-radius: 8px;
	box-shadow: 0 4px 14px rgba(18,58,99,.10);
	overflow: hidden;
	margin-bottom: 24px;
}
/* The titles go first as the gold bar; the view, Curriculum/Chapter and language tools sit
   in a light row under it. */
.rb-plan-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	padding: 0 24px 14px;
	background: #EEF7FF;
	border-bottom: 1px solid #E1E7ED;
}
.rb-plan-titles {
	order: -1;
	flex: 1 1 100%;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	margin: 0 -24px 6px;
	padding: 14px 24px;
	background: #FFCC33;
	color: #022851;
}
/* Navy titles on the gold (not the site's red course name and teal chapter title), also
   where the course name's text colors itself. */
.rb-plan-titles .curriculumTitle,
.rb-plan-titles .chapterTitle,
.rb-plan-titles .symbolFont,
.rb-plan-titles .curriculumTitle * {
	color: #022851 !important;
	font-family: inherit;
	line-height: 1.3;
}
/* The same sizes as every title bar (the course pages too, css/rb-course.css): 18px for the
   line over the title, 30px for the title. */
.rb-plan-titles .curriculumTitle,
.rb-plan-titles > div:first-child .symbolFont {
	font-size: 18px;
	font-weight: 700;
}
.rb-plan-titles .chapterTitle,
.rb-plan-titles > div:last-child .symbolFont {
	font-size: 30px;
	font-weight: 700;
}
.rb-plan-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
.rb-plan-tools-left {
	flex: 1 1 auto;
}
.rb-plan-tools-right {
	flex: 0 0 auto;
}
.rb-plan-tools select {
	height: 30px;
	padding: 2px 8px;
	border: 1px solid #C9D3DD;
	border-radius: 5px;
	background: #fff;
	color: #022851 !important;
	font-size: 13px;
	font-weight: 700;
}
/* The view picker and the language picker in green, both with white text
   and a white arrow (the browser's own arrow would be dark on the color). */
.rb-plan-tools select[name='curriculumView'],
.rb-plan-tools select#autoTranslate {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 28px;
	border: 0;
	color: #fff !important;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") right 9px center / 11px 7px no-repeat;
	cursor: pointer;
}
.rb-plan-tools select[name='curriculumView'],
.rb-plan-tools select#autoTranslate {
	background-color: #00a000;
}
.rb-plan-tools select[name='curriculumView']:hover,
.rb-plan-tools select#autoTranslate:hover {
	background-color: #009300;
}
/* The open list stays white with dark text. */
.rb-plan-tools select option {
	background: #fff;
	color: #022851;
}
.rb-plan-tools .btn-xs {
	padding: 5px 12px;
	font-size: 13px;
}

/* ---- One card per part ---------------------------------------------------------- */
.rb-plan .text-box {
	width: auto !important;
	margin: 20px 24px 0 !important;
	background: #fff !important;
	border: 1px solid #E1E7ED !important;
	border-radius: 8px;
	box-shadow: none;
	overflow: hidden;
	height: auto !important;
}
.rb-plan .text-box:last-child {
	margin-bottom: 24px !important;
}
.rb-plan .text-box > .box-header {
	padding: 10px 18px !important;
	background: #EEF7FF !important; /* light blue */
	border: 0;
}
.rb-plan .text-box > .box-header .symbolFont {
	color: #1F2D3D;
	font-family: inherit;
	font-size: 19px;
	font-weight: 700;
}
.rb-plan .text-box > .box-body {
	padding: 14px 18px 18px !important;
	background: #fff !important;
	overflow-x: auto;
}

/* Contents fit their card: pictures (some are 1000px wide) shrink to the card, and the text
   next to the read-aloud button narrows with them instead of pushing past the card's edge. */
.rb-plan .text-box img {
	max-width: 100%;
	height: auto;
}
.rb-plan .audioDiv {
	min-width: 0;
}
.rb-plan .audioText {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}
.rb-plan .text-box table {
	max-width: 100%;
}

/* ---- Section Overview: one card per lesson (and one for the activities) ------------
   The lesson's own bar (Lesson button, info button, title, PDF File) is the card's gold
   heading (an activity's is light green); its parts follow with headings in the page's text color, and the groups of
   parts (Lesson Foundations, Review and Practice: Day 1, ...) as a gray band. */
.rb-plan-lesson > .box > .box-header:first-child,
.rb-plan-lesson > .box > .box-header[style*='CCFFE4'] {
	padding: 10px 18px !important;
	margin: 0 !important;
	background: #FFCC33 !important;
	justify-content: flex-start;
	border: 0;
}
/* Activities keep the light green of the activity bars. */
#sectionActivities > .box > .box-header[style*='CCFFE4'] {
	background: #CCFFE4 !important;
	border-top: 1px solid #E1E7ED;
}
.rb-plan-lesson > .box > .box-header:first-child .symbolFont,
.rb-plan-lesson > .box > .box-header[style*='CCFFE4'] .symbolFont {
	color: #022851;
	font-family: inherit;
	font-size: 19px;
	font-weight: 700;
}
.rb-plan-lesson > .box > .box-header:first-child > .text-right {
	margin-left: auto;
}
.rb-plan-lesson .box .box > .box-header {
	padding: 10px 18px 2px !important;
	background: transparent !important;
}
.rb-plan-lesson .box .box > .box-header .symbolFont {
	color: #1F2D3D;
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
}
.rb-plan-lesson .box .box > .box-header:empty {
	display: none;
}
.rb-plan-lesson .box .box > .box-header[style*='ffecb2'],
.rb-plan-lesson .box .box > .box-header[style*='aada91'] {
	margin-top: 12px;
	padding: 8px 18px !important;
	background: #EEF7FF !important; /* light blue, like the guides' headings */
}
.rb-plan-lesson .box .box > .box-header[style*='ffecb2'] .symbolFont,
.rb-plan-lesson .box .box > .box-header[style*='aada91'] .symbolFont {
	color: #1F2D3D;
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
}
.rb-plan-lesson .box-body {
	padding: 4px 18px 14px !important;
	background: #fff !important;
	overflow-x: auto;
}
.rb-plan-lesson .box {
	background: transparent;
	box-shadow: none;
}
/* The Activities card's own heading, like the other cards' gray headings. */
#sectionActivities > .box-header[style*='ffecb2'] {
	margin-top: 0;
	padding: 10px 18px !important;
	background: #EEF7FF !important; /* light blue, like the guides' headings */
}
#sectionActivities > .box-header[style*='ffecb2'] .symbolFont {
	color: #1F2D3D;
	font-size: 19px;
}
/* Each lesson's Send Feedback button sits inside its card. */
.rb-plan-lesson #sendCommentButton {
	margin: 4px 18px 16px;
}

/* ---- Narrow screens ------------------------------------------------------------- */
@media (max-width: 900px) {
	.rb-plan {
		flex-direction: column;
		gap: 12px;
	}
	.rb-plan-menu-col {
		position: static;
		flex: none;
		width: 100%;
		max-height: none;
	}
	.rb-plan-menu-head {
		border-radius: 8px;
		cursor: pointer;
		margin: 0;
	}
	.rb-plan-menu-head[aria-expanded='true'] {
		border-radius: 8px 8px 0 0;
		margin-bottom: 2px;
	}
	.rb-plan-menu-burger {
		display: inline-block;
		font-size: 17px;
	}
	.rb-plan-menu-collapse {
		display: none;
	}
	.rb-plan-menu-list {
		display: none;
	}
	/* ~, not +: the hide button sits between the bar and the list. */
	.rb-plan-menu-head[aria-expanded='true'] ~ .rb-plan-menu-list {
		display: block;
	}
	.rb-plan-content {
		width: 100%;
	}
}
@media (max-width: 600px) {
	.rb-plan-head {
		padding: 0 14px 12px;
	}
	.rb-plan-titles {
		margin: 0 -14px 6px;
		padding: 12px 14px;
	}
	.rb-plan-titles .chapterTitle,
	.rb-plan-titles > div:last-child .symbolFont {
		font-size: 24px;
	}
	.rb-plan .text-box {
		margin: 14px 12px 0 !important;
	}
	.rb-plan .text-box > .box-body {
		padding: 12px 14px 14px !important;
	}
}
