/* =========================================================================
   THEORYS — CERTIFICATES OF ANALYSIS
   Loaded on single-product pages (for the media tabs) and on /coas/ (for the
   index and the modal) — see thr_coa_assets() in theorys-coa.php.

   Same house rule as everywhere else here: theorys-shop.css declares
   `.thr-shell h1,h2,h3,h4 { color: var(--ink) }` at (0,1,1), which beats any
   single-class selector, so anything on a dark ground is re-declared with a
   matching or higher-specificity selector.
   ========================================================================= */

/* ---------- 1. PRODUCT PAGE MEDIA TABS ---------------------------------- */

.thr-media { min-width: 0; }

/* GRID PLACEMENT — this is load-bearing, not cosmetic.
   theorys-shop.css pins the two columns of div.product explicitly at ≥768px:
   `.woocommerce-product-gallery { grid-column:1; grid-row:1 }` and
   `.entry-summary { grid-column:2; grid-row:1 }`. Wrapping the gallery in
   .thr-media means that first rule no longer matches a grid ITEM (the gallery is
   now a grandchild), so the wrapper was auto-placed — and because the summary is
   pinned to row 1 column 2, sparse auto-placement cannot go backwards and
   dropped the whole media column into row 2, under the summary. Pinning the
   wrapper to row 1 column 1 at the same breakpoint restores the two-column top.
   Same breakpoint as theorys-shop.css:636 on purpose; changing one means
   changing the other. */
@media (min-width: 768px) {
	.thr-shell div.product .thr-media { grid-column: 1; grid-row: 1; }
}

.thr-media-pills {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	margin: 0 0 16px;
	background: var(--off-white);
	border: 1px solid var(--line);
	border-radius: 999px;
}
.thr-media-pill {
	font-family: var(--font-head);
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	padding: 9px 16px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #5b6660;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.thr-media-pill:hover { color: var(--ink); }
.thr-media-pill.is-active {
	background: var(--forest-deep);
	color: var(--white);
}
.thr-media-pill:focus-visible { outline: 2px solid var(--forest-mid); outline-offset: 2px; }

.thr-media-panel[hidden] { display: none; }

/* The certificate viewer. Aspect ratio approximates a portrait page so the
   embedded PDF opens at a readable scale instead of a letterbox strip. */
.thr-coa-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1.3;
	background: var(--off-white);
	border: 1px solid var(--line);
	border-radius: 14px;
	overflow: hidden;
}
.thr-coa-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}
.thr-coa-frame--image { aspect-ratio: auto; }
.thr-coa-frame--image img { display: block; width: 100%; height: auto; }

.thr-media-coa-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 18px;
	margin: 16px 0 0;
}
.thr-shell .thr-media-coa-link {
	font-family: var(--font-head);
	font-size: 13.5px;
	color: var(--forest-mid);
	text-decoration: none;
}
.thr-shell .thr-media-coa-link:hover { text-decoration: underline; }
.thr-media-coa-note {
	margin: 14px 0 0;
	font-size: 11.5px;
	line-height: 1.6;
	color: var(--platinum-lo);
}

/* ---------- 2. "NOT YET PUBLISHED" STATE -------------------------------- */

.thr-coa-pending {
	background: var(--off-white);
	border: 1px dashed var(--line);
	border-radius: 14px;
	padding: 28px 26px;
	text-align: left;
}
.thr-coa-pending-icon { display: block; width: 26px; height: 26px; color: var(--forest-mid); margin-bottom: 14px; }
.thr-coa-pending-icon svg { width: 100%; height: 100%; }
.thr-coa-pending-head {
	font-family: var(--font-head);
	font-size: 15px;
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 10px;
}
.thr-coa-pending-body {
	margin: 0 0 10px;
	font-size: 13.5px;
	line-height: 1.65;
	color: #4b544e;
}
.thr-coa-pending-body:last-child { margin-bottom: 0; }
.thr-shell .thr-coa-pending-body a { color: var(--forest-mid); text-decoration: underline; text-underline-offset: 2px; }

/* Shared with the Legal Center: an unconfirmed fact is always highlighted. */
.thr-coa-pending .thr-legal-tbd,
.thr-coa-modal .thr-legal-tbd {
	background: #FFF3CD;
	border: 1px dashed #B8860B;
	border-radius: 6px;
	padding: 1px 6px;
	color: #6B4E00;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.88em;
}

/* ---------- 3. /coas/ PAGE ---------------------------------------------- */

.thr-coas-head { background: var(--white); padding: 40px 0 34px; }
.thr-coas-crumbs { margin-bottom: 18px; }
.thr-coas-title {
	font-size: clamp(32px, 6vw, 58px);
	line-height: 1.02;
	letter-spacing: -0.03em;
	margin: 0 0 16px;
}
/* 24px, was 48px. The hero's four stat tiles used to sit between these two
   sections; with them gone (removed 2026-09-09) the stacked paddings read as a
   dead band under the intro paragraph. */
.thr-coas-request { padding: 24px 0 0; }
.thr-coas-request-inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	align-items: end;
}
.thr-coas-h2 { font-size: clamp(22px, 3.2vw, 30px); line-height: 1.15; margin: 0 0 12px; }
.thr-coas-p { font-size: 15.5px; line-height: 1.7; color: #3a423d; max-width: 62ch; margin: 0; }
.thr-coas-request-cta { margin: 0; }

.thr-coas-index { padding: 52px 0 76px; }
.thr-coas-index .thr-lead { margin-bottom: 22px; }

.thr-coas-how {
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 0 18px;
	margin: 0 0 30px;
	background: var(--off-white);
}
.thr-coas-how summary {
	font-family: var(--font-head);
	font-size: 13px;
	font-weight: 500;
	color: var(--forest-deep);
	padding: 14px 0;
	cursor: pointer;
}
.thr-coas-how summary:focus-visible { outline: 2px solid var(--forest-mid); outline-offset: 3px; }
.thr-coas-how-body { padding: 0 0 16px; }
.thr-coas-how-body p { font-size: 14px; line-height: 1.7; color: #4b544e; margin: 0 0 12px; max-width: 72ch; }
.thr-coas-how-body p:last-child { margin-bottom: 0; }
.thr-shell .thr-coas-how-body a { color: var(--forest-mid); text-decoration: underline; text-underline-offset: 2px; }

.thr-coas-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.thr-coas-row {
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr) auto;
	grid-template-areas:
		"n name view"
		". doc view";
	gap: 4px 14px;
	align-items: center;
	padding: 16px 0;
	border-bottom: 1px solid var(--line);
}
.thr-coas-n {
	grid-area: n;
	font-family: var(--font-head);
	font-size: 11.5px;
	color: var(--platinum-lo);
	font-variant-numeric: tabular-nums;
}
.thr-coas-name {
	grid-area: name;
	font-family: var(--font-head);
	font-size: 15.5px;
	font-weight: 500;
	color: var(--ink);
	line-height: 1.3;
}
.thr-coas-doc { grid-area: doc; font-size: 12.5px; color: var(--platinum-lo); }
.thr-coas-row.is-pending .thr-coas-doc { color: #9a7b1f; }
.thr-coas-purity { display: none; }
.thr-coas-view {
	grid-area: view;
	font-family: var(--font-head);
	font-size: 13px;
	font-weight: 500;
	padding: 9px 16px;
	border: 1px solid var(--forest-deep);
	border-radius: 999px;
	background: transparent;
	color: var(--forest-deep);
	cursor: pointer;
	white-space: nowrap;
	transition: background .15s ease, color .15s ease;
}
.thr-coas-view:hover { background: var(--forest-deep); color: var(--white); }
.thr-coas-view:focus-visible { outline: 2px solid var(--forest-mid); outline-offset: 2px; }

.thr-coas-foot {
	margin: 26px 0 0;
	font-size: 12.5px;
	line-height: 1.7;
	color: var(--platinum-lo);
	max-width: 78ch;
}
.thr-shell .thr-coas-foot a { color: var(--forest-mid); text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 700px) {
	.thr-coas-request-inner { grid-template-columns: minmax(0, 1fr) auto; }
	.thr-coas-row {
		grid-template-columns: 34px minmax(0, 1fr) 190px 130px auto;
		grid-template-areas: "n name doc purity view";
		gap: 16px;
		padding: 14px 0;
	}
	.thr-coas-purity {
		display: block;
		grid-area: purity;
		font-family: var(--font-head);
		font-size: 13px;
		color: var(--forest-mid);
	}
}

/* ---------- 4. CERTIFICATE MODAL ---------------------------------------- */

html.thr-coa-open, html.thr-coa-open body { overflow: hidden; }

.thr-coa-modal {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 18px;
	background: rgba(7, 9, 8, 0.72);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	overflow-y: auto;
}
.thr-coa-modal[hidden] { display: none; }

.thr-coa-modal-card {
	width: 100%;
	max-width: 840px;
	max-height: calc(100vh - 48px);
	margin: auto;
	display: flex;
	flex-direction: column;
	background: var(--white);
	border-radius: 16px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
	overflow: hidden;
}
.thr-coa-modal-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 16px;
	border-bottom: 1px solid var(--line);
}
.thr-coa-modal-eyebrow {
	margin: 0 0 4px;
	font-family: var(--font-head);
	font-size: 10.5px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--forest-mid);
	font-weight: 600;
}
.thr-shell .thr-coa-modal-title { font-size: 20px; margin: 0; line-height: 1.25; }
.thr-coa-modal-close {
	flex: none;
	width: 34px;
	height: 34px;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: var(--white);
	color: var(--ink);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.thr-coa-modal-close:hover { background: var(--off-white); }
.thr-coa-modal-close:focus-visible { outline: 2px solid var(--forest-mid); outline-offset: 2px; }

.thr-coa-modal-body { padding: 20px 24px; overflow-y: auto; }
.thr-coa-modal-body .thr-coa-frame { aspect-ratio: 1 / 1.25; }

.thr-coa-modal-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	padding: 16px 24px 20px;
	border-top: 1px solid var(--line);
	background: var(--off-white);
}
.thr-coa-modal-note {
	margin: 0;
	font-size: 11.5px;
	line-height: 1.6;
	color: var(--platinum-lo);
	flex: 1 1 240px;
}

@media (max-width: 600px) {
	.thr-coa-modal { padding: 12px; }
	.thr-coa-modal-card { max-height: calc(100vh - 24px); border-radius: 14px; }
	.thr-coa-modal-head { padding: 18px 18px 14px; }
	.thr-coa-modal-body { padding: 16px 18px; }
	.thr-coa-modal-body .thr-coa-frame { aspect-ratio: 1 / 1.4; }
	.thr-coa-modal-foot { padding: 14px 18px 16px; }
	.thr-coas-head { padding: 28px 0 26px; }
	.thr-coas-index { padding: 40px 0 56px; }
}
