/* MDRK Travels — small helpers for the Elementor header, footer and homepage templates.
 * Everything visual (colours, fonts, spacing, sizes) is set inside Elementor and stays editable there.
 * This file only does what Elementor's free widgets cannot: a compact sticky header, the mobile-menu
 * open/closed state, anchor scroll offsets and readable footer text inside shortcodes. */

/* ---------- sticky header ---------- */
.mdrk-hf--header,
.elementor-location-header:has(.mdrk-sticky-header) {
	position: sticky;
	top: 0;
	z-index: 990;
}
.admin-bar .mdrk-hf--header,
.admin-bar .elementor-location-header:has(.mdrk-sticky-header) { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .mdrk-hf--header,
	.admin-bar .elementor-location-header:has(.mdrk-sticky-header) { top: 46px; }
}
@media (max-width: 600px) {
	.admin-bar .mdrk-hf--header,
	.admin-bar .elementor-location-header:has(.mdrk-sticky-header) { top: 0; }
}
.mdrk-sticky-header.is-scrolled { box-shadow: 0 6px 18px rgba(6, 39, 73, .10); }

/* Anchor targets (#book, #help, …) land below the sticky header. */
html { scroll-padding-top: 88px; }
.admin-bar { scroll-padding-top: 120px; }

/* Header action buttons keep their natural width; nav links never wrap mid-label. */
.mdrk-sticky-header .mdrk-header-actions { width: auto !important; flex: 0 0 auto; }
.mdrk-sticky-header .elementor-icon-list-item { white-space: nowrap; }
.mdrk-sticky-header .elementor-widget-image img { display: block; }

/* ---------- mobile menu panel ---------- */
body:not(.elementor-editor-active) .mdrk-mobile-menu:not(.is-open) { display: none !important; }
.mdrk-mobile-menu.is-open { animation: mdrk-menu-in .16s ease-out; }
@keyframes mdrk-menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mdrk-mobile-menu.is-open { animation: none; } }
.mdrk-mobile-menu .elementor-icon-list-item > a { min-height: 44px; align-items: center; }
.mdrk-menu-toggle .elementor-button { min-height: 40px; }
.mdrk-menu-toggle[aria-expanded="true"] .elementor-button,
.mdrk-menu-toggle .elementor-button[aria-expanded="true"] { background: #F4F6F9; }

/* ---------- focus visibility (keyboard users) ---------- */
.mdrk-hf a:focus-visible,
.mdrk-sticky-header a:focus-visible,
.mdrk-footer a:focus-visible,
.mdrk-intro a:focus-visible,
.elementor-widget-n-accordion summary:focus-visible {
	outline: 3px solid #FD7E14;
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---------- footer: shortcode output on navy ---------- */
.mdrk-footer,
.mdrk-footer .elementor-widget-shortcode { color: #E6ECF3; }
.mdrk-footer .mdrk-hf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; line-height: 1.5; }
.mdrk-footer .mdrk-hf-list a { color: #E6ECF3; text-decoration: none; }
.mdrk-footer .mdrk-hf-list a:hover { color: #FD7E14; text-decoration: underline; }
.mdrk-footer .mdrk-hf-k { color: #9FB3C8; display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.mdrk-footer .mdrk-hf-hint { color: #FFD7B0; font-size: 13px; }
.mdrk-footer p { margin: 0; }

/* ---------- homepage ---------- */
.mdrk-intro .elementor-icon-list-item > a { cursor: pointer; }
.mdrk-booking-section { position: relative; }
.mdrk-bus-photos img { width: 100%; height: auto; aspect-ratio: 12 / 7; object-fit: cover; }

/* Free Elementor: theme wrappers must not box in the full-width templates. */
.mdrk-hf .elementor { width: 100%; }

/* A footer column whose shortcode has nothing to show yet (no contact details / policy URLs configured) is hidden
 * for visitors, heading included. Staff see a hint instead. */
.e-con:has(> .elementor-widget-shortcode .mdrk-hf-empty),
.e-con:has(> .e-con-inner > .elementor-widget-shortcode .mdrk-hf-empty) { display: none !important; }

/* Astra (and similar themes): let the Elementor "Full width" page template use the whole viewport width. */
.page-template-elementor_header_footer .site-content > .ast-container,
.page-template-elementor_header_footer #content > .ast-container {
	display: block;
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}
.page-template-elementor_header_footer .site-content > .ast-container > .elementor { width: 100%; }

/* Booking/manage forms inside a flex container (Elementor containers): give the widget a definite width.
 * Without it Chromium sizes the flex item from the form's narrow intrinsic layout (it uses container queries)
 * and leaves a large empty gap below the form on phones. */
.elementor-widget-shortcode:has(.mdrk-app, .mdrk-manage),
.elementor-widget-shortcode:has(.mdrk-booking-block) { width: 100%; }
/* In Elementor the container already provides the side spacing. */
.elementor-widget-shortcode .mdrk-booking-block { padding-left: 0; padding-right: 0; }

/* Free Elementor on themes other than Astra/Hello: hide the usual theme header/footer wrappers so they don't show twice. */
.mdrk-hf-own-header #masthead, .mdrk-hf-own-header #site-header, .mdrk-hf-own-header header.site-header:not(.mdrk-hf *) { display: none !important; }
.mdrk-hf-own-footer #colophon, .mdrk-hf-own-footer #site-footer, .mdrk-hf-own-footer footer.site-footer:not(.mdrk-hf *) { display: none !important; }
