/**
 * Yodha Fuel — Lab Reports page styles.
 *
 * Same architecture as assets/css/shipping-policy.css and the other static
 * content-page stylesheets: this file renders and contains none of the
 * page's actual copy, dates, batch numbers, or PDF URLs. The Lab Reports
 * page is a normal WordPress Page, built entirely from core Gutenberg
 * blocks in wp-admin (an intro paragraph + a core Table block), rendered
 * through the theme's existing page.php + template-parts/content-page.php
 * (both completely unmodified). This file only styles that editor-built
 * content. Every value below comes from the existing design tokens in
 * variables.css — no new colors, no new font, no new button system, no
 * JavaScript.
 *
 * Loaded ONLY on the Lab Reports page (see inc/enqueue.php's conditional,
 * gated on yodha_fuel_is_lab_reports_page() from inc/lab-reports.php), so
 * nothing here can affect Homepage / Shop / Product / Cart / Checkout / My
 * Account / Thank You / any other static page. Every rule below is also
 * scoped under body.yf-lab-reports-page as a second, belt-and-suspenders
 * layer, matching the `.yf-shipping-*` / `.yf-about-*` per-page naming
 * convention already used across the theme — this file never targets a
 * bare `.wp-block-table` or `table` selector without that body-class
 * ancestor, so it cannot leak onto any WooCommerce table anywhere
 * (product, cart totals, account orders, etc.).
 *
 * Unlike About Us / Contact Us / Shipping Policy, this page has no custom
 * hero band replacing the native title — the existing .yf-page__header /
 * <h1>Lab Reports</h1> markup (template-parts/content-page.php, untouched)
 * is kept and simply inherits its current sitewide styling. Only the
 * content column width and the two-column sidebar constraint are
 * overridden, for the same reason every sibling static page already
 * overrides them: a 4-column table needs more horizontal room than the
 * default 72ch reading column.
 *
 * Mobile-first: base rules are the 375px default; this file uses the same
 * shared 480 / 768 / 1024 / 1280px breakpoints as the rest of the theme.
 */

/* ============================================================
   PAGE-LEVEL OVERRIDES — scoped to body.yf-lab-reports-page only (added by
   yodha_fuel_lab_reports_body_class() in inc/lab-reports.php). Same
   technique as every sibling static page's page-level overrides — see
   shipping-policy.css's top comment for the full reasoning.

   The native page title band (.yf-page__header) is kept rather than
   hidden (see this file's top comment for why), but on its own it spans
   the full #primary width with no centering — confirmed live on the
   production site: .yf-page__header rendered at the full 1520px #primary
   width with a 0px left margin, while .yf-page__content sat centered at
   960px with a ~280px left margin, so the title visibly started at the
   far-left page edge while the paragraph and table beneath it did not.
   Every sibling static page avoids this because its hero band's own
   .wp-block-group__inner-container already carries this same max-width +
   centering (confirmed on the live Shipping Policy page: its hero inner
   container and its .yf-shipping-prose block compute to the identical
   960px width / ~280px left margin). Giving .yf-page__header that same
   treatment lines it up with .yf-page__content below it, matching that
   proven pattern. margin-left/margin-right only (not the `margin`
   shorthand) so layout.css's existing margin-bottom on this element is
   left untouched.
   ============================================================ */
body.yf-lab-reports-page .yf-page__header,
body.yf-lab-reports-page .yf-page__content {
	max-width: var(--container-max-narrow);
	padding-left: var(--container-padding-mobile);
	padding-right: var(--container-padding-mobile);
}

body.yf-lab-reports-page .yf-page__header {
	margin-left: auto;
	margin-right: auto;
}

body.yf-lab-reports-page .yf-page__content {
	margin: 0 auto;
}

body.yf-lab-reports-page #primary.content-area {
	width: 100%;
	float: none;
	margin-right: 0;
}

/* ============================================================
   INTRO PARAGRAPH — optional helper class, "yf-lab-reports-intro". The
   widened .yf-page__content above is sized for the table; applying this
   class to the intro paragraph block (via the editor's Advanced panel →
   "Additional CSS class(es)") keeps that one paragraph at a comfortable
   reading width instead of stretching it the full, table-sized column.
   Entirely optional — the page still looks correct without it.
   ============================================================ */
.yf-lab-reports-intro {
	max-width: 68ch;
	color: var(--color-text);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
}

/* ============================================================
   TABLE WRAPPER — WordPress core wraps every Table block in
   <figure class="wp-block-table">. Explicit horizontal scroll is added
   here rather than relied on from WordPress core's own default styling,
   so narrow screens always scroll the table sideways instead of crushing
   its columns or breaking the page layout, regardless of what core/
   Storefront load elsewhere.
   ============================================================ */
body.yf-lab-reports-page .wp-block-table {
	margin: var(--space-lg) 0 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--card-radius);
	border: var(--border-width) solid var(--color-border);
	box-shadow: var(--shadow-card);
}

body.yf-lab-reports-page .wp-block-table table {
	width: 100%;
	min-width: 640px; /* keeps all four columns legible; the figure above
	                      scrolls horizontally below this width rather than
	                      squeezing cells unreadably thin. */
	border-collapse: collapse;
	background-color: var(--color-bg);
}

/* WordPress core gives every table-block cell its own 1px border on all
   four sides by default (color: currentColor, so white in the dark header
   row and dark charcoal in the body rows) — confirmed live: with
   border-collapse: collapse, those leftover top/left/right borders meet
   at each column boundary and visibly cut across the orange accent rule
   and the body-row dividers below, making a single straight line look
   broken into segments instead. This resets all four sides to none first,
   so only this file's own intentional border-bottom rules (TABLE HEADER /
   TABLE BODY, below, later in the cascade so they still win) draw
   anything — one clean horizontal line per row, no vertical dividers. */
body.yf-lab-reports-page .wp-block-table th,
body.yf-lab-reports-page .wp-block-table td {
	border: none;
}

/* ============================================================
   TABLE HEADER — dark charcoal fill, white text, uppercase label styling
   (matching the existing footer-heading / section-eyebrow convention
   elsewhere in the theme), with a thin brand-orange accent rule underneath
   the header row for a touch of brand color alongside the charcoal.

   Two rules below cover both cases: real <thead><th> markup (the Table
   block's "Header section" toggle on — the more accessible, more
   reliably-targetable option; worth turning on in the editor if it isn't
   already) AND a plain first <tbody> row with no <thead> at all (confirmed
   live on the production page: the Header section toggle was off, so
   there was no <thead> and this first-row text rendered unstyled with the
   browser/WordPress-core default cell borders). The second rule uses
   :not(:has(thead)) so it only applies when there's no real header row,
   and stops applying automatically the moment "Header section" is turned
   on — modern, widely-supported CSS; a very old browser without :has()
   support simply shows that row as a normal cell instead, not a broken
   page.
   ============================================================ */
body.yf-lab-reports-page .wp-block-table thead th {
	background-color: var(--warrior-dark);
	color: var(--color-text-inverse);
	font-size: var(--fs-label);
	font-weight: var(--fw-bold);
	text-transform: uppercase;
	letter-spacing: var(--ls-label);
	text-align: left;
	padding: var(--space-sm) var(--space-md);
	border-bottom: var(--border-width-thick) solid var(--yodha-orange);
	white-space: nowrap;
}

body.yf-lab-reports-page .wp-block-table:not(:has(thead)) tbody tr:first-child td {
	background-color: var(--warrior-dark);
	color: var(--color-text-inverse);
	font-size: var(--fs-label);
	font-weight: var(--fw-bold);
	text-transform: uppercase;
	letter-spacing: var(--ls-label);
	text-align: left;
	border-bottom: var(--border-width-thick) solid var(--yodha-orange);
	white-space: nowrap;
}

/* ============================================================
   TABLE BODY — subtle borders, comfortable padding, light zebra striping
   for scanning across many batch rows, and safe word-wrapping so a long
   product name or batch number wraps inside its own cell instead of
   overflowing or forcing the whole table wider than it needs to be.
   ============================================================ */
body.yf-lab-reports-page .wp-block-table tbody td {
	padding: var(--space-sm) var(--space-md);
	border-bottom: var(--border-width) solid var(--color-border);
	color: var(--color-text);
	font-size: var(--fs-small);
	line-height: var(--lh-body);
	vertical-align: middle;
	overflow-wrap: break-word;
}

body.yf-lab-reports-page .wp-block-table tbody tr:last-child td {
	border-bottom: none;
}

body.yf-lab-reports-page .wp-block-table tbody tr:nth-child(even) td {
	background-color: var(--color-bg-alt);
}

/* The Report column is always this table's last column per the page's
   documented 4-column structure (Date of Manufacturing / Batch Number /
   Product / Report) — centering just that column keeps the PDF link
   visually tidy without needing a hard-coded column count or index
   selector tied to table markup specifics beyond :last-child. */
body.yf-lab-reports-page .wp-block-table tbody td:last-child {
	text-align: center;
}

/* ============================================================
   PDF LINK — "View Report (PDF)", linked by the admin via the Media
   Library and left completely untouched as content. A distinct, brand-
   orange, button-like treatment with a plain document icon drawn with a
   CSS mask (not a new PHP icon or shortcode): the mask's shape is painted
   with background-color: currentColor, so the icon always matches the
   link's current text color automatically, including through hover and
   focus — the same "recolors for free" behavior the theme's inline-SVG
   icons already rely on, achieved here with zero markup change.
   ============================================================ */
body.yf-lab-reports-page .wp-block-table tbody td:last-child a {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2xs);
	padding: var(--space-2xs) var(--space-sm);
	border: var(--border-width-thick) solid var(--yodha-orange);
	border-radius: var(--btn-radius);
	color: var(--yodha-orange);
	font-size: var(--fs-small);
	font-weight: var(--fw-semibold);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

body.yf-lab-reports-page .wp-block-table tbody td:last-child a::before {
	content: "";
	display: inline-block;
	width: 15px;
	height: 15px;
	flex-shrink: 0;
	background-color: currentColor;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cline x1='9' y1='13' x2='15' y2='13'/%3E%3Cline x1='9' y1='16.5' x2='15' y2='16.5'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cline x1='9' y1='13' x2='15' y2='13'/%3E%3Cline x1='9' y1='16.5' x2='15' y2='16.5'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

body.yf-lab-reports-page .wp-block-table tbody td:last-child a:hover,
body.yf-lab-reports-page .wp-block-table tbody td:last-child a:focus {
	background-color: var(--yodha-orange);
	color: var(--white);
	border-color: var(--yodha-orange);
}

/* Clear, visible keyboard-focus state — same ring treatment used on the
   theme's existing buttons (components.css's .yf-btn:focus-visible). */
body.yf-lab-reports-page .wp-block-table tbody td:last-child a:focus-visible {
	outline: 3px solid var(--warrior-dark);
	outline-offset: 2px;
}

/* ============================================================
   BREAKPOINTS — the .yf-page__header / .yf-page__content side padding
   steps up at the same 480/768/1024px points and to the exact same
   values as the sitewide .yf-container utility (layout.css), so this
   page's edge spacing reads identically to every other page's even
   though .yf-container's own class isn't present in this page's markup.
   ============================================================ */

/* 480px — large mobile */
@media (min-width: 480px) {
	body.yf-lab-reports-page .yf-page__header,
	body.yf-lab-reports-page .yf-page__content {
		padding-left: var(--container-padding-small);
		padding-right: var(--container-padding-small);
	}
}

/* 768px — tablet: a little more breathing room in the cells now that
   there's space for it. */
@media (min-width: 768px) {
	body.yf-lab-reports-page .yf-page__header,
	body.yf-lab-reports-page .yf-page__content {
		padding-left: var(--container-padding-tablet);
		padding-right: var(--container-padding-tablet);
	}

	body.yf-lab-reports-page .wp-block-table thead th,
	body.yf-lab-reports-page .wp-block-table tbody td {
		padding: var(--space-md) var(--space-lg);
	}

	body.yf-lab-reports-page .wp-block-table tbody td {
		font-size: var(--fs-body);
	}
}

/* 1024px — desktop: the table no longer needs its own minimum-width
   scroll safeguard at this width; left in place anyway (harmless) as a
   defensive backstop for an unusually long Product name or Batch Number. */
@media (min-width: 1024px) {
	body.yf-lab-reports-page .yf-page__header,
	body.yf-lab-reports-page .yf-page__content {
		padding-left: var(--container-padding-desktop);
		padding-right: var(--container-padding-desktop);
	}

	body.yf-lab-reports-page .wp-block-table table {
		min-width: 0;
	}
}
