/**
 * Featured Stories Widget — Carousel
 *
 * Compact header, horizontal carousel with arrows/dots,
 * CTA final slide. Prefix: tfs-
 *
 * @package TAMUK_Foundation
 * @since   1.0.0
 */

/* ===========================
   Container
   =========================== */

.tamuk-featured-stories {
	padding: var(--space-8, 2rem) 0;
	max-width: 100%;
	overflow: hidden;
}

/* ===========================
   Compact Section Header
   =========================== */

.tfs-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	border-top: 3px solid var(--tamuk-gold, #FCC10F);
	padding-top: 1rem;
	margin-bottom: 1rem;
	padding-left: var(--gutter, 1.5rem);
	padding-right: var(--gutter, 1.5rem);
}

.tfs-section-header-text {
	flex: 1;
	min-width: 0;
}

.tfs-section-title {
	font-family: var(--font-heading, 'Cinzel', serif);
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--tamuk-blue, #003399);
	text-transform: none;
	letter-spacing: normal;
	margin: 0;
	line-height: 1.3;
}

/* Legacy header — hide if still in DOM */
.tfs-header { display: none; }
.tfs-accent-line { display: none; }
.tfs-footer { display: none; }

/* ===========================
   Arrows
   =========================== */

.tfs-arrows {
	display: flex;
	gap: 0.4rem;
	flex-shrink: 0;
}

.tfs-arrow {
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--tamuk-blue, #003399);
	border-radius: 50%;
	background: transparent;
	color: var(--tamuk-blue, #003399);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.tfs-arrow:hover:not(:disabled) {
	background: var(--tamuk-blue, #003399);
	color: #fff;
	transform: scale(1.06);
}

.tfs-arrow:active:not(:disabled) {
	transform: scale(0.96);
}

.tfs-arrow:disabled {
	opacity: 0.3;
	cursor: default;
}

.tfs-arrow:focus-visible {
	outline: 2px solid var(--tamuk-blue, #003399);
	outline-offset: 2px;
}

/* ===========================
   Carousel Viewport & Track
   =========================== */

.tfs-viewport {
	overflow: hidden;
	position: relative;
	padding: 0.75rem var(--gutter, 1.5rem) 0;
}

.tfs-track {
	display: flex;
	transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
}

.tfs-slide {
	flex: none;
	width: calc(33.3333% - 1rem);
	margin-right: 1.5rem;
	box-sizing: border-box;
}

.tfs-carousel[data-visible="2"] .tfs-slide { width: calc(50% - 0.75rem); }
.tfs-carousel[data-visible="3"] .tfs-slide { width: calc(33.3333% - 1rem); }
.tfs-carousel[data-visible="4"] .tfs-slide { width: calc(25% - 1.125rem); }

.tfs-slide:last-child { margin-right: 0; }

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

.tfs-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tfs-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
	border-color: #bfdbfe;
}

/* Image container */
.tfs-card-image-link {
	display: block;
	text-decoration: none;
	overflow: hidden;
	position: relative;
	margin: 0.6rem 0.6rem 0;
	border-radius: 8px;
}

.tfs-card-image {
	position: relative;
	height: 220px;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	border-radius: 8px;
	transition: transform 0.5s ease;
}

a.tfs-card-image-link:hover .tfs-card-image,
a.tfs-card-image-link:focus .tfs-card-image {
	transform: scale(1.04);
}

/* ===========================
   Badge
   =========================== */

.tfs-badge {
	position: absolute;
	z-index: 2;
	display: inline-block;
	padding: 4px 12px;
	background-color: var(--tamuk-gold, #FCC10F);
	color: var(--tamuk-blue, #00286E);
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: 1.3;
	white-space: nowrap;
	border-radius: 4px;
}

.tfs-badge--top-right  { top: 0.6rem; right: 0.6rem; }
.tfs-badge--top-left   { top: 0.6rem; left: 0.6rem; }
.tfs-badge--bottom-right { bottom: 0.6rem; right: 0.6rem; }
.tfs-badge--bottom-left  { bottom: 0.6rem; left: 0.6rem; }

/* ===========================
   Card Body
   =========================== */

.tfs-card-body {
	padding: 1rem 1.25rem 1.25rem;
	font-size: var(--text-sm, 0.875rem);
	line-height: 1.65;
	color: #333;
	flex: 1;
}

.tfs-card-date {
	display: block;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #9CA3AF;
	margin-bottom: 0.35rem;
}

.tfs-card-body p {
	margin: 0;
}

.tfs-card-body a {
	color: var(--tamuk-blue, #00286E);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color 0.15s ease;
}

.tfs-card-body a:hover,
.tfs-card-body a:focus {
	color: var(--tamuk-blue-light, #1a4a99);
}

.tfs-card-read-more {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ===========================
   CTA Slide (final card)
   =========================== */

.tfs-cta-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	height: 100%;
	min-height: 300px;
	background: linear-gradient(145deg, #003399 0%, #001a4d 100%);
	border-radius: 12px;
	padding: 2rem 1.5rem;
	text-decoration: none;
	color: #fff;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.tfs-cta-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 28px rgba(0, 51, 153, 0.2);
}

.tfs-cta-icon {
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(252, 193, 15, 0.12);
	border: 2px solid rgba(252, 193, 15, 0.35);
	border-radius: 50%;
	color: #FCC10F;
	margin-bottom: 1rem;
}

.tfs-cta-title {
	font-family: var(--font-heading, 'Cinzel', serif);
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
	margin: 0 0 0.4rem;
	line-height: 1.3;
}

.tfs-cta-desc {
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.6);
	margin: 0 0 1.25rem;
	line-height: 1.5;
	max-width: 220px;
}

.tfs-cta-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0.55rem 1.5rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: #003399;
	background: #FCC10F;
	border: none;
	border-radius: 50px;
	text-decoration: none;
	transition: background 0.2s ease;
}

.tfs-cta-card:hover .tfs-cta-btn {
	background: #fff;
}

/* ===========================
   Dots
   =========================== */

.tfs-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 1.25rem;
	padding: 0 var(--gutter, 1.5rem);
}

.tfs-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: none;
	padding: 0;
	background: #D1D5DB;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.tfs-dot:hover { background: #9CA3AF; }

.tfs-dot.is-active {
	background: var(--tamuk-blue, #003399);
	transform: scale(1.25);
}

.tfs-dot:focus-visible {
	outline: 2px solid var(--tamuk-blue, #003399);
	outline-offset: 2px;
}

/* ===========================
   Placeholder / No Image
   =========================== */

.tfs-card-image--placeholder {
	background: linear-gradient(135deg, var(--tamuk-gray-100, #f1f3f5) 0%, var(--tamuk-gray-200, #e2e5e9) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.tfs-no-posts {
	text-align: center;
	color: #6B7280;
	padding: 2rem 1rem;
}

/* ===========================
   Responsive: Tablet
   =========================== */

@media (max-width: 960px) {
	.tfs-carousel[data-visible="3"] .tfs-slide,
	.tfs-carousel[data-visible="4"] .tfs-slide {
		width: calc(50% - 0.75rem);
	}

	/* Legacy grid fallback */
	.tfs-grid--3,
	.tfs-grid--4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ===========================
   Responsive: Mobile
   =========================== */

@media (max-width: 640px) {
	.tfs-carousel[data-visible="2"] .tfs-slide,
	.tfs-carousel[data-visible="3"] .tfs-slide,
	.tfs-carousel[data-visible="4"] .tfs-slide {
		width: 100%;
		margin-right: 1.5rem;
	}

	.tfs-section-title {
		font-size: 1.15rem;
	}

	.tfs-arrow {
		width: 34px;
		height: 34px;
	}

	.tfs-card-image { height: 200px; }

	/* Legacy grid fallback */
	.tfs-grid--2,
	.tfs-grid--3,
	.tfs-grid--4 {
		grid-template-columns: 1fr;
	}
}

/* ===========================
   Reduced Motion
   =========================== */

@media (prefers-reduced-motion: reduce) {
	.tfs-track,
	.tfs-card,
	.tfs-card-image,
	.tfs-cta-card,
	.tfs-arrow,
	.tfs-dot {
		transition: none;
	}

	.tfs-card:hover,
	.tfs-cta-card:hover {
		transform: none;
	}

	a.tfs-card-image-link:hover .tfs-card-image {
		transform: none;
	}
}

/* ===========================
   Elementor Editor Overrides
   =========================== */

.elementor-editor-active .tfs-card-image {
	min-height: 200px;
}
