/* Home page "Blog" section (partials/home-blog-slider.blade.php). Dark default; light follows the site switch. */

.hb {
	--hb-card: #121212;
	--hb-line: rgba(239, 237, 234, .14);
	--hb-text: #efedea;
	--hb-title: #d6d3ce;
	--hb-muted: #919191;
	--hb-accent: #bf4a1a;
	--hb-accent-text: #f5533a;
	--hb-gap: 30px;
	--hb-per-view: 3;
}
body.tt-lightmode-on .hb {
	--hb-card: #f8f8f8;
	--hb-line: rgba(20, 19, 18, .2);
	--hb-text: #141312;
	--hb-title: #333;
	--hb-muted: #666;
	--hb-accent-text: #a33c12;
}

/* Heading row: "View all posts" right-aligned on desktop, below the heading on phones */
.hb-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px 32px;
	flex-wrap: wrap;
	margin-bottom: 60px;
}
.hb-head .blogs-heading { margin: 0; }
.hb-all-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
	padding: 12px 24px;
	border: 1px solid var(--hb-line);
	border-radius: 999px;
	color: var(--hb-text) !important;
	font-family: var(--tt-body-font);
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color .2s, color .2s, border-color .2s;
}
.hb-all-link:hover { background: var(--hb-accent); border-color: var(--hb-accent); color: #fff !important; }
.hb-empty { color: var(--hb-muted); font-size: 18px; }

/* Slider: a native scroll-snap row (works without JavaScript) */
.hb-slider { position: relative; }
.hb-track {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 0;
	-webkit-overflow-scrolling: touch;
	padding: 6px 0 18px;
	scrollbar-width: thin;
	scrollbar-color: var(--hb-line) transparent;
}
.hb-js .hb-track { scrollbar-width: none; }
.hb-js .hb-track::-webkit-scrollbar { display: none; }
.hb-track:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 6px; border-radius: 16px; }
.hb-list {
	display: flex;
	gap: var(--hb-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}
.hb-slide {
	flex: 0 0 calc((100% - (var(--hb-per-view) - 1) * var(--hb-gap)) / var(--hb-per-view));
	display: flex; /* cards fill the slide, so every card in the row is the same height */
	min-width: 0; /* don't let the image or the one-line meta row widen the slide */
	margin: 0;
	scroll-snap-align: start;
}

/* Card: full cover image, one meta row, the button pinned to the bottom */
.hb-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--hb-line);
	border-radius: 16px;
	background: var(--hb-card);
	transition: transform .3s ease, box-shadow .3s ease;
}
.hb-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(0, 0, 0, .25); }
.hb-image { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: rgba(130, 130, 130, .12); }
.hb-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center; /* covers are square; anything taller is trimmed at the bottom, never the top */
	transition: transform .6s ease;
}
.hb-card:hover .hb-image img { transform: scale(1.03); }
.hb-body { display: flex; flex: 1; flex-direction: column; padding: 24px 26px 26px; }
.hb-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	color: var(--hb-muted);
	font-family: var(--tt-body-font);
	font-size: 14px;
	line-height: 1.4;
}
.hb-tags {
	/* one line only: a tag that doesn't fit wraps onto the hidden second line, so only whole tags show */
	display: flex;
	flex-wrap: wrap;
	gap: 0 14px;
	min-width: 0;
	height: 1.4em;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow: hidden;
}
.hb-tags li { position: relative; max-width: 100%; margin: 0; padding-left: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hb-tags li::before { content: ''; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: currentColor; }
.hb-date { flex: none; margin-left: auto; white-space: nowrap; }
.hb-title { margin: 0 0 22px; font-family: var(--tt-body-font); font-size: 21px; font-weight: 500; line-height: 1.4; }
.hb-title a { color: var(--hb-title) !important; text-decoration: none; }
.hb-title a::after { content: ''; } /* keep the theme's link underline effects off */
.hb-title a:hover { color: var(--hb-text) !important; }
.hb-read {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	justify-content: center;
	margin-top: auto; /* pinned to the bottom, so buttons line up across cards */
	min-width: 140px;
	min-height: 43px;
	padding: 10px 22px;
	border: 2px solid var(--hb-text);
	border-radius: 30px;
	color: var(--hb-text) !important;
	font-family: var(--tt-body-font);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	transition: background-color .25s, color .25s;
}
.hb-read:hover { background: var(--hb-text); color: var(--hb-card) !important; }

/* Last card: See all articles */
.hb-card-all {
	align-items: flex-start;
	justify-content: flex-end;
	gap: 10px;
	min-height: 100%;
	padding: 32px 30px;
	color: var(--hb-text) !important;
	text-decoration: none;
	background:
		radial-gradient(circle at 85% 15%, rgba(191, 74, 26, .28), transparent 55%),
		var(--hb-card);
}
.hb-all-count { font-family: var(--tt-alter-font); font-size: clamp(90px, 9vw, 140px); font-weight: 800; line-height: .85; color: var(--hb-accent-text); }
.hb-all-text { font-family: var(--tt-body-font); font-size: 22px; font-weight: 600; }
.hb-all-arrow {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	margin-top: 8px;
	border-radius: 50%;
	background: var(--hb-accent);
	color: #fff;
	font-size: 22px;
	transition: transform .25s;
}
.hb-card-all:hover .hb-all-arrow { transform: translateX(4px); }

/* Controls: round previous / next buttons and "1–3 of 6" */
.hb-controls { display: flex; align-items: center; justify-content: flex-start; gap: 16px; margin-top: 18px; } /* left: clear of the site's scroll-to-top button */
.hb-controls[hidden] { display: none; }
.hb-status { margin: 0 4px; min-width: 110px; text-align: center; color: var(--hb-muted); font-family: var(--tt-body-font); font-size: 15px; font-variant-numeric: tabular-nums; }
.hb-arrow {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 1px solid var(--hb-line);
	border-radius: 50%;
	background: transparent;
	color: var(--hb-text);
	cursor: pointer;
	transition: background-color .2s, border-color .2s, color .2s, opacity .2s;
}
.hb-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hb-arrow:hover:not(:disabled) { background: var(--hb-accent); border-color: var(--hb-accent); color: #fff; }
.hb-arrow:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 3px; }
.hb-arrow:disabled { opacity: .35; cursor: default; }

@media (max-width: 1024px) {
	.hb { --hb-per-view: 2.2; --hb-gap: 20px; }
}
@media (max-width: 767px) {
	.hb { --hb-per-view: 1.2; --hb-gap: 16px; }
	.hb-head { flex-direction: column; align-items: flex-start; margin-bottom: 36px; }
	.hb-all-link { margin-bottom: 0; }
	.hb-body { padding: 20px 20px 22px; }
	.hb-title { font-size: 19px; }
	.hb-controls { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
	.hb-card, .hb-image img, .hb-all-arrow { transition: none; }
}
