/* Icon row of the categories under the header (theme 1.4.0, design: Lori). Markup: template-parts/layout/category-bar.php, script: assets/js/catbar.js. */
.tbg-catbar {
	--catbar-item: clamp(74px, calc((100vw - var(--gutter) - 16px) / 4.45), 100px); /* phone: four tiles and almost half of the fifth, the peek says "scroll" */
	background: var(--c-mint);
	border-bottom: 1px solid var(--c-border-soft);
}
.tbg-catbar__scroll {
	--fade-l: 0px; --fade-r: 0px; /* set by JS: a soft edge only on the side that still has tiles */
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scroll-padding-inline: var(--gutter);
	scrollbar-width: none;
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
	mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}
.tbg-catbar__scroll::-webkit-scrollbar { display: none; }
.tbg-catbar__list {
	display: flex;
	gap: 4px;
	width: max-content;     /* wider than the screen: scrolls. narrower: centered, see min-width + justify-content */
	min-width: 100%;
	justify-content: center;
	padding: 8px var(--gutter);
}
.tbg-catbar__item { flex: 0 0 var(--catbar-item); scroll-snap-align: start; }
.tbg-catbar__link {
	display: flex; flex-direction: column; align-items: center; gap: 6px;
	height: 100%; padding: 10px 4px 8px;
	border-radius: var(--radius-card);
	text-align: center;
	transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* The Elementor kit sets a yellow link colour and its own font on legacy pages (see the note under "Header" in main.css): same fix as the header menu. */
body .tbg-catbar__link { color: var(--c-green-800); font-family: var(--font); }
.tbg-catbar__icon { display: flex; flex: none; width: 34px; height: 34px; color: var(--c-green-700); transition: color var(--dur) var(--ease); }
.tbg-catbar__icon svg { width: 100%; height: 100%; }
.tbg-catbar__label {
	display: flex; align-items: flex-start; justify-content: center;
	min-height: 2.5em;      /* two lines reserved, so every icon sits on the same line */
	font-size: 14px; font-weight: 700; line-height: 1.25;
	text-wrap: balance;
}
@media (hover: hover) {
	.tbg-catbar__link:hover { background: var(--c-white); box-shadow: var(--shadow-card); }
}
.tbg-catbar__link:active { background: var(--c-white); }
body .tbg-catbar__link[aria-current] { background: var(--c-green-700); color: var(--c-white); box-shadow: none; }
.tbg-catbar__link[aria-current] .tbg-catbar__icon { color: var(--c-white); }
/* Dark green ring, not the site orange: orange is only 2.4:1 on the mint band, a dark green ring is 11:1. */
.tbg-catbar__link:focus-visible { outline: 3px solid var(--c-green-900); outline-offset: 2px; border-radius: var(--radius-card); }
@media (max-width: 374px) {
	.tbg-catbar { --catbar-item: calc((100vw - var(--gutter) - 12px) / 3.45); } /* small phones: three tiles and almost half of the fourth, so long labels keep two lines */
}
@media (min-width: 768px) {
	.tbg-catbar { --catbar-item: clamp(88px, 8.6vw, 124px); }
	.tbg-catbar__list { padding-block: 10px; }
	.tbg-catbar__link { gap: 8px; padding: 12px 6px 10px; }
	.tbg-catbar__icon { width: 40px; height: 40px; }
	.tbg-catbar__label { font-size: 15px; }
}
/* Windows high contrast removes backgrounds: the current tile keeps a visible frame. */
@media (forced-colors: active) {
	.tbg-catbar__link[aria-current] { outline: 3px solid Highlight; outline-offset: -3px; }
}
/* Mouse users on a narrow laptop or tablet window: a thin scrollbar, since there is no swipe. */
@media (hover: hover) and (pointer: fine) and (max-width: 1023px) {
	.tbg-catbar__scroll { scrollbar-width: thin; scrollbar-color: var(--c-border-mid) transparent; }
	.tbg-catbar__scroll::-webkit-scrollbar { display: block; height: 8px; }
	.tbg-catbar__scroll::-webkit-scrollbar-thumb { background: var(--c-border-mid); border-radius: 4px; }
}

/* Top of a category page (template-parts/category-head.php). */
.tbg-breadcrumbs { margin: 14px 0 10px; font-size: 13px; color: var(--c-green-muted); }
.tbg-breadcrumbs a { color: var(--c-green-700); }
.tbg-breadcrumbs a:hover { text-decoration: underline; }
.tbg-cathead { padding: 4px 0 8px; }
.tbg-cathead__main {
	display: grid; align-items: center; column-gap: 14px; row-gap: 10px;
	grid-template-columns: auto 1fr;
	grid-template-areas: "icon title" "lead lead";
}
.tbg-cathead__icon {
	grid-area: icon;
	display: flex; align-items: center; justify-content: center;
	width: 56px; height: 56px; border-radius: 16px;
	background: var(--c-green-700); color: var(--c-white); /* the same dark tile as the active item in the row above */
}
.tbg-cathead__icon svg { width: 34px; height: 34px; }
.tbg-cathead__title { grid-area: title; }
.tbg-cathead__lead { grid-area: lead; max-width: 68ch; font-size: 16px; line-height: 1.65; }
.tbg-cathead__lead p + p { margin-top: 10px; }
.tbg-cathead__subs { margin-top: 20px; }
.tbg-cathead__subs-title { margin: 0 0 8px; font-weight: 800; color: var(--c-green-700); }
/* The chips are the existing .tbg-places chips (theme), unchanged except a 40px minimum height for touch and no inner scroll. */
.tbg-cathead__subs .tbg-places__list { max-height: none; overflow: visible; } /* the live 168px inner scroll cuts the last row of 40px chips */
.tbg-cathead__subs .tbg-places__chip { min-height: 40px; }
@media (min-width: 768px) {
	.tbg-cathead { padding-top: 8px; }
	.tbg-cathead__main { column-gap: 22px; grid-template-areas: "icon title" "icon lead"; align-items: start; row-gap: 8px; }
	.tbg-cathead__icon { width: 88px; height: 88px; border-radius: 24px; grid-row: 1 / span 2; }
	.tbg-cathead__icon svg { width: 54px; height: 54px; }
	.tbg-cathead__title { align-self: end; }
	.tbg-cathead__lead { font-size: 18px; }
	.tbg-cathead__subs { margin-top: 26px; }
}

/* Questions and answers of a category page (template-parts/category-faq.php). */
.tbg-catfaq { margin: 44px 0 20px; max-width: 820px; }
.tbg-catfaq__title { font-size: clamp(22px, 1.4vw + 16px, 30px); font-weight: 800; margin: 0 0 14px; }
.tbg-catfaq__item { border: 1px solid var(--c-border-soft); border-radius: 14px; background: #fff; margin: 0 0 10px; }
.tbg-catfaq__item summary { cursor: pointer; list-style: none; padding: 14px 18px; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 48px; }
.tbg-catfaq__item summary::-webkit-details-marker { display: none; }
.tbg-catfaq__item summary::after { content: '+'; flex: none; font-size: 22px; line-height: 1; color: var(--c-green-700); }
.tbg-catfaq__item[open] summary::after { content: '−'; }
.tbg-catfaq__item summary:focus-visible { outline: 3px solid var(--c-green-900); outline-offset: 2px; border-radius: 14px; }
.tbg-catfaq__answer { padding: 0 18px 16px; line-height: 1.7; max-width: 68ch; }
.tbg-catfaq__answer a { color: var(--c-green-700); text-decoration: underline; }
