/*
Theme Name: Singularity Marble
Description: A premium, minimalist editorial museum skin of the Singularity Shop block theme — a rounded off-white panel on a cool-grey gallery wall, Cormorant Garamond display type, Inter body, antique-bronze accents and charcoal pill buttons. Kept as a separate theme so the Swiss look (Theme 1) stays switchable.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: singularity-marble
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

/* zero the block-gap margin the editor inserts between top-level sections */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}
.wp-site-blocks main {
	padding-block: 0;
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

:root {
	--outer: var(--wp--preset--color--outer);
	--bg: var(--wp--preset--color--background);
	--ink: var(--wp--preset--color--text);
	--sec: var(--wp--preset--color--muted);
	--accent: var(--wp--preset--color--accent);
	--line: #bfc3c4;
	--button: #595d63;
	--button-text: #f1f1f1;
	--tint: #eef3f2;
	--surface: #f0f4f3;
	--sp-40: var(--wp--preset--spacing--40);
	--sp-50: var(--wp--preset--spacing--50);
	--label: var(--wp--preset--font-size--label);
}

/* full-width page ground — no side margins */
body {
	background: var(--bg);
	color: var(--ink);
	font-family: var(--wp--preset--font-family--inter);
}

.wp-site-blocks {
	width: 100%;
	max-width: none;
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
}
::selection {
	background: var(--ink);
	color: #f5f6f6;
}

/* ================= header ================= */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 30;
}
.site-header {
	background: rgba(243, 247, 247, 0.92);
	backdrop-filter: blur(6px);
	border-bottom: 1px solid var(--line);
}
.site-header__inner {
	width: 100%;
	max-width: none;
	box-sizing: border-box;
}
.site-header__row {
	min-height: 96px;
	gap: 1rem 1.5rem;
	padding: 0;
	margin: 0 auto;
	width: 100%;
	max-width: var(--wp--style--global--content-size, 1000px);
}
.site-brand a {
	color: #2b2f32;
	text-decoration: none;
	font-family: var(--wp--preset--font-family--cormorant-garamond);
	font-size: 1.4rem;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0;
}
.site-brand a:hover {
	color: var(--accent);
}

/* navigation */
.site-nav .wp-block-navigation__container {
	column-gap: 12px;
}
.site-nav .wp-block-navigation-item__content {
	color: #3f4245;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.01em;
	transition: color 0.15s ease;
}
.site-nav .wp-block-navigation-item__content:hover {
	color: var(--accent);
}
.site-nav .wp-block-navigation-item a,
.site-nav .is-style-default .wp-block-navigation-item__content {
	text-decoration: none;
}
.site-nav .current-menu-item > .wp-block-navigation-item__content {
	box-shadow: inset 0 -1px 0 0 #2b2f32;
}
/* current page inside a dropdown: gold pill highlight */
.site-nav .wp-block-navigation__submenu-container .current-menu-item > .wp-block-navigation-item__content,
.site-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content[aria-current="page"] {
	background: var(--accent);
	color: #fff;
	border-radius: 4px;
	box-shadow: none;
}
/* active section (e.g. Physics) hint at the top level */
.site-nav .wp-block-navigation-submenu.current-menu-ancestor > .wp-block-navigation-item__content {
	color: var(--accent);
}

/* header actions: account icon + contact pill on the right */
.site-header__actions {
	margin-left: auto;
	gap: 14px;
}
.header-account {
	margin: 0;
	line-height: 0;
}
.header-account a {
	color: #2b2f32;
	display: inline-flex;
	align-items: center;
}
.header-account a:hover {
	color: var(--accent);
}
.header-cta {
	gap: 0;
}
.header-cta .wp-block-button__link {
	min-width: 108px;
	height: 34px;
	padding: 0 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #595d63;
	color: #f1f1f1;
	border-radius: 999px;
	border: 1px solid #595d63;
	font-size: 14px;
	line-height: 1;
}
.header-cta .wp-block-button__link:hover {
	background: #4a4e53;
	border-color: #4a4e53;
	color: #ffffff;
}

/* ================= footer ================= */
.site-footer {
	border-top: 1px solid var(--line);
}
.site-footer__row {
	padding-block: 3.5rem 1rem;
}
.site-footer__brand {
	margin: 0 0 0.4rem;
	font-family: var(--wp--preset--font-family--cormorant-garamond);
	font-size: 1.2rem;
	font-weight: 500;
	color: #2b2f32;
}
.site-footer__licence {
	margin: 0;
	color: var(--sec);
	font-size: 0.9rem;
}
.site-footer__meta {
	border-top: 1px solid var(--line);
	padding-block: 1.25rem clamp(24px, 6vh, 56px);
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	column-gap: 1rem;
	background: transparent;
}
.site-footer__meta > * { margin: 0; }
.site-footer__links {
	display: flex;
	flex-wrap: wrap;
	column-gap: 1.4rem;
	justify-self: start;
}
.site-footer__links a {
	color: #3f4245;
	font-size: 0.8rem;
	font-weight: 400;
	letter-spacing: 0.02em;
	text-decoration: none;
}
.site-footer__links a:hover { color: var(--accent); }
.site-footer__tagline {
	justify-self: center;
	color: var(--sec);
	font-size: 0.78rem;
	letter-spacing: 0.02em;
}
.site-footer__meta-part {
	justify-self: end;
	color: var(--sec);
	font-size: 0.78rem;
}
.site-footer__meta-part, .site-footer__links a {
	text-transform: none;
}

/* ================= buttons ================= */
.wp-block-button__link {
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.wp-element-button:hover { background: #4a4e53; color: #fff; }

/* outline / ghost button */
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	border: 1px solid var(--line);
	color: var(--ink);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: transparent;
	border-color: var(--accent);
	color: var(--accent);
}

/* ================= eyebrows ================= */
.eyebrow {
	font-family: var(--wp--preset--font-family--inter);
	font-size: 15px;
	font-weight: 400;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--sec);
	margin-bottom: var(--sp-50);
}
.part-no {
	color: var(--accent);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.08em;
}

/* ================= hero (split editorial) ================= */
.site-hero {
	position: relative;
	padding: clamp(2.5rem, 7vh, 4.5rem) 0 clamp(5rem, 12vh, 8rem);
}
/* faint marble-vein contour decoration behind the hero */
.site-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(48% 60% at 78% 12%, rgba(169, 134, 82, 0.10), transparent 65%),
		radial-gradient(40% 55% at 88% 78%, rgba(169, 134, 82, 0.06), transparent 60%);
}
.site-hero.alignfull { margin-inline: 0; }
.site-hero-cols {
	position: relative;
	align-items: start;
	column-gap: clamp(2.5rem, 6vw, 5rem);
	/* match the content width used by inventory / physics so the page stays flush */
	max-width: var(--wp--style--global--content-size, 1000px);
	margin-inline: auto;
}
/* left ~42% / right ~55-60% */
.site-hero-cols .wp-block-column:first-child {
	flex-basis: 42%;
	width: 42%;
	padding-top: clamp(1.5rem, 5vh, 3.5rem);
}
.site-hero-cols .wp-block-column:last-child {
	flex: 1 1 58%;
	max-width: 58%;
}
/* eyebrow above heading */
.site-hero .eyebrow {
	color: var(--sec);
	margin-bottom: 1.5rem;
}
/* massive luxury serif heading, bronze gold, uppercase */
.site-hero h1 {
	margin-top: 0;
	margin-bottom: 0;
	color: var(--accent);
	font-family: var(--wp--preset--font-family--cormorant-garamond);
	font-weight: 400;
	font-size: clamp(2.75rem, 5.6vw, 4.25rem);
	line-height: 1.0;
	text-transform: uppercase;
	letter-spacing: -0.005em;
	max-width: 620px;
}
/* thin divider under the heading */
.site-hero h1::after {
	content: "";
	display: block;
	width: min(96px, 100%);
	height: 1px;
	background: var(--line);
	margin: 1.6rem 0 1.7rem;
}
/* body copy */
.site-hero .has-body-font-size {
	margin: 0 0 2rem;
	color: var(--sec);
	font-family: var(--wp--preset--font-family--inter);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.5;
	max-width: 460px;
}
/* primary button */
.site-hero .wp-block-buttons { gap: 14px; }
.site-hero .wp-block-button__link {
	height: 40px;
	min-width: 128px;
	padding: 0 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #595d63;
	border: 1px solid #595d63;
	color: #f1f1f1;
	border-radius: 999px;
}

/* right image — seamless, blended into the panel */
.placeholder-media {
	min-height: min(560px, 62vh);
	border-radius: 18px;
	border: none;
	background:
		radial-gradient(120% 92% at 74% 26%, rgba(169, 134, 82, 0.13), transparent 58%),
		radial-gradient(90% 80% at 20% 88%, rgba(191, 195, 196, 0.35), transparent 60%),
		linear-gradient(168deg, #fbfcfb, #edf2f1);
	display: flex;
	align-items: center;
	justify-content: center;
}
.placeholder-media::after {
	content: "";
}

/* hero sculpture image */
.site-hero-cols .wp-block-image { margin: 0; }

/* ============ homepage tweaks ============ */
/* one grey for all homepage text: hero intro paragraph + eyebrow join the site-body ink */
.home .site-hero .eyebrow,
.home .site-hero .has-body-font-size { color: var(--ink); }
/* wider rule under the hero heading */
.home .site-hero h1::after { width: min(200px, 100%); }
/* tighten the gap between the hero image and the 'Share it back' section */
.home .site-hero { padding-bottom: clamp(2rem, 5vh, 3.25rem); }
.home .site-section { padding-top: clamp(1.5rem, 4vw, 3rem); }
.site-hero-cols .wp-block-column:last-child img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	border-radius: 18px;
	box-shadow: 0 20px 40px -30px rgba(63, 66, 69, 0.4);
}

/* ================= ruled sections ================= */
.site-section {
	padding-block: clamp(3rem, 7vw, 6rem);
}
.site-section.is-tint {
	background: var(--tint);
}
.site-section > .wp-block-heading {
	padding-inline: var(--wp--style--root--padding-left);
}
.site-section h2,
.site-section h3 {
	color: var(--ink);
}

/* ================= simulation index group rules ================= */
.sim-group.wp-block-separator {
	border-top-width: 1px;
}

/* ================= product grid ================= */
.product-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
	margin-inline: var(--wp--style--root--padding-left);
}
.product-grid > * { margin-top: 0; }
/* cap full-bleed section grids to the content width so tiles align with inventory / mechanics */
.site-section .product-grid {
	width: min(calc(100% - (2 * var(--wp--style--root--padding-left))), var(--wp--style--global--content-size, 1000px));
	max-width: none;
	margin-inline: auto;
}
/* tile sections start right after the breadcrumb / preceding content — the /me/ standard */
.site-section:has(> .product-grid) {
	padding-top: 0;
	padding-bottom: clamp(2rem, 5vw, 4rem);
}
/* every page ends with the same breathing room above the footer as the tile pages */
.entry-content > *:last-child {
	margin-bottom: clamp(2rem, 5vw, 4rem) !important;
}
.entry-content > .site-section:last-child {
	margin-bottom: 0 !important;
	padding-bottom: clamp(2rem, 5vw, 4rem);
}
/* Simulations landing carries four subject tiles: keep them balanced two-by-two on wide screens
   so a single tile never sits alone on a third row */
@media (min-width: 701px) {
	.page-id-297 .covered-topics { grid-template-columns: repeat(2, 1fr); }
	/* an odd last subject tile sits centred on its own row instead of hanging left */
	.page-id-297 .covered-topics > .product-cell:last-child:nth-child(odd) {
		grid-column: 1 / -1;
		width: calc(50% - 10px);
		justify-self: center;
	}
}
/* standardise tile cover images to the periodic-table proportions (3:2 landscape),
   scaled to fit fully within the box (no cropping) */
.product-grid .product-cell img {
	width: 100%;
	display: block;
	aspect-ratio: 3 / 2;
	object-fit: contain;
	object-position: center;
	border-radius: 10px;
}
.product-cell {
	border: 1px solid var(--accent);
	border-radius: 14px;
	background: var(--surface);
	padding: 1.5rem 1.5rem 1.75rem;
	box-shadow: none;
	transition: border-color 0.15s ease, background 0.15s ease;
	display: flex;
	flex-direction: column;
	position: relative;
}
.product-cell h3 {
	margin-top: 1rem;
	margin-bottom: 1rem;
	font-size: 1.5rem;
	font-weight: 600;
	color: #2b2f32;
}
.product-cell h3 a {
	color: #2b2f32;
	text-decoration: none;
	font-weight: 600;
}
.product-cell h3 a:hover { color: var(--accent); }
/* cells that open with a heading (no eyebrow line) keep the same inner top spacing */
.product-cell > .wp-block-heading:first-child { margin-top: 0; }
.product-cell p { margin-bottom: 0.6rem; }
.part-no { color: var(--accent); }

/* download / drawing button inside a cell carries the surface tint */
.product-cell .wp-block-button.is-style-outline .wp-block-button__link {
	background: #ffffff;
}
.product-cell .wp-block-buttons {
	width: 100%;
	margin-top: auto;
	padding-top: 1.25rem;
}
.product-cell .wp-block-button { flex: 1 1 100%; }
.product-cell .wp-block-button__link { width: 100%; text-align: center; border-radius: 999px; }

/* download-count badge */
.download-count {
	position: absolute;
	top: 0.9rem;
	right: 0.9rem;
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.3rem 0.6rem;
	background: #ffffff;
	border: 1px solid var(--line);
	border-radius: 999px;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 0.72rem;
	font-weight: 500;
	line-height: 1;
	color: var(--sec);
	text-transform: none;
	letter-spacing: 0;
}
.download-count::before {
	content: "";
	width: 12px;
	height: 12px;
	background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%2362666b" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="3" x2="12" y2="15"/></svg>') center / contain no-repeat;
}

/* hover: shared gold background on every tile */
.product-cell:hover {
	background: #f6f2ea;
}
.product-cell:hover h3 a {
	color: var(--accent);
}

/* covered-topics tiles: whole cell clickable */
.covered-topics .product-cell h3 { margin-top: 0.4rem; }
.covered-topics .product-cell h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* ================= range link rows ================= */
.range-index { padding-block-start: var(--sp-60); }
.range-link {
	border-top: 1px solid var(--line);
	padding-block: var(--sp-50);
}
.range-link h2 a {
	color: #2b2f32;
	text-decoration: none;
	font-family: var(--wp--preset--font-family--cormorant-garamond);
	font-size: clamp(1.9rem, 4vw, 3rem);
	font-weight: 500;
}
.range-link h2 a:hover { color: var(--accent); }

/* ================= inventory table ================= */
.inventory-table { font-size: 0.9em; }
.inventory-table th,
.inventory-table td { padding: 0.5rem 0.65rem; border-bottom: 1px solid #e3e6e6; }
.inventory-table thead th { border-bottom: 1px solid var(--line); color: #2b2f32; }
.inventory-table td:first-child,
.inventory-table th:nth-child(2),
.inventory-table td:nth-child(2) { white-space: nowrap; }
.inventory-table td:nth-child(4) { line-height: 1.35; }
.inventory-table th:last-child { white-space: nowrap; }
.inventory-table th:last-child,
.inventory-table td:last-child { text-align: center; }
/* inventory stripe tint matches this theme */
.inventory-table.is-style-stripes thead th { background: var(--surface); }
.inventory-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--tint); }
.inventory-table.is-style-stripes tbody tr:nth-child(even) { background: transparent; }

/* ================= breadcrumb (page directory path, gold, footer size) ================= */
.breadcrumb {
	font-family: var(--wp--preset--font-family--inter);
	font-size: 0.7rem;
	line-height: 1.6;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--accent);
	padding: 1.5rem 0 0.25rem;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { color: var(--button); text-decoration: underline; }
.breadcrumb-sep { opacity: 0.55; }

/* ================= legal-page sub-headers sit closer to their text ================= */
.entry-content h2 + p,
.entry-content h3 + p {
	margin-top: 0.4rem;
}

/* ================= inventory tables: border + space before footer ================= */
.inventory-table.is-style-stripes {
	border: 1px solid var(--line);
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 6rem;
}
.inventory-table table {
	border-collapse: collapse;
	width: 100%;
}
.inventory-table th,
.inventory-table td {
	border: 1px solid var(--line);
}
.inventory-table thead th {
	border-bottom: 2px solid var(--line);
}

/* Manufacturer / Maker listing tables reuse the inventory table look but keep the description column wrapped and left-aligned */
.inventory-table.listing-table.is-style-stripes { margin-bottom: 3rem; }
.listing-table th:nth-child(2),
.listing-table td:nth-child(2) { white-space: normal; line-height: 1.45; }
.listing-table th:last-child,
.listing-table td:last-child { text-align: left; }

/* ================= responsive ================= */
@media (max-width: 900px) {
	.product-grid { grid-template-columns: repeat(2, 1fr); }
	.site-header__row { padding-inline: 24px; }
	.site-hero { padding-inline: 24px; }
	.site-hero-cols .wp-block-column:first-child { flex-basis: 100%; width: 100%; }
	.site-hero-cols .wp-block-column:last-child { max-width: 100%; flex-basis: 100%; }
	.site-hero h1 { font-size: clamp(2.4rem, 7vw, 3.4rem); }
}
@media (max-width: 700px) {
	.product-grid { grid-template-columns: 1fr; }
	.site-header__row { min-height: 76px; }
	.site-brand a { font-size: 1.1rem; }
	.site-footer__meta { grid-template-columns: 1fr; gap: 1rem; }
	.site-footer__links,
	.site-footer__tagline,
	.site-footer__meta-part { justify-self: center; }
	.site-hero::after { left: 24px; bottom: 24px; width: 68px; height: 68px; }
	.site-hero { padding-bottom: 6rem; }
}

/* ================= simulation download pill ================= */
.entry-content section[id$="-lab"] { position: relative; }
.sim-download {
	position: absolute;
	top: 0;
	right: 18px;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .4rem .85rem;
	border: 1px solid var(--wp--preset--color--accent, #a98652);
	border-radius: 999px;
	background: #ffffff;
	color: var(--wp--preset--color--accent, #a98652);
	font-family: Inter, system-ui, sans-serif;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .02em;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 6px 14px -10px rgba(63, 66, 69, .55);
	transition: background .2s ease, color .2s ease, border-color .2s ease;
	z-index: 3;
}
.sim-download:hover,
.sim-download:focus-visible {
	background: var(--wp--preset--color--accent, #a98652);
	color: #ffffff;
}
.sim-download:focus-visible { outline: 2px solid var(--wp--preset--color--accent, #a98652); outline-offset: 3px; }
/* the pill sits inside the widget shell, whose own CSS styles bare svg elements —
   pin the icon so no widget rule can resize, move or box it */
.sim-download .sim-download__icon {
	display: block;
	width: 12px !important;
	height: 12px !important;
	max-width: 12px !important;
	flex: none !important;
	margin: 0 !important;
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
}
.sim-download .sim-download__label {
	color: inherit;
	background: none;
	padding: 0;
	border: 0;
}
@media (max-width: 520px) {
	.sim-download { right: 12px; padding: .34rem .68rem; font-size: 11px; }
}
