/* ==========================================================================
   OIB Stories Grid — filter pills + sort + responsive card grid with badges
   ========================================================================== */

.oib-stg {
	--oib-stg-pt: 48px;
	--oib-stg-pb: 80px;
	--oib-stg-bg: #f5f7fb;
	--oib-stg-bar-bg: #ffffff;

	position: relative;
	padding: 0 0 var(--oib-stg-pb);   /* no top padding — bar sits flush at the top */
	background: var(--oib-stg-bg);
	font-family: var(--oib-font, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	-webkit-font-smoothing: antialiased;
}

/* Both inner wrappers share the same max-widths and horizontal padding so
   pills + grid line up vertically. */
.oib-stg__inner,
.oib-stg__bar-inner {
	margin: 0 auto;
	padding-left: 24px;
	padding-right: 24px;
}

.oib-stg__inner {
	padding-top: var(--oib-stg-pt);   /* top spacing for the grid area only */
}

.oib-stg__inner--narrow { max-width: 1080px; }
.oib-stg__inner--wide   { max-width: 1280px; }
.oib-stg__inner--full   { max-width: 100%; }

/* ==========================================================================
   Filter / sort bar — full-width, white, sticky under the header
   ========================================================================== */

.oib-stg__bar {
	width: 100%;
	background: var(--oib-stg-bar-bg, #ffffff);

	/* Sticky pinning. `--oib-header-h` is published by the Header Nav JS
	   at runtime so the bar pins right below the fixed header. Falls back
	   to 0px if no OIB header exists on the page. */
	position: -webkit-sticky;
	position: sticky;
	top: var(--oib-header-h, 0px);
	z-index: 50;
}

/* Constrained content inside the full-width bar */
.oib-stg__bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding-top: 45px;
	padding-bottom: 45px;
}

.oib-stg__pills {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.oib-stg__pill {
	display: inline-flex;
	align-items: center;
	padding: 10px 22px;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: #475569;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
	white-space: nowrap;
}

.oib-stg__pill:not(.is-active):hover,
.oib-stg__pill:not(.is-active):focus-visible {
	background: var(--oib-stg-pill-hover-bg, #eff4ff);
	color: #0f172a;
}

.oib-stg__pill.is-active {
	background: #0f172a;
	color: #ffffff;
	font-weight: 600;
}

.oib-stg__pill:focus-visible {
	outline: 2px solid #0f172a;
	outline-offset: 2px;
}

/* ---- Sort indicator ---- */
.oib-stg__sort {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #64748b;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
}

.oib-stg__sort svg {
	width: 16px;
	height: 16px;
	display: block;
	fill: currentColor;
}

/* ==========================================================================
   Card grid
   ========================================================================== */

.oib-stg__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px;
}

.oib-stg__cell {
	margin: 0;
	padding: 0;
	display: flex;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Hidden cells when filtered out */
.oib-stg__cell[hidden] {
	display: none !important;
}

/* ---- Card ---- */
.oib-stg__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: transparent;
}

/* ---- Media ---- */
.oib-stg__media {
	position: relative;
	overflow: hidden;
	border-radius: 18px;
	aspect-ratio: 18 / 10 !important;
	background: #dbeafe; /* light placeholder if no image */
	margin-bottom: 22px;
}

.oib-stg__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s ease;
}

.oib-stg__card:hover .oib-stg__media img {
	transform: scale(1.04);
}

.oib-stg__media-alt {
	position: absolute;
	top: 12px;
	left: 16px;
	color: #475569;
	font-size: 13px;
	font-weight: 500;
}

/* ---- Badge ---- */
.oib-stg__badge {
	position: absolute;
	top: 16px;
	right: 16px;
	padding: 8px 14px;
	border-radius: 10px;
	background: #7E5D74;
	color: #ffffff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: -0.005em;
	line-height: 1.2;
	box-shadow: 0 4px 12px -4px rgba(126, 93, 116, 0.5);
	white-space: nowrap;
}

/* ---- Body ---- */
.oib-stg__body {
	display: flex;
	flex-direction: column;
}

.oib-stg__meta {
	margin: 0 0 12px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	line-height: 1.4;
}

.oib-stg__cat {
	color: #0284c7;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.oib-stg__sep {
	color: #94a3b8;
}

.oib-stg__time {
	color: #64748b;
	font-weight: 500;
}

.oib-stg__title {
	margin: 0 0 14px;
	color: #0f172a;
	font-size: clamp(20px, 1.8vw, 26px);
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.015em;
	transition: color 0.2s ease;
}

.oib-stg__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.oib-stg__card:hover .oib-stg__title,
.oib-stg__card:hover .oib-stg__title a {
	color: #0284c7;
}

.oib-stg__desc {
	margin: 0 0 18px;
	color: #475569;
	font-size: 14.5px;
	line-height: 1.65;
}

/* ---- CTA ----
   Underline is drawn as a `border-bottom` on the inner <span> rather than
   via `text-decoration` — that property is often forcibly removed by
   themes/Elementor on `a` elements, and we want a guaranteed-visible line. */
.oib-stg__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #0f172a;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.2s ease, gap 0.2s ease;
	align-self: flex-start;
}

.oib-stg__cta > span {
	display: inline-block;
	padding-bottom: 2px;
	border-bottom: 2px solid transparent;
	transition: border-color 0.2s ease;
}

/* Reveal the underline when the card is hovered (or the CTA itself). */
.oib-stg__cell:hover .oib-stg__cta > span,
.oib-stg__card:hover .oib-stg__cta > span,
.oib-stg__cta:hover > span,
.oib-stg__cta:focus-visible > span {
	border-bottom-color: #7E5D74;
}

.oib-stg__cta:hover,
.oib-stg__cta:focus-visible {
	color: #7E5D74;
	gap: 10px;
	outline: none;
}

.oib-stg__cta svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* ---- Empty state ---- */
.oib-stg__empty {
	margin: 32px 0 0;
	color: #64748b;
	font-size: 15px;
	text-align: center;
}

.oib-stg__empty[hidden] {
	display: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
	.oib-stg__grid {
		gap: 24px;
	}
}

@media (max-width: 720px) {
	.oib-stg {
		padding: 0 0 clamp(56px, 12vw, 72px);
	}

	.oib-stg__inner,
	.oib-stg__bar-inner {
		padding-left: 18px;
		padding-right: 18px;
	}

	.oib-stg__inner {
		padding-top: clamp(28px, 7vw, 40px);
	}

	.oib-stg__bar-inner {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding-top: 14px;
		padding-bottom: 14px;
	}

	.oib-stg__pills {
		gap: 6px;
		overflow-x: auto;
		flex-wrap: wrap;
		padding-bottom: 4px;
		-webkit-overflow-scrolling: touch;
	}

	.oib-stg__pill {
		padding: 9px 16px;
		font-size: 13.5px;
	}

	.oib-stg__sort {
		font-size: 13px;
	}

	.oib-stg__grid {
		grid-template-columns: 1fr !important;
		gap: 28px;
	}

	.oib-stg__media {
		border-radius: 14px;
		margin-bottom: 18px;
	}

	.oib-stg__title {
		font-size: 19px;
	}

	.oib-stg__badge {
		top: 12px;
		right: 12px;
		padding: 6px 12px;
		font-size: 12px;
	}
}

/* ==========================================================================
   A11y / motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.oib-stg__cell,
	.oib-stg__title,
	.oib-stg__cta,
	.oib-stg__media img,
	.oib-stg__pill { transition: none !important; }

	.oib-stg__card:hover .oib-stg__media img { transform: none; }
}

/* ==========================================================================
   Page Link
   ========================================================================== */

.oib-stg__page-link-wrap {
	margin: 44px 0 0;
}

/* Shared base */
.oib-stg__page-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: gap 0.2s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.oib-stg__page-link svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.oib-stg__page-link:hover svg {
	transform: translateX(4px);
}

/* Outline */
.oib-stg__page-link--outline {
	padding: 11px 24px;
	border: 1.5px solid #0f172a;
	border-radius: 10px;
	color: #0f172a;
	background: transparent;
}

.oib-stg__page-link--outline:hover {
	background: #0f172a;
	color: #ffffff;
}

/* Solid */
.oib-stg__page-link--solid {
	padding: 12px 26px;
	border: 1.5px solid transparent;
	border-radius: 10px;
	background: #7E5D74;
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(126, 93, 116, 0.28);
}

.oib-stg__page-link--solid:hover {
	background: #6A4960;
	box-shadow: 0 6px 18px rgba(126, 93, 116, 0.36);
}

/* Text link */
.oib-stg__page-link--link {
	padding: 0;
	color: #7E5D74;
	gap: 6px;
}

.oib-stg__page-link--link:hover {
	color: #6A4960;
	gap: 10px;
}
