/* ============================================================================
   Amnesty Freedom — Research listing
   ----------------------------------------------------------------------------
   Written to sit inside the site's existing design rather than beside it: the
   same Source Sans 3, the same #4a7fa5, the same hard edges and thin rules as
   the homepage. Everything is scoped under .afl-page or .afl.
   ========================================================================= */

.afl-page,
.afl {
	--afl-black:  #0d1117;
	--afl-white:  #ffffff;
	--afl-accent: #4a7fa5;
	--afl-accent-light: #dde8f0;
	--afl-accent-dark:  #2c5f80;
	--afl-gray:   #f2f4f6;
	--afl-text:   #1a1f24;
	--afl-muted:  #5a6472;
	--afl-border: #d8dfe6;
	--afl-font: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
}

.afl-page { font-family: var(--afl-font); color: var(--afl-text); background: var(--afl-white); }
.afl-page *, .afl *, .afl *::before, .afl *::after { box-sizing: border-box; }

/* ── Hero ────────────────────────────────────────────────────────────── */

.afl-hero {
	background: linear-gradient(135deg, #1c2d3d 0%, #2c4a62 50%, #1c2d3d 100%);
	padding: 64px 40px 58px;
	position: relative;
	overflow: hidden;
}
.afl-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234a7fa5' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.afl-hero-inner { max-width: 1180px; margin: 0 auto; position: relative; }
.afl-hero-label {
	margin: 0 0 18px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #7fb8d8;
}
.afl-hero-label a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(127,184,216,0.4); }
.afl-hero-label a:hover { color: #fff; }
.afl-hero-title {
	margin: 0 0 20px;
	font-size: clamp(2.1rem, 5vw, 3.6rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: #fff;
}
.afl-hero-intro,
.afl-hero-intro p {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 300;
	line-height: 1.7;
	color: rgba(255,255,255,0.72);
	max-width: 640px;
}

/* ── Layout ──────────────────────────────────────────────────────────── */

.afl-main { max-width: 1180px; margin: 0 auto; padding: 56px 40px 80px; }
.afl-heading {
	margin: 0 0 28px;
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	font-weight: 700;
	letter-spacing: -0.02em;
}

/* ── Filters ─────────────────────────────────────────────────────────── */

.afl-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 20px;
	padding-bottom: 22px;
	margin-bottom: 34px;
	border-bottom: 1px solid var(--afl-border);
}
.afl-searchwrap { position: relative; flex: 1 1 260px; max-width: 380px; }
.afl-searchicon {
	position: absolute;
	left: 12px; top: 50%;
	transform: translateY(-50%);
	width: 17px; height: 17px;
	color: var(--afl-muted);
	pointer-events: none;
}
.afl-search {
	width: 100%;
	padding: 11px 12px 11px 38px;
	font-family: inherit;
	font-size: 15px;
	color: var(--afl-text);
	background: var(--afl-white);
	border: 1px solid var(--afl-border);
	border-radius: 0;
	-webkit-appearance: none;
	appearance: none;
}
.afl-search:focus { outline: none; border-color: var(--afl-accent); box-shadow: 0 0 0 3px rgba(74,127,165,0.14); }

.afl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.afl-chip {
	padding: 7px 14px;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--afl-muted);
	background: transparent;
	border: 1px solid var(--afl-border);
	cursor: pointer;
	transition: color .15s, border-color .15s, background .15s;
}
.afl-chip:hover { color: var(--afl-accent-dark); border-color: var(--afl-accent); }
.afl-chip.is-on {
	color: #fff;
	background: var(--afl-accent);
	border-color: var(--afl-accent);
}
.afl-count { margin: 0; font-size: 13px; color: var(--afl-muted); flex: 1 1 100%; }
.afl-count:empty { display: none; }

/* ── The grid ────────────────────────────────────────────────────────── */

.afl-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 34px 30px;
}
.afl[data-cols="2"] .afl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.afl[data-cols="4"] .afl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.afl-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--afl-white);
	transition: transform .18s ease, box-shadow .18s ease;
}
.afl-card.is-hidden { display: none; }
.afl-card:hover { transform: translateY(-3px); }

/* One link over the whole card keeps the markup honest for screen readers:
   a single destination, announced once, rather than a title link and an image
   link and a "read more" link all going to the same place. */
.afl-card-link { position: absolute; inset: 0; z-index: 3; }
.afl-card-link:focus-visible { outline: 3px solid var(--afl-accent); outline-offset: 3px; }

/* The whole-card link carries its own label. GeneratePress defines
   .screen-reader-text, but this page must not depend on a theme class it does
   not control — without this rule the label prints across the top of a card. */
.afl .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Cover */
.afl-cover {
	position: relative;
	aspect-ratio: 1 / 1.294;
	background: var(--afl-gray);
	overflow: hidden;
	box-shadow: 0 10px 26px rgba(13,17,23,0.14), 0 1px 3px rgba(13,17,23,0.10);
	transition: box-shadow .18s ease;
}
.afl-card:hover .afl-cover { box-shadow: 0 18px 40px rgba(13,17,23,0.22), 0 2px 5px rgba(13,17,23,0.12); }
.afl-cover img,
.afl-cover canvas {
	position: relative;
	z-index: 2;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #fff;
}
.afl-cover canvas:not([data-drawn]) { opacity: 0; }

/* The typographic cover, shown until a real one is drawn — and kept for good
   on papers with no cover image and no readable first page. */
.afl-cover-fallback {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 26px 22px 22px;
	background: linear-gradient(160deg, #1c2d3d 0%, #2c4a62 100%);
}
.afl-cover-mark {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.22em;
	color: rgba(255,255,255,0.55);
}
.afl-cover-title {
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: #fff;
}
/* The spine: a thin darker strip down the left edge, so a flat rectangle
   reads as a document rather than as a photograph. */
.afl-cover-spine {
	position: absolute;
	top: 0; bottom: 0; left: 0;
	width: 9px;
	z-index: 4;
	background: linear-gradient(to right, rgba(0,0,0,0.22), rgba(0,0,0,0.05) 55%, rgba(0,0,0,0));
	pointer-events: none;
}

/* Body */
.afl-body { padding: 18px 2px 0; display: flex; flex-direction: column; flex: 1 1 auto; }
.afl-topics { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.afl-topic {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--afl-accent-dark);
	background: var(--afl-accent-light);
	padding: 3px 8px;
}
.afl-title {
	margin: 0 0 9px;
	font-size: 1.18rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var(--afl-text);
}
.afl-card:hover .afl-title { color: var(--afl-accent-dark); }
.afl-summary {
	margin: 0 0 14px;
	font-size: 0.94rem;
	font-weight: 300;
	line-height: 1.65;
	color: var(--afl-muted);
}
.afl-meta {
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--afl-border);
	font-size: 12px;
	color: var(--afl-muted);
	display: flex;
	align-items: center;
	gap: 7px;
}
.afl-read {
	display: inline-block;
	margin-top: 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--afl-accent-dark);
}
.afl-card:hover .afl-read span { display: inline-block; transform: translateX(4px); transition: transform .18s; }

/* ── Empty and pagination ────────────────────────────────────────────── */

.afl-none, .afl--empty {
	padding: 60px 40px;
	text-align: center;
	border: 1px dashed var(--afl-border);
}
.afl-none h2 { margin: 0 0 10px; font-size: 1.5rem; font-weight: 700; }
.afl-none p, .afl-empty-note { margin: 0; font-size: 1rem; font-weight: 300; color: var(--afl-muted); }

.afl-page .pagination,
.afl-page .nav-links {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 50px;
	flex-wrap: wrap;
}
.afl-page .page-numbers {
	display: inline-block;
	padding: 9px 15px;
	font-size: 13px;
	font-weight: 700;
	color: var(--afl-muted);
	text-decoration: none;
	border: 1px solid var(--afl-border);
}
.afl-page .page-numbers:hover { color: var(--afl-accent-dark); border-color: var(--afl-accent); }
.afl-page .page-numbers.current { color: #fff; background: var(--afl-accent); border-color: var(--afl-accent); }

/* ── Narrow screens ──────────────────────────────────────────────────── */

@media (max-width: 980px) {
	.afl-grid,
	.afl[data-cols="4"] .afl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
	.afl-hero { padding: 46px 20px 42px; }
	.afl-main { padding: 36px 20px 60px; }
	.afl-grid,
	.afl[data-cols="2"] .afl-grid,
	.afl[data-cols="4"] .afl-grid { grid-template-columns: 1fr; gap: 30px; }
	.afl-searchwrap { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
	.afl-card, .afl-cover, .afl-read span { transition: none !important; }
	.afl-card:hover { transform: none; }
}
