/* Basic styles */
* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
	line-height: 1.5;
	color: #444;
	margin: 0;
}

/* Layout structure */
#content {
	margin-top: 0 !important;
}

#primary {
	margin-top: 2rem !important;
}

.header-container {
	max-width: 1200px;
	margin: 0 auto 2em;
}

#program-filters-top {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

.flex {
	display: flex;
	flex-direction: row;
	/* Ensure flex items are laid out horizontally */
	align-items: stretch;
	/* Stretch children to match the height */
	gap: 1em;
}

.flex-row {
	flex-direction: row; 
}

.justify-between {
	justify-content: space-between;
}

#sidebar .sidebar-content {
	background: #f1f1f1;
	/* Or any other background properties */
	border-radius: 8px;
	padding: 1.6em;
	margin-bottom: 1em;
	/* Adjust as needed */
}

.sidebar-content small {
	font-size: 12px
}

#sidebar {
	flex: 0 0 24%;
	margin: 0;
	position: sticky;
	top: 0;
	/* distance from top while scrolling */
	align-self: flex-start;
	/* needed inside a flex container */
	height: fit-content;
	/* prevents it from stretching */
	z-index: 10;
	/* optional, only if overlapping issues */
}

#sidebar.not-sticky {
	position: static;
}

.main {
	flex-grow: 1;
	/* Allow the main content to grow and fill the space */
	padding: 0 1.6em;
	/* Adjust padding as needed */
}

.program-entry {
	margin-bottom: 0;
}

.program-intro {
	margin-bottom: 1em;
}

#loading-indicator.fade-out {
	opacity: 0;
	transition: opacity 0.3s ease;
}

/* Form and Inputs */

input[type="checkbox"] {
	margin-right: 0.5rem;
}

input[type="checkbox"]:checked {
	border: 1px solid #007176;
	background-color: #007176;
}

label {
	margin: 0 !important;
	font-size: 13px;
	display: inline-block;
}

.sort-container select {
	margin-top: 4px;
	border: 1px solid #dddddd;
	box-shadow: 1px 2px #ccc;
	background: #fff;
}

.program-counter {
	display: flex;
	justify-content: flex-start;
	flex-direction: row;
	align-items: center;
	/* Vertically center the text */
}

#program-count,
#program-found {
	font-weight: 500;
	font-size: 18px;
	color: #444;
	margin: 0 4px 0 0;
}

#program-count {
	font-weight: 900;
	font-size: 20px;
}

.sort-container {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	text-align: right;
	justify-content: center;
	/* Vertically center the elements */
}

.sort-container small,
.sort-container span {
	font-size: 11px;
}

.sort-container select {
	padding: 0.5em;
	font-size: 12px;
	background: #fff;
	border: none;
	box-shadow: 1px 2px #ccc;
}

.program-intro {
	font-size: 14px;
	color: #666;
	font-weight: 450;
}

/* Program count and "programs found" text */
#program-count,
#program-found {
	display: flex;
	font-weight: 500;
	font-size: 18px;
	color: #444;
}

#program-count {
	font-weight: 900;
	font-size: 20px;
	margin-right: 8px;
	align-items: center;
}

.reset-button {
	font-size: 12px;
	font-weight: 500;
	padding: 4px 8px;
	color: #252525;
	border: 1px dotted #252525;
	border-radius: 4px;
	display: block;
	max-width: 90px;
	text-align: center;
	cursor: pointer;
	margin-bottom: 12px;
}

.reset-button.active {
	color: #e74c3c;
	border: 1px solid #e74c3c;
}

.reset-button:hover {
	color: #e74c3c;
	border-color: #e74c3c;
}

.reset-button:active {
	border-color: #e74c3c;
	background-color: rgba(231, 76, 60, 0.1);
}

#sort-options {
	font-size: 12px;
}

fieldset {
	border: none;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.p-4 {
	padding: 1rem;
}

.mb-6 {
	margin-bottom: 1.5rem;
}

fieldset legend,
.search-label {
	font-weight: bold;
	font-size: 14px;
	margin-bottom: 0;
	padding-left: 0 !important;
	color: #444;
}

.count-display {
	padding-left: 4px;
	font-size: 12px;
	color: #666;
}

/* Degree level filter colored squares */
.degree-level label::before {
	content: '';
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-right: 6px;
	vertical-align: middle;
}

.degree-level label[for="degree_level_undergraduate"]::before {
	background-color: #fdb515;
}

.degree-level label[for="degree_level_graduate"]::before {
	background-color: #000;
}

.program-overview-header {
	margin-top: 0;
	line-height: 32px;
}

.program-overview-header h3 {
	color: #252525;
	font-size: 28px;
	font-weight: 800;
	text-decoration: none;
	letter-spacing: -0.4px;
}

.program-entry a span.degree-level {
	font-weight: 500;
	font-size: 20px;
	margin-top: 12px;
	letter-spacing: -1px;
	margin-bottom: 8px;
	color: #555;
	display: block;
}

.text-lg {
	font-size: 1.125rem;
	font-weight: bold;
}

.text-sm {
	font-size: 0.875rem;
}

.text-gray-600 {
	color: #666;
}

.text-gray-700 {
	color: #252525;
}

.font-semibold {
	font-weight: 600;
}

/* Utility Classes */
.block {
	display: block;
}

.mr-2 {
	margin-right: 0.5rem;
}

.program-overview-header {
	margin: 0;
}

.program-child {
	transition: opacity 0.3s ease;
}

.program-child.hidden {
	opacity: 0;
	display: none !important;
}

.program-child {
	display: flex;
	align-items: center;
	/* Vertically center items within the container */
	margin-bottom: 16px;
	margin-top: 16px;
	gap: 8px;
}

.degree-tag-container {
	height: 30px;
	/* Set a fixed height for the container */
	display: flex;
	/* Enable flex layout */
	align-items: center;
	/* Vertically center the degree tag */
}

.degree-tag {
	display: inline-block;
	/* Allows the tag to have its own intrinsic width */
	background-color: #f3f3f3;
	color: #444;
	border-radius: 2px 4px 4px 2px;
	/* Ensures fully rounded corners */
	text-transform: capitalize;
	line-height: normal;
	/* Reset line-height to default */
	padding: 8px 12px;
	/* Adjust padding as needed */
	height: auto;
	/* Allow the tag to adjust its height based on content */
	text-decoration: none;
	font-size: 12px;
	font-weight: 450;
	visibility: visible;
	/* Ensures the tag is visible */
	position: relative;
	/* Needed for positioning the ::before pseudo-element */
	overflow: hidden;
	/* Ensures the before pseudo-element doesn't overflow */
}

.degree-tag::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	/* Adjusted width */
	height: 30px;
	border-radius: 1px 0 0 1px;
	/* Apply rounded corners to match the tag */
	background-color: transparent;
	/* Default color */
}

.degree-tag.graduate::before {
	background-color: black;
	/* Left edge color for graduate tags */
}

.degree-tag.undergraduate::before {
	background-color: #fdb515;
	/* Left edge color for undergraduate tags */
}

/* Style for hidden degree tags */
.degree-tag.hidden {
	visibility: hidden;
	/* Hide but maintain space */
}

a.child-title {
	font-size: 14px;
	font-weight: 600;
	color: #252525;
	line-height: 160%;
	text-decoration: underline;
	text-decoration-color: #ccc;
	text-decoration-thickness: 1px;
	text-decoration-skip-ink: none;
	text-underline-offset: 0.2em;
	/* Optional: Adjust the underline offset if needed */
}

a.child-title:hover {
	text-decoration-color: #000;
	color: #000;
}

.program-letter-section {
	display: flex;
	flex-direction: row;
	justify-content: flex-end;
	align-items: flex-start;
	width: 100%;
	border-top: 1px solid #ccc;
	padding-bottom: 2em;
	gap: 1em;
	padding-top: 2em;
}

.letter-container {
	text-align: right;
	order: 2;
	border-right: 8px solid #fdb515;
	align-items: start;
	display: flex;
	height: 48px;
}

.program-entries-container {
	flex-grow: 1;
	/* Allows the container to take up remaining space */
	padding-top: 0;
	order: 1;
}

h2.program-letter-header a {
	color: #444;
	font-size: 60px;
	line-height: 48px;
	padding-right: 12px;
}

.divider {
	font-size: 8px;
	align-self: center;
}

.program-children {
	display: block;
	flex-wrap: wrap;
	gap: 8px;
}

hr {
	background-color: #ccc;
	border: 0;
	height: 0.4px;
	margin-bottom: 1em;
	margin-top: 1em;
}

.hidden {
	display: none;
}

.expander {
	display: none;
	/* Initially hidden */
}

.filters-group {
	display: flex;
	align-items: center;
	margin: 4px 0;
}

.filter {
	margin: 1em 0;
}

.desktop-promo {
	text-align: left;
	padding: 1em;
}

.desktop-promo h2 {
	margin-top: 1em;
	font-size: 20px;
}

.caret {
	margin: 0 1px;
	cursor: pointer;
	font-size: 11px;
}

.desktop-only {
	display: block;
}

.mobile-only {
	display: none;
}

@media (max-width: 991px) {

	input[type="search"] {
		font-size: 16px !important;
		/* This avoids zooming on iOS */
	}

	.header-container,
	.main {
		padding: 1em;
		text-align: left;
	}

	#primary {
		margin-top: 1em !important;
	}

	#sidebar,
	.main {
		flex-basis: auto;
		max-width: 100%;
		flex-wrap: wrap;
	}

	.mobile-only {
		display: block;
	}

	#sidebar {
		position: relative;
	}
	
	#sidebar .sidebar-content {
		margin: 0;
		padding: 0; 
	}

	#mobile-filter-bar, #mobile-filter-actions {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		background: #ccc;
		border-top: 1px solid #ccc;
		z-index: 9999;
		padding: 0.75rem;
		box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
	}

	.mobile-filter-button, .close-filter-buttton {
		width: 100%;
		flex: 1; 
		background: #005a5b;
		color: #fff;
		font-weight: bold;
		padding: 0.75rem;
		font-size: 16px;
		border: none;
		border-radius: 6px;
	}

	#filters {
		display: none;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		top: 0;
		background: #fff;
		z-index: 10000;
		overflow-y: scroll;
		padding: 1rem;
		margin: 0 !important;
		/* Force full edge-to-edge layout */
	}

	#filters[aria-expanded="true"] {
		display: block;
	}
	
	.mobile-search-drawer-top {
		margin: 1.75rem 0;
		padding: 1rem;
		border-radius: 8px;
		background-color: #f6f6f6;
	}

	.mobile-search-header {
		background-color: #f6f6f6;
		padding: 1rem;
		border-radius: 8px;
		margin-bottom: 1.75rem;
	}

	.mobile-search-header label {
		font-size: 18px;
		font-weight: 600;
		margin-bottom: 0.75rem;
		display: block;
	}

	.mobile-search-header .search-container {
		display: flex;
		align-items: center;
		gap: 0.5rem;
	}

	.mobile-search-header .search-input {
		flex: 1;
		padding: 0.5rem;
		font-size: 16px;
		/* Prevent zooming */
		border: 1px solid #ccc;
		border-radius: 6px;
		min-width: 0;
	}

	.mobile-search-header .search-icon-btn {
		padding: 0.5rem;
		background-color: #005a5b;
		color: #fff;
		border-radius: 6px;
		font-size: 16px;
	}

	.close-filter-button {
		background: #000;
		flex: 1;
		color: #fff;
		border: 0; 
	}

	.sidebar-content .expander,
	.desktop-promo {
		display: none;
	}

	h1 {
		font-size: 36px;
	}

	.flex {
		display: flex;
		flex-wrap: wrap;
		margin: -1em;
		padding: 1em;
	}

	.program-overview-header {
		text-align: left;
		margin-bottom: 12px;
	}

	h3 {
		line-height: 24px;
	}

	h3 a {
		font-size: 24px;
		font-weight: 700;
		letter-spacing: -0.54px;
	}

	.program-entry span.degree-level {
		font-size: 19px;
		letter-spacing: -0.8px;
	}

	.expander {
		cursor: pointer;
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 1em 2px;
	}

	.expander a {
		padding: 0;
		border: none;
		background-color: transparent;
		display: flex;
		margin: 0;
		font-size: 24px;
		justify-content: flex-start;
	}

	.expander a>* {
		padding: 0;
		flex: 0 1 auto;
	}

	#expander-text {
		font-weight: 700;
		color: #252525;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		padding: 0;
	}

	#expander-icon {
		font-weight: 700;
		padding: 0;
	}

	.filter-group {
		margin-bottom: 1.75rem;
		padding: 1rem;
		border-radius: 8px;
		background-color: #f6f6f6;
	}

	.filter-group legend {
		font-size: 18px;
		font-weight: 600;
		margin-bottom: 0.75rem;
	}

	.filters-group {
		display: flex;
		align-items: center;
		gap: 0.5rem;
		margin-bottom: 0.5rem;
	}

	input[type="checkbox"] {
		width: 20px;
		height: 20px;
		accent-color: #005a5b;
	}

	label {
		font-size: 16px;
		display: inline-block;
		line-height: 1.4;
		margin: 0;
	}

	.program-children {
		flex-direction: column;
	}

	.program-letter-section {
		flex-direction: column;
		align-items: flex-start;
	}

	.letter-container {
		text-align: left;
		padding-right: 0;
		order: 1;
		border-left: 8px solid #fdb515;
		border-right: 0;
		padding-left: 12px;
	}

	.program-entries-container {
		padding-right: 0;
		width: 100%;
		order: 2;
	}

	.program-counter {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.sort-container {
		display: flex;
		flex-direction: column;
		align-items: flex-end;
		text-align: left;
		margin-top: 0;
	}

	.sort-container select {
		margin-top: 4px;
	}

	.program-child {
		display: flex;
		align-items: center;
	}

	.degree-tag-container {
		min-width: 100px;
	}

	.child-title {
		margin-left: 8px;
		display: block;
	}

	.callout-left {
		font-size: 16px;
		line-height: 1.2em;
		font-weight: 500;
	}

	#program-filters-top {
		padding: 0;
		margin-left: 0;
		margin-right: 0;
		width: 100%;
	}

	.ast-container {
		padding-left: 0;
		padding-right: 0;
	}

	.desktop-promo,
	.desktop-only {
		display: none;
	}

	#filters {
		margin: 0 !important;
		padding: 1rem !important;
		/* keep internal padding */
	}

	#ast-scroll-top {
		position: static !important;
		margin-left: 0 !important;
		display: inline-block;
		padding: 12px;
		width: 48px;
		height: 48px;
		line-height: 28px;
	}

	#mobile-filter-bar, #mobile-filter-actions {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		bottom: 0;
		z-index: 9999;
	}

}


/* Flat search results container */
.flat-results-container {
	display: none;
	/* Hidden by default, shown when search is active */
	margin-top: 20px;
	border-top: 1px solid #eee;
	padding-top: 20px;
}

/* Match quality indicators */
.match-quality {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 0.65rem;
}

.match-quality.exact {
	background-color: #d4edda;
	color: #155724;
}

/* Search mode indicator */
.search-mode-indicator {
	display: none;
	margin-bottom: 8px;
	padding: 4px 8px;
	background-color: #e9ecef;
	border-radius: 4px;
	font-size: 0.875rem;
}

.search-mode-active .search-mode-indicator {
	display: block;
}

.results-sort-row {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	margin-bottom: 16px;
	width: 100%;
}

/* Active filters display */
.active-filters {
	display: flex;
	flex-wrap: wrap;
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.4;
	color: #444;
}

.filter-category {
	font-weight: 600;
	margin-right: 4px;
}

.filter-item {
	display: inline-block;
	margin-right: 4px;
}

.filter-item.search-term {
	background-color: #f8f9fa;
	padding: 2px 6px;
	border-radius: 4px;
	font-style: italic;
}

/* Sort container */
.sort-container {
	display: none;
	/* Hidden by default */
	justify-content: flex-end;
	align-items: center;
	flex-direction: row;
	gap: 12px;
}

.sort-container label {
	margin-right: 12px;
	font-weight: bold;
}

#sort-options {
	border: 1px solid #ced4da;
	background-color: #fff;
}


.reset-button:hover {
	border-color: #c0392b;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.sort-container {
		flex-direction: column;
		align-items: flex-start;
	}

	.sort-container label {
		margin-bottom: 5px;
	}

	#sort-options {
		width: 100%;
	}
}

.program-parent-section{margin-bottom:3.25rem;}
.program-parent-header{line-height:1;}

/* ==========================================================================
   Dark Mode — Program Archive
   ========================================================================== */

/* Page/intro text */
[data-theme="dark"] body {
    color: #c0c0c0;
}

/* Archive page H1 and intro paragraphs */
[data-theme="dark"] .header-container .title {
    color: #e0e0e0;
}

[data-theme="dark"] .header-container p {
    color: #c0c0c0;
}

/* Theme section heading (e.g. "Engineering") */
[data-theme="dark"] .program-theme-header {
    color: #e0e0e0;
}

/* Parent group heading (e.g. "Computer Science") */
[data-theme="dark"] .program-parent-header {
    color: #e0e0e0;
}

/* Sidebar */
[data-theme="dark"] #sidebar .sidebar-content {
    background: #222;
}

[data-theme="dark"] fieldset legend,
[data-theme="dark"] .search-label {
    color: #e0e0e0;
}

[data-theme="dark"] .count-display {
    color: #888;
}

[data-theme="dark"] .program-intro {
    color: #aaa;
}

[data-theme="dark"] #program-count,
[data-theme="dark"] #program-found {
    color: #c0c0c0;
}

/* Sort select */
[data-theme="dark"] .sort-container select,
[data-theme="dark"] #sort-options {
    background: #1e1e1e;
    border-color: #3a3a3a;
    color: #e0e0e0;
    box-shadow: 1px 2px #111;
}

/* Reset button */
[data-theme="dark"] .reset-button {
    color: #c0c0c0;
    border-color: #555;
}

[data-theme="dark"] .reset-button.active,
[data-theme="dark"] .reset-button:hover {
    color: #ff7b6b;
    border-color: #ff7b6b;
}

/* Program letter sections */
[data-theme="dark"] .program-letter-section {
    border-top-color: #333;
}

/* Letter gold right/left bar stays — gold on dark background is valid */

[data-theme="dark"] h2.program-letter-header a {
    color: #888;
}

/* Program title links */
[data-theme="dark"] .program-overview-header h3 {
    color: #e0e0e0;
}

[data-theme="dark"] .program-entry a span.degree-level {
    color: #888;
}

/* Child program links */
[data-theme="dark"] a.child-title {
    color: #c0c0c0;
    text-decoration-color: #555;
}

[data-theme="dark"] a.child-title:hover {
    color: #e0e0e0;
    text-decoration-color: #e0e0e0;
}

/* Degree tags */
[data-theme="dark"] .degree-tag {
    background-color: #252525;
    color: #c0c0c0;
}

[data-theme="dark"] .degree-tag:hover {
    background-color: #2e2e2e;
}

/* Gold left bar on undergraduate degree-tag stays valid */

/* Horizontal rules */
[data-theme="dark"] hr {
    background-color: #333;
}

/* Active filters */
[data-theme="dark"] .active-filters {
    color: #c0c0c0;
}

[data-theme="dark"] .filter-item.search-term {
    background-color: #252525;
}

/* Mobile filter panel */
[data-theme="dark"] #filters {
    background: #1a1a1a;
}

[data-theme="dark"] .filter-group {
    background-color: #222;
}

[data-theme="dark"] .filter-group legend {
    color: #e0e0e0;
}

[data-theme="dark"] #mobile-filter-bar,
[data-theme="dark"] #mobile-filter-actions {
    background: #1a1a1a;
    border-top-color: #333;
}

[data-theme="dark"] .mobile-search-drawer-top,
[data-theme="dark"] .mobile-search-header {
    background-color: #222;
}

[data-theme="dark"] .mobile-search-header label {
    color: #e0e0e0;
}

[data-theme="dark"] .mobile-search-header .search-input {
    background: #1e1e1e;
    border-color: #3a3a3a;
    color: #e0e0e0;
}

/* Desktop promo sidebar */
[data-theme="dark"] .desktop-promo {
    color: #c0c0c0;
}

/* Flat search results divider */
[data-theme="dark"] .flat-results-container {
    border-top-color: #333;
}