/*
Theme Name: Peptico
Description: Block theme for the Peptico extract shop. Layout inspired by wellness DTC shops (hero, stats, numbered steps, comparison) mixed with a clinical "lab data" look (monospace specs, batch badges). All content is editable in Appearance > Editor; products come from WooCommerce.
Version: 1.0.0
Requires at least: 7.0
Requires PHP: 8.1
Text Domain: peptico
License: GPL-2.0-or-later
*/

/* Most styling lives in theme.json. This file only holds what theme.json cannot express. */

/* ---------- Lab spec card (monospace key/value rows) ---------- */
.kh-spec {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
}
.kh-spec .kh-spec-row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.7rem 0;
	border-bottom: 1px solid rgb(255 255 255 / 0.12);
	margin: 0;
}
.kh-spec .kh-spec-row:last-child {
	border-bottom: 0;
}
.kh-spec .kh-spec-row span:last-child {
	text-align: right;
	color: var(--wp--preset--color--accent);
}
.kh-spec--light .kh-spec-row {
	border-bottom-color: var(--wp--preset--color--line);
}
.kh-spec--light .kh-spec-row span:last-child {
	color: var(--wp--preset--color--forest);
}

/* Small status dot used in badges ("verified") */
.kh-dot::before {
	content: "";
	display: inline-block;
	width: 0.5em;
	height: 0.5em;
	margin-right: 0.5em;
	border-radius: 50%;
	background: var(--wp--preset--color--lab);
	vertical-align: middle;
}

/* ---------- Kicker / eyebrow labels ---------- */
.kh-kicker {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* ---------- Product cards ---------- */
.wp-block-woocommerce-product-template > li {
	/* Column layout so the add-to-cart button sits at the bottom of every card,
	   even when a product title wraps onto two lines. */
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 14px;
	padding: 1rem 1rem 1.25rem;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wp-block-woocommerce-product-template > li:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 30px rgb(11 20 17 / 0.08);
}
.wp-block-woocommerce-product-template > li > .wc-block-components-product-button {
	margin-top: auto;
}
.wp-block-woocommerce-product-template .wc-block-components-product-image img {
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
}
@media (prefers-reduced-motion: reduce) {
	.wp-block-woocommerce-product-template > li {
		transition: none;
	}
	.wp-block-woocommerce-product-template > li:hover {
		transform: none;
	}
}

/* ---------- Comparison table ---------- */
.kh-compare table {
	border-collapse: collapse;
	width: 100%;
}
.kh-compare th,
.kh-compare td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.9rem 0.75rem;
	text-align: left;
}
.kh-compare thead th {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-bottom: 2px solid var(--wp--preset--color--ink);
}
.kh-compare td:nth-child(2),
.kh-compare th:nth-child(2) {
	background: var(--wp--preset--color--surface);
	font-weight: 600;
}
.kh-compare td:nth-child(n + 2),
.kh-compare th:nth-child(n + 2) {
	text-align: center;
}

/* ---------- FAQ accordion (core/details) ---------- */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 1.1rem 0;
}
.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}
.wp-block-details summary::-webkit-details-marker {
	display: none;
}
.wp-block-details summary::after {
	content: "+";
	font-family: var(--wp--preset--font-family--mono);
}
.wp-block-details[open] summary::after {
	content: "−";
}
.wp-block-details > :not(summary) {
	margin-top: 0.75rem;
	color: var(--wp--preset--color--muted);
}

/* ---------- Header ---------- */
/* WordPress wraps the part in <header class="wp-block-template-part">;
   sticky must sit on that wrapper, not on an inner group. */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
}
@media (min-width: 601px) {
	.admin-bar header.wp-block-template-part {
		top: var(--wp-admin--admin-bar--height, 32px);
	}
}
.kh-header {
	backdrop-filter: saturate(1.4) blur(10px);
}

/* Visible keyboard focus everywhere */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--lab);
	outline-offset: 2px;
}

/* Cart on phones: the "Spare …" badge (quantity discount) made the item
   table wider than the screen. Let the badge wrap and keep the table inside. */
@media (max-width: 600px) {
	.wc-block-cart-items {
		table-layout: fixed;
		width: 100%;
	}
	.wc-block-cart-items .wc-block-components-sale-badge {
		white-space: normal;
		text-align: right;
	}
}

/* ---------- Wordmark (Peptico brand) ----------
   Lowercase, Inter Tight Bold, -4.5 %. The dot on the "i" is the only brand
   accent and always mint (functions.php swaps "i" for a dotless "ı" + dot). */
.kh-wm-i {
	position: relative;
	display: inline-block;
	line-height: 1;
}
/* Same technique as the brand guide: an "i" in mint, cut off below its dot,
   so the dot has exactly the font's shape and position. */
.kh-wm-dot {
	position: absolute;
	top: 0;
	left: 0;
	color: var(--wp--preset--color--accent);
	clip-path: inset(0 -0.3em 0.716em -0.3em);
}
.kh-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Wordmark: navy on light backgrounds (header), white on navy (footer inherits). */
header .wp-block-site-title {
	color: var(--wp--preset--color--forest);
}

/* ---------- Responsive header ----------
   1. The header's blur (backdrop-filter) makes it the containing block for
      position:fixed children, so the opened mobile menu was squeezed into the
      header bar (only "Shop" visible). No blur while the menu is open.
   2. The menu has 7 items: below 1100 px they no longer fit next to logo and
      account, so tablets get the burger menu too (WordPress switches at 600 px).
   3. The wordmark never wraps ("pepti / co"). */
.kh-header:has(.wp-block-navigation__responsive-container.is-menu-open) {
	backdrop-filter: none;
}
@media (min-width: 600px) and (max-width: 1100px) {
	.kh-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
	.kh-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}
.kh-header .wp-block-site-title {
	flex-shrink: 0;
	white-space: nowrap;
}
/* Opened menu: brand look, large tap targets. */
.kh-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 1.25rem 1.5rem;
	background: #fff;
	color: var(--wp--preset--color--forest);
}
.kh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 3.5rem;
	align-items: flex-start;
}
.kh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 0;
	width: 100%;
	align-items: stretch;
}
.kh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	width: 100%;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.kh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	padding: 0.9rem 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.25rem;
	font-weight: 600;
}
/* Green bar: centred and smaller on phones. */
@media (max-width: 600px) {
	.kh-kicker.has-forest-background-color p {
		font-size: 10px;
		text-align: center;
	}
	.kh-header .wc-block-customer-account__account-label,
	.kh-header .wc-block-customer-account a span:not([class*="icon"]) {
		display: none;
	}
}
.kh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	text-align: left;
}
/* Long German words: hyphenate instead of breaking mid-word ("pharmazeutische-r"). */
h1, h2, h3 {
	hyphens: auto;
	overflow-wrap: normal;
}
@media (max-width: 1100px) {
	h1.wp-block-heading {
		font-size: clamp(2rem, 5.2vw, 3rem);
	}
}
/* Footer links never break mid-word on tablets ("Widerrufsbelehrun-g"). */
footer .wp-block-navigation-item__content,
footer .kh-footer-cats a {
	hyphens: auto;
	overflow-wrap: normal;
	word-break: normal;
}
@media (min-width: 782px) and (max-width: 1100px) {
	footer .has-forest-background-color > .wp-block-columns.alignwide {
		flex-wrap: wrap !important;
	}
	footer .has-forest-background-color > .wp-block-columns.alignwide > .wp-block-column:first-child {
		flex-basis: 100% !important;
	}
}
/* Sticky headers need a background, otherwise the checkout's simple header
   (logo + cart) floats over the form while scrolling. */
header.wp-block-template-part {
	background: #fff;
}
/* Main menu: larger, easier to read (was 14 px). */
@media (min-width: 1101px) {
	.kh-header .wp-block-navigation {
		font-size: 16px;
		font-weight: 500;
	}
	.kh-header .wp-block-navigation__container {
		gap: 1.75rem;
	}
}
.kh-header .wc-block-customer-account a {
	font-size: 16px;
}

/* Home page trust bar (brand guide): four points with a line icon. */
.kh-trust-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 32px;
}
.kh-trust-item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: var(--wp--preset--color--muted);
	font-size: 14px;
	line-height: 1.5;
}
.kh-trust-item svg {
	width: 24px;
	height: 24px;
	margin-bottom: 8px;
	stroke: var(--wp--preset--color--forest);
}
.kh-trust-item strong {
	color: var(--wp--preset--color--ink);
	font-size: 16px;
	font-weight: 600;
}
@media (max-width: 900px) {
	.kh-trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
	.kh-trust-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
