/* =========================================================
   Montage Insights — Frontend Styles
   ========================================================= */

/* --- Variables ------------------------------------------ */
:root {
	--mtg-bg:          #f5f2ec;   /* card cream background   */
	--mtg-dark:        #1a1a1a;   /* dark icon circle / text */
	--mtg-orange:      #e8621a;   /* accent / CTA            */
	--mtg-orange-dark: #c9521000; /* hover state             */
	--mtg-text:        #333333;
	--mtg-meta:        #e8621a;   /* category label colour   */
	--mtg-border:      #dddad2;
	--mtg-radius:      0px;
	--mtg-font:        inherit;
	--mtg-gap:         2px;
}

/* --- Wrapper -------------------------------------------- */
.mtg-insights {
	font-family: var(--mtg-font);
	color: var(--mtg-text);
	max-width: 100%;
}

/* --- Filter Bar ----------------------------------------- */
.mtg-insights__filters {
	display: flex;
	align-items: center;
	gap: 0;
	padding: 0 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.mtg-insights__filter-btn {
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.03em;
	padding: 14px 20px;
	cursor: pointer;
	transition: color 0.2s;
	border-radius: 0;
	position: relative;
}

.mtg-insights__filter-btn:hover {
	color: var(--mtg-orange);
}

.mtg-insights__filter-btn--active {
	background: var(--mtg-orange);
	color: #ffffff !important;
	border-radius: 20px;
	padding: 8px 18px;
	margin: 8px 4px;
}

/* Search button (right-aligned) */
.mtg-insights__search-btn {
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 14px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 14px 20px;
	cursor: pointer;
	margin-left: auto;
	transition: color 0.2s;
}

.mtg-insights__search-btn:hover {
	color: var(--mtg-orange);
}

/* --- Search Bar ----------------------------------------- */
.mtg-insights__search-bar {
	background: #2a2a2a;
	padding: 10px 16px 14px;
}

.mtg-insights__search-input {
	width: 100%;
	padding: 10px 14px;
	font-size: 15px;
	border: 1px solid #555;
	background: #1a1a1a;
	color: #fff;
	border-radius: 4px;
	box-sizing: border-box;
}

.mtg-insights__search-input::placeholder {
	color: #999;
}

/* --- Grid ----------------------------------------------- */
.mtg-insights__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 50px 30px;
}

/* =========================================================
   Responsive — Tablet (max 1024px)
   ========================================================= */
@media (max-width: 1024px) {

	.mtg-insights__grid {
		gap: 30px 20px;
	}

	.mtg-card__inner {
		padding: 28px 24px 24px;
	}

	.mtg-card__cta {
		font-size: 18px;
		padding: 14px 18px 10px;
	}

	.mtg-insights__pagination {
		padding-top: 48px;
	}
}

/* =========================================================
   Responsive — Mobile (max 767px)
   ========================================================= */
@media (max-width: 767px) {

	/* Filter bar */
	.mtg-insights__filters {
		padding: 0 12px;
		margin-bottom: 16px;
	}

	.mtg-insights__filter-btn {
		font-size: 13px;
		padding: 10px 14px;
	}

	.mtg-insights__filter-btn--active {
		padding: 6px 14px;
		margin: 6px 3px;
	}

	.mtg-insights__search-btn {
		padding: 10px 14px;
	}

	/* Grid: single column */
	.mtg-insights__grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	/* Card */
	.mtg-card__inner {
		padding: 24px 20px 20px;
	}

	.mtg-card__header {
		gap: 12px;
		margin-bottom: 14px;
	}

	.mtg-card__category {
		font-size: 14px;
	}

	.mtg-card__reading-time {
		font-size: 12px;
	}

	.mtg-card__excerpt {
		font-size: 13px;
		margin-bottom: 20px;
	}

	.mtg-card__cta {
		font-size: 16px;
		padding: 12px 16px 9px;
		width: 100%;
		justify-content: space-between;
	}

	/* Pagination */
	.mtg-insights__pagination {
		padding-top: 36px;
		gap: 12px;
	}

	.mtg-insights__view-all {
		font-size: 20px;
	}

	.mtg-insights__page-btn {
		width: 36px;
		height: 36px;
	}
}

/* =========================================================
   Responsive — Small Mobile (max 520px)
   ========================================================= */
@media (max-width: 520px) {

	/* Filter bar: wrap tabs to their own rows */
	.mtg-insights__filters {
		padding: 0 8px;
		gap: 0;
	}

	.mtg-insights__filter-btn {
		font-size: 12px;
		padding: 8px 10px;
	}

	.mtg-insights__filter-btn--active {
		padding: 5px 12px;
		margin: 5px 2px;
	}

	.mtg-insights__search-btn {
		padding: 8px 10px;
		font-size: 12px;
	}

	/* Card */
	.mtg-card__inner {
		padding: 20px 16px 18px;
	}

	/* Stack icon above title on very narrow screens */
	.mtg-card__header {
		flex-direction: column;
		gap: 10px;
		margin-bottom: 12px;
	}

	.mtg-card__category {
		font-size: 13px;
	}

	.mtg-card__cta {
		font-size: 15px;
		padding: 11px 14px 8px;
	}

	/* Pagination */
	.mtg-insights__pagination {
		padding-top: 28px;
		gap: 10px;
	}

	.mtg-insights__view-all {
		font-size: 18px;
	}

	.mtg-insights__page-btn {
		width: 32px;
		height: 32px;
	}
}

/* --- Card ----------------------------------------------- */
.mtg-card {
	background: #F5F3EB;
	box-shadow: 0 0 13px 0 rgba(0, 0, 0, 0.08);
}

.mtg-card__inner {
	padding: 36px 32px 32px;
	display: flex;
	flex-direction: column;
	height: 100%;
	box-sizing: border-box;
}

/* Card header: icon + title side by side */
.mtg-card__header {
	display: flex;
	gap: 15px;
	margin-bottom: 20px;
}

/* Icon circle — used only for custom uploaded icons */
.mtg-card__icon-wrap {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--mtg-dark);
	display: flex;
	justify-content: center;
	flex-shrink: 0;
}

/* Brand SVGs already include the circle — no wrapper background needed */
.mtg-card__icon-wrap--brand {
	background: transparent;
	width: auto;
	height: auto;
}

.mtg-card__icon {
	width: 24px;
	height: 24px;
	stroke: #ffffff;
}

/* Custom uploaded image icon */
.mtg-card__icon--img {
	width: 28px;
	height: 28px;
	object-fit: contain;
	stroke: none;
	filter: brightness(0) invert(1);
}

/* Title */
.mtg-card__title {
	font-size: 28px !important;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: 94%;
	color: #333333;
	font-family: 'Teko', sans-serif !important;
	margin: 0;
}

/* Meta row */
.mtg-card__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	margin-bottom: 14px;
}

.mtg-card__category {
	color: #F0731F;
	line-height: 150%;
	font-weight: 600;
	font-family: 'Founders Grotesk - Semibold';
	font-size: 16px;
}

.mtg-card__meta-sep {
	color: #999;
}

.mtg-card__reading-time {
	color: #63666A;
	font-weight: 400;
	font-size: 14px;
	line-height: 100%;
}

/* Excerpt */
.mtg-card__excerpt {
	font-size: 14px;
	line-height: 1.6;
	color: #555;
	margin: 0 0 24px;
	flex-grow: 1;
}

/* CTA button */
.mtg-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: #F0731F;
	color: #ffffff;
	text-decoration: none;
	font-size: 20px;
	font-weight: 700;
	padding: 17px 20px 12px;
	border-radius: 0;
	transition: background 0.2s;
	align-self: flex-start;
	margin-top: auto;
	font-family: 'Founders Grotesk - Semibold';
}

.mtg-card__cta:hover,
.mtg-card__cta:focus {
	background: #c9521a;
	color: #ffffff;
	text-decoration: none;
}

.mtg-card__cta-arrow {
	flex-shrink: 0;
}

/* --- Loading Spinner ------------------------------------ */
.mtg-insights__spinner {
	display: flex;
	justify-content: center;
	padding: 32px 0;
}

.mtg-insights__spinner-ring {
	display: block;
	width: 36px;
	height: 36px;
	border: 3px solid var(--mtg-border);
	border-top-color: var(--mtg-orange);
	border-radius: 50%;
	animation: mtg-spin 0.7s linear infinite;
}

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

/* --- No Results ----------------------------------------- */
.mtg-insights__no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 48px 16px;
	color: #888;
	font-size: 15px;
}

/* --- Pagination ----------------------------------------- */
.mtg-insights__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 65px 16px 0;
	background: transparent;
}

.mtg-insights__page-btn {
	background: transparent;
	border: 2px solid var(--mtg-dark);
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
	padding: 0;
	color: var(--mtg-dark);
}

.mtg-insights__page-btn:hover:not(:disabled) {
	background: var(--mtg-dark);
	color: #ffffff;
}

.mtg-insights__page-btn:hover:not(:disabled) svg {
	stroke: #ffffff;
}

.mtg-insights__page-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.mtg-insights__page-btn svg {
	stroke: var(--mtg-dark);
}

.mtg-insights__view-all {
	font-size: 26px;
	font-weight: 400;
	text-transform: uppercase;
	color: #333;
	text-decoration: none;
	border-bottom: 1px solid #333;
	transition: color 0.2s, border-color 0.2s;
	font-family: 'Teko', sans-serif;
}

.mtg-insights__view-all:hover {
	color: var(--mtg-orange);
	border-color: var(--mtg-orange);
}
