/*
 * COA Manager — front-end styles.
 *
 * Every value falls back to a neutral default, so the gallery looks deliberate
 * on any theme. Three ways to restyle it, in increasing order of effort:
 *
 *   1. Settings > accent colour (writes --coam-accent / --coam-brand)
 *   2. Override any token below in the Customizer's Additional CSS
 *   3. Copy single-coa_report.php into your theme to replace the layout
 */

/* DualCore Peptides build.
   Every value below is the matching token from the DualCore Elementor Global
   Kit, so a certificate card and a product card read as the same object on
   the page. Radii are the dc.* family's R_CHIP (10) and R_CARD (14), not the
   plugin's softer 12/18 - the reference's cards are noticeably rounder than
   the trade families and the certificates have to follow. */
:root {
	--coam-accent: #1E6FD9;   /* kit: primary  - the blue in "CORE"    */
	--coam-accent-2: #4FC3F7; /* kit: accent   - the logo's brightest  */
	--coam-brand: linear-gradient(90deg, #1E6FD9, #4FC3F7);

	--coam-ink: #0B1626;      /* kit: secondary                        */
	--coam-body: #333B47;     /* kit: text                             */
	--coam-muted: #69737F;    /* kit: muted   - chrome, flattened      */
	--coam-line: #D4DDE8;     /* kit: border  - chrome, flattened      */
	--coam-surface: #FFFFFF;
	--coam-panel: linear-gradient(170deg, #E6EEF9 0%, #F4F8FD 62%); /* surface_alt -> surface */
	--coam-panel-2: #F4F8FD;  /* kit: surface                          */

	--coam-radius: 10px;
	--coam-radius-lg: 14px;

	--coam-cols: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

/* Follow the reader's preference unless the theme has already decided. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		/* Retinted off the kit's #0B1626 rather than the plugin's
		   blue-grey, so a dark-mode certificate sits on the same ground as
		   the site's inset dark bands. */
		--coam-ink: #F2F6FB;
		--coam-body: #C2CCD9;
		--coam-muted: #98A3B1;
		--coam-line: rgba(255, 255, 255, 0.16);
		--coam-surface: #131F31;
		--coam-panel: linear-gradient(170deg, #16243A 0%, #0B1626 62%);
		--coam-panel-2: #152337;
	}
}

/*
 * The report gallery.
 *
 * Every colour, radius and font resolves against the tokens above, each with a
 * literal fallback, so the gallery looks deliberate on any theme.
 */

/* min() keeps the track from exceeding the viewport on a narrow phone, which
   a bare minmax() floor would do. */
.coam {
	display: grid;
	grid-template-columns: var(--coam-cols);
	gap: 1.25rem;
	align-items: start;
}

/*
 * Cards follow the product-card anatomy from the theme: white ground, a
 * gradient-tinted panel behind the artwork, and a brand-gradient hairline
 * that lights up on hover.
 */
.coam__card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	padding: 1.25rem;
	border: 1px solid var(--coam-line, #e4e8f0);
	border-radius: var(--coam-radius-lg, 18px);
	background: var(--coam-surface, #fff);
	overflow: hidden;
	transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

/* Gradient hairline along the top edge, revealed on hover. */
.coam__card::before {
	content: "";
	position: absolute;
	inset-block-start: 0;
	inset-inline: 0;
	height: 3px;
	background-image: var(--coam-brand, linear-gradient(90deg, #1E6FD9, #4FC3F7));
	opacity: 0;
	transition: opacity 0.35s ease;
}

.coam__card:hover {
	transform: translateY(-2px);
	border-color: rgba(43, 107, 255, 0.28);
	box-shadow: 0 18px 44px rgba(20, 45, 120, 0.12);
}

.coam__card:hover::before {
	opacity: 1;
}

.coam__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
}

.coam__name {
	margin: 0;
	font-family: inherit;
	font-size: 1.0625rem;
	font-weight: 800;
	line-height: 1.2;
	color: var(--coam-ink, #0a0e1a);
}

/*
 * Gradient chip, matching the eyebrow pills used across the site.
 *
 * The inline padding is asymmetric on purpose: letter-spacing adds its space
 * after the final character too, so with equal padding the text reads as
 * shoved to the left inside the pill.
 */
.coam__amount {
	flex: none;
	padding-block: 0.4rem;
	padding-inline: 0.75rem calc(0.75rem - 0.1em);
	border-radius: 999px;
	background-image: var(--coam-brand, linear-gradient(90deg, #1E6FD9, #4FC3F7));
	font-size: 0.625rem;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #fff;
}

/* --- Tabs ------------------------------------------------------------ */

.coam__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.coam__tab {
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--coam-line, #e4e8f0);
	border-radius: 999px;
	background: transparent;
	font: inherit;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--coam-body, #4a5268);
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.coam__tab:hover {
	border-color: var(--coam-accent, #1E6FD9);
	color: var(--coam-accent, #1E6FD9);
}

.coam__tab.is-active {
	border-color: transparent;
	background-image: var(--coam-brand, linear-gradient(90deg, #1E6FD9, #4FC3F7));
	color: #fff;
}

.coam__tab:focus-visible {
	outline: 2px solid var(--coam-accent, #1E6FD9);
	outline-offset: 2px;
}

/* --- Certificate sheet ----------------------------------------------- */

/* The certificate sits on the same tinted panel the product cards use, so the
   gallery reads as part of the shop rather than a plain document list. */
.coam__sheet {
	padding: 0.75rem;
	border: 1px solid var(--coam-line, #e4e8f0);
	border-radius: var(--coam-radius, 12px);
	background: var(--coam-panel, linear-gradient(170deg, #e7effe 0%, #f7f9ff 62%));
	overflow: hidden;
}

.coam__sheet .coam__img {
	border-radius: calc(var(--coam-radius, 12px) - 4px);
	box-shadow: 0 8px 22px rgba(20, 45, 120, 0.12);
}

.coam__sheetlink {
	display: block;
	text-decoration: none;
}

.coam__img {
	display: block;
	width: 100%;
	height: auto;
	/* Certificates are portrait sheets; a fixed ratio keeps every card in the
	   row the same height regardless of how each scan was cropped. */
	aspect-ratio: 3 / 4;
	object-fit: cover;
	object-position: top center;
	transition: transform 0.4s ease;
}

.coam__sheetlink:hover .coam__img {
	transform: scale(1.02);
}

.coam__sheetlink:focus-visible {
	outline: 2px solid var(--coam-accent, #1E6FD9);
	outline-offset: 2px;
}

/* --- Data rows -------------------------------------------------------- */

.coam__rows {
	margin: 0;
	display: grid;
	gap: 0.4rem;
}

.coam__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	font-size: 0.8125rem;
}

.coam__row dt {
	color: var(--coam-muted, #6b7280);
}

.coam__row dd {
	margin: 0;
	text-align: end;
	font-weight: 700;
	color: var(--coam-ink, #0a0e1a);
	overflow-wrap: anywhere;
}

.coam__row dd.is-mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.75rem;
	letter-spacing: 0.01em;
}

.coam__row dd.is-good {
	color: #0f8a4a;
}

/* --- Footer links ----------------------------------------------------- */

.coam__links {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: auto;
	padding-top: 0.9rem;
	border-top: 1px solid var(--coam-line, #e4e8f0);
}

.coam__links a {
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--coam-accent, #1E6FD9);
	text-decoration: none;
}

.coam__links a:hover {
	color: var(--coam-accent-2, #4FC3F7);
	text-decoration: underline;
}

.coam__empty {
	color: var(--coam-muted, #6b7280);
}

/* --- Single report page ---------------------------------------------- */

.coam-single {
	display: grid;
	grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
	gap: clamp(1.5rem, 4vw, 3.5rem);
	align-items: start;
}

.coam-single__back {
	margin: 0 0 1rem;
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.coam-single__back a {
	color: var(--coam-muted, #6b7280);
	text-decoration: none;
}

.coam-single__back a:hover {
	color: var(--coam-accent, #1E6FD9);
}

.coam-single__facts {
	position: sticky;
	top: 7rem;
	padding: 1.5rem;
	border: 1px solid var(--coam-line, #e4e8f0);
	border-radius: var(--coam-radius-lg, 18px);
	background: var(--coam-panel, linear-gradient(170deg, #e7effe 0%, #f7f9ff 62%));
}

.coam-single__facts .coam__row {
	padding-block: 0.4rem;
	border-bottom: 1px solid rgba(10, 14, 26, 0.07);
}

.coam-single__buy {
	margin: 1.25rem 0 0;
}

.coam-single__sheets {
	display: grid;
	gap: 2rem;
}

.coam-single__sheet {
	margin: 0;
}

.coam-single__sheet figcaption {
	margin-bottom: 0.6rem;
	font-size: 0.625rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--coam-muted, #6b7280);
}

.coam-single__sheet img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--coam-line, #e4e8f0);
	border-radius: var(--coam-radius, 12px);
	box-shadow: 0 14px 40px rgba(20, 45, 120, 0.1);
}

.coam-single__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin: 0.75rem 0 0;
	font-size: 0.8125rem;
	font-weight: 700;
}

.coam-single__actions a {
	color: var(--coam-accent, #1E6FD9);
	text-decoration: none;
}

.coam-single__actions a:hover {
	text-decoration: underline;
}

@media (max-width: 860px) {
	.coam-single {
		grid-template-columns: minmax(0, 1fr);
	}

	.coam-single__facts {
		position: static;
	}
}

@media (max-width: 560px) {
	.coam {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* --- Single report page (plugin template) ---------------------------- */

.coam-single {
	padding-block: clamp(2rem, 6vw, 5rem);
	color: var(--coam-body);
}

.coam-single__wrap {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.coam-single__back {
	margin: 0 0 1rem;
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.coam-single__back a {
	color: var(--coam-muted);
	text-decoration: none;
}

.coam-single__back a:hover {
	color: var(--coam-accent);
}

.coam-single__title {
	margin: 0 0 2rem;
	color: var(--coam-ink);
	line-height: 1.1;
}

.coam-single__body {
	display: grid;
	grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
	gap: clamp(1.5rem, 4vw, 3.5rem);
	align-items: start;
}

.coam-single__facts {
	position: sticky;
	top: 2rem;
	padding: 1.5rem;
	border: 1px solid var(--coam-line);
	border-radius: var(--coam-radius-lg);
	background: var(--coam-panel);
}

.coam-single__facts .coam__row {
	padding-block: 0.4rem;
	border-bottom: 1px solid var(--coam-line);
}

.coam-single__buy {
	margin: 1.25rem 0 0;
}

.coam-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.85rem 1.6rem;
	border-radius: 999px;
	background-image: var(--coam-brand);
	background-color: var(--coam-accent);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.coam-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 30px rgba(43, 107, 255, 0.28);
	color: #fff;
}

.coam-single__sheets {
	display: grid;
	gap: 2rem;
}

.coam-single__sheet {
	margin: 0;
}

.coam-single__sheet figcaption {
	margin-bottom: 0.6rem;
	font-size: 0.625rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--coam-muted);
}

.coam-single__sheet img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--coam-line);
	border-radius: var(--coam-radius);
	box-shadow: 0 14px 40px rgba(18, 22, 31, 0.1);
}

.coam-single__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin: 0.75rem 0 0;
	font-size: 0.8125rem;
	font-weight: 700;
}

.coam-single__actions a {
	color: var(--coam-accent);
	text-decoration: none;
}

.coam-single__actions a:hover {
	text-decoration: underline;
}

.coam__more {
	font-weight: 700;
}

@media (max-width: 860px) {
	.coam-single__body {
		grid-template-columns: minmax(0, 1fr);
	}

	.coam-single__facts {
		position: static;
	}
}
