/* ==========================================================================
   Media page (599) — category filter bar + blog/news card grid (Query Loop).
   Owner: Ivy (scoped by Cole). Core wp:query skinned to the Divi et_pb_blog
   look (.creda-blog-grid): #003746 filter bar w/ #039ca2 active tab, cards with
   a teal top-left corner triangle, navy headline, date + dark-teal READ MORE.
   Built to data/qa_baseline/media/1440.png. Palette RECON §2 / §4.7.
   ========================================================================== */

/* --- Category filter bar (full-bleed dark-teal band; full-width equal tabs) --- */
.media-filter-bar {
	display: flex;
	gap: 0;
	padding: 0;
	margin: 0 0 44px;
	background: var(--creda-dark-teal); /* #003746 */
	justify-content: stretch !important;
	flex-wrap: nowrap;
	font-family: Inter, Helvetica, Arial, sans-serif;
	/* Sticky: stays under the fixed 84px header as you scroll (Media, category, story). */
	position: sticky;
	top: 84px;
	z-index: 500;
}
/* Each tab is an equal, full-width segment (live), with thin dividers between. */
.media-filter__link {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	text-align: center;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	border-right: 1px solid rgba(255, 255, 255, .14);
}
.media-filter__link:last-child { border-right: 0; }
.media-filter__link a {
	display: block;
	padding: 18px 12px;
	color: #fff;
	text-align: center;
	text-decoration: none;
	transition: color .2s ease, background-color .2s ease;
}
.media-filter__link a:hover { background: rgba(3, 156, 162, .55); color: #fff; }
.media-filter__link.is-active a { background: var(--creda-secondary); color: #fff; } /* #039ca2 */

/* --- Archive (category) hero — teal title band with notch, matching live ---- */
.content-area--archive { }
/* Match the interior .page-title-bar (e.g. /about/) exactly: same compact band
   height, same pale-teal heading, and left-aligned at the 3vw gutter (not
   centered in a 1280px container). */
.archive-hero {
	background: var(--creda-secondary);
	padding: clamp(26px, 2vw, 38px) 3vw;
}
.archive-hero__title {
	font-family: 'Inter', Helvetica, Arial, sans-serif;
	font-weight: 600;
	color: var(--creda-pale-teal);
	font-size: clamp(2.2rem, 1.4rem + 3vw, 3.75rem);
	line-height: 1.1;
}

/* --- Blog / news grid ------------------------------------------------------ */
.creda-blog-grid {
	max-width: 1280px;
	margin-inline: auto;
	padding: 0 20px 48px;
}
.creda-blog-grid .wp-block-post-template.is-layout-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 34px;
	align-items: stretch;
}
.creda-blog-grid .wp-block-post {
	display: flex;
	flex-direction: column;
	background: #fff;
	box-shadow: 0 8px 22px rgba(1, 58, 73, .12);
	transition: transform .25s ease, box-shadow .25s ease;
}
.creda-blog-grid .wp-block-post:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 30px rgba(1, 58, 73, .18);
}

/* Thumbnail — uniform 8:5 landscape crop (matches LIVE's -400x250 blog thumbs,
   so rows stay even) + teal corner triangle. */
.media-card__thumb {
	position: relative;
	margin: 0;
	overflow: hidden;
	line-height: 0;
	aspect-ratio: 8 / 5;
}
.media-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s ease;
}
/* Thumbnail zooms subtly when its card is hovered (pairs with the card lift). */
.creda-blog-grid .wp-block-post:hover .media-card__thumb img { transform: scale(1.05); }
.media-card__thumb::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 58px;
	height: 58px;
	z-index: 2;
	background: var(--creda-secondary); /* #039ca2 */
	clip-path: polygon(0 0, 100% 0, 0 100%);
	pointer-events: none;
}

/* Body */
.media-card__body {
	padding: 22px 24px 26px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 0;
}
.media-card__title {
	font-family: Roboto, Helvetica, Arial, sans-serif;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.28;
	margin: 0 0 14px;
}
.media-card__title a {
	color: var(--creda-primary); /* #013a49 */
	text-decoration: none;
	transition: color .2s ease;
}
.media-card__title a:hover { color: var(--creda-secondary); }
/* Footer row — date left, READ MORE right, on one line (matches live). */
.media-card__foot {
	margin-top: auto;
	display: flex;
	flex-wrap: nowrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}
.media-card__date {
	font-size: 14px;
	color: #8a9296;
	margin: 0;
	white-space: nowrap;
}
/* wp:read-more renders the className directly on the <a>. */
.media-card__more {
	display: inline-block;
	flex: 0 0 auto;
	background: var(--creda-dark-teal); /* #003746 */
	color: #fff;
	font-family: Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 12px 26px;
	border: 0;
	transition: background-color .25s ease, transform .25s ease;
}
.media-card__more:hover { background: var(--creda-secondary); color: #fff; }

/* --- Pagination ------------------------------------------------------------ */
.media-pagination {
	max-width: 1280px;
	margin: 8px auto 0;
	padding: 0 20px 40px;
}
.media-pagination a,
.media-pagination .wp-block-query-pagination-next {
	color: var(--creda-primary);
	font-family: Inter, Helvetica, Arial, sans-serif;
	font-weight: 600;
	text-decoration: none;
	transition: color .2s ease;
}
.media-pagination a:hover { color: var(--creda-secondary); }

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 980px) {
	.creda-blog-grid .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, 1fr); }
	.media-filter__link a { padding: 15px 18px; font-size: 14px; }
}
@media (max-width: 600px) {
	.creda-blog-grid .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr; }
	/* Wrap the tabs (all 5 stay visible/tappable) instead of hiding them behind
	   a horizontal scroll on narrow phones. */
	.media-filter-bar {
		flex-wrap: wrap;
		justify-content: center !important;
		padding: 4px 0;
	}
	.media-filter__link { flex: 1 1 auto; border-right: 0; }
	.media-filter__link a { padding: 12px 16px; font-size: 13px; }
}
