/* ========================================
   ZSMH Header & Footer
   Custom header/footer (Divi removal migration)
   ======================================== */

/* ----------------------------------------
   0. Skip Link (Accessibility)
   ---------------------------------------- */
.zsmh-skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 12px 24px;
	clip: auto;
	white-space: normal;
	overflow: visible;
	margin: 0;
	background: var(--gcid-primary-color);
	color: #fff;
	font-family: var(--font-heading);
	font-size: var(--text-sm);
	font-weight: 700;
	text-decoration: none;
	border-radius: var(--radius-sm);
	box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

/* ----------------------------------------
   1. Top Bar
   ---------------------------------------- */
.zsmh-top-bar {
	background: var(--gcid-primary-color);
	color: #fff;
	font-size: var(--text-sm);
	line-height: 1;
}

.zsmh-top-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 0;
	gap: 16px;
}

.zsmh-top-bar__info {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.zsmh-top-bar__phone,
.zsmh-top-bar__email {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	text-decoration: none;
	-webkit-text-fill-color: #fff; /* Safari iOS mailto: link fix */
}

.zsmh-top-bar__email:hover {
	text-decoration: underline;
	color: #fff;
}

.zsmh-top-bar__social {
	display: flex;
	align-items: center;
	gap: 12px;
}

.zsmh-top-bar__social-link {
	color: #fff;
	opacity: 0.85;
	transition: opacity var(--transition-fast);
	display: inline-flex;
}

.zsmh-top-bar__social-link:hover {
	opacity: 1;
	color: #fff;
}

@media (max-width: 640px) {
	.zsmh-top-bar__inner {
		justify-content: center;
	}
	.zsmh-top-bar__social {
		display: none;
	}
}

/* ----------------------------------------
   2. Main Header
   ---------------------------------------- */
.zsmh-header {
	background: var(--gcid-white);
	box-shadow: var(--shadow-sm);
	position: sticky;
	top: 0;
	z-index: 9999;
	transition: box-shadow var(--transition-base);
	height: auto !important; /* override Divi inline height on fixed nav */
}

/* WP admin bar offset */
.admin-bar .zsmh-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .zsmh-header {
		top: 46px;
	}
}

.zsmh-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 80px;
	gap: 20px;
	padding-left: 0;
	padding-right: 0;
	transition: height var(--transition-base);
}

/* Shrink on scroll — header sa zmenší, logo sa zmenší */
.zsmh-header--shrink {
	box-shadow: var(--shadow-md);
	height: auto !important;
}

#main-header.zsmh-header--shrink {
	min-height: 0 !important; /* override megamenu.css #main-header 85px min-height */
}

.zsmh-header--shrink .zsmh-header__inner {
	height: 56px;
	min-height: 0 !important;
}

@media (max-width: 980px) {
	.zsmh-header--shrink .zsmh-header__inner {
		height: 52px;
	}
}

.zsmh-header--shrink .zsmh-header__logo img {
	height: 32px;
	transition: height var(--transition-base);
}

/* Logo */
.zsmh-header__logo {
	flex-shrink: 0;
	min-width: 0;
}

.zsmh-header__logo a {
	display: flex;
	align-items: center;
}

.zsmh-header__logo img {
	height: 43px;
	width: auto;
	max-width: 380px !important;
	transition: height var(--transition-base);
}

@media (max-width: 980px) {
	.zsmh-header__inner {
		padding-left: var(--space-4, 16px);
		padding-right: var(--space-4, 16px);
		height: 64px;
	}
	.zsmh-header__logo {
		flex-shrink: 1;
	}
	.zsmh-header__logo img {
		max-width: 260px !important;
		height: auto;
	}
	/* Hamburger + search doprava — nie space-between */
	.zsmh-header__hamburger {
		margin-left: auto;
	}
}

@media (max-width: 480px) {
	.zsmh-header__logo img {
		max-width: 200px !important;
	}
}

/* Mega menu — override megamenu.css absolute positioning
   for our custom flex header (replaces Divi header behavior) */
@media (min-width: 981px) {
	.zsmh-header .zsmh-mega-nav {
		position: static !important;
		margin-top: 0 !important;
		right: auto !important;
		flex: 1;
		display: flex !important;
		justify-content: flex-end;
	}
}
@media (max-width: 980px) {
	.zsmh-header .zsmh-mega-nav {
		display: none !important;
	}
}

/* Search toggle */
.zsmh-header__search-toggle {
	background: none;
	border: none;
	padding: 8px;
	cursor: pointer;
	color: var(--gcid-muted-color);
	transition: color var(--transition-fast);
	flex-shrink: 0;
	display: flex;
}

.zsmh-header__search-toggle:hover {
	color: var(--gcid-primary-color);
}

/* Hamburger */
.zsmh-header__hamburger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	background: none;
	border: none;
	padding: 8px;
	cursor: pointer;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
}

.zsmh-header__hamburger-line {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--gcid-heading-color);
	border-radius: 1px;
	transition: all var(--transition-base);
}

/* Hamburger active state */
.zsmh-header__hamburger[aria-expanded="true"] .zsmh-header__hamburger-line:nth-child(1) {
	transform: rotate(45deg) translate(5px, 5px);
}
.zsmh-header__hamburger[aria-expanded="true"] .zsmh-header__hamburger-line:nth-child(2) {
	opacity: 0;
}
.zsmh-header__hamburger[aria-expanded="true"] .zsmh-header__hamburger-line:nth-child(3) {
	transform: rotate(-45deg) translate(5px, -5px);
}

/* Search overlay */
.zsmh-header__search {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--gcid-white);
	box-shadow: var(--shadow-md);
	padding: 16px 0;
	z-index: 100;
}

.zsmh-header__search form {
	display: flex;
	align-items: center;
	gap: 12px;
}

.zsmh-header__search input[type="search"] {
	flex: 1;
	padding: 12px 16px;
	border: 2px solid var(--gcid-border-color);
	border-radius: var(--radius-md);
	font-size: var(--text-base);
	font-family: var(--font-body);
	outline: none;
	transition: border-color var(--transition-fast);
}

.zsmh-header__search input[type="search"]:focus {
	border-color: var(--gcid-primary-color);
}
.zsmh-header__search input[type="search"]:focus-visible {
	outline: 2px solid var(--gcid-primary-color);
	outline-offset: -2px;
}

.zsmh-header__search button[type="submit"] {
	background: var(--gcid-primary-color);
	border: none;
	border-radius: var(--radius-md);
	padding: 12px;
	color: #fff;
	cursor: pointer;
	display: flex;
}

.zsmh-header__search-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: var(--gcid-muted-color);
	padding: 8px;
}

/* ----------------------------------------
   3. Mobile Menu
   ---------------------------------------- */
.zsmh-mobile-menu {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--gcid-white);
	box-shadow: var(--shadow-lg);
	display: none; /* default hidden — JS toggles via hidden attr */
}

.zsmh-mobile-menu:not([hidden]) {
	display: block; /* shown when hamburger is toggled */
	max-height: calc(100vh - 64px);
	overflow-y: auto;
	z-index: 99;
	-webkit-overflow-scrolling: touch;
}

.zsmh-mobile-menu__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.zsmh-mobile-menu__list li {
	border-bottom: 1px solid var(--gcid-border-color);
}

.zsmh-mobile-menu__list li a {
	display: block;
	padding: 14px 20px;
	color: var(--gcid-heading-color);
	font-family: var(--font-body);
	font-size: var(--text-base);
	text-decoration: none;
}

.zsmh-mobile-menu__list li a:hover {
	color: var(--gcid-primary-color);
	background: var(--gcid-primary-cream);
}

/* Depth 0 — top level */
.zsmh-mobile-menu__list > li > a {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 15px;
	color: var(--gcid-heading-color);
}

/* Depth 1 — column headers (section dividers) */
.zsmh-mobile-menu__list > li > .sub-menu > li > a {
	font-family: var(--font-heading);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--gcid-light-color);
	padding: 14px 20px 6px;
	pointer-events: none;
	cursor: default;
}

/* Vizuálne oddelenie sekcií v mobile menu — jemné pozadie + horná čiara */
.zsmh-mobile-menu__list > li > .sub-menu > li {
	border-top: 1px solid var(--gcid-border-color, #e5e5e5);
}

.zsmh-mobile-menu__list > li > .sub-menu > li > a {
	background: var(--gcid-bg-muted, #f7f6f3);
	padding-top: 12px;
	padding-bottom: 8px;
	margin-top: 0;
}

/* Depth 2 — actual links */
.zsmh-mobile-menu__list > li > .sub-menu > li > .sub-menu > li > a {
	padding: 10px 20px 10px 32px;
	font-size: var(--text-sm);
	color: var(--gcid-body-color);
}

.zsmh-mobile-menu__list .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Hide separator items in mobile */
.zsmh-mobile-menu__list .separator,
.zsmh-mobile-menu__list .sub-header,
.zsmh-mobile-menu__list .contact-info {
	display: none;
}

@media (max-width: 980px) {
	.zsmh-header .zsmh-mega-nav {
		display: none !important;
	}
	.zsmh-header__hamburger {
		display: flex;
	}
}

@media (min-width: 981px) {
	.zsmh-mobile-menu {
		display: none !important;
	}
	.zsmh-header__hamburger {
		display: none !important;
	}
}

/* ----------------------------------------
   4. Footer
   ---------------------------------------- */
.zsmh-footer {
	background: var(--gcid-heading-color);
	color: #ccc;
	font-size: var(--text-sm);
}

.zsmh-footer a {
	color: #ccc;
	text-decoration: none;
	transition: color var(--transition-fast);
}

.zsmh-footer a:hover {
	color: var(--gcid-primary-color);
}

/* Footer widgets */
.zsmh-footer__widgets {
	padding: 48px 0 32px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.zsmh-footer__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--module-gutter);
}

@media (max-width: 980px) {
	.zsmh-footer__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.zsmh-footer__grid {
		grid-template-columns: 1fr;
	}
}

.zsmh-footer__widget-title,
.zsmh-footer .fwidget h4 {
	color: #fff;
	font-family: var(--font-heading);
	font-size: var(--text-base);
	font-weight: 700;
	margin-bottom: 16px;
}

.zsmh-footer__col ul,
.zsmh-footer .fwidget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.zsmh-footer__col ul li,
.zsmh-footer .fwidget ul li {
	margin-bottom: 8px;
}

/* Footer bottom */
.zsmh-footer__bottom {
	padding: 6px 0 10px;
}
/* Keď je stav widget prítomný, viac priestoru */
.zsmh-footer__bottom:has(.zsmh-stav-widget) {
	padding: 16px 0;
}

.zsmh-footer__bottom-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
}

.zsmh-footer__copyright p {
	margin: 0;
	color: var(--gcid-light-color);
	font-size: var(--text-xs);
}

.zsmh-footer__social {
	display: flex;
	gap: 12px;
}

.zsmh-footer__social .zsmh-top-bar__social-link {
	color: var(--gcid-light-color);
}

.zsmh-footer__social .zsmh-top-bar__social-link:hover {
	color: var(--gcid-primary-color);
}

/* Stav widget — zachovanie kompatibility (injektuje sa cez functions.php) */
#footer-bottom .zsmh-stav-widget {
	width: 100%;
}

/* Footer thumbnail grid (galérie, videá) */
.zsmh-footer-thumbgrid {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr) !important;
	gap: 4px !important;
}

.zsmh-footer-thumbgrid a {
	display: block;
	overflow: hidden;
	border-radius: 3px;
	aspect-ratio: 1;
}

.zsmh-footer-thumbgrid img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity var(--transition-fast);
}

.zsmh-footer-thumbgrid a:hover img {
	opacity: 0.75;
}

/* 2-column variant (videá — 4 väčšie thumbnaily) */
.zsmh-footer-thumbgrid--2col {
	grid-template-columns: repeat(2, 1fr) !important;
}

/* Footer "Neprehliadnite" — thumbnail + text links */
.zsmh-footer .ikona-nadpis {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 0;
	color: #ccc;
	text-decoration: none;
	font-size: var(--text-sm);
	line-height: 1.3;
}

.zsmh-footer .ikona-nadpis:hover {
	color: var(--gcid-primary-color);
}

.zsmh-footer .ikona-nadpis img {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 3px;
	flex-shrink: 0;
}

/* Footer nadpisurl — title links */
.zsmh-footer .nadpisurl {
	text-decoration: none;
	color: inherit;
}

.zsmh-footer .nadpisurl:hover .zsmh-footer__widget-title {
	color: var(--gcid-primary-color);
}

/* Footer link bar */
.zsmh-footer__linkbar {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: 16px 0;
}

.zsmh-footer__linkbar-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 24px;
}

/* WP nav menu renders <ul><li><a> — flatten to inline flex */
.zsmh-footer__linkbar-nav > ul {
	display: contents;     /* ul becomes invisible, li items flow into parent flex */
	list-style: none;
	margin: 0;
	padding: 0;
}
.zsmh-footer__linkbar-nav li {
	display: contents;     /* li becomes invisible, <a> flows directly */
}

.zsmh-footer__linkbar-nav a {
	color: var(--gcid-primary-color);
	text-decoration: none;
	font-size: var(--text-sm);
	white-space: nowrap;
}

.zsmh-footer__linkbar-nav a:hover {
	color: #fff;
	text-decoration: underline;
}

/* Footer fallback cards in thumbnail grid */
.zsmh-footer-thumbgrid .zsmh-fallback-card {
	width: 100%;
	height: 100%;
	font-size: 10px;
}

/* ----------------------------------------
   Footer — Kontakt widget (Nájdete nás)
   ---------------------------------------- */
.zsmh-footer__kontakt {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Mapa — čisté inline SVG (Dunaj + Hrad + 2 budovy) */
.zsmh-footer-kontakt__map {
	display: block;
	width: 100%;
	height: 95px;
	border-radius: 4px;
	overflow: hidden;
	background: #1e2226;
	border: 1px solid rgba(255, 255, 255, 0.1);
	position: relative;
	transition: opacity var(--transition-fast);
}
.zsmh-footer-kontakt__map:hover {
	opacity: 0.92;
}
.zsmh-footer-kontakt__map svg {
	display: block;
	width: 100%;
	height: 100%;
}
.zsmh-footer-kontakt__map::after {
	content: 'Zobraziť na mape →';
	position: absolute;
	bottom: 5px;
	right: 7px;
	font-size: 9px;
	color: #fff;
	background: rgba(0, 0, 0, 0.7);
	padding: 2px 7px;
	border-radius: 99px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	font-weight: 600;
	pointer-events: none;
}

/* Karta budovy (kompakt) */
.zsmh-footer-kontakt__bldg {
	display: block;
	padding: 6px 9px;
	background: rgba(255, 255, 255, 0.04);
	border-radius: 0 3px 3px 0;
	text-decoration: none;
	color: inherit;
	border-left: 3px solid #4a7fb8;
	transition: background var(--transition-fast);
}
.zsmh-footer-kontakt__bldg--b2 {
	border-left-color: #5aa84a;
}
.zsmh-footer-kontakt__bldg:hover {
	background: rgba(255, 255, 255, 0.08);
}

.zsmh-footer-kontakt__name-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px;
	line-height: 1.2;
}
.zsmh-footer-kontakt__name {
	color: #fff;
	font-weight: 700;
	font-size: 12px;
}
.zsmh-footer-kontakt__tel {
	color: var(--gcid-primary-color);
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.zsmh-footer-kontakt__sub {
	display: block;
	color: #888;
	font-size: 10px;
	line-height: 1.3;
	margin-top: 1px;
}

/* Spoločný email (tenký pás pod kartami) */
.zsmh-footer-kontakt__email {
	display: flex;
	align-items: center;
	gap: 6px;
	padding-top: 8px;
	margin-top: 2px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 12px;
}
.zsmh-footer-kontakt__email svg {
	color: var(--gcid-primary-color);
	flex-shrink: 0;
}
.zsmh-footer-kontakt__email a {
	color: #fff;
}
.zsmh-footer-kontakt__email a:hover {
	color: var(--gcid-primary-color);
}

/* ----------------------------------------
   5. Divi Compatibility Overrides
   ---------------------------------------- */

/* Ak Divi parent štýly ešte existujú, potlačiť ich vplyv na header/footer.
   Divi nastavuje #main-header { position: fixed } a #page-container { padding-top: 80px }
   čo rozbije náš sticky header a vytvára bielu medzeru navrchu. */

#page-container {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Potlačiť Divi body padding pre fixed nav */
body.et_fixed_nav #page-container,
body.et_fixed_nav.et_show_nav #page-container,
body.et_fixed_nav.et_secondary_nav_enabled #page-container {
	padding-top: 0 !important;
}

/* Potlačiť Divi top-header fixed positioning */
#top-header.zsmh-top-bar {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
}

/* Potlačiť Divi #main-header fixed positioning — náš header je sticky */
#main-header.zsmh-header {
	position: sticky !important;
	top: 0 !important;
	z-index: 9999 !important;
	width: 100% !important;
	left: auto !important;
	right: auto !important;
	transform: none !important;
	-webkit-transform: none !important;
	animation: none !important;
	-webkit-animation: none !important;
	transition: box-shadow var(--transition-base) !important;
}

.admin-bar #main-header.zsmh-header {
	top: 32px !important;
}

@media (max-width: 782px) {
	.admin-bar #main-header.zsmh-header {
		top: 46px !important;
	}
}

/* Potlačiť Divi ET fixed nav transformy a animácie */
body.et_fixed_nav #main-header.zsmh-header,
body.et_fixed_nav.et_show_nav #main-header.zsmh-header {
	position: sticky !important;
	top: 0 !important;
	transform: none !important;
	-webkit-transform: none !important;
}

body.et_fixed_nav.admin-bar #main-header.zsmh-header {
	top: 32px !important;
}

/* Zabezpečiť že main content začína pod header */
#et-main-area {
	padding-top: 0;
}
