/* ==========================================================================
   ROMs Archive Page
   ========================================================================== */

/* Hide Astra sidebar / enforce full width */
.page-id-roms .site-content,
.page-id-roms #primary,
.page-id-roms .content-area,
.page-id-roms .ast-container,
.page-id-roms .entry-content,
.page-id-roms .ast-article-single,
.page-id-roms .ast-plain-container {
	max-width: 100% !important;
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
	float: none !important;
}

.roms-page-wrap {
	max-width: 1280px;
	margin: 0 auto;
	padding: 40px 24px 60px;
}

/* ==========================================================================
   PAGE HEADER
   ========================================================================== */
.roms-header {
	margin-bottom: 28px;
}

.roms-header__inner {
	display: flex;
	align-items: baseline;
	gap: 16px;
	flex-wrap: wrap;
}

.roms-header__title {
	font-size: 1.8rem;
	font-weight: 800;
	color: #111827;
	margin: 0;
}

.roms-header__count {
	font-size: 0.9rem;
	color: #6b7280;
	margin: 0;
}

/* ==========================================================================
   CATEGORY FILTER TABS
   ========================================================================== */
.roms-filter {
	margin-bottom: 32px;
	border-bottom: 2px solid #e5e7eb;
}

.roms-filter__inner {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
	padding-bottom: 0;
}

.roms-filter__tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	font-size: 0.88rem;
	font-weight: 600;
	color: #6b7280;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	border-radius: 6px 6px 0 0;
	transition: color 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}

.roms-filter__tab:hover {
	color: #4285F4;
	text-decoration: none;
}

.roms-filter__tab.is-active {
	color: #4285F4;
	border-bottom-color: #4285F4;
}

.roms-filter__tab-count {
	font-size: 0.72rem;
	background: #f3f4f6;
	color: #9ca3af;
	padding: 1px 6px;
	border-radius: 10px;
	font-weight: 700;
}

.roms-filter__tab.is-active .roms-filter__tab-count,
.roms-filter__tab:hover .roms-filter__tab-count {
	background: #e8f0fe;
	color: #4285F4;
}

/* ==========================================================================
   ROM CARD GRID
   ========================================================================== */
.roms-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 20px;
}

/* ==========================================================================
   ROM CARD
   ========================================================================== */
.rom-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid #e5e7eb;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rom-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.rom-card__link {
	display: block;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

/* Image */
.rom-card__image-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 300 / 420;
	overflow: hidden;
	background: #f3f4f6;
}

.rom-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.rom-card:hover .rom-card__image {
	transform: scale(1.04);
}

.rom-card__image-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 3rem;
	background: #f3f4f6;
	color: #d1d5db;
}

/* Format Badge — top left */
.rom-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: #EA4335;
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 5px;
	line-height: 1.5;
	z-index: 2;
}

/* Rating — top right */
.rom-card__rating {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	gap: 4px;
	background: rgba(17, 24, 39, 0.82);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	padding: 4px 8px;
	border-radius: 6px;
	backdrop-filter: blur(4px);
	z-index: 2;
	line-height: 1;
}

.rom-card__rating svg {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}

/* Card Body */
.rom-card__body {
	padding: 12px 14px 14px;
}

.rom-card__title {
	font-size: 0.88rem;
	font-weight: 700;
	color: #111827;
	line-height: 1.4;
	margin: 0 0 6px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rom-card__meta {
	display: flex;
	align-items: center;
	gap: 5px;
	flex-wrap: wrap;
}

.rom-card__cat {
	font-size: 0.75rem;
	font-weight: 600;
	color: #4285F4;
}

.rom-card__dot {
	font-size: 0.75rem;
	color: #d1d5db;
}

.rom-card__size {
	font-size: 0.75rem;
	color: #9ca3af;
	font-weight: 500;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.roms-pagination {
	margin-top: 48px;
	display: flex;
	justify-content: center;
}

.roms-pagination .page-numbers {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
}

.roms-pagination .page-numbers li a,
.roms-pagination .page-numbers li span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	color: #374151;
	border: 1px solid #e5e7eb;
	background: #fff;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.roms-pagination .page-numbers li a:hover {
	background: #e8f0fe;
	color: #4285F4;
	border-color: #c5d8fc;
}

.roms-pagination .page-numbers li span.current {
	background: #4285F4;
	color: #fff;
	border-color: #4285F4;
}

.roms-pagination .page-numbers li a.prev,
.roms-pagination .page-numbers li a.next {
	font-size: 1.3rem;
	font-weight: 400;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.roms-empty {
	text-align: center;
	padding: 80px 20px;
	color: #6b7280;
}

.roms-empty__icon {
	font-size: 3.5rem;
	display: block;
	margin-bottom: 16px;
}

.roms-empty p {
	font-size: 1.1rem;
	margin-bottom: 20px;
}

.roms-empty__reset {
	display: inline-flex;
	padding: 10px 24px;
	background: #4285F4;
	color: #fff;
	border-radius: 8px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s;
}

.roms-empty__reset:hover {
	background: #1a73e8;
	color: #fff;
	text-decoration: none;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1200px) {
	.roms-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
	.roms-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
	.roms-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.roms-header__title { font-size: 1.4rem; }
	.roms-filter__inner { gap: 2px; }
	.roms-filter__tab { padding: 7px 10px; font-size: 0.8rem; }
}

@media (max-width: 380px) {
	.roms-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}