/* research.css — the Research page's theme cards. Loaded only by
 * research/index.html.
 *
 * Each card is a <details>: the theme name is the summary, the description
 * opens beneath it. No script is needed to fold them, and print.css opens
 * every one.
 *
 * A card's two gradient stops arrive as --theme-top and --theme-bottom, set by
 * assets/js/theme-cards.js from the one colour in data/research-themes.json.
 * The fallbacks below are what shows if that script does not run. */

.theme-cards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
	align-items: start;
	margin-top: 2rem;
	text-align: left;
}

.theme-card {
	--theme-top: #EFEAE4;
	--theme-bottom: #E6DFD7;

	background-image: linear-gradient(to bottom, var(--theme-top) 0%, var(--theme-bottom) 100%);
	border: 1px solid rgba(20, 26, 32, 0.14);
	border-radius: 8px;
	padding: 1rem 1.15rem;
}

/* The name row. flex rather than the default marker so the number, the name and
   the caret sit on one line with the caret pushed to the end. */
.theme-card > summary {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	cursor: pointer;
	list-style: none;
	font-size: 1.05rem;
	line-height: 1.3;
}

.theme-card > summary::-webkit-details-marker {
	display: none;
}

.theme-name {
	flex: 1 1 auto;
}

.theme-caret {
	flex: 0 0 auto;
	width: 0.75rem;
	height: 0.75rem;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translate(-0.1em, -0.1em);
	opacity: 0.5;
	transition: transform 0.18s ease;
}

.theme-card[open] .theme-caret {
	transform: rotate(225deg) translate(-0.1em, -0.1em);
}

.theme-card > summary:focus-visible {
	outline: 2px solid #30363d;
	outline-offset: 3px;
	border-radius: 3px;
}

/* Indented to the name rather than the number, so the text block lines up with
   the heading above it. */
.theme-body {
	padding: 0.85rem 0 0 2.3rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1rem;
}

.theme-body p {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.6;
	max-width: 34rem;
}

/* A theme's buttons sit in a row, and wrap when the card is narrow. */
.theme-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

/* main.css draws .button with a white-ish inset shadow meant for dark panels. */
.theme-card .button.small {
	box-shadow: none;
	border: 1px solid rgba(48, 54, 61, 0.45);
}

.theme-card .button.small:hover,
.theme-card .button.small:focus-visible {
	box-shadow: none;
	border-color: #30363d;
}

@media screen and (max-width: 736px) {

	.theme-cards {
		grid-template-columns: 1fr;
	}

}

@media (prefers-reduced-motion: reduce) {

	.theme-caret {
		transition: none;
	}

}


/* Vertical rhythm for the area sections. Keyed on data-area and on position,
   not on the sections' ids, so an area added, removed or reordered in
   data/research-areas.json needs no change here.

   The theme default is 7rem top / 5rem bottom, which stacks to about 12rem
   between two sections and opens a white band between the areas. The first
   area is tighter still, because it follows the page's intro paragraph rather
   than another area's cards. Specificity has to clear .wrapper.style1 > .inner
   in main.css, which is why the wrapper classes are named here too. */
section[data-area].wrapper.style1 > .inner {
	padding-top: 2rem;
	padding-bottom: 2rem;
}

section[data-area] + section[data-area].wrapper.style1 > .inner {
	padding-top: 3rem;
}
