/* STW Magazine Library V2 */
.stw-ml {
	--stw-ml-accent: #e8501e;
	--stw-ml-dark: #1d1d1d;
	--stw-ml-navy: #0a112d;
	--stw-ml-border: #ddd;
	font-family: inherit;
	margin: 0 0 2rem;
}

/* Tabs */
.stw-ml__tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; border-bottom: 2px solid var(--stw-ml-border); }
.stw-ml__tab {
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	padding: 0.65rem 1.1rem;
	font-size: 1rem;
	font-weight: 700;
	color: #666;
	cursor: pointer;
}
.stw-ml__tab:hover { color: var(--stw-ml-dark); }
.stw-ml__tab.is-active { color: var(--stw-ml-accent); border-bottom-color: var(--stw-ml-accent); }

/* Filters */
.stw-ml__filters {
	background: #f7f7f7;
	border: 1px solid var(--stw-ml-border);
	border-radius: 10px;
	padding: 1rem 1.25rem 1.25rem;
	margin-bottom: 1.5rem;
}
.stw-ml__row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; }
.stw-ml__field { display: flex; flex-direction: column; min-width: 160px; flex: 1 1 160px; }
.stw-ml__field--search { flex: 2 1 260px; }
.stw-ml__field label {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-bottom: 0.35rem;
	color: var(--stw-ml-dark);
}
.stw-ml__field input[type="search"],
.stw-ml__field select {
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--stw-ml-border);
	border-radius: 6px;
	font-size: 0.95rem;
	background: #fff;
	color: var(--stw-ml-dark);
}
.stw-ml__field--reset { flex: 0 0 auto; min-width: 0; }
.stw-ml__reset {
	background: none;
	border: 1px solid var(--stw-ml-border);
	border-radius: 6px;
	padding: 0.45rem 0.9rem;
	font-size: 0.85rem;
	cursor: pointer;
	color: #555;
}
.stw-ml__reset:hover { border-color: var(--stw-ml-accent); color: var(--stw-ml-accent); }

.stw-ml__status { font-size: 0.9rem; color: #555; margin-bottom: 1rem; min-height: 1.2em; }

/* Issue grid — landscape wraparound covers, fewer per row */
.stw-ml__grid--issues {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
	gap: 1.4rem;
}
.stw-ml__issue {
	border: 1px solid var(--stw-ml-border);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stw-ml__issue:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.14); transform: translateY(-2px); }
.stw-ml__issue-cover {
	display: block;
	aspect-ratio: 3 / 2;
	background: var(--stw-ml-navy);
	position: relative;
	overflow: hidden;
}
/* contain, not cover: wraparound art is shown whole, never cropped;
   the odd portrait cover letterboxes on the navy background */
.stw-ml__issue-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.stw-ml__issue-cover .stw-ml__nocover {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	color: #fff; font-weight: 800; font-size: 1.6rem; opacity: 0.7;
}
.stw-ml__issue-head { padding: 0.7rem 0.9rem 0.15rem; }
.stw-ml__issue-no { font-size: 1.05rem; font-weight: 800; color: var(--stw-ml-dark); margin: 0; }
.stw-ml__issue-date { font-size: 0.78rem; color: #888; }
.stw-ml__issue-actions { display: flex; gap: 0.4rem; padding: 0.6rem 0.9rem 0.9rem; flex-wrap: wrap; }
.stw-ml__btn {
	flex: 1 1 auto;
	text-align: center;
	font-size: 0.78rem;
	font-weight: 700;
	padding: 0.42rem 0.5rem;
	border-radius: 5px;
	text-decoration: none;
	border: 1px solid transparent;
	white-space: nowrap;
}
.stw-ml__btn--pdf { background: var(--stw-ml-accent); color: #fff; }
.stw-ml__btn--pdf:hover { background: #c93f12; color: #fff; }
/* Same slot as --pdf, outlined rather than filled: the issue is there, this
   reader just isn't entitled to it yet. */
.stw-ml__btn--subscribe { background: none; border-color: var(--stw-ml-accent); color: var(--stw-ml-accent); }
.stw-ml__btn--subscribe:hover { background: var(--stw-ml-accent); color: #fff; }
.stw-ml__btn--articles { background: var(--stw-ml-navy); color: #fff; }
.stw-ml__btn--articles:hover { background: #1c2a5e; color: #fff; }
.stw-ml__btn--shop { background: none; border-color: var(--stw-ml-border); color: #555; }
.stw-ml__btn--shop:hover { border-color: var(--stw-ml-accent); color: var(--stw-ml-accent); }
.stw-ml__btn--disabled { background: #eee; color: #aaa; pointer-events: none; }

/* Article grid (mirrors reviews finder) */
.stw-ml__grid--articles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.25rem;
}
.stw-ml__article {
	border: 1px solid var(--stw-ml-border);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	position: relative;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stw-ml__article:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.12); transform: translateY(-2px); }
.stw-ml__article-img { display: block; aspect-ratio: 16 / 10; background: #eee center/cover no-repeat; }
.stw-ml__issue-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: var(--stw-ml-navy);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.25rem 0.55rem;
	border-radius: 4px;
}
.stw-ml__article-body { padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.stw-ml__article-type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--stw-ml-accent); font-weight: 700; }
.stw-ml__article-title { font-size: 1.02rem; line-height: 1.3; margin: 0; font-weight: 700; }
.stw-ml__article-title a { color: var(--stw-ml-dark); text-decoration: none; }
.stw-ml__article-title a:hover { color: var(--stw-ml-accent); }
.stw-ml__article-excerpt { font-size: 0.85rem; color: #555; margin: 0; flex: 1; }
.stw-ml__article-meta { font-size: 0.78rem; color: #888; }

/* Load more + empty state */
.stw-ml__more-wrap { text-align: center; margin-top: 1.75rem; }
.stw-ml__more {
	background: var(--stw-ml-dark);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 0.7rem 1.6rem;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
}
.stw-ml__more:hover { background: var(--stw-ml-accent); }
.stw-ml__more[disabled] { opacity: 0.6; cursor: wait; }
.stw-ml__empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 3rem 1rem;
	color: #777;
	border: 1px dashed var(--stw-ml-border);
	border-radius: 10px;
}

@media (max-width: 600px) {
	.stw-ml__row { gap: 0.85rem; }
	.stw-ml__field { flex-basis: 100%; }
	.stw-ml__grid--issues { grid-template-columns: 1fr; gap: 1rem; }
}
