/**
 * ==========================================================================
 * HEADER CSS — Zelené Ralsko
 * ==========================================================================
 *
 * Globální styly headeru — načítají se na všech stránkách webu.
 * Přesunuto z homepage.css (sekce 13) aby header fungoval i na podstránkách.
 *
 * Závislosti: tokens.css, styles.css
 *
 * @since 1.1.0
 */


/* ============================================================
   ASTRA NATIVE HEADER — skrýt (nahrazujeme vlastním)
   ============================================================ */

#masthead { display: none; }


/* ============================================================
   ASTRA OVERRIDE — tap highlight + active flash
   Zrušení světle modrého záblesku při kliknutí/tapnutí
   na všech interaktivních prvcích headeru (desktop i mobil).
   ============================================================ */

#nps-header a,
#nps-header button,
#nps-header [role="button"] {
	-webkit-tap-highlight-color: transparent !important;
}

#nps-header a:active,
#nps-header button:active,
#nps-header [role="button"]:active {
	background-color: transparent !important;
	background: transparent !important;
	color: inherit !important;
}

/* Astra specificky přidává :active styl na .menu-item a */
#nps-header .nps-header__link:active,
#nps-header .nps-header__mobile-link:active,
#nps-header .nps-header__mobile-sublink:active,
#nps-header .nps-header__dropdown-link:active,
#nps-header button.nps-header__link--parent:active,
#nps-header button.nps-header__mobile-link--parent:active {
	background-color: transparent !important;
	background: transparent !important;
}


/* ============================================================
   HEADER — obal
   ============================================================ */

.nps-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: rgba(246, 248, 228, 0.96);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(48, 60, 29, 0.10);
}

.nps-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--space-8);
	min-height: 104px;
	padding: 0 var(--space-6);
	max-width: 1560px;
	margin-inline: auto;
}

@media (min-width: 768px)  { .nps-header__inner { padding: 0 var(--space-10); } }
@media (min-width: 1280px) { .nps-header__inner { padding: 0 var(--space-16); } }

@media (min-width: 1920px) {
	.nps-header__inner {
		max-width: 1760px;
		min-height: 112px;
	}
}

@media (min-width: 2560px) {
	.nps-header__inner {
		max-width: 2000px;
		min-height: 120px;
		padding: 0 var(--space-20);
	}
}


/* ============================================================
   NAVIGACE
   ============================================================ */

.nps-header__nav {
	display: flex;
	align-items: center;
	min-width: 0;
}

.nps-header__nav--left  { justify-content: flex-end; }
.nps-header__nav--right { justify-content: flex-start; }

.nps-header__menu {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: clamp(18px, 1.8vw, 34px);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 1920px) {
	.nps-header__menu {
		gap: clamp(28px, 1.5vw, 44px);
	}
}


/* ============================================================
   LOGO
   ============================================================ */

.nps-header__brand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	padding-inline: var(--space-4);
}

.nps-header__logo {
	display: block;
	width: auto;
	height: 44px;
	max-width: 220px;
}

@media (min-width: 1920px) {
	.nps-header__logo {
		height: 52px;
		max-width: 260px;
	}
}

@media (min-width: 2560px) {
	.nps-header__logo {
		height: 60px;
		max-width: 300px;
	}
}

/* Logo přes Astra .site-logo-img */
.nps-header .site-logo-img {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding-inline: var(--space-3);
}

.nps-header .site-logo-img a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.nps-header .site-logo-img svg {
	display: block;
	width: auto;
	height: 60px;
	max-width: 180px;
}

@media (max-width: 1100px) {
	.nps-header .site-logo-img svg {
		height: 70px;
		max-width: 150px;
	}
}

@media (min-width: 1920px) {
	.nps-header .site-logo-img svg {
		height: 72px;
		max-width: 220px;
	}
}

@media (min-width: 2560px) {
	.nps-header .site-logo-img svg {
		height: 84px;
		max-width: 260px;
	}
}


/* ============================================================
   NAV LINKY
   ============================================================ */

.nps-header__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-family: var(--font-heading);
	font-size: 0.98rem;
	font-weight: var(--font-weight-semibold);
	letter-spacing: 0.01em;
	color: var(--color-primary);
	text-decoration: none;
	white-space: nowrap;
	position: relative;
}

@media (min-width: 1920px) {
	.nps-header__link { font-size: 1.06rem; }
}

@media (min-width: 2560px) {
	.nps-header__link {
		font-size: 1.15rem;
		min-height: 52px;
	}
}

/* Podtržení hover efekt */
.nps-header__link::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 100%;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--transition-base);
	opacity: 0.5;
}

.nps-header__link:hover::after,
.nps-header__link:focus-visible::after,
.nps-header__link[aria-current="page"]::after {
	transform: scaleX(1);
}

/* CTA varianta — ohraničené tlačítko */
.nps-header__link--cta {
	padding: 0 18px;
	min-height: 44px;
	border: 1.5px solid rgba(48, 60, 29, 0.28);
	background: rgba(48, 60, 29, 0.04);
}

.nps-header__link--cta::after { display: none; }

.nps-header__link--cta:hover,
.nps-header__link--cta:focus-visible {
	background: var(--color-primary);
	color: var(--color-text-inverse);
	border-color: var(--color-primary);
}

/* Focus stavy */
.nps-header__link:focus-visible,
.nps-header__brand:focus-visible,
.nps-header__toggle:focus-visible,
.nps-header__mobile-link:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 3px;
}


/* ============================================================
   HAMBURGER TLAČÍTKO
   ============================================================ */

.nps-header__toggle {
	display: none;
	background: transparent !important;
	border: 0 !important;
	padding: 12px;
	cursor: pointer;
	outline: none !important;
	box-shadow: none !important;
	-webkit-tap-highlight-color: transparent;
	-webkit-appearance: none;
	appearance: none;
	min-width: 48px;
	min-height: 48px;
	align-items: center;
	justify-content: center;
}

.nps-header__toggle:focus {
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
}

.nps-header__toggle:focus-visible {
	outline: 2px solid var(--color-accent) !important;
	outline-offset: 2px;
}

.nps-header__toggle-line {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--color-primary);
}

.nps-header__toggle-line + .nps-header__toggle-line {
	margin-top: 5px;
}


/* ============================================================
   MOBILNÍ MENU
   ============================================================ */

.nps-header__mobile {
	border-top: 1px solid rgba(48, 60, 29, 0.10);
	background: rgba(246, 248, 228, 0.98);
}

.nps-header__mobile[hidden] {
	display: none;
}

.nps-header__mobile-menu {
	list-style: none;
	margin: 0;
	padding: var(--space-4) var(--space-6) var(--space-6);
}

.nps-header__mobile-link {
	display: block;
	padding: 14px 0;
	font-family: var(--font-heading);
	font-size: var(--text-base);
	font-weight: var(--font-weight-semibold);
	color: var(--color-primary);
	text-decoration: none;
	border-bottom: 1px solid rgba(48, 60, 29, 0.08);
}

.nps-header__mobile-link:last-child {
	border-bottom: none;
}

.nps-header__mobile-link:hover {
	color: var(--color-primary-light);
}

.nps-header__mobile-link[aria-current="page"] {
	color: var(--color-primary);
	font-weight: var(--font-weight-bold);
	border-left: 3px solid var(--color-accent);
	padding-left: 10px;
}


/* ============================================================
   BREAKPOINT — přepnutí na hamburger
   ============================================================ */

@media (max-width: 1100px) {
	.nps-header__inner {
		grid-template-columns: auto 1fr auto;
		min-height: 88px;
	}

	.nps-header__nav { display: none; }

	.nps-header__brand {
		justify-content: flex-start;
		padding-inline: 0;
	}

	.nps-header__logo {
		height: 40px;
		max-width: 200px;
	}

	.nps-header__toggle {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
}


/* ============================================================
   DROPDOWN — desktop submenu
   ============================================================ */

.nps-header__item--has-dropdown {
	position: relative;
}

/* Parent tlačítko — stejný vzhled jako link */
.nps-header__link--parent {
	background: transparent;
	border: none;
	cursor: pointer;
	gap: var(--space-2);
	font-family: var(--font-heading);
	font-size: 0.98rem;
	font-weight: var(--font-weight-semibold);
	letter-spacing: 0.01em;
	color: var(--color-primary);
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	white-space: nowrap;
	position: relative;
	padding: 0;
	text-decoration: none;
}

/* Podtržení hover efekt — stejné jako .nps-header__link */
.nps-header__link--parent::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: -2px;
	width: calc(100% - 20px); /* minus šířka šipky */
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--transition-base);
	opacity: 0.5;
}

.nps-header__link--parent:hover::after,
.nps-header__link--parent:focus-visible::after,
.nps-header__link--parent[aria-expanded="true"]::after,
.nps-header__link--parent[aria-current="true"]::after {
	transform: scaleX(1);
}

.nps-header__link--parent:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 3px;
}

/* Šipka chevron */
.nps-header__chevron {
	flex-shrink: 0;
	transition: transform var(--transition-base);
}

.nps-header__link--parent[aria-expanded="true"] .nps-header__chevron {
	transform: rotate(180deg);
}

/* Dropdown panel */
.nps-header__dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	min-width: 220px;
	background: rgba(246, 248, 228, 0.98);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(48, 60, 29, 0.10);
	box-shadow: var(--shadow-lg);
	list-style: none;
	margin: 0;
	padding: var(--space-2) 0;
	z-index: var(--z-dropdown);

	/* Počáteční stav pro animaci */
	opacity: 0;
	transform: translateX(-50%) translateY(-6px);
	transition:
		opacity 160ms ease,
		transform 160ms ease;
}

.nps-header__dropdown--open {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Trojúhelníček nahoře */
.nps-header__dropdown::before {
	content: '';
	position: absolute;
	top: -6px;
	left: 50%;
	transform: translateX(-50%);
	width: 10px;
	height: 6px;
	background: rgba(246, 248, 228, 0.98);
	clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.nps-header__dropdown-item {
	margin: 0;
	padding: 0;
}

.nps-header__dropdown-link {
	display: block;
	padding: var(--space-3) var(--space-6);
	font-family: var(--font-heading);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-semibold);
	color: var(--color-primary);
	text-decoration: none;
	white-space: nowrap;
	transition: background var(--transition-fast), color var(--transition-fast);
	border-left: 2px solid transparent;
}

.nps-header__dropdown-link:hover,
.nps-header__dropdown-link:focus-visible {
	background: rgba(48, 60, 29, 0.05);
	border-left-color: var(--color-accent);
	color: var(--color-primary);
	outline: none;
}

.nps-header__dropdown-link[aria-current="page"] {
	border-left-color: var(--color-accent);
	color: var(--color-primary);
	background: rgba(150, 195, 139, 0.08);
}


/* ============================================================
   MOBILE MENU — submenu accordion
   ============================================================ */

/* Hamburger animace — X při otevření */
.nps-header__toggle--open .nps-header__toggle-line:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.nps-header__toggle--open .nps-header__toggle-line:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
}

.nps-header__toggle--open .nps-header__toggle-line:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

.nps-header__toggle-line {
	transition:
		transform 200ms ease,
		opacity 200ms ease;
}

/* Mobile sub-trigger */
.nps-header__mobile-link--parent {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 14px 0;
	font-family: var(--font-heading);
	font-size: var(--text-base);
	font-weight: var(--font-weight-semibold);
	color: var(--color-primary);
	text-align: left;
	border-bottom: 1px solid rgba(48, 60, 29, 0.08);
}

.nps-header__mobile-chevron {
	flex-shrink: 0;
	transition: transform var(--transition-base);
}

.nps-header__mobile-link--parent[aria-expanded="true"] .nps-header__mobile-chevron {
	transform: rotate(180deg);
}

/* Submenu accordion panel */
.nps-header__mobile-sub {
	list-style: none;
	margin: 0;
	padding: 0 0 var(--space-2) var(--space-5);
	background: rgba(48, 60, 29, 0.03);
}

.nps-header__mobile-sublink {
	display: block;
	padding: 10px 0;
	font-family: var(--font-heading);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-semibold);
	color: var(--color-text-muted);
	text-decoration: none;
	border-bottom: 1px solid rgba(48, 60, 29, 0.05);
	transition: color var(--transition-fast);
}

.nps-header__mobile-sublink:hover,
.nps-header__mobile-sublink:focus-visible {
	color: var(--color-primary);
}

.nps-header__mobile-sublink[aria-current="page"] {
	color: var(--color-primary) !important;
	font-weight: var(--font-weight-bold) !important;
	border-left: 3px solid var(--color-accent) !important;
	padding-left: 10px !important;
}

.nps-header__mobile-link--parent[aria-current="true"] {
	color: var(--color-primary);
	font-weight: var(--font-weight-bold);
}

/* Body scroll lock při otevřeném menu */
body.nps-menu-open {
	overflow: hidden;
}

/* Scrolled stav — zesílí stín */
.nps-header--scrolled {
	box-shadow: 0 2px 20px rgba(48, 60, 29, 0.12);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.nps-header__dropdown,
	.nps-header__chevron,
	.nps-header__mobile-chevron,
	.nps-header__toggle-line {
		transition: none !important;
		animation: none !important;
	}
}


/* ============================================================
   ASTRA OVERRIDE — button.nps-header__link--parent
   Astra aplikuje vlastní button styly (padding, background, barva,
   font-size) — agresivní reset přes ID selector aby přebil specifičnost.
   ============================================================ */

#nps-header button.nps-header__link--parent {
	font-family: var(--font-heading) !important;
	font-size: 0.98rem !important;
	font-weight: var(--font-weight-semibold) !important;
	letter-spacing: 0.01em !important;
	color: var(--color-primary) !important;
	background: transparent !important;
	background-color: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	text-transform: none !important;
	line-height: inherit !important;
}

#nps-header button.nps-header__link--parent:hover,
#nps-header button.nps-header__link--parent:active,
#nps-header button.nps-header__link--parent:visited {
	background: transparent !important;
	background-color: transparent !important;
	color: var(--color-primary) !important;
	box-shadow: none !important;
}

#nps-header button.nps-header__link--parent:focus {
	background: transparent !important;
	background-color: transparent !important;
	color: var(--color-primary) !important;
	box-shadow: none !important;
	outline: none !important;
}

#nps-header button.nps-header__link--parent:focus-visible {
	outline: 3px solid var(--color-focus) !important;
	outline-offset: 3px !important;
	color: var(--color-primary) !important;
	background: transparent !important;
}

@media (min-width: 1920px) {
	#nps-header button.nps-header__link--parent {
		font-size: 1.06rem !important;
	}
}

@media (min-width: 2560px) {
	#nps-header button.nps-header__link--parent {
		font-size: 1.15rem !important;
	}
}


/* ============================================================
   ASTRA OVERRIDE — mobilní menu (Astra .current-menu-item styly)
   Astra obarvuje aktivní položky modře přes .current-menu-item a,
   .ast-header-responsive-menu a, apod. Reset přes ID selector.
   ============================================================ */

#nps-header .nps-header__mobile-link,
#nps-header .nps-header__mobile-link:visited,
#nps-header .nps-header__mobile-sublink,
#nps-header .nps-header__mobile-sublink:visited {
	color: var(--color-primary) !important;
	background: transparent !important;
	background-color: transparent !important;
	text-decoration: none !important;
	border-left: none !important;
	padding-left: 0 !important;
}

#nps-header .nps-header__mobile-sublink[aria-current="page"],
#nps-header .nps-header__mobile-link[aria-current="page"] {
	color: var(--color-primary) !important;
	font-weight: var(--font-weight-bold) !important;
	border-left: 3px solid var(--color-accent) !important;
	padding-left: 10px !important;
}

#nps-header .nps-header__mobile-link--parent[aria-current="true"] {
	color: var(--color-primary) !important;
	font-weight: var(--font-weight-bold) !important;
}

#nps-header .nps-header__mobile-link:hover,
#nps-header .nps-header__mobile-link:focus-visible {
	color: var(--color-accent) !important;
	background: transparent !important;
}

#nps-header .nps-header__mobile-sublink:hover,
#nps-header .nps-header__mobile-sublink:focus-visible {
	color: var(--color-primary) !important;
	background: transparent !important;
}

/* Astra .current-menu-item highlight — přebít */
#nps-header .current-menu-item > .nps-header__mobile-link,
#nps-header .current-menu-item > .nps-header__mobile-sublink,
#nps-header li.current-menu-item a.nps-header__mobile-link,
#nps-header li.current-menu-item a.nps-header__mobile-sublink,
#nps-header li.current-menu-ancestor a.nps-header__mobile-link {
	color: var(--color-primary) !important;
	background: transparent !important;
	background-color: transparent !important;
	font-weight: var(--font-weight-bold) !important;
}

/* Mobile parent button — stejný reset jako desktop */
#nps-header button.nps-header__mobile-link--parent {
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
	width: 100% !important;
	font-family: var(--font-heading) !important;
	font-size: var(--text-base) !important;
	font-weight: var(--font-weight-semibold) !important;
	color: var(--color-primary) !important;
	background: transparent !important;
	background-color: transparent !important;
	border: none !important;
	box-shadow: none !important;
	text-transform: none !important;
	padding: 14px 0 !important;
	text-align: left !important;
}

#nps-header button.nps-header__mobile-link--parent:hover,
#nps-header button.nps-header__mobile-link--parent:active,
#nps-header button.nps-header__mobile-link--parent:focus {
	background: transparent !important;
	background-color: transparent !important;
	color: var(--color-primary) !important;
	box-shadow: none !important;
}

#nps-header button.nps-header__mobile-link--parent[aria-current="true"] {
	color: var(--color-primary) !important;
	font-weight: var(--font-weight-bold) !important;
	background: rgba(150, 195, 139, 0.12) !important;
	border-radius: 4px !important;
	padding-left: 10px !important;
}