/* SoldierStrong Access research briefs: single page, archive and cards. Works on any theme: brand values come
   from the theme's presets when it has them, with the brand colors as fallbacks. Avada-only rules are in avada.css. */

:root {
	--ssa-navy: var(--wp--preset--color--navy, #113968);
	--ssa-red: var(--wp--preset--color--red, #d7242b);
	--ssa-ink: #333333;
	--ssa-muted: #555555;
	--ssa-rule: #e0dede;
	--ssa-serif: var(--wp--preset--font-family--heading, Cinzel, Garamond, serif);
	--ssa-sans: var(--wp--preset--font-family--body, "Open Sans", Arial, Helvetica, sans-serif);
	--ssa-measure: 44rem;
	--ssa-wide: 62.5rem;
	--ssa-rule-on-navy: #3d6a9e;
	--ssa-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3 6.9 7.5.7-5.7 5 1.7 7.4L12 17.9l-6.5 3.9 1.7-7.4-5.7-5 7.5-.7z'/%3E%3C/svg%3E");
	--ssa-button-font: var(--button_typography-font-family, "Open Sans"), "Open Sans", Arial, sans-serif;
}

/* ---------- Shared ---------- */

.ssa-brief,
.ssa-archive,
.ssa-more,
.ssa-cards {
	font-family: var(--ssa-sans);
	color: var(--ssa-ink);
}

.ssa-print-head {
	display: none;
}

/* Label line: document type, month, reading time, then a short red rule (matches the homepage cards). */
:is(.fusion-body, .ssa-site) .ssa-brief__meta,
:is(.fusion-body, .ssa-site) .ssa-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.75rem;
	margin: 0 0 1rem;
	font-family: var(--ssa-sans);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.4 !important; /* Avada custom CSS sets .whitepapercontainer p to 1.8 !important */
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ssa-muted);
}

/* A small red star between items, drawn so it renders the same in every font and is not read aloud. */
.ssa-brief__meta span + span::before,
.ssa-card__meta span + span::before {
	content: "";
	display: inline-block;
	width: 0.75em;
	height: 0.75em;
	margin-right: 0.75rem;
	vertical-align: -0.06em;
	background: var(--ssa-red);
	-webkit-mask: var(--ssa-star) center / contain no-repeat;
	mask: var(--ssa-star) center / contain no-repeat;
}

.ssa-brief__meta::after,
.ssa-card__meta::after {
	content: "";
	flex: 0 1 4rem;
	min-width: 2rem;
	height: 3px;
	background: var(--ssa-red);
}

/* Buttons */
:is(.fusion-body, .ssa-site) .ssa-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.625rem 1.375rem;
	border: 2px solid var(--ssa-red);
	border-radius: 0;
	background: var(--ssa-red);
	color: #ffffff;
	/* Same type as the site's own buttons (Avada button typography: Montserrat 14px, uppercase, 2px tracking). */
	font-family: var(--ssa-button-font);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: var(--button_typography-letter-spacing, 2px);
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

:is(.fusion-body, .ssa-site) .ssa-btn:hover {
	background: var(--ssa-navy);
	border-color: var(--ssa-navy);
	color: #ffffff;
}

:is(.fusion-body, .ssa-site) .ssa-btn--secondary {
	background: #ffffff;
	border-color: var(--ssa-navy);
	color: var(--ssa-navy);
}

:is(.fusion-body, .ssa-site) .ssa-btn--secondary:hover {
	background: var(--ssa-navy);
	color: #ffffff;
}

.ssa-btn[hidden],
.ssa-brief__hint[hidden] {
	display: none !important;
}

/* ---------- Single brief ---------- */

.ssa-brief {
	padding: clamp(2.5rem, 6vw, 4.5rem) 0 0;
}

.ssa-brief__header,
.ssa-brief__body {
	max-width: var(--ssa-measure);
	margin-left: auto;
	margin-right: auto;
}

:is(.fusion-body, .ssa-site) .ssa-brief__title {
	margin: 0 0 1rem;
	font-family: var(--ssa-serif);
	font-size: clamp(1.875rem, 1.35rem + 2.2vw, 2.875rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.01em;
	color: var(--ssa-navy);
	text-wrap: balance;
}

.ssa-brief__subtitle {
	margin: 0 0 1.75rem;
	font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
	line-height: 1.5;
	color: var(--ssa-muted);
	text-wrap: balance;
}

.ssa-brief__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 2.5rem;
}

.ssa-brief__hint {
	flex-basis: 100%;
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--ssa-muted);
}

.ssa-brief__image {
	max-width: var(--ssa-wide);
	margin: 0 auto clamp(2rem, 5vw, 3.5rem);
}

.ssa-brief__image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

/* Body copy: long-form reading, so tighter than Avada's 18px / 36px. */
:is(.fusion-body, .ssa-site) .ssa-brief__body {
	font-size: 1.125rem;
	line-height: 1.7;
	padding-bottom: 1rem;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body p {
	margin: 0 0 1.25em;
	font-size: inherit;
	line-height: inherit;
	text-wrap: pretty;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body h2 {
	margin: 2.25em 0 0.75em;
	font-family: var(--ssa-serif);
	font-size: clamp(1.4375rem, 1.25rem + 0.8vw, 1.875rem);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.01em;
	color: var(--ssa-navy);
	text-wrap: balance;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body h3 {
	margin: 1.75em 0 0.5em;
	font-family: var(--ssa-serif);
	font-size: clamp(1.1875rem, 1.1rem + 0.35vw, 1.375rem);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.01em;
	color: var(--ssa-navy);
	text-wrap: balance;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body > h2:first-child,
:is(.fusion-body, .ssa-site) .ssa-brief__body > p:first-child + h2 {
	margin-top: 0;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body a {
	color: var(--ssa-navy);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body a:hover {
	color: var(--ssa-red);
}

/* Pull quotes: larger and set apart by space, not by a border. */
:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-block-quote,
:is(.fusion-body, .ssa-site) .ssa-brief__body blockquote {
	margin: 2.5rem 0;
	padding: 0 0 0 clamp(0rem, 4vw, 2.5rem);
	border: 0;
	background: none;
	font-style: normal;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-block-quote p {
	margin: 0;
	font-family: var(--ssa-sans);
	font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
	font-weight: 600;
	line-height: 1.45;
	color: var(--ssa-navy);
	text-wrap: balance;
}

/* Tables: scroll inside their own box on narrow screens, never the page. */
.ssa-table-scroll {
	max-width: 100%;
	overflow-x: auto;
	margin: 2rem 0;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-block-table {
	margin: 0;
	min-width: 28rem;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 1rem;
	line-height: 1.5;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-block-table td,
:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-block-table th {
	padding: 0.75rem 1rem;
	border: 0;
	border-bottom: 1px solid var(--ssa-rule);
	vertical-align: top;
	text-align: left;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-block-table tr:first-child td {
	border-top: 2px solid var(--ssa-navy);
}

:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-block-table td:first-child {
	width: 35%;
	font-weight: 700;
	color: var(--ssa-navy);
}

:is(.fusion-body, .ssa-site) .ssa-brief__body figcaption,
:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-element-caption {
	margin: 0.75rem 0 0;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--ssa-muted);
	text-align: left;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-block-image {
	margin: 2rem 0;
}

:is(.fusion-body, .ssa-site) .ssa-brief__body .wp-block-image img {
	height: auto;
}

/* References and anything after them read as notes. */
:is(.fusion-body, .ssa-site) .ssa-brief__body .ssa-references-heading ~ p {
	font-size: 0.9375rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

/* More research */
.ssa-more {
	max-width: 73.125rem;
	margin: clamp(3rem, 8vw, 5rem) auto 0;
	padding: clamp(2.5rem, 6vw, 4rem) 0;
	border-top: 1px solid var(--ssa-rule);
}

:is(.fusion-body, .ssa-site) .ssa-more__title {
	margin: 0 0 2rem;
	font-family: var(--ssa-serif);
	font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
	line-height: 1.2;
	color: var(--ssa-navy);
}

/* ---------- Archive ---------- */

.ssa-archive {
	padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 8vw, 5rem);
}

.ssa-archive__header {
	max-width: var(--ssa-measure);
	margin: 0 0 clamp(2rem, 5vw, 3rem);
}

:is(.fusion-body, .ssa-site) .ssa-archive__title {
	margin: 0 0 1rem;
	font-family: var(--ssa-serif);
	font-size: clamp(1.875rem, 1.35rem + 2.2vw, 2.875rem);
	font-weight: 700;
	line-height: 1.15;
	color: var(--ssa-navy);
	text-wrap: balance;
}

:is(.fusion-body, .ssa-site) .ssa-archive__intro {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.7;
	text-wrap: pretty;
}

.ssa-pagination {
	margin-top: 3rem;
}

.ssa-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

:is(.fusion-body, .ssa-site) .ssa-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0 0.75rem;
	border: 2px solid var(--ssa-navy);
	color: var(--ssa-navy);
	font-weight: 700;
	text-decoration: none;
}

:is(.fusion-body, .ssa-site) .ssa-pagination .page-numbers.current,
:is(.fusion-body, .ssa-site) .ssa-pagination a.page-numbers:hover {
	background: var(--ssa-navy);
	color: #ffffff;
}

/* ---------- Cards ---------- */

.ssa-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
	margin: 0;
}

.ssa-card {
	display: flex;
	flex-direction: column;
	margin: 0;
}

.ssa-card__image {
	display: block;
	margin: 0 0 1.25rem;
	overflow: hidden;
}

.ssa-card__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.ssa-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
}

:is(.fusion-body, .ssa-site) .ssa-card__title {
	margin: 0 0 0.75rem;
	font-family: var(--ssa-serif);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: 0.01em;
	text-transform: none;
	text-wrap: balance;
}

:is(.fusion-body, .ssa-site) .ssa-card__title a {
	color: var(--ssa-navy);
	text-decoration: none;
}

:is(.fusion-body, .ssa-site) .ssa-card__title a:hover {
	color: var(--ssa-red);
}

:is(.fusion-body, .ssa-site) .ssa-card__excerpt {
	margin: 0 0 1.5rem;
	font-size: 1rem;
	line-height: 1.65;
	text-wrap: pretty;
}

:is(.fusion-body, .ssa-site) .ssa-card .ssa-card__action {
	margin: auto 0 0;
}

/* "View all research" under the homepage cards, and "Load more research" on the research page:
   centered under the grid and larger than the card buttons, so the way onward is easy to find. */
:is(.fusion-body, .ssa-site) .ssa-cards__more,
:is(.fusion-body, .ssa-site) .ssa-feed__more {
	margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
	text-align: center;
	line-height: 1.2 !important;
}

:is(.fusion-body, .ssa-site) .ssa-cards__more .ssa-btn,
:is(.fusion-body, .ssa-site) .ssa-feed__more .ssa-btn {
	min-height: 3.25rem;
	padding: 0.875rem 2.25rem;
	font-size: 0.9375rem;
}

:is(.fusion-body, .ssa-site) .ssa-feed__more .ssa-btn[disabled] {
	cursor: progress;
	opacity: 0.7;
}

/* Cards on the navy homepage section */
.ssa-cards--dark,
:is(.fusion-body, .ssa-site) .ssa-cards--dark .ssa-card__excerpt,
.ssa-cards--dark .ssa-card__meta {
	color: #ffffff;
}

:is(.fusion-body, .ssa-site) .ssa-cards--dark .ssa-card__title a {
	color: #ffffff;
}

/* Cards on navy: a faint glass panel with a light border and a red top edge, as on the live homepage's columns.
   The image runs edge to edge; the text and button sit inside the panel. */
.ssa-cards--dark .ssa-card {
	background: rgb(255 255 255 / 0.04);
	border: 1px solid rgb(255 255 255 / 0.1);
	border-top: 3px solid var(--ssa-red);
}

.ssa-cards--dark .ssa-card__image {
	margin: 0;
}

.ssa-cards--dark .ssa-card__body {
	padding: 1.25rem clamp(1rem, 2vw, 1.5rem) 1.5rem;
}

:is(.fusion-body, .ssa-site) .ssa-cards--dark .ssa-card .ssa-card__action {
	padding-top: 1.25rem;
}

:is(.fusion-body, .ssa-site) .ssa-cards--dark .ssa-card__title a:hover {
	color: #ffffff;
	text-decoration: underline;
}

:is(.fusion-body, .ssa-site) .ssa-cards--dark .ssa-btn {
	border-color: #ffffff;
}

:is(.fusion-body, .ssa-site) .ssa-cards--dark .ssa-btn:hover {
	background: var(--ssa-navy);
	border-color: #ffffff;
}

/* The homepage section's own bottom padding is short, so the button gets a little room below it. */
:is(.fusion-body, .ssa-site) .ssa-cards__more--dark {
	margin-bottom: clamp(0.5rem, 2vw, 1.5rem);
}

/* On navy the "View all research" button is the one white button, set apart from the red card buttons. */
:is(.fusion-body, .ssa-site) .ssa-cards__more--dark .ssa-btn {
	background: #ffffff;
	border-color: #ffffff;
	color: var(--ssa-navy);
}

:is(.fusion-body, .ssa-site) .ssa-cards__more--dark .ssa-btn:hover {
	background: transparent;
	border-color: #ffffff;
	color: #ffffff;
}

@media (max-width: 1023px) {
	.ssa-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Tablets show the homepage cards two across. Nine would leave one card alone on the last row, so the
   ninth (the oldest) waits for the research page. */
@media (min-width: 768px) and (max-width: 1023px) {
	.ssa-cards--dark .ssa-card:nth-child(9) {
		display: none;
	}
}

@media (max-width: 767px) {
	.ssa-cards {
		grid-template-columns: minmax(0, 1fr);
	}

	:is(.fusion-body, .ssa-site) .ssa-brief__body {
		font-size: 1.0625rem;
	}
}

/* Narrow phones: the brief page's three-item label line wraps, so its stars go and spacing does the work.
   Cards have two items and fit, so they keep the star. */
@media (max-width: 479px) {
	:is(.fusion-body, .ssa-site) .ssa-brief__meta {
		column-gap: 1.25rem;
	}

	.ssa-brief__meta span + span::before {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	:is(.fusion-body, .ssa-site) .ssa-btn {
		transition: none;
	}
}
