/* GoreAd site header (v2) — mirrors the main goread.io header. Markup: template-parts/site-header.php */

/* Blocksy no longer renders its header, so provide the height var other components (quick-order sticky sidebar) rely on. */
:root {
	--header-sticky-height: 81px;
}

@media (max-width: 991px) {
	:root {
		--header-sticky-height: 65px;
	}
}

.gr-header {
	--gr-orange: #ff5c00;
	--gr-ink: #1a1a2e;
	--gr-muted: #777986;
	--gr-dropdown-text: #6b6b7b;
	--gr-divider: #e8e8ec;
	--gr-font: "DM Sans", Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	position: sticky;
	top: var(--admin-bar, 0px);
	z-index: 1030;
	background-color: #fff;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	font-family: var(--gr-font);
	-webkit-font-smoothing: antialiased;
}

.gr-header :where(*),
.gr-header :where(*)::before,
.gr-header :where(*)::after {
	box-sizing: border-box;
}

.gr-header :where(ul, li) {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gr-header :where(a) {
	text-decoration: none;
}

.gr-header :where(button) {
	appearance: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
	min-height: 0;
	cursor: pointer;
}

.gr-header__container {
	width: 100%;
	max-width: 1302px;
	margin: 0 auto;
	padding: 0 16px;
}

@media (min-width: 1334px) {
	.gr-header__container {
		padding: 0;
	}
}

.gr-header__nav {
	position: relative;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	min-height: 80px;
	padding: 16px 0;
}

.gr-header__brand {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	margin-right: 16px;
	line-height: 0;
}

.gr-header__brand img {
	display: block;
	width: auto;
	height: 40px;
	max-width: 100%;
	object-fit: contain;
}

/* ---- Toggler (hamburger) ---- */
.gr-header__toggler {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-left: auto;
	padding: 0;
	color: #2d2d3a;
}

.gr-header__toggler-close,
.gr-header.is-open .gr-header__toggler-open {
	display: none;
}

.gr-header.is-open .gr-header__toggler-close {
	display: block;
}

.gr-header__toggler:focus-visible,
.gr-nav__link:focus-visible,
.gr-nav__dropdown-link:focus-visible,
.gr-nav__signup:focus-visible,
.gr-header__brand:focus-visible {
	outline: 2px solid var(--gr-orange);
	outline-offset: 2px;
	border-radius: 6px;
}

/* ---- Menu lists ---- */
.gr-header__menu {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-width: 0;
}

.gr-nav {
	display: flex;
	align-items: center;
	gap: 2px;
}

.gr-nav__item {
	position: relative;
	padding: 4px !important;
}

.gr-nav__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 22px 8px 12px;
	font-family: var(--gr-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	white-space: nowrap;
	color: var(--gr-muted);
	transition: color 0.15s ease;
}

.gr-nav__link--plain:hover,
.gr-nav__link--plain:focus-visible,
.gr-nav__item--dropdown.is-open > .gr-nav__link--plain {
	color: var(--gr-orange);
}

.gr-nav__link--pill {
	padding-right: 28px;
	border-radius: 999px;
	color: var(--gr-orange);
}

.gr-nav__item--login .gr-nav__link,
.gr-nav__item:not(.gr-nav__item--dropdown) > .gr-nav__link--plain {
	padding-right: 12px;
}

.gr-nav__link--login {
	padding-left: 14px !important;
	padding-right: 14px !important;
	font-weight: 700;
	color: var(--gr-ink);
}

.gr-nav__link--login:hover {
	color: var(--gr-orange);
}

.gr-nav__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 0;
	color: var(--gr-orange);
}

.gr-nav__icon svg {
	display: block;
}

.gr-nav__caret {
	position: absolute;
	top: 50%;
	right: 5px;
	width: 10px;
	height: 8px;
	margin-top: -4px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M13.69 1.94 7.44 8.19a.63.63 0 0 1-.88 0L.31 1.94a.63.63 0 0 1 .88-.88L7 6.87l5.81-5.81a.63.63 0 0 1 .88.88Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M13.69 1.94 7.44 8.19a.63.63 0 0 1-.88 0L.31 1.94a.63.63 0 0 1 .88-.88L7 6.87l5.81-5.81a.63.63 0 0 1 .88.88Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	transition: transform 0.2s ease;
}

.gr-nav__link--pill .gr-nav__caret {
	right: 10px;
}

.gr-nav__divider {
	display: block;
	align-self: center;
	flex-shrink: 0;
	width: 1px;
	height: 28px;
	margin: 0 10px !important;
	padding: 0 !important;
	background: var(--gr-divider);
	pointer-events: none;
}

/* Sign up button */
.gr-nav__item--signup {
	margin-left: 8px !important;
}

.gr-nav__signup {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 999px;
	background: linear-gradient(109.13deg, #ffa567 0%, #ff4330 100%);
	font-family: var(--gr-font);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
	white-space: nowrap;
	color: #fff !important;
	transition: opacity 0.15s ease;
}

.gr-nav__signup:hover {
	background: linear-gradient(109.13deg, #ff4330 0%, #ffa567 100%);
	color: #fff !important;
	opacity: 0.92;
}

/* ---- Dropdowns ---- */
.gr-nav__dropdown {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1060;
	min-width: 220px;
	padding: 8px 0 !important;
	background: #fff;
	border: 1px solid #efefef;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	text-align: left;
}

/* invisible bridge so the menu doesn't close while the pointer moves onto it */
.gr-nav__dropdown::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -8px;
	height: 8px;
}

.gr-nav--account .gr-nav__dropdown {
	left: auto;
	right: 0;
}

.gr-nav__dropdown li {
	padding: 10px !important;
}

.gr-nav__dropdown-link {
	display: block;
	padding: 0 12px;
	font-family: var(--gr-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--gr-dropdown-text);
	transition: color 0.15s ease;
}

.gr-nav__dropdown-link:hover,
.gr-nav__dropdown-link:focus-visible {
	color: var(--gr-orange);
}

.gr-nav__item--dropdown.is-open > .gr-nav__dropdown {
	display: block;
}

@media (hover: hover) and (min-width: 992px) {
	.gr-nav__item--dropdown:hover > .gr-nav__dropdown {
		display: block;
	}
}

/* ---- Wide desktop (>= 1280px): everything inline ---- */
@media (min-width: 1280px) {
	.gr-nav--primary {
		flex: 1 1 auto;
		justify-content: flex-start;
		min-width: 0;
	}

	.gr-nav--account {
		flex-shrink: 0;
	}
}

/* ---- Small desktop / tablet landscape (992px – 1279px): primary inline, account items in a popover ---- */
@media (min-width: 992px) and (max-width: 1279px) {
	.gr-header__nav {
		flex-wrap: nowrap;
	}

	.gr-header__toggler {
		display: inline-flex;
		order: 3;
		margin-left: 8px;
	}

	.gr-header__menu {
		order: 2;
		justify-content: center;
	}

	.gr-nav--primary {
		flex-wrap: nowrap;
	}

	.gr-nav--account {
		display: none;
		position: absolute;
		top: calc(100% + 4px);
		right: 0;
		z-index: 1050;
		flex-direction: column;
		align-items: center;
		gap: 2px;
		min-width: 240px;
		max-width: min(320px, calc(100vw - 32px));
		padding: 12px 8px !important;
		background: #fff;
		border: 1px solid rgba(0, 0, 0, 0.08);
		border-radius: 12px;
		box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
	}

	.gr-header.is-open .gr-nav--account {
		display: flex;
	}

	.gr-nav--account .gr-nav__item--dropdown {
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 100%;
	}

	.gr-nav--account .gr-nav__dropdown,
	.gr-nav--account .gr-nav__item--dropdown:hover > .gr-nav__dropdown {
		display: none;
		position: static;
		width: 100%;
		margin-top: 8px;
		border: 0;
		box-shadow: none;
		background: #f5f8fa;
	}

	.gr-nav--account .gr-nav__item--dropdown.is-open > .gr-nav__dropdown {
		display: block;
	}

	.gr-nav__item--signup {
		margin: 4px 0 0 !important;
	}
}

/* ---- Mobile / tablet (< 992px): collapsible panel ---- */
@media (max-width: 991px) {
	.gr-header__nav {
		min-height: 64px;
		padding: 10px 0;
	}

	.gr-header__brand {
		margin-right: 0;
	}

	.gr-header__toggler {
		display: inline-flex;
		margin-right: -10px;
	}

	.gr-header__menu {
		display: none;
		flex: 0 0 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		max-height: calc(100vh - 64px - var(--admin-bar, 0px));
		max-height: calc(100dvh - 64px - var(--admin-bar, 0px));
		padding: 8px 0 16px;
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.gr-header.is-open .gr-header__menu {
		display: flex;
	}

	.gr-nav {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
	}

	.gr-nav__item {
		padding: 0 !important;
	}

	.gr-nav__divider {
		display: none;
	}

	.gr-nav__link,
	.gr-nav__link--pill {
		display: flex;
		width: 100%;
		padding: 8px 32px 8px 0;
		font-size: 16px;
		text-align: left;
	}

	.gr-nav__caret,
	.gr-nav__link--pill .gr-nav__caret {
		right: 4px;
		width: 12px;
		height: 9px;
	}

	.gr-nav__item--dropdown.is-open > .gr-nav__link .gr-nav__caret {
		transform: rotate(180deg);
	}

	.gr-nav__dropdown {
		position: static;
		min-width: 0;
		margin: 4px 0 8px;
		padding: 4px 0 !important;
		border: 0;
		border-radius: 8px;
		box-shadow: none;
		background: #f5f8fa;
	}

	.gr-nav__dropdown::before {
		display: none;
	}

	.gr-nav__dropdown li {
		padding: 9px 4px !important;
	}

	.gr-nav__link--login {
		padding-left: 2px !important;
	}

	.gr-nav__item--signup {
		align-self: flex-start;
		margin: 10px 0 0 !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gr-header * {
		transition: none !important;
	}
}
