/**
 * Chiba Sharks Archive Explorer Stylesheet.
 *
 * Provides WCAG 2.1 AA compliant styling, dual-mode views (Card Grid vs Chronicle Timeline),
 * and 7-breakpoint responsive ergonomics (1440px down to 390px).
 *
 * @package ChibaSharks
 */

:root {
	--sharks-archive-navy: #001b3a;
	--sharks-archive-navy-hover: #0a2952;
	--sharks-archive-blue: #0056b3;
	--sharks-archive-gold: #f59e0b;
	--sharks-archive-gold-dark: #b45309;
	--sharks-archive-slate-dark: #0f172a;
	--sharks-archive-slate-body: #334155;
	--sharks-archive-slate-muted: #475569;
	--sharks-archive-border: #e2e8f0;
	--sharks-archive-bg-light: #f8fafc;
	--sharks-archive-chip-bg: #f1f5f9;
	--sharks-archive-chip-text: #0f172a;
	--sharks-archive-focus-ring: 0 0 0 3px rgba(0, 27, 58, 0.25);
}

/* ==========================================================================
   Base Container & Hero
   ========================================================================== */

.sharks-archive-page-wrap {
	padding: 24px 0 60px;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.sharks-archive-explorer {
	font-family: inherit;
	color: var(--sharks-archive-slate-body);
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

.sharks-archive-explorer *,
.sharks-archive-explorer *::before,
.sharks-archive-explorer *::after {
	box-sizing: border-box;
}

.sharks-archive-hero {
	text-align: center;
	padding: 20px 16px 28px;
	margin-bottom: 20px;
	background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
	border-radius: 12px;
	border: 1px solid var(--sharks-archive-border);
}

.sharks-archive-hero__title {
	font-size: clamp(1.6rem, 3.5vw, 2.4rem);
	font-weight: 800;
	color: var(--sharks-archive-navy);
	margin: 0 0 10px;
	line-height: 1.25;
}

.sharks-archive-hero__subtitle {
	font-size: clamp(0.95rem, 1.8vw, 1.15rem);
	color: var(--sharks-archive-slate-muted);
	max-width: 720px;
	margin: 0 auto;
	line-height: 1.5;
}

/* ==========================================================================
   1. Seasons & Eras Navigation (Positioned at Top, Identical to Image Gallery)
   ========================================================================== */

.sharks-archive-tabs-wrap {
	border-bottom: 2px solid var(--sharks-archive-border);
	padding-bottom: 0.85rem;
	margin-bottom: 1.25rem;
	width: 100%;
}

.sharks-archive-tablist {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.sharks-archive-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.45rem 0.95rem;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	color: #1a202c;
	background: #ffffff;
	border: 1.5px solid #ccd0d4;
	border-radius: 9999px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
	line-height: 1.35;
	text-decoration: none;
}

.sharks-archive-tab:hover {
	border-color: #5ac9d1;
	color: var(--sharks-archive-navy);
	transform: translateY(-1px);
}

.sharks-archive-tab:focus-visible {
	outline: 2px solid #5ac9d1;
	outline-offset: 2px;
}

.sharks-archive-tab.is-active,
.sharks-archive-tab[aria-selected="true"] {
	background: var(--sharks-archive-navy);
	color: #5ac9d1;
	border-color: #5ac9d1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sharks-archive-tab .tab-count {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 700;
	padding: 0.1rem 0.4rem;
	border-radius: 9999px;
	background: rgba(0, 0, 0, 0.08);
	color: inherit;
}

.sharks-archive-tab.is-active .tab-count {
	background: rgba(90, 201, 209, 0.22);
	color: #5ac9d1;
}

/* ==========================================================================
   2. Filter Bar, Search Box & View Mode Switcher
   ========================================================================== */

.sharks-archive-filter-bar {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	margin-bottom: 1.5rem;
	background: #ffffff;
	border: 1px solid var(--sharks-archive-border);
	border-radius: 12px;
	padding: 16px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
}

.sharks-archive-filter-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

/* Search Input Wrap */
.sharks-archive-search-wrap {
	flex: 1 1 auto;
	min-width: 260px;
	max-width: 440px;
}

.sharks-archive-search-input-box {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

.sharks-archive-search-input-box .search-icon {
	position: absolute;
	left: 0.85rem;
	width: 18px;
	height: 18px;
	color: var(--sharks-archive-slate-muted);
	pointer-events: none;
}

.sharks-archive-search-input {
	width: 100%;
	height: 44px;
	padding: 0.5rem 2.5rem 0.5rem 2.5rem;
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--sharks-archive-slate-dark);
	background: #ffffff;
	border: 1.5px solid #ccd0d4;
	border-radius: 9999px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sharks-archive-search-input:focus {
	border-color: #5ac9d1;
	box-shadow: 0 0 0 3px rgba(90, 201, 209, 0.25);
}

.sharks-archive-search-clear {
	position: absolute;
	right: 0.75rem;
	background: transparent;
	border: none;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--sharks-archive-slate-muted);
	cursor: pointer;
	padding: 0.25rem;
	border-radius: 50%;
}

.sharks-archive-search-clear:hover,
.sharks-archive-search-clear:focus-visible {
	color: var(--sharks-archive-slate-dark);
	outline: 2px solid #5ac9d1;
}

/* Article Type Category Buttons (Matching Image Gallery Category Pills) */
.sharks-archive-type-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.sharks-archive-type-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.45rem 1rem;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	color: #1a202c;
	background: #ffffff;
	border: 1.5px solid #ccd0d4;
	border-radius: 9999px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
	line-height: 1.35;
	white-space: nowrap;
}

.sharks-archive-type-btn:hover {
	border-color: #5ac9d1;
	color: var(--sharks-archive-navy);
	transform: translateY(-1px);
}

.sharks-archive-type-btn:focus-visible {
	outline: 2px solid #5ac9d1;
	outline-offset: 2px;
}

.sharks-archive-type-btn.is-active,
.sharks-archive-type-btn[aria-pressed="true"] {
	background: var(--sharks-archive-navy);
	color: #5ac9d1;
	border-color: #5ac9d1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* View Mode Switcher */
.sharks-archive-view-toggle {
	display: inline-flex;
	align-self: flex-start;
	width: fit-content;
	background: var(--sharks-archive-chip-bg);
	border-radius: 9999px;
	padding: 3px;
	gap: 2px;
	border: 1.5px solid #ccd0d4;
}

.sharks-archive-view-btn {
	background: transparent;
	border: none;
	padding: 6px 12px;
	border-radius: 9999px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--sharks-archive-slate-muted);
	transition: all 0.2s ease;
	min-height: 34px;
}

.sharks-archive-view-btn.is-active {
	background: var(--sharks-archive-navy);
	color: #5ac9d1;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sharks-archive-view-btn:focus-visible {
	outline: 2px solid #5ac9d1;
	outline-offset: 1px;
}

/* Status Bar */
.sharks-archive-status-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 4px;
	padding-top: 10px;
	border-top: 1px solid var(--sharks-archive-border);
	font-size: 0.85rem;
	color: var(--sharks-archive-slate-muted);
}

.sharks-archive-count {
	font-weight: 600;
}

.sharks-archive-reset-btn {
	background: transparent;
	border: none;
	color: var(--sharks-archive-blue);
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

.sharks-archive-reset-btn:hover {
	color: var(--sharks-archive-navy);
}

/* ==========================================================================
   Results Feed: Card Grid View
   ========================================================================== */

.sharks-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	margin-bottom: 30px;
}

.sharks-article-card {
	background: #ffffff;
	border: 1px solid var(--sharks-archive-border);
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	position: relative;
}

.sharks-article-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.sharks-article-card__thumb-wrap {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* 16:9 Aspect Ratio */
	background: #e2e8f0;
	overflow: hidden;
}

.sharks-article-card__img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.sharks-article-card:hover .sharks-article-card__img {
	transform: scale(1.03);
}

.sharks-article-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 3px 8px;
	border-radius: 4px;
	z-index: 2;
}

.sharks-badge--report {
	background: var(--sharks-archive-navy);
	color: #ffffff;
}

.sharks-badge--feature {
	background: var(--sharks-archive-gold);
	color: #000000;
}

.sharks-badge--news {
	background: var(--sharks-archive-blue);
	color: #ffffff;
}

.sharks-article-card__body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.sharks-article-card__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.78rem;
	color: var(--sharks-archive-slate-muted);
	margin-bottom: 8px;
	font-weight: 600;
}

.sharks-article-card__title {
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.35;
	margin: 0 0 10px;
	color: var(--sharks-archive-slate-dark);
}

.sharks-article-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.sharks-article-card__title a:hover {
	color: var(--sharks-archive-blue);
}

.sharks-article-card__title a:focus-visible {
	outline: 2px solid var(--sharks-archive-navy);
	border-radius: 2px;
}

.sharks-article-card__excerpt {
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--sharks-archive-slate-muted);
	margin: 0 0 16px;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sharks-article-card__footer {
	margin-top: auto;
	padding-top: 10px;
	border-top: 1px solid #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.sharks-article-card__read-link {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--sharks-archive-navy);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.sharks-article-card__read-link:hover {
	color: var(--sharks-archive-blue);
}

/* ==========================================================================
   Results Feed: Chronicle Timeline View
   ========================================================================== */

.sharks-archive-chronicle {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 30px;
	position: relative;
	padding-left: 20px;
	border-left: 3px solid var(--sharks-archive-border);
}

.sharks-chronicle-item {
	background: #ffffff;
	border: 1px solid var(--sharks-archive-border);
	border-radius: 8px;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	position: relative;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.sharks-chronicle-item::before {
	content: '';
	position: absolute;
	left: -28px;
	top: 50%;
	transform: translateY(-50%);
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--sharks-archive-navy);
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 2px var(--sharks-archive-border);
}

.sharks-chronicle-item:hover {
	background: var(--sharks-archive-bg-light);
	border-color: #cbd5e1;
}

.sharks-chronicle-item__main {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
}

.sharks-chronicle-item__date {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--sharks-archive-slate-muted);
	white-space: nowrap;
	min-width: 90px;
}

.sharks-chronicle-item__title {
	font-size: 0.95rem;
	font-weight: 700;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sharks-chronicle-item__title a {
	color: var(--sharks-archive-slate-dark);
	text-decoration: none;
}

.sharks-chronicle-item__title a:hover {
	color: var(--sharks-archive-blue);
}

.sharks-chronicle-item__badge {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	padding: 2px 6px;
	border-radius: 4px;
	white-space: nowrap;
}

/* ==========================================================================
   Empty State & Buttons
   ========================================================================== */

.sharks-archive-empty {
	text-align: center;
	padding: 48px 16px;
	background: #ffffff;
	border: 1px dashed var(--sharks-archive-border);
	border-radius: 12px;
	margin-bottom: 30px;
}

.sharks-archive-empty__icon {
	font-size: 2.5rem;
	margin-bottom: 12px;
}

.sharks-archive-empty__title {
	font-size: 1.3rem;
	font-weight: 800;
	color: var(--sharks-archive-slate-dark);
	margin: 0 0 8px;
}

.sharks-archive-empty__desc {
	font-size: 0.95rem;
	color: var(--sharks-archive-slate-muted);
	max-width: 480px;
	margin: 0 auto 20px;
}

.sharks-archive-btn {
	background: var(--sharks-archive-navy);
	color: #ffffff;
	border: none;
	padding: 10px 20px;
	font-size: 0.9rem;
	font-weight: 700;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.sharks-archive-btn:hover {
	background: var(--sharks-archive-navy-hover);
}

.sharks-archive-btn--secondary {
	background: #ffffff;
	color: var(--sharks-archive-navy);
	border: 1px solid var(--sharks-archive-border);
}

.sharks-archive-btn--secondary:hover {
	background: var(--sharks-archive-chip-bg);
}

.sharks-archive-pagination {
	text-align: center;
	margin: 30px 0;
}

/* ==========================================================================
   7-Breakpoint Responsive Ergonomics Matrix
   1440px | 1200px | 1040px | 1024px | 768px | 600px | 390px
   ========================================================================== */

/* 1440px & 1200px: 4-column desktop */
@media (min-width: 1200px) {
	.sharks-archive-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* 1040px & 1024px: 3-column tablet landscape / small desktop */
@media (max-width: 1199px) and (min-width: 1024px) {
	.sharks-archive-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* 768px: 2-column portrait tablet */
@media (max-width: 1023px) and (min-width: 768px) {
	.sharks-archive-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.sharks-archive-filter-row {
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 12px;
	}
	.sharks-archive-search-wrap {
		flex: 0 0 auto;
		width: 100%;
		max-width: 100%;
	}
}

/* 600px: large mobile / phablet */
@media (max-width: 767px) {
	.sharks-archive-grid {
		grid-template-columns: 1fr;
	}
	.sharks-archive-filter-bar {
		padding: 12px;
	}
	.sharks-archive-filter-row {
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 10px;
	}
	.sharks-archive-search-wrap {
		flex: 0 0 auto;
		width: 100%;
		max-width: 100%;
	}
	.sharks-archive-type-pills {
		justify-content: flex-start;
		overflow-x: auto;
		flex-wrap: nowrap;
		padding-bottom: 4px;
	}
	.sharks-archive-type-btn {
		font-size: 0.8rem;
		padding: 0.35rem 0.85rem;
	}
	.sharks-archive-tablist {
		gap: 0.35rem;
	}
	.sharks-archive-tab {
		font-size: 0.82rem;
		padding: 0.35rem 0.75rem;
	}
	.sharks-chronicle-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
	.sharks-chronicle-item__main {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
	.sharks-chronicle-item__title {
		white-space: normal;
	}
}

/* 390px: iPhone 14/15/16 small mobile */
@media (max-width: 420px) {
	.sharks-archive-page-wrap {
		padding: 12px 0 40px;
	}
	.sharks-archive-hero {
		padding: 16px 12px;
	}
	.sharks-archive-hero__title {
		font-size: 1.45rem;
	}
	.sharks-archive-hero__subtitle {
		font-size: 0.88rem;
	}
	.sharks-archive-controls {
		padding: 10px;
	}
	.sharks-archive-chip {
		font-size: 0.8rem;
		padding: 5px 10px;
	}
	.sharks-article-card__body {
		padding: 12px;
	}
	.sharks-article-card__title {
		font-size: 0.98rem;
	}
}
