/**
 * Intelliguard Elements — Resources page widget styles.
 *
 * Ported from src/pages/Resources.tsx and SectionLabel.tsx.
 *
 * All selectors are ig-prefixed and page-namespaced with `ig-res-` to avoid
 * collisions with other page widgets. Brand tokens (--ig-navy, --ig-gold,
 * --ig-teal ...) mirror the base widgets.css block and are set on each
 * section root so the variables resolve regardless of :root support.
 */

/* =========================================================================
   Brand tokens (mirrors assets/css/widgets.css — do NOT redefine :root)
   ========================================================================= */
.ig-res-hero,
.ig-res-featured,
.ig-res-grid {
	--ig-navy: hsl(225 70% 17%);
	--ig-navy-light: hsl(225 50% 30%);
	--ig-gold: hsl(38 91% 55%);
	--ig-gold-light: hsl(38 91% 70%);
	--ig-teal: hsl(174 60% 42%);
	--ig-teal-light: hsl(174 50% 60%);
	--ig-background: var(--ig-surface, hsl(0 0% 100%));
	--ig-foreground: var(--ig-ink, hsl(225 70% 17%));
	--ig-muted: hsl(220 20% 96%);
	--ig-muted-foreground: hsl(220 10% 46%);
	--ig-border: hsl(220 20% 90%);
	--ig-card: hsl(0 0% 100%);
	--ig-popover: hsl(0 0% 100%);
	--ig-destructive: hsl(0 84% 60%);
	--ig-radius: 0.75rem;

	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	box-sizing: border-box;
}

.ig-res-hero *,
.ig-res-featured *,
.ig-res-grid * {
	box-sizing: border-box;
}

/* =========================================================================
   Hero — navy ribbon band, content offset right (React: pl-[25%])
   ========================================================================= */
.ig-res-hero {
	position: relative;
	overflow: hidden;
	background: var(--ig-surface, var(--ig-navy));
	padding: 5rem 0;
}

.ig-res-hero__ribbon {
	position: absolute;
	z-index: 1;
	pointer-events: none;
}

.ig-res-hero__ribbon--gold {
	left: -60px;
	bottom: -40px;
	width: 220px;
	height: 350px;
	background: var(--ig-gold);
	clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
}

.ig-res-hero__ribbon--teal {
	right: -40px;
	top: -40px;
	width: 200px;
	height: 320px;
	background: var(--ig-teal);
	clip-path: polygon(0 0, 100% 0, 100% 100%, 0 60%);
}

.ig-res-hero__inner {
	position: relative;
	z-index: 10;
	padding-left: 25%;
}

.ig-res-hero__content {
	max-width: 42rem;
	animation: ig-fade-in-up 0.7s ease-out both;
}

.ig-res-hero__eyebrow {
	color: var(--ig-gold-light);
	margin-bottom: 1rem;
	letter-spacing: 0.15em;
}

.ig-res-hero__heading {
	font-size: clamp(2.25rem, 5vw, 3rem);
	font-weight: 800;
	color: #fff;
	line-height: 1.1;
	margin: 0 0 1.5rem;
}

.ig-res-hero__sub {
	font-size: 1.125rem;
	color: rgba(255, 255, 255, 0.8);
	margin: 0;
	line-height: 1.6;
}

@media (max-width: 900px) {
	.ig-res-hero__inner {
		padding-left: 2rem;
	}
}

/* =========================================================================
   Featured white paper card
   ========================================================================= */
.ig-res-featured {
	padding: 4rem 0;
	background: var(--ig-background);
}

.ig-res-featured__card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	overflow: hidden;
	border-radius: 1rem;
	background: var(--ig-card);
	border: 1px solid var(--ig-border);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.ig-res-featured__media {
	position: relative;
	min-height: 220px;
	overflow: hidden;
}

.ig-res-featured__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ig-res-featured__body {
	flex: 1;
	padding: 2rem;
}

.ig-res-featured__badge {
	display: inline-block;
	background: var(--ig-gold);
	color: var(--ig-navy);
	font-size: 0.75rem;
	font-weight: 700;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
	margin-bottom: 1rem;
}

.ig-res-featured__title {
	font-size: clamp(1.5rem, 3vw, 1.875rem);
	font-weight: 700;
	color: var(--ig-navy);
	margin: 0 0 0.75rem;
	line-height: 1.2;
}

.ig-res-featured__source {
	font-size: 0.875rem;
	color: var(--ig-muted-foreground);
	margin: 0 0 0.5rem;
}

.ig-res-featured__desc {
	color: hsl(225 70% 17% / 0.7);
	line-height: 1.7;
	margin: 0 0 1.5rem;
}

.ig-res-featured__btn {
	padding: 0.75rem 1.5rem;
}

.ig-res-featured__btn-icon {
	display: inline-flex;
}

.ig-res-featured__btn-icon svg {
	width: 1rem;
	height: 1rem;
}

@media (min-width: 768px) {
	.ig-res-featured__card {
		flex-direction: row;
	}

	.ig-res-featured__media {
		flex: 0 0 40%;
		max-width: 40%;
	}

	.ig-res-featured__body {
		padding: 3rem;
	}
}

/* =========================================================================
   Filters & Grid
   ========================================================================= */
.ig-res-grid {
	padding: 4rem 0;
	background: var(--ig-surface, var(--ig-muted));
}

.ig-res-grid__head {
	text-align: center;
	margin-bottom: 2.5rem;
}

.ig-res-grid__heading {
	font-size: clamp(1.5rem, 3vw, 1.875rem);
	font-weight: 700;
	color: var(--ig-navy);
	margin: 0.75rem 0 0;
}

/* Search */
.ig-res-grid__search {
	position: relative;
	max-width: 36rem;
	margin: 0 auto 2rem;
}

.ig-res-grid__search-icon {
	position: absolute;
	left: 0.85rem;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	color: var(--ig-muted-foreground);
	pointer-events: none;
}

.ig-res-grid__search-icon svg {
	width: 1rem;
	height: 1rem;
}

.ig-res-grid__search-input {
	width: 100%;
	height: 2.75rem;
	padding: 0 2.5rem;
	border-radius: 9999px;
	border: 1px solid var(--ig-border);
	background: var(--ig-card);
	color: var(--ig-foreground);
	font-family: inherit;
	font-size: 0.9375rem;
}

.ig-res-grid__search-input:focus {
	outline: none;
	border-color: hsl(225 70% 17% / 0.4);
	box-shadow: 0 0 0 3px hsl(225 70% 17% / 0.08);
}

.ig-res-grid__search-clear {
	position: absolute;
	right: 0.85rem;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	border: none;
	background: transparent;
	color: var(--ig-muted-foreground);
	cursor: pointer;
	padding: 0;
}

.ig-res-grid__search-clear:hover {
	color: var(--ig-foreground);
}

.ig-res-grid__search-clear svg {
	width: 1rem;
	height: 1rem;
}

/* Filters row */
.ig-res-grid__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	margin-bottom: 2.5rem;
}

.ig-res-dropdown {
	position: relative;
}

.ig-res-dropdown__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.5rem 1rem;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 9999px;
	border: 1px solid var(--ig-border);
	background: var(--ig-card);
	color: var(--ig-foreground);
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.ig-res-dropdown__toggle:hover {
	border-color: hsl(225 70% 17% / 0.4);
}

.ig-res-dropdown__label {
	color: var(--ig-muted-foreground);
	margin-right: 0.125rem;
}

.ig-res-dropdown__summary {
	color: var(--ig-foreground);
	max-width: 140px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ig-res-dropdown__chev {
	display: inline-flex;
	color: var(--ig-muted-foreground);
	transition: transform 0.2s ease;
}

.ig-res-dropdown__chev svg {
	width: 0.875rem;
	height: 0.875rem;
}

.ig-res-dropdown.is-open .ig-res-dropdown__chev {
	transform: rotate(180deg);
}

.ig-res-dropdown__menu {
	display: none;
	position: absolute;
	top: calc(100% + 0.25rem);
	left: 0;
	z-index: 50;
	width: 14rem;
	max-height: 16rem;
	overflow-y: auto;
	padding: 0.25rem 0;
	background: var(--ig-popover);
	border: 1px solid var(--ig-border);
	border-radius: 0.5rem;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

.ig-res-dropdown.is-open .ig-res-dropdown__menu {
	display: block;
}

.ig-res-dropdown__option {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.ig-res-dropdown__option:hover {
	background: var(--ig-muted);
}

.ig-res-dropdown__checkbox {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.ig-res-dropdown__box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 1rem;
	height: 1rem;
	border-radius: 0.25rem;
	border: 1px solid var(--ig-border);
	color: #fff;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ig-res-dropdown__box svg {
	width: 0.7rem;
	height: 0.7rem;
	opacity: 0;
}

.ig-res-dropdown__checkbox:checked + .ig-res-dropdown__box {
	border-color: transparent;
}

.ig-res-dropdown__checkbox:checked + .ig-res-dropdown__box.is-navy {
	background: var(--ig-navy);
}

.ig-res-dropdown__checkbox:checked + .ig-res-dropdown__box.is-teal {
	background: var(--ig-teal);
}

.ig-res-dropdown__checkbox:checked + .ig-res-dropdown__box svg {
	opacity: 1;
}

.ig-res-dropdown__opt-label {
	color: var(--ig-muted-foreground);
}

.ig-res-dropdown__checkbox:checked ~ .ig-res-dropdown__opt-label {
	color: var(--ig-foreground);
	font-weight: 500;
}

.ig-res-dropdown__clear {
	display: block;
	width: 100%;
	text-align: left;
	padding: 0.5rem 0.75rem;
	font-size: 0.75rem;
	color: var(--ig-destructive);
	background: transparent;
	border: none;
	cursor: pointer;
}

.ig-res-dropdown__clear:hover {
	background: var(--ig-muted);
}

.ig-res-grid__clear-all {
	margin-left: 0.5rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--ig-destructive);
	background: transparent;
	border: none;
	cursor: pointer;
}

.ig-res-grid__clear-all:hover {
	text-decoration: underline;
}

/* Count */
.ig-res-grid__count {
	text-align: center;
	font-size: 0.875rem;
	color: var(--ig-muted-foreground);
	margin: 0 0 1.5rem;
}

/* Grid */
.ig-res-grid__items {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

@media (min-width: 640px) {
	.ig-res-grid__items {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.ig-res-grid__items {
		grid-template-columns: repeat(4, 1fr);
	}
}

.ig-res-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 0.75rem;
	background: var(--ig-card);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
	cursor: pointer;
	transition: box-shadow 0.2s ease;
}

.ig-res-card:hover {
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.12);
}

.ig-res-card__thumb {
	height: 9rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: hsl(225 70% 17% / 0.05);
}

.ig-res-card__thumb-icon {
	display: inline-flex;
	color: hsl(225 70% 17% / 0.2);
	transition: color 0.2s ease;
}

.ig-res-card__thumb-icon svg,
.ig-res-card__thumb-icon i {
	width: 3rem;
	height: 3rem;
	font-size: 3rem;
}

.ig-res-card:hover .ig-res-card__thumb-icon {
	color: hsl(38 91% 55% / 0.6);
}

.ig-res-card__body {
	padding: 1.25rem;
}

.ig-res-card__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.25rem;
}

.ig-res-card__type {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ig-gold);
}

.ig-res-card__date {
	font-size: 0.625rem;
	color: var(--ig-muted-foreground);
}

.ig-res-card__title {
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--ig-navy);
	line-height: 1.35;
	margin: 0.25rem 0 0.5rem;
}

.ig-res-card__desc {
	font-size: 0.75rem;
	color: var(--ig-muted-foreground);
	line-height: 1.6;
	margin: 0;
}

.ig-res-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin-top: 0.75rem;
}

.ig-res-card__tag {
	font-size: 0.625rem;
	color: var(--ig-muted-foreground);
	background: var(--ig-muted);
	padding: 0.125rem 0.5rem;
	border-radius: 9999px;
}

.ig-res-card__more {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin-top: 0.75rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ig-gold);
}

.ig-res-card:hover .ig-res-card__more {
	text-decoration: underline;
}

.ig-res-card__more-icon {
	display: inline-flex;
}

.ig-res-card__more-icon svg {
	width: 0.75rem;
	height: 0.75rem;
}

/* Empty state */
.ig-res-grid__empty {
	text-align: center;
	padding: 4rem 0;
}

.ig-res-grid__empty-icon {
	display: inline-flex;
	color: hsl(220 10% 46% / 0.3);
	margin-bottom: 1rem;
}

.ig-res-grid__empty-icon svg {
	width: 2.5rem;
	height: 2.5rem;
}

.ig-res-grid__empty-text {
	color: var(--ig-muted-foreground);
	font-weight: 500;
	margin: 0 0 0.5rem;
}

.ig-res-grid__empty-clear {
	font-size: 0.875rem;
	color: var(--ig-navy);
	background: transparent;
	border: none;
	cursor: pointer;
}

.ig-res-grid__empty-clear:hover {
	text-decoration: underline;
}

[data-ig-res-item][hidden],
.ig-res-grid__empty[hidden],
.ig-res-grid__clear-all[hidden],
.ig-res-grid__search-clear[hidden] {
	display: none !important;
}

/* =========================================================================
   Keyframes (mirrors base widgets.css)
   ========================================================================= */
@keyframes ig-fade-in-up {
	from { opacity: 0; transform: translateY(30px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.ig-res-hero__content {
		animation: none !important;
	}
}

/* Card link wrapper + image thumbnails.
   Standardized grid-image treatment: the thumb box is a fixed 9rem frame and the
   image fills it absolutely with object-fit cover. Absolute positioning (inset:0)
   is deliberate -- Elementor's global `.elementor img { height: auto }` reset
   out-specifies a plain class and was letting natural-height images spill out of
   the box and under the card text. inset-based sizing is immune to that. */
.ig-res-card__link { color: inherit; text-decoration: none; }
.ig-res-card__thumb { position: relative; overflow: hidden; }
.ig-res-card__thumb .ig-res-card__link { display: block; position: absolute; inset: 0; }
.ig-res-card__thumb .ig-res-card__thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-res-card__title .ig-res-card__link:hover { color: var(--ig-teal); }

/* Featured media: same immunity -- fill the fixed-height frame absolutely. */
.ig-res-featured__media .ig-res-featured__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
