/* Magazine Library: /library/ and the library product pages.
   Builds on archive.css (tokens, chips, panel headings, buttons). */

.wfa-wrap-lib { max-width: 1180px; }
/* archive.css caps .wfa-lede at 62ch for article pages; the library intro runs full width. */
.wfa-wrap-lib .wfa-lede { max-width: none; }

/* --- subscription band: the strongest call to action ---------------- */
.wfa-lib-sub {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin: 0 0 18px;
	padding: 18px 22px;
	border-radius: 12px;
	background: var(--wfa-ink);
	color: #fff;
}
.wfa-lib-sub-h { margin: 0 0 4px; font-size: 1.15rem; font-weight: 800; color: #fff; }
.wfa-lib-sub-t { margin: 0; font-size: 0.92rem; opacity: 0.85; }
.wfa-lib-sub-btn { flex: 0 0 auto; padding: 12px 26px; font-size: 1rem; }

.wfa-lib-passline { font-size: 0.95rem; color: var(--wfa-muted); margin: 0 0 22px; }
.wfa-lib-passline a { color: var(--wfa-pink-dark); font-weight: 600; }

/* --- year filter ----------------------------------------------------- */
.wfa-lib-years {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	margin: 0 0 30px;
	scroll-margin-top: 90px;
}

.wfa-lib-year { margin-bottom: 38px; }
.wfa-lib-year[hidden] { display: none; }

/* --- grid and card --------------------------------------------------- */
.wfa-lib-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
	gap: 26px 20px;
}
.wfa-lib-card { display: flex; flex-direction: column; min-width: 0; }
.wfa-lib-cover {
	position: relative;
	display: block;
	aspect-ratio: 708 / 1000;
	border-radius: 6px;
	overflow: hidden;
	background: var(--wfa-tint);
	box-shadow: 0 2px 10px rgba(20, 22, 26, 0.14);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wfa-lib-cover:hover,
.wfa-lib-cover:focus { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(20, 22, 26, 0.2); }
.wfa-lib-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wfa-lib-flag {
	position: absolute;
	bottom: 8px;
	left: 8px;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--wfa-ink);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}
.wfa-lib-flag.is-free { background: var(--wfa-pink); }

.wfa-lib-body { padding-top: 12px; display: flex; flex-direction: column; flex: 1 1 auto; }
.wfa-lib-kicker {
	margin: 0 0 2px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wfa-pink-dark);
}
.wfa-lib-name { margin: 0; font-size: 1.02rem; line-height: 1.25; }
.wfa-lib-name a { color: var(--wfa-ink); text-decoration: none; }
.wfa-lib-name a:hover { color: var(--wfa-pink-dark); }
.wfa-lib-date { margin: 2px 0 10px; font-size: 0.85rem; color: var(--wfa-muted); }

.wfa-lib-actions { display: flex; flex-direction: column; gap: 6px; }
.wfa-lib-btn {
	display: block;
	padding: 9px 12px;
	border-radius: 8px;
	text-align: center;
	font-weight: 700;
	font-size: 0.88rem;
	line-height: 1.25;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.wfa-lib-read { background: var(--wfa-pink); color: #fff; border: 2px solid var(--wfa-pink); }
.wfa-lib-read:hover,
.wfa-lib-read:focus { background: var(--wfa-pink-dark); border-color: var(--wfa-pink-dark); color: #fff; }
.wfa-lib-read span { font-weight: 500; opacity: 0.9; }
/* Current issue: same shape as the read button, greyed out and not clickable. */
.wfa-lib-btn.is-disabled,
.wfa-lib-btn.is-disabled:hover { background: var(--wfa-line); border-color: var(--wfa-line); color: var(--wfa-muted); cursor: default; }
.wfa-lib-buy { background: #fff; color: var(--wfa-ink); border: 2px solid var(--wfa-ink); }
.wfa-lib-buy:hover,
.wfa-lib-buy:focus { background: var(--wfa-ink); color: #fff; }
.wfa-lib-buy .amount { color: inherit; }
.wfa-lib-sub-btn { background: var(--wfa-pink); color: #fff; }
.wfa-lib-sub-btn:hover,
.wfa-lib-sub-btn:focus { background: var(--wfa-pink-dark); color: #fff; }
.wfa-lib-note { display: block; font-size: 0.8rem; line-height: 1.35; color: var(--wfa-muted); text-align: center; padding: 4px 2px; }
.wfa-lib-low { display: block; font-size: 0.78rem; font-weight: 700; color: var(--wfa-pink-dark); text-align: center; }
.wfa-lib-articles { margin-top: 10px; font-size: 0.82rem; font-weight: 600; color: var(--wfa-pink-dark); text-decoration: none; }
.wfa-lib-articles:hover { text-decoration: underline; }

/* --- product page ---------------------------------------------------- */
.wfa-lib-readbox {
	margin: 4px 0 18px;
	padding: 14px 16px;
	border-radius: 10px;
	background: var(--wfa-tint);
	border: 1px solid var(--wfa-line);
}
.wfa-lib-readbox-l { margin: 0 0 10px; font-size: 0.95rem; line-height: 1.5; }
.wfa-lib-readbox .wfa-lib-btn { display: inline-block; padding: 11px 22px; }

.wfa-lib-toc { clear: both; margin: 10px 0 36px; }
.wfa-lib-toc-list { list-style: none; margin: 0 0 18px; padding: 0; }
.wfa-lib-toc-list li {
	display: flex;
	gap: 14px;
	align-items: baseline;
	padding: 9px 0;
	border-bottom: 1px solid var(--wfa-line);
}
.wfa-lib-toc-p { flex: 0 0 44px; font-size: 0.82rem; font-weight: 700; color: var(--wfa-pink-dark); }
.wfa-lib-toc-t { flex: 1 1 auto; font-weight: 600; color: var(--wfa-ink); }
.wfa-lib-toc-t a { color: var(--wfa-ink); text-decoration: none; }
.wfa-lib-toc-t a:hover { color: var(--wfa-pink-dark); }
.wfa-lib-toc-w { display: block; font-weight: 400; font-size: 0.88rem; color: var(--wfa-muted); }
.wfa-lib-toc-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 24px; }
.wfa-lib-toc-links a { font-weight: 600; color: var(--wfa-pink-dark); text-decoration: none; }
.wfa-lib-toc-links a:hover { text-decoration: underline; }

@media (max-width: 560px) {
	.wfa-lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
	.wfa-lib-sub { flex-direction: column; align-items: stretch; text-align: left; }
	.wfa-lib-btn { font-size: 0.82rem; padding: 8px 6px; }
}
