/* QldBeach Mobile UX v1.0.8
   Mobile-first layout, nav fix, discover strip, badges, search results, CLS. */

/* ── Override broken global submenu rules from Additional CSS ───────────────
   Those rules were unscoped and broke the burger menu (double/overlapping).
   Desktop hover only; mobile uses ListingHive burger behaviour. */
@media (max-width: 1023px) {
	.header-navbar__burger .menu-item-has-children > .sub-menu,
	.header-navbar__burger .sub-menu {
		position: static !important;
		display: none;
		width: 100% !important;
		box-shadow: none !important;
	}
	.header-navbar__burger .menu-item-has-children.is-open > .sub-menu,
	.header-navbar__burger .menu-item-has-children:focus-within > .sub-menu {
		display: block !important;
	}
	/* Kill unscoped hover that opens every nested submenu on touch */
	.header-navbar__burger .menu-item-has-children:hover > .sub-menu {
		display: none !important;
	}
	.header-navbar__burger .menu-item-has-children.is-open:hover > .sub-menu,
	.header-navbar__burger .menu-item-has-children.is-open > .sub-menu {
		display: block !important;
	}
}

@media (min-width: 1024px) {
	.header-navbar__menu .menu-item-has-children:hover > .sub-menu,
	.header-navbar__menu .menu-item-has-children:focus-within > .sub-menu {
		display: block !important;
	}
	.header-navbar__menu .sub-menu {
		position: absolute;
		z-index: 9999;
	}
}

/* ── Compact sticky header (mobile) ──────────────────────────────────────── */
@media (max-width: 782px) {
	.site-header,
	header.site-header {
		padding-top: 0 !important;
		padding-bottom: 0 !important;
	}
	.header-navbar {
		min-height: 44px !important;
		padding-top: 2px !important;
		padding-bottom: 2px !important;
		align-items: center !important;
	}
	.header-navbar__start,
	.header-navbar__end {
		padding-top: 0 !important;
		padding-bottom: 0 !important;
	}
	.header-logo {
		padding: 0 !important;
		margin: 0 !important;
		line-height: 1 !important;
	}
	.header-logo img,
	.header-logo .custom-logo,
	.header-navbar .custom-logo {
		width: 36px !important;
		height: 36px !important;
		max-width: 36px !important;
		max-height: 36px !important;
		object-fit: contain !important;
		display: block !important;
	}
	.header-navbar__burger,
	.header-navbar__burger-button,
	.menu-toggle {
		padding: 6px !important;
		min-height: 36px !important;
	}
	.header-hero {
		padding-top: 10px !important;
		padding-bottom: 8px !important;
		min-height: 0 !important;
	}
	.header-hero .page__title,
	.header-hero h1 {
		font-size: 1.35rem !important;
		line-height: 1.25 !important;
		margin: 0 !important;
	}
}

/* Brand-blue accordion toggles + “→” text links (Gold Coast consistency) */
.wp-block-accordion-heading__toggle,
.wp-block-accordion-heading__toggle-icon,
.wp-block-accordion-item .wp-block-accordion-heading__toggle-icon {
	color: #00b3ff !important;
	fill: #00b3ff !important;
}
.wp-block-accordion-heading__toggle:hover .wp-block-accordion-heading__toggle-icon,
.wp-block-accordion-heading__toggle:focus .wp-block-accordion-heading__toggle-icon {
	color: #0099dd !important;
	fill: #0099dd !important;
}

/* ── Homepage discover strip ─────────────────────────────────────────────── */
.qbm-discover {
	background: linear-gradient(180deg, #e8f7fc 0%, #ffffff 100%);
	border-radius: 14px;
	padding: 18px 14px 20px;
	margin: 0 0 22px;
	border: 1px solid rgba(0, 179, 255, 0.18);
}
.qbm-discover__title {
	margin: 0 0 12px !important;
	font-size: 1.35rem !important;
	line-height: 1.25 !important;
	color: #123047 !important;
	text-align: center;
	font-weight: 700;
}
.qbm-discover__label {
	margin: 14px 0 10px !important;
	font-size: 0.72rem !important;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #5a6b78;
	text-align: center;
}
.qbm-discover__search {
	position: relative;
}
.qbm-search-form {
	display: flex !important;
	width: 100% !important;
	margin: 0 auto !important;
}
.qbm-search-input {
	flex: 1 1 auto !important;
	min-height: 48px !important;
	font-size: 16px !important; /* prevents iOS zoom */
	border: 1px solid #c5d5e0 !important;
	border-right: 0 !important;
	border-radius: 10px 0 0 10px !important;
	padding: 10px 14px !important;
	background: #fff !important;
	color: #123047 !important;
}
.qbm-search-submit {
	min-width: 52px !important;
	min-height: 48px !important;
	border: 0 !important;
	border-radius: 0 10px 10px 0 !important;
	background: #00b3ff !important;
	color: #fff !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.qbm-search-submit:hover { background: #0099dd !important; }
.qbm-screen-reader {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0);
	border: 0;
}

/* Live results panel */
.qbm-search-panel {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	z-index: 40;
	background: #fff;
	border: 1px solid #d7e3ec;
	border-radius: 12px;
	box-shadow: 0 10px 28px rgba(18, 48, 71, 0.16);
	padding: 8px 0;
	max-height: 320px;
	overflow: auto;
}
.qbm-discover {
	position: relative;
}
.qbm-search-status {
	padding: 10px 14px;
	font-size: 0.9rem;
	color: #5a6b78;
}
.qbm-search-results {
	list-style: none;
	margin: 0;
	padding: 0;
}
.qbm-search-result a {
	display: block;
	padding: 12px 14px;
	color: #123047 !important;
	text-decoration: none !important;
	font-weight: 600;
	border-top: 1px solid #eef3f7;
}
.qbm-search-result:first-child a { border-top: 0; }
.qbm-search-result a:hover,
.qbm-search-result a:focus {
	background: #e8f7fc;
	color: #0077aa !important;
}
.qbm-search-all {
	display: block;
	padding: 12px 14px;
	font-weight: 700;
	color: #00b3ff !important;
	text-decoration: none !important;
	border-top: 1px solid #eef3f7;
}

/* Legacy Ivory form styles (menu only) */
.qbm-discover__search .is-search-form {
	display: flex !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 auto !important;
}
.qbm-discover__search .is-search-input {
	flex: 1 1 auto !important;
	min-height: 48px !important;
	font-size: 16px !important;
	border-radius: 10px 0 0 10px !important;
	padding: 10px 14px !important;
}
.qbm-discover__search .is-search-submit {
	min-width: 52px !important;
	min-height: 48px !important;
	border-radius: 0 10px 10px 0 !important;
	background: #00b3ff !important;
}
.qbm-discover__regions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
.qbm-region-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 10px;
	background: #007eb8;
	color: #fff !important;
	font-size: 0.95rem;
	font-weight: 600;
	text-align: center;
	text-decoration: none !important;
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0, 126, 184, 0.28);
	line-height: 1.2;
}
.qbm-region-btn:hover,
.qbm-region-btn:focus {
	background: #006a9b;
	color: #fff !important;
}

@media (min-width: 600px) {
	.qbm-discover__regions {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* Homepage main heading: center to match surrounding content */
.qbm-home h1.wp-block-heading {
	text-align: center !important;
}

/* On mobile homepage, tighten space above discover / reduce hero noise */
@media (max-width: 782px) {
	.qbm-home .qbm-discover {
		margin-top: 8px;
	}
	/* Existing category button grid — finger friendly */
	.qbm-home .wp-block-button.beach-category-btn .wp-block-button__link,
	.qbm-home .beach-category-btn .wp-block-button__link {
		min-height: 48px !important;
		padding: 14px 12px !important;
		font-size: 0.95rem !important;
		display: flex !important;
		align-items: center;
		justify-content: center;
		white-space: normal !important;
		line-height: 1.2 !important;
	}
}

/* ── Single beach above-the-fold (Irene wireframe) ─────────────────────────
   Photo → Name → Stars → Badges → Description */
.qbm-beach .header-hero {
	display: none !important; /* title moves into qbm-beach-hero */
}
/* Hide any leftover theme page title so we don't show two H1s */
.qbm-beach h1.page__title,
.qbm-beach h1.entry-title:not(.qbm-beach-hero__title) {
	display: none !important;
}
.qbm-beach-hero {
	margin: 0 0 18px;
}
.qbm-beach-hero__photo {
	max-height: 250px;
	overflow: hidden;
	border-radius: 12px;
	margin: 0 0 14px;
	aspect-ratio: 16 / 10;
	background: #dce7ef;
	width: 100%;
}
.qbm-beach-hero__photo .wp-block-gallery,
.qbm-beach-hero__photo .wp-block-image,
.qbm-beach-hero__photo figure {
	margin: 0 !important;
	padding: 0 !important;
	gap: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
	height: 100% !important;
	display: block !important;
}
.qbm-beach-hero__photo .wp-block-gallery .wp-block-image:not(:first-child) {
	display: none !important;
}
.qbm-beach-hero__photo .wp-block-gallery .wp-block-image:first-child,
.qbm-beach-hero__photo .blocks-gallery-item:first-child {
	width: 100% !important;
	max-width: 100% !important;
	flex-basis: 100% !important;
	margin: 0 !important;
}
.qbm-beach-hero__photo img {
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 250px !important;
	object-fit: cover !important;
	object-position: center center !important;
	display: block !important;
	margin: 0 auto !important;
}
.qbm-beach-hero__title {
	margin: 0 0 6px !important;
	font-size: 1.55rem !important;
	line-height: 1.2 !important;
	color: #123047 !important;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	font-weight: 700 !important;
}
.qbm-beach-rating,
.qbm-beach-hero .qbmr-widget {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 !important;
	padding-bottom: 20px; /* padding does not collapse into the badges */
	font-size: 1rem;
	color: #123047;
}
/* Dedicated gap after stars so badges are not tight against them. */
.qbm-rating-spacer {
	display: block;
	height: 12px;
	width: 100%;
	pointer-events: none;
}
.qbm-beach-rating__stars {
	letter-spacing: 1px;
}
.qbm-star-empty {
	opacity: 0.35;
}
.qbm-beach-rating__value {
	color: #5a6b78;
	font-weight: 600;
}

@media (max-width: 782px) {
	.qbm-beach-hero__title {
		text-align: center !important;
	}
	.qbm-beach-rating {
		justify-content: center;
		text-align: center;
	}
}

/* Amenity chips — icon + label (wireframe style) */
.qbm-badges {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin: 0 0 18px;
}
.qbm-badge {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 10px;
	background: #f3f7fa;
	border: 1px solid #d7e3ec;
	font-size: 0.88rem;
	line-height: 1.2;
	font-weight: 600;
	color: #1d3344;
}
.qbm-badge__icon {
	font-size: 1.1rem;
	line-height: 1;
}
.qbm-badge__label {
	font-weight: 700;
	color: #1d3344;
}
.qbm-badge--yes,
.qbm-badge--ok,
.qbm-badge--info { border-color: #9ad7b0; background: #eefaf2; }
.qbm-badge--no { border-color: #e2c4c4; background: #faf1f1; opacity: 0.92; }
.qbm-badge--warn { border-color: #e6d39a; background: #fff8e8; }

@media (min-width: 600px) {
	.qbm-badges {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* Legacy gallery cap if a gallery remains lower in the page */
@media (max-width: 782px) {
	.qbm-beach .wp-block-gallery:not(.qbm-beach-hero__photo .wp-block-gallery) {
		max-height: 250px;
		overflow: hidden;
		border-radius: 12px;
	}
	.qbm-beach iframe,
	.qbm-beach .wpgmza_map,
	.qbm-beach .gm-style {
		min-height: 220px;
		aspect-ratio: 16 / 10;
	}
}

/* ── Beach Information accordion ─────────────────────────────────────────── */
.qbm-accordion {
	margin: 12px 0 22px;
	border: 1px solid #d7e3ec;
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
}
.qbm-accordion__summary {
	cursor: pointer;
	list-style: none;
	padding: 14px 16px;
	font-weight: 700;
	color: #123047;
	background: #f3f7fa;
}
.qbm-accordion__summary::-webkit-details-marker { display: none; }
.qbm-accordion__summary::after {
	content: '+';
	float: right;
	font-weight: 400;
	color: #00b3ff;
}
.qbm-accordion[open] > .qbm-accordion__summary::after { content: '–'; }
.qbm-accordion__body {
	padding: 8px 16px 14px;
}
/* Hide duplicate heading inside accordion body */
.qbm-accordion__body > h2,
.qbm-accordion__body > h3 {
	display: none;
}

/* ── Menu Ivory search: compact on mobile ────────────────────────────────── */
@media (max-width: 782px) {
	.header-navbar__burger .is-search-form {
		margin: 10px 0;
	}
	.header-navbar__burger .is-search-input {
		min-height: 44px;
		font-size: 16px;
	}
	/* Hide duplicate desktop menu copy search inside burger if both visible */
	.header-navbar__menu .is-search-form {
		/* desktop nav search stays */
	}
}

/* ── Search results page ─────────────────────────────────────────────────── */
.qbm-search-head {
	margin: 4px 0 20px;
	padding: 16px 18px;
	background: linear-gradient(180deg, #e8f7fc 0%, #ffffff 100%);
	border: 1px solid rgba(0, 179, 255, 0.18);
	border-radius: 14px;
}
.qbm-search-head__title {
	margin: 0 0 4px !important;
	font-size: 1.3rem !important;
	line-height: 1.3 !important;
	color: #123047 !important;
}
.qbm-search-head__query {
	color: #0090cc;
}
.qbm-search-head__count {
	margin: 0 !important;
	font-size: 0.88rem !important;
	color: #5a6b78 !important;
	font-weight: 600;
}

/* Result cards */
.qbm-search .post--archive {
	background: #fff;
	border: 1px solid #dfe9f1;
	border-radius: 14px;
	padding: 18px 18px 14px;
	margin: 0 0 16px !important;
	box-shadow: 0 2px 10px rgba(18, 48, 71, 0.05);
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.qbm-search .post--archive:hover {
	border-color: #9ed9f5;
	box-shadow: 0 6px 18px rgba(18, 48, 71, 0.1);
}
.qbm-search .post--archive .post__title {
	margin: 0 0 8px !important;
	font-size: 1.1rem !important;
	line-height: 1.35 !important;
}
.qbm-search .post--archive .post__title a {
	color: #123047 !important;
	text-decoration: none !important;
}
.qbm-search .post--archive .post__title a:hover {
	color: #0090cc !important;
}
.qbm-search .post--archive .post__text {
	font-size: 0.92rem;
	line-height: 1.55;
	color: #48606f;
}
.qbm-search .post--archive .post__text p {
	margin: 0 0 10px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.qbm-search .post--archive .post__details {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 14px;
	padding-top: 10px;
	border-top: 1px solid #eef3f7;
	font-size: 0.82rem;
	color: #7a8b98;
}
.qbm-search .post--archive .post__date,
.qbm-search .post--archive .post__author {
	font-size: 0.82rem !important;
	color: #7a8b98 !important;
}
.qbm-search .post--archive .post__readmore {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: #00b3ff;
	color: #fff !important;
	font-size: 0.82rem;
	font-weight: 700;
	border-radius: 8px;
	text-decoration: none !important;
}
.qbm-search .post--archive .post__readmore:hover {
	background: #0099dd;
	color: #fff !important;
}
.qbm-search .post--archive .post__readmore i {
	font-size: 0.7rem;
}

/* Pagination */
.qbm-search .pagination,
.qbm-search .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 24px 0;
}
.qbm-search .pagination a,
.qbm-search .pagination span,
.qbm-search .nav-links a,
.qbm-search .nav-links span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	min-height: 42px;
	padding: 8px 12px;
	border: 1px solid #d7e3ec;
	border-radius: 10px;
	background: #fff;
	color: #123047 !important;
	font-weight: 600;
	text-decoration: none !important;
}
.qbm-search .pagination .current,
.qbm-search .nav-links .current {
	background: #00b3ff;
	border-color: #00b3ff;
	color: #fff !important;
}
.qbm-search .pagination a:hover,
.qbm-search .nav-links a:hover {
	border-color: #00b3ff;
	color: #0090cc !important;
}

/* Sidebar cleanup on search pages: hide placeholder widgets
   (Recent Posts "Hello world!", Recent Comments, Archives, Categories).
   Keep the search widget + any ad widgets. */
.qbm-search .site-sidebar .widget_block:has(.wp-block-latest-posts),
.qbm-search .site-sidebar .widget_block:has(.wp-block-latest-comments),
.qbm-search .site-sidebar .widget_block:has(.wp-block-archives),
.qbm-search .site-sidebar .widget_block:has(.wp-block-categories) {
	display: none !important;
}
.qbm-search .site-sidebar .widget {
	background: #fff;
	border: 1px solid #dfe9f1;
	border-radius: 14px;
	padding: 16px;
	margin-bottom: 16px;
}
.qbm-search .site-sidebar .widget:empty,
.qbm-search .site-sidebar .widget_custom_html:has(.custom-html-widget:empty) {
	display: none !important;
}
.qbm-search .site-sidebar .wp-block-search__button {
	background: #00b3ff !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 8px !important;
}

/* Sidebar ad slot */
.qas-sidebar-ad {
	background: #fff;
	border: 1px solid #dfe9f1;
	border-radius: 14px;
	padding: 12px;
	margin-bottom: 16px;
	min-height: 250px;
	text-align: center;
}
.qas-sidebar-ad__label {
	display: block;
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #a3b2bd;
	margin-bottom: 8px;
}

/* Mobile: sidebar drops below results — keep it tidy */
@media (max-width: 782px) {
	.qbm-search .site-sidebar {
		margin-top: 12px;
	}
}

/* Desktop: discover strip still useful but calmer */
@media (min-width: 783px) {
	.qbm-discover {
		padding: 22px 24px 26px;
		margin: 0 auto 28px;
		max-width: 900px;
	}
	.qbm-discover__title {
		font-size: 1.6rem !important;
	}

	/* Beach hero photo fills the full content column on desktop */
	.qbm-beach-hero__photo {
		max-height: 460px;
		aspect-ratio: 16 / 9;
		width: 100%;
	}
	.qbm-beach-hero__photo img {
		max-height: 460px !important;
	}
	.qbm-beach-hero__title {
		font-size: 2rem !important;
	}
}
