/* ==========================================================================
   Research — index, post shell and the report container (.rdoc).

   A report file brings its own stylesheet; research-lib.php scopes it to
   .rdoc and prints it inline on the post page. This file only styles what
   the SITE adds around a report, plus the /research index.
   ========================================================================== */

/* ---------- /research index (rows reuse .nfeed/.nrow from pages.css) ---------- */
.nrow .ndate {
	font-size: 1.2rem;
	font-weight: 500;
	color: var(--ink-soft);
	letter-spacing: 0.01em;
}
.nrow .ngo-pdf {
	margin-left: 1.4rem;
}

/* ---------- article-style research post (no report file) ---------- */
.research-actions {
	margin-top: 1.8rem;
}

/* ---------- report container ---------- */
.rdoc {
	display: flow-root;
}

/* anchor jumps (#s1, #ex-3 …) land below the fixed header + report bar;
   research.js refines the value from the real heights */
html:has(.rdoc) {
	scroll-padding-top: 140px;
}

/* "Click for PDF" buttons only exist when the post has a PDF attached
   (data-pdf = direct link, data-pdf-gate = email sign-up first) */
.rdoc:not([data-pdf]):not([data-pdf-gate]) [data-pdf-open] {
	display: none !important;
}

/* A report without a dark .hero opener sits under the solid header, which
   does not shrink: keep the report bar docked at 96px in its light style. */
.rdoc--plain {
	padding-top: 96px;
}
.rdoc--plain:has(.rbar) {
	padding-top: 150px;
}
.rdoc--plain .rbar,
.rdoc--plain .rbar.shrunk {
	top: 96px;
}

/* ---------- strip between the report and the site footer ---------- */
.rdoc-foot {
	background: var(--paper-3);
	border-top: 1px solid var(--line);
}
.rdoc-foot-in {
	display: flex;
	justify-content: space-between;
	gap: 16px 32px;
	flex-wrap: wrap;
	padding-block: 24px;
}
.rdoc-foot a,
.rdoc-foot button {
	font-family: var(--ui-font);
	background: none;
	border: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.74rem;
	font-weight: 600;
	color: var(--ink);
	border-bottom: 1px solid var(--accent);
	padding-bottom: 3px;
	transition: gap 0.35s var(--ease), color 0.35s var(--ease);
}
.rdoc-foot a:hover,
.rdoc-foot button:hover {
	gap: 0.85em;
	color: var(--maroon);
}

/* ---------- sign-up band (shown until the visitor has signed up) ---------- */
.rsub-band {
	background: var(--green);
	color: var(--cream);
	padding: clamp(44px, 6vw, 76px) 0;
}
.rsub-band-in {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px 48px;
	flex-wrap: wrap;
}
.rsub-band .eyebrow {
	color: #d0b395;
}
.rsub-band .eyebrow::before {
	background: var(--camel);
}
.rsub-band h2 {
	color: #fff;
	font-size: clamp(1.8rem, 3.4vw, 2.7rem);
	margin: 0;
}
.rsub-band .btn-fill {
	background: var(--camel);
	border-color: var(--camel);
	color: #fff;
	cursor: pointer;
}
.rsub-band .btn-fill:hover {
	background: var(--cream);
	border-color: var(--cream);
	color: var(--ink);
}
button.btn {
	cursor: pointer;
	font-family: var(--ui-font);
}

/* ---------- "Subscribe to Research" popup ---------- */
.rsub {
	border: 0;
	padding: 0;
	background: transparent;
	max-width: min(480px, calc(100vw - 32px));
	width: 100%;
	color: var(--ink);
}
.rsub::backdrop {
	background: rgba(25, 24, 23, 0.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}
.rsub[open] {
	animation: rsub-in 0.35s var(--ease) both;
}
@keyframes rsub-in {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
.rsub-form {
	position: relative;
	background: var(--paper);
	border-top: 3px solid var(--camel);
	border-radius: 2px;
	padding: clamp(26px, 5vw, 40px);
	box-shadow: var(--shadow-lg);
	font-family: var(--ui-font);
}
.rsub-form .eyebrow {
	margin-bottom: 0.8rem;
}
.rsub-t {
	font-size: clamp(1.7rem, 4.5vw, 2.2rem);
	line-height: 1.08;
	margin: 0 0 1.4rem;
}
.rsub-lead {
	margin: -0.6rem 0 1.4rem;
	color: var(--ink-soft);
}
.rsub-close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 40px;
	height: 40px;
	border: 0;
	background: none;
	color: var(--ink-soft);
	font-size: 1.9rem;
	line-height: 1;
	cursor: pointer;
}
.rsub-close:hover {
	color: var(--ink);
}
.rsub-lbl {
	display: block;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--ink-soft);
	margin-bottom: 0.5rem;
}
.rsub-in {
	display: block;
	width: 100%;
	font: inherit;
	font-size: 1rem;
	color: var(--ink);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 1px;
	padding: 0.8em 0.9em;
	margin-bottom: 1.3rem;
	transition: border-color 0.25s;
}
.rsub-in:focus {
	outline: none;
	border-color: var(--camel-dk);
	box-shadow: 0 0 0 3px rgba(192, 154, 114, 0.22);
}
.rsub-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.rsub-chk {
	display: flex;
	align-items: flex-start;
	gap: 0.7em;
	font-size: 0.98rem;
	line-height: 1.4;
	margin-bottom: 0.85rem;
	cursor: pointer;
}
.rsub-chk input {
	width: 18px;
	height: 18px;
	margin: 0.12em 0 0;
	flex: 0 0 auto;
	accent-color: var(--green);
	cursor: pointer;
}
.rsub-err {
	margin: 0.4rem 0 0;
	color: var(--maroon);
	font-size: 0.92rem;
	font-weight: 600;
}
.rsub-sub,
.rsub-ghost {
	display: block;
	width: 100%;
	margin-top: 1rem;
	text-align: center;
	font-family: var(--ui-font);
	text-transform: uppercase;
	letter-spacing: 0.16em;
	font-size: 0.78rem;
	font-weight: 700;
	padding: 1em 1.4em;
	border-radius: 1px;
	cursor: pointer;
	transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.rsub-sub {
	background: var(--green);
	color: var(--cream);
	border: 1px solid var(--green);
}
.rsub-sub:hover {
	background: #26402c;
	border-color: #26402c;
	color: #fff;
}
.rsub-sub[disabled] {
	opacity: 0.6;
	cursor: default;
}
.rsub-ghost {
	background: none;
	color: var(--ink);
	border: 1px solid var(--line);
}
.rsub-ghost:hover {
	border-color: var(--ink);
}
.rsub [hidden] {
	display: none !important;
}
body.rsub-open {
	overflow: hidden;
}

@media print {
	.rsub-band,
	.rsub {
		display: none !important;
	}
}

@media print {
	.site-head,
	.mobile-menu,
	.rdoc-foot,
	.rdoc .rbar {
		display: none !important;
	}
	.rdoc [data-reveal] {
		opacity: 1 !important;
		transform: none !important;
	}
}
