/* ==========================================================================
   Eagle Rock Golf — top bar, header and main navigation (redesign 2026-11)
   Markup: topbar.inc, header.inc   Behaviour: js/redesign-header.js
   Everything is namespaced .erg-* so it can't clash with Canvas styles.
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Barlow:wght@400;500;600&display=swap");

.erg-skip-link, .erg-topbar, #header.erg-header {
	--erg-red: #a3082f;
	--erg-red-bright: #c8102e;
	--erg-charcoal: #2e2f31;
	--erg-charcoal-2: #45474a;
	--erg-grey-line: #e6e6e6;
	--erg-white: #fff;
	--erg-font-head: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
	--erg-font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
	--erg-header-h: 84px;
	--erg-header-h-mobile: 64px;
	--erg-focus: 0 0 0 3px #fff, 0 0 0 5px var(--erg-red-bright);
}

/* ---------- Skip link ---------- */
.erg-skip-link {
	position: absolute;
	left: 8px;
	top: -100px;
	z-index: 2000;
	padding: 10px 16px;
	background: var(--erg-charcoal);
	color: #fff !important;
	font: 600 15px/1.2 var(--erg-font-body);
	border-radius: 4px;
	text-decoration: none;
}
.erg-skip-link:focus { top: 8px; outline: none; box-shadow: var(--erg-focus); }

/* ---------- Top bar ---------- */
.erg-topbar {
	background: var(--erg-charcoal);
	color: #e9e9e9;
	font-family: var(--erg-font-body);
	font-size: 14px;
	line-height: 1.2;
}
.erg-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 16px;
	min-height: 40px;
}
.erg-topbar ul {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.erg-topbar a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 40px;
	color: #e9e9e9;
	text-decoration: none;
	white-space: nowrap;
	transition: color .15s ease;
}
.erg-topbar a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.erg-topbar a:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--erg-red-bright); border-radius: 2px; color: #fff; }
.erg-topbar i { font-size: 13px; opacity: .85; }
.erg-topbar__promo a {
	color: #fff;
	font-family: var(--erg-font-head);
	font-weight: 600;
	font-size: 15px;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.erg-topbar__promo a::before {
	content: "";
	width: 7px; height: 7px;
	border-radius: 50%;
	background: var(--erg-red-bright);
	display: inline-block;
}
.erg-topbar__icon a { justify-content: center; min-width: 32px; }
.erg-topbar__icon i { font-size: 15px; opacity: 1; }
.erg-topbar__account a { font-weight: 600; color: #fff; }

@media (max-width: 1199.98px) {
	.erg-hide-md { display: none !important; }
}
@media (max-width: 767.98px) {
	.erg-hide-sm { display: none !important; }
	.erg-topbar__inner { padding: 0 12px; min-height: 36px; }
	.erg-topbar a { min-height: 44px; }   /* comfortable tap target */
	.erg-topbar__phone a { font-weight: 600; color: #fff; }
}
@media (max-width: 399.98px) {
	.erg-hide-xs { display: none; }
}

/* ---------- Header shell ---------- */
#header.erg-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--erg-white);
	border-bottom: 1px solid var(--erg-grey-line);
	font-family: var(--erg-font-body);
	transition: box-shadow .2s ease, transform .25s ease;
}
#header.erg-header.is-scrolled { box-shadow: 0 4px 18px rgba(0,0,0,.08); }

.erg-header__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 16px;
	min-height: var(--erg-header-h);
}

.erg-logo { display: inline-flex; align-items: center; flex: 0 0 auto; margin-right: auto; padding: 6px 0; }
.erg-logo img { display: block; height: 76px; width: auto; max-width: none; }
.erg-logo:focus-visible { outline: none; box-shadow: var(--erg-focus); border-radius: 4px; }

/* ---------- Buttons ---------- */
.erg-hbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 22px;
	border-radius: 4px;
	font-family: var(--erg-font-head);
	font-weight: 700;
	font-size: 18px;
	letter-spacing: .05em;
	text-transform: uppercase;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background-color .15s ease, transform .15s ease;
}
.erg-hbtn--book { background: var(--erg-red); color: #fff !important; }
.erg-hbtn--book:hover { background: var(--erg-red-bright); }
.erg-hbtn--book:active { transform: translateY(1px); }
.erg-hbtn:focus-visible { outline: none; box-shadow: var(--erg-focus); }

/* ---------- Menu (shared) ---------- */
.erg-menu, .erg-sub, .erg-nav__contact, .erg-social { list-style: none; margin: 0; padding: 0; }

.erg-menu__link {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	min-height: 44px;
	padding: 0 14px;
	border: 0;
	background: none;
	color: var(--erg-charcoal);
	font-family: var(--erg-font-head);
	font-weight: 600;
	font-size: 19px;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none !important;
	line-height: 1.1;
	cursor: pointer;
	white-space: nowrap;
}
.erg-menu__link:hover,
.erg-menu__item.is-open > .erg-menu__link { color: var(--erg-red); }
.erg-menu__link:focus-visible,
.erg-sub__link:focus-visible,
.erg-nav a:focus-visible,
.erg-nav button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--erg-red-bright); border-radius: 3px; }

.erg-chevron { flex: 0 0 auto; transition: transform .2s ease; }
.erg-menu__toggle[aria-expanded="true"] .erg-chevron { transform: rotate(180deg); }

.erg-sub__link {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 18px;
	color: var(--erg-charcoal);
	font-family: var(--erg-font-body);
	font-weight: 500;
	font-size: 16px;
	line-height: 1.25;
	text-decoration: none !important;
}
.erg-sub__link:hover { color: var(--erg-red); background: #f6f4f4; }
.erg-sub__link[aria-current="page"] { color: var(--erg-red); font-weight: 600; }

/* Mobile-only pieces hidden on desktop */
.erg-header__mobile-actions,
.erg-nav__head,
.erg-nav__book,
.erg-nav__extras { display: none; }
.erg-nav-backdrop { display: none; }

/* ==========================================================================
   Desktop (≥ 1200px). Below that the hamburger panel is used (tablets incl.)
   ========================================================================== */
@media (min-width: 1200px) {
	.erg-nav { display: flex; align-items: center; }
	.erg-menu { display: flex; align-items: center; gap: 2px; }
	.erg-menu__item { position: relative; }
	.erg-menu__link { min-height: var(--erg-header-h); padding: 0 12px; font-size: 18px; }

	/* active-section underline */
	.erg-menu__item > .erg-menu__link { position: relative; }
	.erg-menu__item > .erg-menu__link::after {
		content: "";
		position: absolute;
		left: 12px; right: 12px; bottom: 18px;
		height: 3px;
		background: var(--erg-red);
		transform: scaleX(0);
		transform-origin: left;
		transition: transform .2s ease;
	}
	.erg-menu__item.is-active > .erg-menu__link::after,
	.erg-menu__item > .erg-menu__link:hover::after,
	.erg-menu__item.is-open > .erg-menu__link::after { transform: scaleX(1); }

	.erg-sub {
		position: absolute;
		top: calc(100% - 10px);
		left: 0;
		min-width: 240px;
		padding: 8px 0;
		background: #fff;
		border-top: 3px solid var(--erg-red);
		border-radius: 0 0 6px 6px;
		box-shadow: 0 14px 30px rgba(0,0,0,.12);
		opacity: 0;
		visibility: hidden;
		transform: translateY(6px);
		transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
		z-index: 5;
	}
	/* open when toggled by click/keyboard ... */
	.erg-menu__item.is-open > .erg-sub {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition-delay: 0s;
	}

	.erg-header__book { margin-left: 8px; }
}
/* ... and on hover, for real mouse pointers only (avoids sticky-hover on tablets) */
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) {
	.erg-menu__item.has-sub:hover > .erg-sub {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition-delay: 0s;
	}
	.erg-menu__item.has-sub:hover > .erg-menu__link { color: var(--erg-red); }
}

/* Smaller desktops: tighten so everything fits on one row */
@media (min-width: 1200px) and (max-width: 1399.98px) {
	.erg-header__inner { gap: 8px; }
	.erg-menu__link { padding: 0 8px; font-size: 16px; letter-spacing: .03em; }
	.erg-menu__item > .erg-menu__link::after { left: 8px; right: 8px; }
	.erg-hbtn { padding: 0 14px; font-size: 16px; }
}

/* ==========================================================================
   Mobile / tablet (< 1200px): compact bar + off-canvas panel
   ========================================================================== */
@media (max-width: 1199.98px) {
	#header.erg-header.is-hidden:not(.is-open) { transform: translateY(-100%); }

	.erg-header__inner { min-height: var(--erg-header-h-mobile); padding: 0 8px 0 12px; gap: 4px; }
	.erg-logo img { height: 58px; }
	.erg-header__book { display: none; }

	.erg-header__mobile-actions { display: flex; align-items: center; gap: 4px; }

	.erg-icon-btn,
	.erg-menu-toggle,
	.erg-nav__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		min-width: 48px;
		min-height: 48px;
		padding: 0 10px;
		border: 0;
		border-radius: 6px;
		background: none;
		color: var(--erg-charcoal);
		cursor: pointer;
		text-decoration: none !important;
	}
	.erg-icon-btn { color: var(--erg-red); }
	.erg-icon-btn:hover, .erg-menu-toggle:hover, .erg-nav__close:hover { background: #f3f3f3; }
	.erg-icon-btn:focus-visible, .erg-menu-toggle:focus-visible, .erg-nav__close:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--erg-red-bright); }

	.erg-menu-toggle__label {
		font-family: var(--erg-font-head);
		font-weight: 700;
		font-size: 17px;
		letter-spacing: .06em;
		text-transform: uppercase;
	}
	.erg-menu-toggle__bars { display: inline-flex; flex-direction: column; justify-content: space-between; width: 22px; height: 16px; }
	.erg-menu-toggle__bars span { display: block; height: 2.5px; border-radius: 2px; background: currentColor; }

	/* Off-canvas panel (only when JS is running; without JS the menu shows inline) */
	.erg-js .erg-nav {
		position: fixed;
		top: 0; right: 0; bottom: 0;
		width: min(88vw, 380px);
		display: flex;
		flex-direction: column;
		background: #fff;
		box-shadow: -10px 0 30px rgba(0,0,0,.18);
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		transform: translateX(100%);
		visibility: hidden;
		transition: transform .25s ease, visibility 0s linear .25s;
		z-index: 1002;
	}
	.erg-js #header.is-open .erg-nav { transform: none; visibility: visible; transition-delay: 0s; }

	.erg-js .erg-nav-backdrop:not([hidden]) {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(20,20,20,.5);
		z-index: 1001;
	}

	/* no-JS fallback: menu listed below the header bar */
	html:not(.erg-js) .erg-header__inner { flex-wrap: wrap; }
	html:not(.erg-js) .erg-nav { display: block; flex: 1 0 100%; padding-bottom: 12px; }
	html:not(.erg-js) .erg-menu-toggle { display: none; }

	.erg-nav__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 8px 8px 8px 20px;
		border-bottom: 1px solid var(--erg-grey-line);
		position: sticky; top: 0; background: #fff; z-index: 1;
	}
	.erg-nav__title {
		font-family: var(--erg-font-head);
		font-weight: 700;
		font-size: 20px;
		letter-spacing: .08em;
		text-transform: uppercase;
		color: var(--erg-charcoal-2);
	}
	.erg-nav__book { display: flex; margin: 16px 20px 8px; min-height: 52px; font-size: 20px; }

	.erg-menu { padding: 4px 0; }
	.erg-menu__item { border-bottom: 1px solid var(--erg-grey-line); }
	.erg-menu__link { min-height: 56px; padding: 8px 20px; justify-content: space-between; font-size: 21px; white-space: normal; text-align: left; }
	.erg-menu__item.is-active > .erg-menu__link { color: var(--erg-red); }
	.erg-menu__item.is-active > .erg-menu__link::before {
		content: ""; position: absolute; left: 0; width: 4px; height: 32px; background: var(--erg-red);
	}
	.erg-menu__item { position: relative; }

	.erg-js .erg-sub { display: none; }
	.erg-js .erg-menu__item.is-open > .erg-sub { display: block; }
	.erg-sub { background: #faf8f8; padding: 4px 0 10px; }
	.erg-sub__link { min-height: 48px; padding: 8px 20px 8px 32px; font-size: 17px; }

	.erg-nav__extras { display: block; padding: 18px 20px 28px; margin-top: auto; background: #f4f4f4; }
	.erg-nav__contact a {
		display: flex;
		align-items: center;
		gap: 12px;
		min-height: 48px;
		color: var(--erg-charcoal);
		font-size: 16px;
		font-weight: 500;
		text-decoration: none !important;
		word-break: break-word;
	}
	.erg-nav__contact a:hover { color: var(--erg-red); }
	.erg-nav__contact i { width: 18px; text-align: center; color: var(--erg-red); }
	.erg-social { display: flex; gap: 10px; margin-top: 10px; }
	.erg-social a {
		display: inline-flex; align-items: center; justify-content: center;
		width: 48px; height: 48px; border-radius: 50%;
		background: var(--erg-charcoal); color: #fff !important; font-size: 18px;
		text-decoration: none !important;
	}
	.erg-social a:hover { background: var(--erg-red); }

	body.erg-nav-open { overflow: hidden; }
}

@media (max-width: 379.98px) {
	.erg-menu-toggle__label { display: none; }   /* icon-only on very small phones */
	.erg-logo img { height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
	#header.erg-header, .erg-nav, .erg-sub, .erg-chevron, .erg-menu__link::after { transition: none !important; }
}

@media print {
	.erg-topbar, .erg-header__mobile-actions, .erg-header__book, .erg-nav { display: none !important; }
	#header.erg-header { position: static; }
}
