/* =============================================================================
 * SCCFD Top Navigation
 * Design copied from the prototype (index.html).
 * ============================================================================= */


/* ----- Header ----- */

.sccfd-nav {
	position: sticky;           /* Stays at the top when you scroll. */
	top: 0;
	z-index: 100;
	background: #fff;
	border-bottom: 1px solid #e1e5ea;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* When logged in, sit below the black WordPress admin bar. */
.admin-bar .sccfd-nav {
	top: 32px;
}

.sccfd-nav__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 16px 32px;
}

.sccfd-nav svg {
	flex-shrink: 0;
}

/* Gold outline for keyboard users. */
.sccfd-nav a:focus-visible,
.sccfd-nav button:focus-visible,
.sccfd-nav input:focus-visible {
	outline: 3px solid #f1d11a;
	outline-offset: 2px;
}

/* Text only for screen readers. */
.sccfd-nav .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}


/* ----- Logo (left) ----- */

.sccfd-nav__brand {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
	color: #063a78;
	text-decoration: none;
}

.sccfd-nav__logo {
	width: auto;
	height: 75px;
}

.sccfd-nav__name {
	display: flex;
	flex-direction: column;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.sccfd-nav__name strong {
	font-weight: 800;
}


/* ----- Menu (middle) ----- */

.sccfd-nav__menu {
	display: flex;
	flex: 1;
	justify-content: center;
}

.sccfd-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sccfd-nav__list {
	display: flex;
	gap: 2px;
}

.sccfd-nav__item {
	position: relative;
}

/* Top buttons: "Who We Are", "How Do I", ... */
.sccfd-nav__top {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 10px 11px;
	border: 0;
	border-radius: 4px;
	background: none;
	color: #16191f;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.sccfd-nav__top:hover,
.sccfd-nav__item.is-open .sccfd-nav__top {
	background: #f7f8fa;
	color: #063a78;
}

/* Small arrow next to the button. */
.sccfd-nav__caret {
	width: 11px;
	height: 11px;
	color: #5b6472;
	transition: transform 0.2s;
}

.sccfd-nav__item.is-open .sccfd-nav__caret {
	transform: rotate(180deg);
	color: #b32b25;
}


/* ----- Drop-down panel ----- */

.sccfd-nav__panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 200;
	display: none;
	grid-template-columns: repeat(2, max-content);
	gap: 4px 28px;
	padding: 22px 24px;
	border-top: 3px solid #063a78;
	background: #fff;
	box-shadow: 0 16px 32px rgba(6, 58, 120, 0.14);
}

/* Open on mouse hover, or on click / Enter key (.is-open, added by script.js). */
.sccfd-nav__item:hover .sccfd-nav__panel,
.sccfd-nav__item.is-open .sccfd-nav__panel {
	display: grid;
}

/* The last 3 panels open to the left, so they stay on the screen. */
.sccfd-nav__item:nth-last-child(-n+3) .sccfd-nav__panel {
	right: 0;
	left: auto;
}

.sccfd-nav__column-title {
	display: block;
	margin-bottom: 4px;
	padding: 0 12px 9px;
	border-bottom: 1px solid #e1e5ea;
	color: #b32b25;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.sccfd-nav__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 12px;
	border-radius: 6px;
	color: #16191f;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.sccfd-nav__link:hover,
.sccfd-nav__link[aria-current="page"] {
	background: #f7f8fa;
	color: #063a78;
}

.sccfd-nav__icon {
	width: 19px;
	height: 19px;
	color: #063a78;
}

.sccfd-nav__link:hover .sccfd-nav__icon {
	color: #b32b25;
}


/* ----- Search and menu buttons (right) ----- */

.sccfd-nav__buttons {
	display: flex;
	gap: 8px;
	margin-left: auto;   /* Always push the buttons to the right. */
}

.sccfd-nav__icon-button {
	display: flex;
	padding: 8px;
	border: 0;
	border-radius: 4px;
	background: none;
	color: #063a78;
	cursor: pointer;
}

.sccfd-nav__icon-button:hover,
.sccfd-nav__icon-button[aria-expanded="true"] {
	background: #f7f8fa;
}

.sccfd-nav__icon-button svg {
	width: 22px;
	height: 22px;
}

/* The menu button only shows on small screens (see bottom of this file). */
.sccfd-nav__menu-button {
	display: none;
}


/* ----- Search box ----- */

.sccfd-nav__search {
	border-top: 1px solid #e1e5ea;
	background: #f7f8fa;
}

.sccfd-nav__search form {
	display: flex;
	gap: 10px;
	max-width: 760px;
	margin: 0 auto;
	padding: 16px 20px;
}

.sccfd-nav__search input {
	flex: 1;
	min-width: 0;
	padding: 11px 14px;
	border: 1.5px solid #e1e5ea;
	border-radius: 6px;
	font-family: inherit;
	font-size: 15px;
}

.sccfd-nav__search button {
	padding: 10px 18px;
	border: 0;
	border-radius: 4px;
	background: #b32b25;
	color: #fff;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
}

.sccfd-nav__search button:hover {
	background: #8f231e;
}


/* ----- Small screens: menu becomes a list under the header -----
 * The 7 menu buttons need about 1320px to fit in one row.
 */

@media (max-width: 1320px) {
	.sccfd-nav__inner {
		flex-wrap: wrap;
		padding: 14px 20px;
	}

	.sccfd-nav__menu-button {
		display: flex;
	}

	/* Menu is hidden until the menu button is clicked. */
	.sccfd-nav__menu {
		display: none;
		order: 3;            /* Move it below the logo and buttons. */
		flex-basis: 100%;
	}

	.sccfd-nav__menu.is-open {
		display: block;
	}

	.sccfd-nav__list {
		flex-direction: column;
	}

	.sccfd-nav__item {
		border-bottom: 1px solid #e1e5ea;
	}

	.sccfd-nav__top {
		justify-content: space-between;
		width: 100%;
		padding: 16px 2px;
		font-size: 16px;
	}

	/* Panels: no hover on small screens. They open on click, inside the list. */
	.sccfd-nav__item:hover .sccfd-nav__panel {
		display: none;
	}

	.sccfd-nav__item.is-open .sccfd-nav__panel {
		display: block;
	}

	.sccfd-nav__panel,
	.sccfd-nav__item:nth-last-child(-n+3) .sccfd-nav__panel {
		position: static;
		padding: 0 0 12px 8px;
		border-top: 0;
		box-shadow: none;
	}

	.sccfd-nav__column-title {
		margin-top: 8px;
		padding-left: 2px;
		border-bottom: 0;
	}

	.sccfd-nav__link {
		padding-left: 2px;
		font-weight: 500;
		white-space: normal;
	}
}

@media (max-width: 782px) {
	/* The admin bar is taller on phones. */
	.admin-bar .sccfd-nav {
		top: 46px;
	}
}

@media (max-width: 600px) {
	/* The admin bar scrolls away on small phones, so stick to the very top. */
	.admin-bar .sccfd-nav {
		top: 0;
	}

	/* Smaller logo, text and gaps, so logo + buttons fit on one line. */
	.sccfd-nav__inner {
		gap: 12px;
		padding: 12px 16px;
	}

	.sccfd-nav__brand {
		gap: 10px;
	}

	.sccfd-nav__logo {
		height: 50px;
	}

	.sccfd-nav__name {
		font-size: 12.5px;
	}

	.sccfd-nav__buttons {
		gap: 2px;
	}

	.sccfd-nav__icon-button {
		padding: 6px;
	}
}

/* Very small phones (320px wide). */
@media (max-width: 360px) {
	.sccfd-nav__logo {
		height: 40px;
	}

	.sccfd-nav__name {
		font-size: 11px;
	}
}
