/* Category Tiles 1.0 - https://ocmod.net
   The same block as the approved home page markup: one large tile, four small
   ones, the rest behind the "all categories" button. Colours come from the
   theme tokens when the theme declares them, otherwise from the fallbacks. */
.hcat-wrap {
	max-width: 1580px;
	margin: 0 auto;
	padding: 0 15px;
}
.hcat {
	padding: 24px 0 8px;
}
/* 12px gutter instead of the Bootstrap 30px: the tiles read as one block */
.hcat .row { margin-left: -6px; margin-right: -6px; }
.hcat .row > [class*="col-"] { padding-left: 6px; padding-right: 6px; }

.hcat-tile {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	margin-bottom: 12px;
	overflow: hidden;
	border-radius: 14px;
	background: var(--color-surface-muted, #eeeeee);
	box-shadow: var(--shadow-sm, 0 1px 4px rgba(0, 0, 0, .08));
	transition: var(--transition-card, box-shadow .7s ease, border-color .7s ease);
}
.hcat-tile img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .7s ease;
}
/* Darkened bottom edge keeps the white caption readable on any photo */
.hcat-tile::after {
	content: "";
	position: absolute;
	inset: 45% 0 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .62));
	pointer-events: none;
}
.hcat-name {
	position: absolute;
	left: 18px;
	right: 18px;
	bottom: 16px;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	padding-bottom: 8px;
	color: var(--color-text-inverse, #fff);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
/* Orange dot before the name, as on the original site */
.hcat-name::before {
	content: "";
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--color-accent, #ff7300);
}
/* The line under the name grows on hover, carried over from the original site */
.hcat-name::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 32px;
	height: 3px;
	border-radius: 2px;
	background: var(--color-brand, #18b316);
	transition: width .4s ease;
}
.hcat-tile:hover,
.hcat-tile:focus-visible {
	box-shadow: var(--shadow-card-hover, 0 10px 26px rgba(0, 0, 0, .07));
}
.hcat-tile:hover img,
.hcat-tile:focus-visible img { transform: scale(1.04); }
.hcat-tile:hover .hcat-name::after,
.hcat-tile:focus-visible .hcat-name::after { width: 100%; }
.hcat-tile:focus-visible {
	outline: none;
	box-shadow: var(--shadow-focus, 0 0 0 3px rgba(24, 179, 22, .23)), var(--shadow-card-hover, 0 10px 26px rgba(0, 0, 0, .07));
}
.hcat-tile-main .hcat-name {
	left: 24px;
	bottom: 22px;
	font-size: 26px;
}

/* "All categories / Collapse" button */
.hcat-toggle-wrap {
	padding-top: 12px;
	text-align: center;
}
.hcat-toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 11px 24px;
	border: 0;
	border-radius: var(--radius-pill, 999px);
	background: var(--color-primary, #1c9a1a);
	color: var(--color-on-primary, #fff);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	box-shadow: 0 6px 16px rgba(24, 179, 22, .28);
	transition: background .2s ease;
}
.hcat-toggle:hover { background: var(--color-primary-dark, #178516); }
.hcat-toggle:focus { outline: none; }
.hcat-toggle:focus-visible { box-shadow: var(--shadow-focus, 0 0 0 3px rgba(24, 179, 22, .23)); }
.hcat-toggle-arrow {
	flex: 0 0 auto;
	transition: transform .3s ease;
}
/* Bootstrap puts .collapsed on the closed button; the label follows it */
.hcat-toggle-close,
.hcat-toggle.collapsed .hcat-toggle-open { display: inline; }
.hcat-toggle-open,
.hcat-toggle.collapsed .hcat-toggle-close { display: none; }
.hcat-toggle:not(.collapsed) .hcat-toggle-arrow { transform: rotate(180deg); }

/* Desktop: the large tile is as tall as two rows of small ones */
@media (min-width: 992px) {
	.hcat-row { display: flex; }
	.hcat-row::before,
	.hcat-row::after { display: none; }   /* the Bootstrap clearfix would become a flex item */
	.hcat-col-main { display: flex; }
	.hcat-tile-main {
		flex: 1 1 auto;
		aspect-ratio: auto;
	}
}
@media (max-width: 991px) {
	.hcat-tile-main { aspect-ratio: 16 / 9; }
	.hcat-tile-main .hcat-name { font-size: 22px; }
}
@media (max-width: 575px) {
	.hcat { padding-top: 16px; }
	.hcat .row { margin-left: -4px; margin-right: -4px; }
	.hcat .row > [class*="col-"] { padding-left: 4px; padding-right: 4px; }
	.hcat-tile { margin-bottom: 8px; border-radius: 12px; }
	.hcat-name { left: 12px; right: 12px; bottom: 10px; gap: 6px; padding-bottom: 6px; font-size: 15px; }
	.hcat-name::before { width: 6px; height: 6px; }
	.hcat-tile-main .hcat-name { left: 16px; bottom: 14px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
	.hcat-tile img,
	.hcat-name::after,
	.hcat-toggle-arrow { transition: none; }
}

/* Without Bootstrap CSS the hidden part still stays hidden until opened */
.hcat .collapse:not(.in) { display: none; }
.hcat-more-open { display: block; }
