/* ==========================================================================
   SCC Times – Tag archive (tag.php)
   Scoped under .sct-tag so it cannot leak into other templates.
   Tweak the variables below to match the theme.
   ========================================================================== */

.sct-tag {
	--sct-red: #c4111d;
	--sct-ink: #121212;
	--sct-muted: #5f5f5f;
	--sct-line: #e4e1da;
	--sct-soft: #f6f4ef;
	--sct-card: #fff;
	--sct-radius: 6px;
	--sct-gap: 28px;
	--sct-sticky-top: 24px;

	color: var(--sct-ink);
}

.sct-tag *,
.sct-tag *::before,
.sct-tag *::after { box-sizing: border-box; }

.sct-wrap {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ---------- Hero (dark grid + red glow, matches site header band) ---------- */
.sct-tag__hero {
	position: relative;
	overflow: hidden;
	color: #fff;
	padding: 26px 0 34px;
	margin-bottom: 30px;
	border-top: 1px solid #d8d8d8;
	border-bottom: 4px solid #b30d17;
	background:
		radial-gradient(ellipse 34% 170% at 89% -10%, rgba(200, 16, 30, .92) 0%, rgba(128, 8, 20, .6) 42%, rgba(60, 4, 10, 0) 72%),
		linear-gradient(90deg, #0b0c0e 0%, #130b0d 45%, #1a0709 72%, #2a0407 100%);
}
.sct-tag__hero::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image:
		linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
	background-size: 40px 40px;
}
.sct-tag__hero > .sct-wrap { position: relative; z-index: 1; }

.sct-tag__crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 18px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .72);
}
.sct-tag__crumbs a {
	display: inline-block;
	padding: 10px 14px;
	color: #fff;
	text-decoration: none;
	background: #232426;
	border: 1px solid #4a4b4e;
	border-radius: 3px;
	transition: border-color .2s ease, background .2s ease;
}
.sct-tag__crumbs a:hover { background: #2c2d30; border-color: #ff4d62; }
.sct-tag__sep { opacity: .45; }
.sct-tag__crumbs [aria-current] { color: #fff; }

.sct-tag__kicker {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: #ff4d62;
}
.sct-tag__kicker::before {
	content: "";
	width: 28px;
	height: 2px;
	background: #ff4d62;
}

.sct-tag__title {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px;
	margin: 0 0 12px;
	font-size: clamp(30px, 4.6vw, 52px);
	line-height: 1.08;
	font-weight: 800;
	letter-spacing: -.01em;
	background: none;
	-webkit-text-fill-color: #fff;
	color: #fff;
}

.sct-tag__pill {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #fff;
	background: var(--sct-red);
	padding: 6px 10px;
	border-radius: 3px;
	-webkit-text-fill-color: #fff;
}

.sct-tag__desc {
	max-width: 720px;
	font-size: 16px;
	line-height: 1.6;
	color: rgba(255, 255, 255, .72);
}
.sct-tag__desc p { margin: 0 0 6px; }
.sct-tag__desc strong { color: #fff; }

.sct-tag__count {
	margin: 14px 0 0;
	font-size: 13px;
	color: rgba(255, 255, 255, .6);
}
.sct-tag__count strong { color: #fff; font-size: 15px; }

/* ---------- Toolbar ---------- */
.sct-tag__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding-bottom: 14px;
	margin-bottom: 24px;
	border-bottom: 2px solid var(--sct-ink);
}
.sct-tag__showing { margin: 0; font-size: 13px; color: var(--sct-muted); }
.sct-tag__perpage form { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sct-muted); margin: 0; }
.sct-tag__perpage select {
	font: inherit;
	color: var(--sct-ink);
	border: 1px solid var(--sct-line);
	border-radius: 4px;
	padding: 5px 26px 5px 10px;
	background-color: #fff;
}

/* ---------- Cards (shared) ---------- */
.sct-card {
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: var(--sct-card);
	border: 1px solid var(--sct-line);
	border-radius: var(--sct-radius);
	position: relative;
	transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.sct-card:hover {
	border-color: #cfcabf;
	box-shadow: 0 10px 26px rgba(0, 0, 0, .08);
	transform: translateY(-2px);
}

/* Fixed ratio box: fixes the tall blank/broken image areas */
.sct-card__media {
	position: relative;
	display: block;
	aspect-ratio: 886 / 554;
	background: var(--sct-soft);
	overflow: hidden;
	border-radius: var(--sct-radius) var(--sct-radius) 0 0;
}
.sct-card__media img {
	image-rendering: auto;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important; /* override WP height attribute */
	max-width: none;
	object-fit: contain;
	display: block;
	transition: transform .35s ease;
}

.sct-card__ph {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #f1eee7, #e7e3d9);
	color: #b9b3a3;
}
.sct-card__ph-mark { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: .02em; }
.sct-card__ph-word { font-size: 11px; letter-spacing: .4em; margin-top: 6px; }

.sct-card__body {
	min-width: 0;
	overflow-wrap: anywhere;
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 16px 18px 16px;
}

.sct-card__cats {
	margin: 0 0 8px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--sct-red);
}

.sct-card__title {
	margin: 0 0 8px;
	font-size: 19px;
	line-height: 1.28;
	font-weight: 700;
	letter-spacing: 0;
	background: none;
	-webkit-text-fill-color: currentColor;
}
.sct-card__title a {
	color: var(--sct-ink);
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.sct-card__title a:hover { color: var(--sct-red); }

.sct-card__excerpt {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--sct-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Tag chips: one tidy row, never a wall of pills */
.sct-card__chips {
	display: flex;
	flex-wrap: nowrap;
	gap: 6px;
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
}
.sct-card__chips li { flex: 0 1 auto; min-width: 0; margin: 0; }
.sct-card__chips a,
.sct-card__more-btn {
	display: block;
	max-width: 150px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 11px;
	line-height: 1;
	padding: 6px 9px;
	border: 1px solid var(--sct-line);
	border-radius: 999px;
	color: var(--sct-muted);
	text-decoration: none;
	background: #fff;
}
.sct-card__chips a:hover { color: #fff; background: var(--sct-red); border-color: var(--sct-red); }
.sct-card__more { position: relative; flex-shrink: 0; }
.sct-card__more-btn {
	font: inherit;
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
	background: var(--sct-soft);
	border-style: dashed;
}
.sct-card__more:hover .sct-card__more-btn,
.sct-card__more:focus-within .sct-card__more-btn { background: var(--sct-ink); border-color: var(--sct-ink); border-style: solid; color: #fff; }

/* Dropdown with the remaining tags (hover / keyboard focus / tap) */
.sct-card__more-pop {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 30;
	display: none;
	min-width: 190px;
	max-width: 260px;
	padding-top: 8px; /* invisible bridge so hover isn't lost */
}
.sct-card__more:hover .sct-card__more-pop,
.sct-card__more:focus-within .sct-card__more-pop { display: block; }
.sct-card__more-list {
	list-style: none;
	margin: 0;
	padding: 6px;
	max-height: 240px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--sct-line);
	border-radius: 8px;
	box-shadow: 0 14px 32px rgba(0, 0, 0, .16);
}
.sct-card__more-list li { margin: 0; }
.sct-card__more-list a {
	display: block;
	padding: 8px 10px;
	font-size: 12.5px;
	line-height: 1.3;
	color: var(--sct-ink);
	text-decoration: none;
	border-radius: 5px;
}
.sct-card__more-list a:hover,
.sct-card__more-list a:focus { background: var(--sct-soft); color: var(--sct-red); }
.sct-card:hover, .sct-card:focus-within { z-index: 5; }

.sct-card__meta {
	margin: auto 0 0;
	padding-top: 12px;
	border-top: 1px solid var(--sct-line);
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--sct-muted);
}
.sct-card__author { font-weight: 600; color: var(--sct-ink); }

/* ---------- Lead story ---------- */
/* Layout reacts to the card's own width (the sidebar shrinks the column),
   not the viewport, so text can never get squeezed and clipped. */
.sct-tag__lead {
	margin-bottom: var(--sct-gap);
	container-type: inline-size;
	container-name: sct-lead;
}
.sct-card--lead { flex-direction: column; }
.sct-card--lead .sct-card__media { aspect-ratio: 886 / 554; }
.sct-card--lead .sct-card__body { padding: 20px 22px; }
.sct-card--lead .sct-card__title { font-size: clamp(22px, 5cqi, 30px); line-height: 1.2; }
.sct-card--lead .sct-card__title a { -webkit-line-clamp: 4; }
.sct-card--lead .sct-card__excerpt { font-size: 15px; -webkit-line-clamp: 4; }

@container sct-lead (min-width: 720px) {
	/* Image keeps its true 886:554 shape and sets the card height: no beige bars */
	.sct-card--lead { display: grid; grid-template-columns: 56% minmax(0, 1fr); align-items: start; }
	.sct-card--lead .sct-card__media { aspect-ratio: 886 / 554; min-height: 0; border-radius: var(--sct-radius) 0 0 var(--sct-radius); }
	.sct-card--lead .sct-card__body { padding: 18px 22px; align-self: stretch; }
	.sct-card--lead .sct-card__title { font-size: 22px; line-height: 1.22; }
	.sct-card--lead .sct-card__title a { -webkit-line-clamp: 3; }
	.sct-card--lead .sct-card__excerpt { font-size: 14px; -webkit-line-clamp: 2; margin-bottom: 10px; }
	.sct-card--lead .sct-card__chips { margin-bottom: 10px; }
	.sct-card--lead .sct-card__meta { margin-top: auto; padding-top: 10px; }
}

/* ---------- Grid ---------- */
.sct-tag__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--sct-gap);
	align-items: stretch;
}
@media (min-width: 640px)  { .sct-tag__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Pagination ---------- */
.sct-tag__pagination { margin: 44px 0 12px; }
.sct-tag__pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}
.sct-tag__pagination .page-numbers {
	min-width: 40px;
	height: 40px;
	padding: 0 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--sct-ink);
	text-decoration: none;
	border: 1px solid var(--sct-line);
	border-radius: 4px;
	background: #fff;
}
.sct-tag__pagination a.page-numbers:hover { border-color: var(--sct-ink); }
.sct-tag__pagination .page-numbers.current { background: var(--sct-ink); border-color: var(--sct-ink); color: #fff; }
.sct-tag__pagination .page-numbers.dots { border: 0; background: none; }

/* ---------- Empty state ---------- */
.sct-tag__empty {
	text-align: center;
	padding: 60px 20px;
	background: var(--sct-soft);
	border: 1px dashed var(--sct-line);
	border-radius: var(--sct-radius);
}
.sct-tag__empty h2 { margin: 0 0 8px; }
.sct-tag__empty p { color: var(--sct-muted); margin: 0 0 18px; }

/* ---------- Two-column layout (main + aside) ---------- */
.sct-tag__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 40px;
	align-items: start;
	padding-bottom: 56px;
}
.sct-tag__main { min-width: 0; }
.sct-tag, .sct-tag__layout { overflow: visible; } /* sticky breaks inside overflow:hidden parents */
@media (min-width: 1024px) {
	.sct-tag__layout { grid-template-columns: minmax(0, 1fr) 320px; }
	.sct-tag__aside {
		position: sticky;
		top: var(--sct-sticky-top, 24px);   /* raise this if the site header is fixed/sticky */
		align-self: start;
	}
}

/* ---------- Sidebar widgets ---------- */
.sct-tag__aside { display: flex; flex-direction: column; gap: 28px; min-width: 0; position: relative; z-index: 10; }

.sct-tag__aside .widget,
.sct-widget {
	margin: 0;
	padding: 18px 18px 20px;
	background: #fff;
	border: 1px solid var(--sct-line);
	border-top: 3px solid var(--sct-red);
	border-radius: var(--sct-radius);
}

.sct-tag__aside .widget-title,
.sct-tag__aside .widgettitle,
.sct-widget__title {
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--sct-ink);
}

.sct-widget__list { list-style: none; margin: 0; padding: 0; }
.sct-widget__list li + li { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sct-line); }

.sct-mini { display: block; text-decoration: none; color: var(--sct-ink); }
.sct-mini__thumb { display: block; margin-bottom: 10px; background: var(--sct-soft); border-radius: 4px; overflow: hidden; }
.sct-mini__thumb img { display: block; width: 100%; height: auto !important; max-width: 100%; } /* complete image, no crop */
.sct-mini__title {
	display: block;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}
.sct-mini:hover .sct-mini__title { color: var(--sct-red); }
.sct-mini__date { display: block; margin-top: 4px; font-size: 11.5px; color: var(--sct-muted); }


.sct-widget__chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.sct-widget__chips a {
	display: inline-block;
	font-size: 12.5px;
	padding: 7px 12px;
	border: 1px solid var(--sct-line);
	border-radius: 999px;
	color: var(--sct-ink);
	text-decoration: none;
	background: #fff;
}
.sct-widget__chips a:hover { background: var(--sct-ink); border-color: var(--sct-ink); color: #fff; }

/* ---------- Small screens ---------- */
@media (max-width: 639px) {
	.sct-tag__hero { padding: 20px 0 26px; }
	.sct-tag__toolbar { flex-direction: column; align-items: flex-start; }
	.sct-card__body { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.sct-card, .sct-card__media img { transition: none; }
	.sct-card:hover { transform: none; }
}