/*
 * Billabong Pool Guides: hub, topic and article templates.
 * Every colour and font maps to the Elementor Default Kit globals (post #6), with the kit's own
 * values as fallbacks. No new colours or fonts are introduced. Scoped to .bg-guides.
 * One bold device per template: the hub's navy "Start here" band; the article's answer box.
 */
.bg-guides {
	--bg-navy: var(--e-global-color-primary, #1B3F91);
	--bg-blue: var(--e-global-color-secondary, #2D63DD);
	--bg-ink: var(--e-global-color-text, #4C4C4C);
	--bg-ink-strong: var(--e-global-color-accent, #303030);
	--bg-sky: #96C6E0;            /* kit custom colour "BG color" */
	--bg-sand: #EEECE9;           /* kit custom colour "section bg" */
	--bg-paper: #FFFFFF;          /* kit custom colour "white" */
	/* Derived (add, never change): tints of kit colours for surfaces and rules */
	--bg-sky-wash: color-mix(in srgb, var(--bg-sky) 22%, var(--bg-paper));
	--bg-rule: color-mix(in srgb, var(--bg-ink) 18%, var(--bg-paper));
	--bg-font-head: var(--e-global-typography-primary-font-family, "neohomi"), Georgia, serif;
	--bg-font-body: var(--e-global-typography-text-font-family, "Inter"), system-ui, -apple-system, "Segoe UI", sans-serif;
	--bg-measure: 62ch;     /* about 75-78 characters a line in Inter */
	--bg-radius: 10px;
	--bg-header-offset: 9rem;     /* clears the sticky Elementor header (about 125px) */
	--bg-ease: cubic-bezier(.2, .7, .2, 1);

	color: var(--bg-ink);
	background: var(--bg-paper);
	font-family: var(--bg-font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
}
.bg-guides *,
.bg-guides *::before,
.bg-guides *::after { box-sizing: border-box; }

.bg-wrap { width: min(1200px, 100% - 2rem); margin-inline: auto; }

/* neohomi is a wide display face: headings at display sizes only. */
.bg-guides h1,
.bg-guides h2 {
	font-family: var(--bg-font-head);
	color: var(--bg-navy);
	line-height: 1.12;
	letter-spacing: -0.01em;
	margin: 0;
	text-wrap: balance;
}
.bg-guides h3 { font-family: var(--bg-font-body); font-weight: 600; color: var(--bg-ink-strong); margin: 0; line-height: 1.3; }
.bg-guides a { color: var(--bg-blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
.bg-guides a:hover { color: var(--bg-navy); text-decoration-thickness: 2px; }
.bg-guides :focus-visible { outline: 3px solid var(--bg-blue); outline-offset: 2px; border-radius: 3px; }

/* Breadcrumbs */
.bg-crumbs ol { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; font-size: .875rem; }
.bg-crumbs li { display: inline-flex; align-items: center; gap: .5rem; }
.bg-crumbs li + li::before { content: "/"; color: var(--bg-rule); }
.bg-crumbs a { color: var(--bg-ink); text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.bg-crumbs a:hover { color: var(--bg-blue); text-decoration: underline; }
.bg-crumbs [aria-current] { color: var(--bg-ink-strong); }
@media (max-width: 767px) { .bg-crumbs__current { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

.bg-guides .bg-section-title { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem); margin-bottom: 1.1rem; }
/* In-text links carry an underline, not colour alone (WCAG 1.4.1); the kit strips underlines site-wide. */
.bg-guides .bg-prose a, .bg-guides .bg-faq__a a, .bg-guides .bg-callout a, .bg-guides .bg-sources a, .bg-guides .bg-answer a, .bg-guides .bg-strip__services a, .bg-guides .bg-topic__desc a, .bg-guides .bg-next__read a { text-decoration: underline; text-decoration-thickness: 1px; }
.bg-guides .bg-prose a:hover, .bg-guides .bg-faq__a a:hover, .bg-guides .bg-sources a:hover, .bg-guides .bg-strip__services a:hover { text-decoration-thickness: 2px; }

/* ---------- Hub ---------- */
.bg-hub__head { background: var(--bg-sky-wash); padding: clamp(1.5rem, 4vw, 3.5rem) 0 clamp(1.5rem, 3.5vw, 2.75rem); }
.bg-hub__title { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.2rem); }
.bg-hub__lead { max-width: 58ch; margin: 1rem 0 0; font-size: clamp(1.05rem, 1rem + .35vw, 1.22rem); color: var(--bg-ink-strong); }
.bg-hub__jump ul { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; }
.bg-hub__jump a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--bg-navy); }

/* The one bold device on the hub: a full-bleed navy band holding the pillar guides. */
.bg-band { background: var(--bg-navy); color: var(--bg-paper); padding: clamp(2rem, 5vw, 3.25rem) 0; }
.bg-guides .bg-band__title { color: var(--bg-paper); font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem); margin-bottom: 1.5rem; max-width: 30ch; }
.bg-band__grid { display: grid; gap: 0; }
@media (min-width: 900px) { .bg-band__grid { grid-template-columns: repeat(3, 1fr); } }
.bg-pillar { position: relative; padding: 1.25rem 0; border-top: 1px solid color-mix(in srgb, var(--bg-sky) 55%, var(--bg-navy)); }
@media (min-width: 900px) {
	.bg-pillar { padding: 0 1.75rem; border-top: 0; border-left: 1px solid color-mix(in srgb, var(--bg-sky) 55%, var(--bg-navy)); }
	.bg-pillar:first-child { padding-left: 0; border-left: 0; }
}
.bg-pillar__title { font-family: var(--bg-font-head) !important; font-size: clamp(1.35rem, 1.1rem + .9vw, 1.7rem) !important; line-height: 1.22 !important; }
.bg-pillar__title a { color: var(--bg-paper); text-decoration: none; }
.bg-pillar__title a::after { content: ""; position: absolute; inset: 0; }
.bg-pillar__title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.bg-pillar:focus-within { outline: 3px solid var(--bg-sky); outline-offset: 4px; }
.bg-pillar__title a:focus-visible { outline: none; }
.bg-pillar__summary { margin: .75rem 0 0; color: color-mix(in srgb, var(--bg-paper) 88%, var(--bg-navy)); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bg-pillar__meta { margin: .75rem 0 0; font-size: .85rem; color: var(--bg-sky); }

/* Topic sections: heading column beside ruled index rows */
.bg-topic { padding-top: clamp(2.25rem, 5vw, 3.5rem); scroll-margin-top: var(--bg-header-offset); display: grid; gap: .75rem 3rem; }
@media (min-width: 900px) { .bg-topic { grid-template-columns: minmax(14rem, 1fr) 2.4fr; align-items: start; } }
.bg-topic__title { font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2rem); }
.bg-topic__title a { color: inherit; text-decoration: none; }
.bg-topic__title a:hover { text-decoration: underline; }
.bg-topic__desc { margin: .6rem 0 0; max-width: 34ch; }

.bg-rows { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--bg-navy); }
.bg-row { position: relative; display: grid; gap: .3rem 1.5rem; padding: 1rem 0 1.05rem; border-bottom: 1px solid var(--bg-rule); }
@media (min-width: 640px) { .bg-row { grid-template-columns: 1fr auto; } .bg-row__meta { grid-column: 2; grid-row: 1; } .bg-row__summary { grid-column: 1; } }
.bg-guides .bg-row__title { font-family: var(--bg-font-body); font-weight: 600; font-size: 1.12rem; line-height: 1.35; letter-spacing: 0; }
.bg-row__title a { color: var(--bg-navy); text-decoration: none; }
.bg-row__title a::after { content: ""; position: absolute; inset: 0; }
.bg-row:hover .bg-row__title a { text-decoration: underline; text-decoration-thickness: 2px; }
.bg-row:focus-within { outline: 3px solid var(--bg-blue); outline-offset: 2px; }
.bg-row__title a:focus-visible { outline: none; }
.bg-row__summary { margin: 0; font-size: .97rem; max-width: 62ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bg-row__meta { margin: 0; font-size: .85rem; white-space: nowrap; }
.bg-rows--solo { max-width: 920px; }
.bg-hub--topic .bg-hub__head + .bg-wrap { padding-top: clamp(1.5rem, 4vw, 2.5rem); }

.bg-back { margin: 2.5rem 0 0; }
.bg-empty { padding: 2rem 0; }

/* Service strip: the site's own sand band */
.bg-strip { margin-top: clamp(3rem, 7vw, 5rem); background: var(--bg-sand); padding: clamp(2rem, 5vw, 3rem) 0; }
.bg-strip__inner { width: min(1200px, 100% - 2rem); margin-inline: auto; display: grid; gap: 1rem; justify-items: start; }
.bg-strip__title { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.bg-strip__lead { margin: .5rem 0 0; max-width: 60ch; }
.bg-strip__inner { gap: 1.5rem; justify-items: stretch; }
.bg-shops { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 2px solid var(--bg-navy); }
@media (min-width: 720px) { .bg-shops { grid-template-columns: repeat(3, 1fr); } .bg-shop + .bg-shop { border-left: 1px solid var(--bg-rule); padding-left: 1.5rem; } }
.bg-shop { display: grid; gap: .15rem; padding: 1rem 0; border-bottom: 1px solid var(--bg-rule); }
@media (min-width: 720px) { .bg-shop { border-bottom: 0; } }
.bg-shop__town { font-family: var(--bg-font-head); font-size: 1.45rem; color: var(--bg-navy) !important; text-decoration: none; line-height: 1.2; }
.bg-shop__town:hover { text-decoration: underline; }
.bg-shop__tel { justify-self: start; margin-top: .5rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bg-btn__tel { white-space: nowrap; }
.bg-strip__services { margin: 0; max-width: 70ch; }
.bg-btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1.4rem;
	background: var(--bg-navy); color: var(--bg-paper) !important; border-radius: 999px; font-weight: 600; text-decoration: none !important;
}
.bg-btn:hover { background: var(--bg-blue); }

/* ---------- Article ---------- */
.bg-article__head { padding: clamp(1.25rem, 3.5vw, 2.75rem) 0 clamp(1.25rem, 2.5vw, 2rem); border-bottom: 1px solid var(--bg-rule); }
.bg-article__title { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); max-width: 26ch; }
.bg-article__meta { margin: 1rem 0 0; font-size: .92rem; max-width: 62ch; }

.bg-article__layout { display: grid; gap: clamp(1.25rem, 3vw, 3.5rem); padding-top: clamp(1.25rem, 3vw, 2.5rem); }
.bg-article__main { min-width: 0; max-width: var(--bg-measure); }

/* TOC: collapsed list above the answer on mobile; sticky rail on desktop */
.bg-toc { font-size: .93rem; }
.bg-toc__details { border: 1px solid var(--bg-rule); border-radius: var(--bg-radius); padding: .25rem 1rem; background: var(--bg-paper); }
.bg-toc__title { cursor: pointer; font-weight: 600; color: var(--bg-navy); min-height: 44px; display: flex; align-items: center; justify-content: space-between; list-style: none; }
.bg-toc__title::-webkit-details-marker { display: none; }
.bg-toc__title::after, .bg-faq__q::after { content: ""; width: .85rem; height: .85rem; flex: none; background: linear-gradient(var(--bg-blue), var(--bg-blue)) center / 100% 2px no-repeat, linear-gradient(var(--bg-blue), var(--bg-blue)) center / 2px 100% no-repeat; transition: transform .2s var(--bg-ease); }
.bg-toc__details[open] .bg-toc__title::after { transform: rotate(45deg); }
.bg-toc__list { list-style: none; margin: .25rem 0 .75rem; padding: 0; }
.bg-toc__list li + li { border-top: 1px solid color-mix(in srgb, var(--bg-rule) 60%, var(--bg-paper)); }
.bg-toc__list a { color: var(--bg-ink); text-decoration: none; display: block; padding: .3rem 0; line-height: 1.4; }
.bg-toc__list a:hover { color: var(--bg-navy); text-decoration: underline; }
.bg-toc__list a[aria-current="location"] { color: var(--bg-navy); font-weight: 600; }
@media (min-width: 1024px) {
	.bg-article__layout { grid-template-columns: 15.5rem minmax(0, var(--bg-measure)); }
	.bg-toc { position: sticky; top: var(--bg-header-offset); align-self: start; max-height: calc(100vh - var(--bg-header-offset) - 1.5rem); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bg-rule) transparent; padding-right: .5rem; }
	.bg-toc__details { border: 0; padding: 0; border-radius: 0; background: transparent; }
	.bg-toc__title { pointer-events: none; min-height: 0; margin-bottom: .6rem; list-style: none; }
	.bg-toc__title::after { content: none; }
	.bg-toc__title::-webkit-details-marker { display: none; }
}

/* The one bold device on the article: the answer-first box */
.bg-answer {
	background: var(--bg-sky-wash); border: 2px solid var(--bg-navy);
	border-radius: var(--bg-radius); padding: 1.35rem 1.5rem 1.4rem; margin-bottom: 2.25rem;
}
.bg-answer__title { font-family: var(--bg-font-body) !important; font-size: .95rem !important; font-weight: 600; color: var(--bg-navy); margin-bottom: .45rem !important; letter-spacing: 0 !important; }
.bg-answer__text { margin: 0; font-size: 1.15rem; line-height: 1.55; color: var(--bg-ink-strong); }
.bg-answer__points { margin: 1rem 0 0; padding-left: 1.2rem; display: grid; gap: .4rem; }

/* Prose */
.bg-prose > * + * { margin-top: 1.1em; }
.bg-prose h2 { font-size: clamp(1.45rem, 1.2rem + .9vw, 1.85rem); margin-top: 2.2em; scroll-margin-top: var(--bg-header-offset); }
.bg-prose h3 { font-size: 1.15rem; margin-top: 1.7em; }
.bg-prose p, .bg-prose li { color: var(--bg-ink); }
.bg-prose strong { color: var(--bg-ink-strong); }
.bg-prose ul, .bg-prose ol { padding-left: 1.3rem; }
.bg-prose li + li { margin-top: .35em; }
.bg-prose blockquote { margin: 1.5em 0; padding: .9rem 1.1rem; border-block: 1px solid var(--bg-rule); font-size: 1.08em; color: var(--bg-ink-strong); }
.bg-prose img { max-width: 100%; height: auto; border-radius: var(--bg-radius); }

/* Tables scroll inside their own region, never the page */
.bg-table { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--bg-rule); border-radius: var(--bg-radius); -webkit-overflow-scrolling: touch;
	background:
		linear-gradient(to right, var(--bg-paper) 30%, transparent) left / 2rem 100% no-repeat local,
		linear-gradient(to left, var(--bg-paper) 30%, transparent) right / 2rem 100% no-repeat local,
		radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / .14), transparent) left / .8rem 100% no-repeat scroll,
		radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / .14), transparent) right / .8rem 100% no-repeat scroll;
}
.bg-table:focus-visible { outline: 3px solid var(--bg-blue); }
.bg-prose table { border-collapse: collapse; width: 100%; min-width: 32rem; font-size: .95rem; margin: 0; }
.bg-prose th, .bg-prose td { text-align: left; vertical-align: top; padding: .7rem .85rem; border-bottom: 1px solid var(--bg-rule); }
.bg-prose thead th { background: var(--bg-navy); color: var(--bg-paper); font-weight: 600; }
.bg-prose tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-sand) 55%, var(--bg-paper)); }
.bg-prose caption { caption-side: top; text-align: left; padding: .6rem .85rem; font-weight: 600; color: var(--bg-navy); }

/* Boundary callout */
.bg-callout { margin: 2rem 0; padding: 1.1rem 1.25rem; border: 0; border-radius: var(--bg-radius); background: var(--bg-sand); }
.bg-callout p { margin: 0; }
.bg-callout p + p { margin-top: .4rem; }
.bg-guides .bg-callout__title { font-family: var(--bg-font-body); font-size: 1.05rem; font-weight: 700; line-height: 1.35; color: var(--bg-navy); margin-bottom: .35rem; letter-spacing: 0; }

/* FAQ */
.bg-faq { margin-top: 2.75rem; scroll-margin-top: var(--bg-header-offset); }
.bg-faq h2 { font-size: clamp(1.45rem, 1.2rem + .9vw, 1.85rem); margin-bottom: 1rem; }
.bg-faq__item { border-top: 1px solid var(--bg-rule); }
.bg-faq__item:last-of-type { border-bottom: 1px solid var(--bg-rule); }
.bg-faq__q {
	cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
	min-height: 48px; padding: .85rem 0; font-weight: 600; color: var(--bg-navy);
}
.bg-faq__q::-webkit-details-marker { display: none; }

.bg-faq__item[open] .bg-faq__q::after { transform: rotate(45deg); }
.bg-faq__a { padding: 0 0 1rem; }
.bg-faq__a p { margin: 0; }

/* Where to next */
.bg-next { margin-top: 2.75rem; }
.bg-next h2 { font-size: 1.35rem; margin-bottom: .9rem; }
.bg-next__read { margin: 0 0 1rem; }
.bg-next__act { margin: 0; }

/* Sources: visible, dated */
.bg-sources { margin-top: 2.75rem; padding-top: 1.25rem; border-top: 2px solid var(--bg-sky); font-size: .9rem; scroll-margin-top: var(--bg-header-offset); }
.bg-sources h2 { font-size: 1.25rem; margin-bottom: .6rem; }
.bg-sources__list { padding-left: 1.3rem; display: grid; gap: .45rem; max-width: 62ch; }
.bg-sources__list a { word-break: break-word; }

/* Related */
.bg-related { margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--bg-rule); }

@media (prefers-reduced-motion: reduce) {
	.bg-guides *, .bg-guides *::before, .bg-guides *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
	.bg-toc, .bg-strip, .bg-related, .bg-next, .bg-hub__jump { display: none !important; }
	.bg-article__layout { display: block; }
	.bg-band { background: none; color: inherit; }
	.bg-faq__item, .bg-table, .bg-callout { break-inside: avoid; }
	.bg-sources__list a::after { content: " (" attr(href) ")"; color: var(--bg-ink); }
}
