/* =========================================================================
   Ziban Clinic — blog.css
   Magazine listing (posts index + category archives): category tabs,
   featured band and post cards. Depends on main.css (tokens, chrome).
   ========================================================================= */

/* =========================================================================
   Scoped reset for the magazine section.
   Everything inside main.zbpg-blog starts from zero: browser defaults,
   WP-core leftovers and parent-theme leaks (heading margins, list
   paddings, link colors, media sizing) are neutralized once here, so
   component rules never fight inherited surprises again.
   :where() keeps specificity at 0 — any class rule overrides it.
   ========================================================================= */
.zbpg-blog :where(*, *::before, *::after) {
	box-sizing: border-box;
}

.zbpg-blog :where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, address, dl, dd) {
	margin: 0;
	padding: 0;
	font: inherit;
}

.zbpg-blog :where(ul, ol) {
	margin: 0;
	padding: 0;
	list-style: none;
}

.zbpg-blog :where(a) {
	color: inherit;
	text-decoration: none;
}

.zbpg-blog :where(img, video) {
	display: block;
	max-width: 100%;
	height: auto;
}

.zbpg-blog :where(button, input, select, textarea) {
	margin: 0;
	font: inherit;
	color: inherit;
}

.zbpg-blog :where(hr) {
	margin: 0;
	border: 0;
}

body {
	font-family: var(--z-font);
}

.zbpg-blog {
	background: #fff;
	/* Top spacing lives HERE (not as first-child margins): children's
	   top margins would collapse through this container and expose the
	   gray body background as a stray band under the header. */
	padding-top: clamp(24px, 3vw, 44px);
	padding-bottom: clamp(40px, 5vw, 56px);
}

.zbpg-wrap {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
}

/* ---- Block 1: page title + tabs ---- */
.zbpg-title {
	font-size: clamp(19px, 2.2vw, 25px);
	font-weight: 700;
	color: #000;
	line-height: 1.7;
}

.zbpg-head {
	padding-top: clamp(28px, 4vw, 64px);
	margin-bottom: 24px;
}

.zbt-tabs-wrap {
	/* allows the tabs row to scroll horizontally on overflow */
	max-width: 100%;
}

.zbt-tabs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding-block: 4px;
}

.zbt-tabs::-webkit-scrollbar {
	display: none;
}

.zbt-tab {
	flex: 0 0 164px;
	min-width: 120px;
	height: 77px;
	border-radius: 12px;
	background: #f4f5f7;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	text-align: start;
	scroll-snap-align: start;
	font-family: inherit;
}

.zbt-tab:focus-visible {
	outline: 3px solid #1e88e5;
	outline-offset: 2px;
}

.zbt-tab__name {
	font-size: 16px;
	font-weight: 600;
	color: #444;
	line-height: 1.6;
	white-space: nowrap;
}

.zbt-tab__count {
	font-size: 12px;
	font-weight: 400;
	color: #9e9e9e;
	line-height: 1.6;
	white-space: nowrap;
}

.zbt-tab.is-active {
	/* Figma: #1789E5 @ 10% — flat tint, no gradient */
	background: #1789E51A;
}

.zbt-tab.is-active .zbt-tab__name {
	color: #1e88e5;
}

.zbt-tab.is-active .zbt-tab__count {
	color: #6b8fb5;
}

/* mobile-only expander (desktop strip scrolls instead) */
.zbt-more {
	display: none;
}

/* ---- Block 2: featured band ---- */
.zbf-wrap {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
}

.zbf-featured {
	background: #f4f5f7;
	padding: 56px 0;
	margin-top: 0;
}

/* rhythm when the band follows the category-page title */
.zbpg-head + .zbf-featured {
	margin-top: 32px;
}

/* gap between the featured band and the posts area (band is optional) */
.zbf-featured + .zbpg-wrap {
	margin-top: clamp(28px, 3vw, 48px);
}

.zbf-title {
	font-size: clamp(19px, 2.2vw, 25px);
	font-weight: 700;
	color: #000;
	line-height: 1.7;
	margin-bottom: 4px;
}

.zbf-subtitle {
	font-size: clamp(14px, 1.5vw, 20px);
	font-weight: 400;
	color: #9e9e9e;
	line-height: 1.8;
	margin-bottom: 24px;
}

.zbf-head {
	margin-bottom: 24px;
}

.zbf-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

/* ---- Post card ---- */
.zbc-card {
	position: relative;
	background: #fff;
	border: 1px solid #eceef1;
	border-radius: 16px;
	padding: clamp(12px, 1.4vw, 14px);
	display: flex;
	flex-direction: column;
}

.zbc-card__img {
	width: 100%;
	aspect-ratio: 220 / 165;
	border-radius: 12px;
	object-fit: cover;
	display: block;
	background: #f4f5f7;
}

.zbc-card__img--ph {
	background-image: repeating-conic-gradient(#eceef1 0% 25%, #f7f8fa 0% 50%);
	background-size: 16px 16px;
}

.zbc-card__title {
	font-size: clamp(14px, 1.4vw, 15px);
	font-weight: 400;
	color: #333;
	line-height: 1.9;
	text-align: start;
	margin-top: 16px;
	margin-bottom: 12px;
	/* two reserved lines keep dividers/footers aligned across cards */
	min-height: calc(2 * 1.9em);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* whole-card stretched link */
.zbc-card__link {
	color: #616161;
	text-decoration: none;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.7;
}

.zbc-card__link::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.zbc-card__link:focus-visible {
	outline: 3px solid #1e88e5;
	outline-offset: 2px;
}

.zbc-card__divider {
	height: 1px;
	background: #e6e8ec;
	margin-top: auto;
}

.zbc-card__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 12px;
	font-size: clamp(11px, 1.2vw, 13px);
	color: #8a8f98;
}

.zbc-card__author,
.zbc-card__date {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}
.zbc-card__author .author, .zbc-card__date time{
	font-size: 14px;
	font-weight: 500;
}
.zbc-card__date time{
	padding-top: 2px;
}

.zbc-card__author .zi,
.zbc-card__date .zi {
	color: #9E9E9E;
	flex: none;
}

.zbc-card__author .zi {
	width: 20px;
	height: 20px;
}

.zbc-card__date .zi {
	width: 18px;
	height: 18px;
}

.zbc-card__author span,
.zbc-card__date time {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---- latest articles + sidebar (two-column) ----
   Figma: posts 1fr | sidebar 228px, gap ~54px; cards 246×240
   (compact variant); pagination 1 2 … 5 with chevrons. */
.zbl-latest {
	display: grid;
	/* 1200 = 812 posts (2x400 + 12) + 348 sidebar + 40 gap; card 400x356 */
	grid-template-columns: minmax(0, 1fr) 348px;
	column-gap: 40px;
	/* spacing from whatever precedes it is owned by the container
	   (padding-top of .zbpg-blog / .zbf-featured + .zbpg-wrap rule) —
	   a first-child margin here would collapse out and show the gray body */
	margin-top: 0;
	padding-bottom: clamp(0, 5vw, 50px);
}

.zbl-title {
	font-size: clamp(17px, 2vw, 25px);
	font-weight: 700;
	color: #000;
	line-height: 1.7;
	margin-bottom: 24.5px;
}

.zbl-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

/* fixed 398x356 desktop card (1200 container), cover 344.5x188 */
.zbl-grid .zbc-card--compact {
	height: 356px;
}

.zbl-grid .zbc-card--compact .zbc-card__img {
	width:  100%;
	height: 188px;
	aspect-ratio: auto;
	margin-inline: 0;
	flex: none; /* never let the flex column squeeze the fixed cover */
}

.zbl-empty {
	color: #555;
	font-size: 15px;
}

/* compact card variant: cover 224/122, tighter type */
.zbc-card--compact {
	padding: 16px;
}

.zbc-card--compact .zbc-card__img {
	aspect-ratio: 224 / 122;
}

.zbc-card--compact .zbc-card__title {
	font-size: clamp(13px, 1.3vw, 14px);
	margin-top: 16px;
	margin-bottom: 19.5px;
}

.zbc-card--compact .zbc-card__meta {
	font-size: clamp(11px, 1.1vw, 12px);
	margin-top: 19.5px;
	line-height: 1; /* body line-height must not inflate the meta row */
}

/* pagination bar: Fill (posts column) x 32 Hug — Figma spec */
.zbl-pagination {
	margin-top: 24px;
}

.zbl-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	direction: rtl;
	list-style: none;
	padding: 0;
	margin: 0;
}

.zbl-pagination li {
	display: flex; /* li strut/baseline must not grow the 32px row */
}

.zbl-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding-inline: 6px;
	border-radius: 8px;
	color: #666;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
}

.zbl-pagination a.page-numbers {
	color: #666;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.zbl-pagination a.page-numbers:hover {
	color: #1e88e5;
	background: #f4f5f7;
}

.zbl-pagination .page-numbers.current {
	background: #1e88e5;
	color: #fff;
	border-radius: 999px;
	min-width: 32px;
	height: 32px;
}

.zbl-pagination .page-numbers.dots {
	color: #666;
}

.zbl-pagination .page-numbers .zi {
	width: 14px;
	height: 14px;
}

.zbl-pagination a.page-numbers:focus-visible {
	outline: 3px solid #1e88e5;
	outline-offset: 2px;
}

/* ---- sidebar (sticky) ---- */
.zbs-sidebar {
	position: sticky;
	top: 90px;
	align-self: start;
	display: flex;
	flex-direction: column;
}

.zbs-quick__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	font-weight: 600;
	color: #1D1D1D;
	line-height: 1.7;
	margin: 0;
}

.zbs-quick__title .zi {
	width: 16px;
	height: 16px;
	flex: none;
	color: #1e88e5;
}

.zbs-quick__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.zbs-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 69px;
	height: 24px;
	padding: 0 10px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid #e6e8ec;
	color: #4B5565;
	font-size: 14px;
	font-weight: 500;	white-space: nowrap;
	line-height: 1.7;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.zbs-chip:hover {
	color: #1e88e5;
	border-color: #90c2ef;
}

.zbs-chip:focus-visible {
	outline: 3px solid #1e88e5;
	outline-offset: 2px;
}

.zbs-banners {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 16px;
}

.zbs-banner {
	position: relative;
	display: block;
	width: 100%;
	max-width: 348px;
	height: 180px;
	border-radius: 14px;
	overflow: hidden;
}

.zbs-banner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.zbs-banner__ph {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: 22px;
	font-weight: 700;
}

.zbs-banner:focus-visible {
	outline: 3px solid #1e88e5;
	outline-offset: 2px;
}

/* ---- breakpoints ---- */
@media (max-width: 1023px) {
	.zbf-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	/* sidebar drops below the posts */
	.zbl-latest {
		grid-template-columns: minmax(0, 1fr);
	}

	.zbl-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.zbs-sidebar {
		position: static;
	}

	.zbs-banners {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
	}

	.zbs-banner {
		width: 100%;
	}
}

@media (max-width: 767px) {
	.zbf-grid {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-ms-overflow-style: none;
		padding-block: 4px;
	}

	.zbf-grid::-webkit-scrollbar {
		display: none;
	}

	.zbf-grid .zbc-card {
		flex: 0 0 75vw;
		scroll-snap-align: start;
	}

	/* latest list: single column, full-width cards */
	.zbl-grid {
		grid-template-columns: 1fr;
	}

	/* featured carousel cards (Figma mobile: 16px inset, 250x160 cover) */
	.zbf-grid .zbc-card {
		padding: 16px;
	}

	.zbf-grid .zbc-card__img {
		aspect-ratio: 250 / 160;
	}
   .zbs-quick{
	margin-top: 40px;
	margin-bottom: 16px;
   }
	/* quick chips wrap into rows (Figma mobile), taller pill */
	.zbs-quick__chips {
		flex-wrap: wrap;
		overflow: visible;
		padding-block: 0;
	}

	.zbs-chip {
		flex: none;
		height: 35px;
		padding: 0 18px;
	}

	/* banners: horizontal snap carousel with a peek of the next card */
	.zbs-banners {
		flex-direction: row; /* base is column — must be a horizontal strip here */
		display: flex;
		gap: 12px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		margin-inline: -20px; /* bleed to the screen edges, gutter via padding */
		padding-inline: 20px;
		padding-block: 4px;
	}

	.zbs-banners::-webkit-scrollbar {
		display: none;
	}

	.zbs-banner {
		flex: 0 0 265px;
		width: 265px;
		height: 130px;
		max-width: none;
		border-radius: 20px;
		scroll-snap-align: start;
	}

	/* ---- page gutter (Figma mobile: 20px side margins) ---- */
	.zbpg-wrap,
	.zbf-wrap {
		padding-inline: 20px;
	}

	/* ---- category cards: 2-col grid, 4 visible + "show more" ---- */
	.zbt-tabs {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
		overflow: visible;
		padding-block: 0;
	}

	.zbt-tab {
		flex: initial;
		min-width: 0;
		height: auto;
		gap: 4px;
		padding: 12px 16px 14px;
		border-radius: 14px;
	}

	.zbt-tab__name {
		white-space: normal;
	}

	.zbt-tab__count {
		font-size: 13px;
	}

	/* collapsed: only the first four cards are visible */
	.zbt-tabs:not(.is-open) .zbt-tab:nth-child(n + 5) {
		display: none;
	}

	.zbt-more {
		display: flex; /* block-level flex so margin auto truly centers */
		width: fit-content;
		align-items: center;
		gap: 8px;
		margin: 20px auto 0;
		padding: 10px 22px;
		border: 1px solid #e6e8ec;
		border-radius: 999px;
		background: #fff;
		color: #333;
		font-size: 14px;
		font-weight: 500;
		line-height: 1; /* body line-height must not inflate the pill */
		font-family: inherit;
		cursor: pointer;
	}

	.zbt-more .zi {
		transform: rotate(-90deg); /* chevron points down */
		transition: transform 0.2s ease;
	}

	.zbt-more.is-open .zi {
		transform: rotate(90deg); /* chevron points up when expanded */
	}

	.zbt-more:focus-visible {
		outline: 3px solid #1e88e5;
		outline-offset: 2px;
	}
}
