/* =========================================================
   Education Articles Plugin — Styles
   Design reference: IUX Landing Page / Articles frame
   Colors: bg #000, accent #0fef9e, text #fff, muted #9f9f9f
   Font: Manrope (loaded via Google Fonts or theme)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700&display=swap');

/* ── Design tokens ──────────────────────────────────────── */
:root {
	--art-bg:          #000000;
	--art-white:       #ffffff;
	--art-primary:     #0fef9e;
	--art-gray-200:    #dfdfdf;
	--art-gray-400:    #9f9f9f;
	--art-gray-800:    #202020;
	--art-border:      rgba(255, 255, 255, 0.12);

	--art-font:        'Manrope', sans-serif;
	--art-radius:      4px;
	--art-radius-card: 8px;

	--art-container:   1200px;
	--art-gutter:      120px;
}

/* ── Wrapper ────────────────────────────────────────────── */
.articles-page {
	background-color: var(--art-bg);
	color: var(--art-white);
	font-family: var(--art-font);
	width: 100%;
}

/* ── Sub-header (Breadcrumb + Search) ───────────────────── */
.articles-subheader {
	background-color: var(--art-bg);
}

.articles-subheader__inner {
	max-width: 1440px;
	margin-inline: auto;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	padding: 12px 96px;
	box-sizing: border-box;
	min-height: 56px;
}

/* Breadcrumb — EN:Manrope/H6 */
.articles-subheader__breadcrumb .rank-math-breadcrumb p {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: 2px;
	margin: 0;
	padding: 0;
	font-size: 12px;
	font-weight: 500;
	line-height: 18px;
	font-family: var(--art-font);
}

.articles-page .articles-subheader__breadcrumb .rank-math-breadcrumb a {
	color: var(--art-white) !important;
	text-decoration: none;
	transition: color 0.2s ease;
}

.articles-page .articles-subheader__breadcrumb .rank-math-breadcrumb a:hover {
	color: var(--art-primary) !important;
}

.articles-subheader__breadcrumb .rank-math-breadcrumb .separator {
	color: var(--art-gray-400);
	user-select: none;
	font-size: 10px;
}

.articles-subheader__breadcrumb .rank-math-breadcrumb .last {
	color: var(--art-gray-400);
}

/* Search input */
.articles-subheader__search {
	flex-shrink: 0;
}

.articles-search {
	position: relative;
	width: 220px;
}

.articles-search__icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--art-gray-400);
	pointer-events: none;
	flex-shrink: 0;
}

.articles-search__input {
	width: 100%;
	background-color: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 20px;
	color: var(--art-white);
	font-family: var(--art-font);
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	padding: 8px 16px 8px 36px;
	outline: none;
	transition: border-color 0.2s ease;
	box-sizing: border-box;
}

.articles-search__input::placeholder {
	color: var(--art-gray-400);
}

.articles-search__input:focus {
	border-color: var(--art-primary);
}

.articles-search__input::-webkit-search-cancel-button,
.articles-search__input::-webkit-search-decoration {
	display: none;
}

.articles-search__clear {
	display: none;
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: var(--art-gray-400);
	line-height: 0;
	transition: color 0.2s ease;
}

.articles-search__clear:hover {
	color: var(--art-white);
}

.articles-search.has-value .articles-search__clear {
	display: flex;
	align-items: center;
	justify-content: center;
}

.articles-search.has-value .articles-search__input {
	padding-right: 36px;
}

/* ── Hero ───────────────────────────────────────────────── */
.articles-hero {
	background-color: var(--art-bg);
	padding: 96px 64px;
	text-align: center;
}

.articles-hero__inner {
	max-width: 990px;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.articles-hero__title {
	font-size: 64px;
	font-weight: 500;
	line-height: 1.5;
	color: var(--art-white);
	margin: 0;
}

.articles-hero__subtitle {
	font-size: 18px;
	font-weight: 500;
	line-height: 28px;
	color: var(--art-gray-400);
	margin: 0;
}

/* ── Search Results header (replaces hero on /search page) ── */
.articles-search-header {
	padding-block: 40px 0;
}

.articles-search-header__title {
	font-size: 48px;
	font-weight: 500;
	line-height: 1.25;
	color: var(--art-white);
	margin: 0 0 12px;
}

/* When on search page, articles-main has no hero above it — add top spacing */
.articles-page--search .articles-main {
	padding-top: 0;
}

/* ── Main section ───────────────────────────────────────── */
.articles-main {
	background-color: var(--art-bg);
	padding-block: 96px;
}

.articles-main__inner {
	max-width: calc(var(--art-container) + var(--art-gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--art-gutter);
}

/* ── Results count ──────────────────────────────────────── */
.articles-count {
	font-size: 16px;
	font-weight: 500;
	line-height: 24px;
	color: var(--art-white);
	margin: 0 0 16px;
}

/* ── Filter bar ─────────────────────────────────────────── */
.articles-filter {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 24px;
}

.articles-filter__dropdowns {
	display: flex;
	gap: 24px;
	flex: 1;
}

.articles-filter__dropdown {
	position: relative;
	flex: 1;
}

.articles-filter__btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 16px;
	background-color: transparent;
	border: 1px solid var(--art-border);
	border-radius: var(--art-radius);
	color: var(--art-white);
	font-family: var(--art-font);
	font-size: 16px;
	font-weight: 500;
	line-height: 24px;
	cursor: pointer;
	transition: border-color 0.2s ease;
	white-space: nowrap;
}

.articles-filter__btn:hover {
	border-color: var(--art-gray-200);
}

.articles-filter__btn[aria-expanded="true"] {
	border-color: var(--art-primary);
}

.articles-filter__btn[aria-expanded="true"] .articles-filter__chevron {
	transform: rotate(180deg);
}

.articles-filter__chevron {
	flex-shrink: 0;
	color: var(--art-gray-400);
	transition: transform 0.2s ease;
}

.articles-filter__list {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 100;
	background-color: var(--art-gray-800);
	border: 1px solid var(--art-border);
	border-radius: var(--art-radius);
	list-style: none;
	margin: 0;
	padding: 4px 0;
	max-height: 240px;
	overflow-y: auto;
	display: none;
}

.articles-filter__list.is-open {
	display: block;
}

.articles-filter__option {
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--art-gray-200);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.articles-filter__option:hover {
	background-color: rgba(255, 255, 255, 0.06);
	color: var(--art-white);
}

.articles-filter__option[aria-selected="true"] {
	color: var(--art-primary);
}

.articles-filter__reset {
	padding: 0;
	background: none;
	border: none;
	color: var(--art-gray-400);
	font-family: var(--art-font);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.2s ease;
}

.articles-filter__reset:hover {
	color: var(--art-white);
}

/* ── Cards grid ─────────────────────────────────────────── */
.articles-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px 24px;
	min-height: 200px;
	position: relative;
}

.articles-grid.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--art-radius-card);
}

.articles-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--art-gray-400);
	font-size: 16px;
	padding: 48px 0;
}

/* ── Article card ───────────────────────────────────────── */
.articles-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background-color: var(--art-gray-800);
	border-radius: var(--art-radius-card);
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	list-style: none;
}

.articles-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 40px rgba(15, 239, 158, 0.1);
}

.articles-card__link {
	display: block;
	text-decoration: none;
}

.articles-card__thumbnail {
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background-color: #111;
}

.articles-card__thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.articles-card:hover .articles-card__thumbnail img {
	transform: scale(1.04);
}

.articles-card__thumbnail-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
}

.articles-card__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px 20px 16px;
	flex: 1;
	min-height: 0;
	min-width: 0; /* prevent flex child from expanding beyond card width */
}

.articles-card__badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--art-primary);
}

.articles-card__title {
	font-size: 18px;
	font-weight: 500;
	line-height: 26px;
	margin: 0;
	min-height: calc(26px * 2); /* always reserve exactly 2 lines height */
}

.articles-card__title a {
	color: var(--art-white);
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.articles-card__title a:hover {
	color: var(--art-primary);
}

.articles-card__excerpt {
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--art-gray-400);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	height: calc(20px * 3); /* exactly 3 lines, never more */
}

.articles-card__footer {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 8px;
	border-top: 1px solid var(--art-border);
}

.articles-card__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 400;
	line-height: 18px;
	color: var(--art-gray-400);
	flex-wrap: wrap;
}

.articles-card__read-time {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.articles-card__sep {
	color: var(--art-border);
}

.articles-card__read-icon {
	flex-shrink: 0;
	color: var(--art-gray-400);
}

/* ── Tags row ────────────────────────────────────────────── */
.articles-card__tags {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding-bottom: 2px;
	flex-wrap: nowrap;
	margin-top: 4px;
	min-width: 0; /* constrain to parent width so overflow-x:auto can scroll */
	cursor: grab;
}

.articles-card__tags:active {
	cursor: grabbing;
}

.articles-card__tags::-webkit-scrollbar {
	display: none;
}

.articles-card__tag {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	background-color: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--art-border);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	line-height: 18px;
	color: var(--art-gray-200);
	white-space: nowrap;
}

/* ── Pagination ─────────────────────────────────────────── */
.articles-pagination-wrap {
	margin-top: 48px;
	display: flex;
	justify-content: center;
}

.articles-pagination {
	display: flex;
	align-items: center;
	gap: 4px;
}

/* Base — all buttons */
.articles-pagination__btn {
	width: 40px;
	height: 40px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
	border-radius: 8px;
	font-family: var(--art-font);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

/* Page number — inactive */
.articles-pagination__page {
	background: transparent;
	border-color: var(--art-border);
	color: var(--art-white);
}

.articles-pagination__page:hover:not(:disabled) {
	border-color: rgba(255, 255, 255, 0.3);
}

/* Page number — active */
.articles-pagination__page.is-active {
	background: transparent;
	border-color: var(--art-primary);
	color: var(--art-primary);
}

/* Nav buttons (<<, <, >, >>) — enabled */
.articles-pagination__nav {
	background: var(--art-primary);
	border-color: transparent;
	color: var(--art-gray-800);
}

/* Nav buttons — disabled */
.articles-pagination__nav:disabled {
	background: var(--art-gray-800);
	border-color: transparent;
	color: var(--art-gray-400);
	cursor: not-allowed;
}

/* Ellipsis — styled as inactive box */
.articles-pagination__ellipsis {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--art-border);
	border-radius: 8px;
	color: var(--art-gray-400);
	font-size: 14px;
}

/* ── CTA section ────────────────────────────────────────── */
.articles-cta {
	position: relative;
	overflow: hidden;
	background-color: var(--art-bg);
	padding: 32px 64px;
	text-align: center;
}

.articles-cta__glow {
	position: absolute;
	bottom: -80px;
	left: 50%;
	transform: translateX(-50%);
	width: 202px;
	height: 152px;
	background-color: var(--art-primary);
	border-radius: 999px;
	filter: blur(200px);
	pointer-events: none;
}

.articles-cta__inner {
	position: relative;
	z-index: 1;
	max-width: 1312px;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

.articles-cta__title {
	font-size: 32px;
	font-weight: 500;
	line-height: 48px;
	color: var(--art-white);
	margin: 0;
}

.articles-cta__desc {
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--art-gray-400);
	margin: 0;
	max-width: 760px;
}

.articles-cta__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	background-color: var(--art-primary);
	border-radius: var(--art-radius);
	color: var(--art-gray-800);
	font-family: var(--art-font);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.articles-cta__btn:hover {
	opacity: 0.88;
	color: var(--art-gray-800);
}

/* ── Loading spinner (injected by JS) ────────────────────── */
.articles-spinner {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 0;
	grid-column: 1 / -1;
}

.articles-spinner::after {
	content: '';
	width: 32px;
	height: 32px;
	border: 3px solid var(--art-border);
	border-top-color: var(--art-primary);
	border-radius: 50%;
	animation: articles-spin 0.7s linear infinite;
}

@keyframes articles-spin {
	to { transform: rotate(360deg); }
}

/* ── Responsive ─────────────────────────────────────────── */

/* ── Tablet: ≤ 1024px ─────────────────────────────────── */
@media (max-width: 1024px) {
	.articles-subheader__inner {
		padding: 12px 40px;
	}

	.articles-search {
		width: 200px;
	}

	.articles-hero {
		padding: 64px 40px;
	}

	.articles-hero__title {
		font-size: 48px;
	}

	.articles-search-header__title {
		font-size: 36px;
	}

	.articles-main__inner {
		padding-inline: 40px;
	}

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

	/* Filters stack vertically on tablet */
	.articles-filter {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.articles-filter__dropdowns {
		flex-direction: column;
		gap: 12px;
	}

	.articles-filter__reset {
		align-self: flex-start;
	}
}

/* ── Mobile: ≤ 768px ──────────────────────────────────── */
@media (max-width: 768px) {
	.articles-subheader__inner {
		height: auto;
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
		padding: 20px 24px;
	}

	.articles-subheader__search {
		width: 100%;
	}

	.articles-search {
		width: 100%;
	}

	.articles-hero {
		padding: 48px 24px;
	}

	.articles-hero__title {
		font-size: 36px;
	}

	.articles-search-header__title {
		font-size: 28px;
	}

	.articles-hero__subtitle {
		font-size: 16px;
	}

	.articles-main__inner {
		padding-inline: 24px;
	}

	.articles-cta {
		padding: 32px 24px;
	}

	.articles-cta__title {
		font-size: 24px;
		line-height: 36px;
	}

	/* 1-column grid on mobile */
	.articles-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.articles-hero__title {
		font-size: 28px;
	}
}
