/*
Theme Name:        Zentile
Theme URI:         https://zentile.co.uk
Author:            Zentile
Description:       Monochrome panel-grid theme for Zentile, the 8-electrode biometric smart scale. Responsive quadrant layout, WooCommerce-ready, blog-ready, hamburger menu and header search.
Version:           1.0.1
Requires at least: 6.3
Tested up to:      6.8
Requires PHP:      7.4
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       zentile
Tags:              e-commerce, blog, grid-layout, one-column, custom-logo, custom-menu, featured-images, block-styles, wide-blocks
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
	--z-white: #ffffff;
	--z-paper: #f3f3f3;      /* reading panels */
	--z-rule: #e2e2e2;       /* hairlines on white */
	--z-logo: #777777;       /* matches logo grey */
	--z-mid: #5e5e5e;        /* mid-grey panels (white text ≥ 6:1) */
	--z-dark: #2a2a2a;       /* dark-grey panels */
	--z-ink: #141414;        /* grid gutters / deepest tone */
	--z-text-on-dark: #f2f2f2;
	--z-muted-on-dark: rgba(242, 242, 242, 0.68);
	--z-text-on-light: #1b1b1b;
	--z-muted-on-light: #5a5a5a;

	--z-font: "Inter Tight", "Helvetica Neue", Arial, system-ui, sans-serif;
	--z-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

	--z-header-h: 72px;
	--z-gap: 1px;                         /* grid hairline between panels */
	--z-pad: clamp(1.5rem, 4vw, 3.5rem);  /* panel padding */
	--z-ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 900px) {
	:root { --z-header-h: 84px; }
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--z-header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
	margin: 0;
	font-family: var(--z-font);
	font-size: 1.0625rem;
	line-height: 1.6;
	font-weight: 400;
	color: var(--z-text-on-dark);
	background: var(--z-ink);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .6em; font-weight: 400; line-height: 1.12; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; margin: 0; z-index: 1000;
	top: .75rem; left: .75rem; padding: .75rem 1rem; background: var(--z-white); color: var(--z-ink);
}

.mono { font-family: var(--z-mono); font-size: .8125rem; letter-spacing: .02em; }
.muted { color: var(--z-muted-on-dark); }

/* ==========================================================================
   Type scale
   ========================================================================== */
.display {
	font-size: clamp(2.25rem, 4.6vw, 4.5rem);
	font-weight: 300;
	letter-spacing: -0.03em;
	line-height: 1.02;
	max-width: 14ch;
}
.display--sm { font-size: clamp(2rem, 3.6vw, 3.4rem); max-width: 22ch; }
.h2 { font-size: clamp(1.6rem, 2.4vw, 2.25rem); font-weight: 300; letter-spacing: -0.02em; }
.h3 { font-size: clamp(1.2rem, 1.5vw, 1.4rem); font-weight: 500; letter-spacing: -0.01em; }
.lede { font-size: clamp(1.05rem, 1.25vw, 1.2rem); color: var(--z-muted-on-dark); max-width: 46ch; }

/* Spec label: "01 / MEASURE" */
.z-label {
	display: inline-block;
	font-family: var(--z-mono);
	font-size: .72rem;
	font-weight: 500;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--z-muted-on-dark);
	margin-bottom: 1.75rem;
}
.z-label__num { color: var(--z-text-on-dark); }

/* ==========================================================================
   Header (white strip)
   ========================================================================== */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--z-white);
	color: var(--z-ink);
	border-bottom: 1px solid var(--z-rule);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.site-header__inner {
	height: var(--z-header-h);
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	padding: 0 var(--z-pad);
}
.site-logo, .custom-logo-link { display: block; line-height: 0; }
.site-logo img, .custom-logo { height: 22px; width: auto; }
@media (min-width: 900px) { .site-logo img, .custom-logo { height: 28px; } }

.site-header__tools { display: flex; align-items: center; gap: .25rem; }

.icon-btn {
	position: relative;
	display: inline-grid; place-items: center;
	width: 44px; height: 44px;
	padding: 0; border: 0; background: none; cursor: pointer;
	color: inherit; text-decoration: none;
}
.icon-btn svg { width: 22px; height: 22px; }

.cart-count {
	position: absolute; top: 6px; right: 4px;
	min-width: 16px; height: 16px; padding: 0 4px;
	border-radius: 8px; background: var(--z-ink); color: var(--z-white);
	font: 500 10px/16px var(--z-mono); text-align: center;
}
.cart-count[hidden] { display: none; }

/* Header search — inline on desktop, expands from icon on mobile */
.header-search { display: flex; align-items: center; }
.header-search input {
	width: 0; opacity: 0; padding: 0;
	border: 0; border-bottom: 1px solid var(--z-ink);
	background: transparent; color: var(--z-ink);
	font-size: .95rem; height: 34px; border-radius: 0;
	transition: width .35s var(--z-ease), opacity .2s, padding .35s;
}
.header-search input::placeholder { color: var(--z-logo); }
.header-search input:focus { outline: none; }
.header-search.is-open input { width: min(52vw, 260px); opacity: 1; padding: 0 .5rem; }
@media (min-width: 900px) {
	.header-search input { width: 220px; opacity: 1; padding: 0 .5rem; border-bottom-color: var(--z-rule); }
	.header-search input:focus { border-bottom-color: var(--z-ink); }
}

/* ==========================================================================
   Drawer (hamburger menu)
   ========================================================================== */
.site-drawer { position: fixed; inset: 0; z-index: 100; }
.site-drawer[hidden] { display: none; }
.site-drawer__scrim { position: absolute; inset: 0; background: rgba(10, 10, 10, .55); opacity: 0; transition: opacity .3s; }
.site-drawer__panel {
	position: absolute; top: 0; right: 0; bottom: 0; z-index: 1;
	width: min(440px, 100%);
	display: flex; flex-direction: column;
	background: var(--z-dark); color: var(--z-text-on-dark);
	transform: translateX(100%); transition: transform .4s var(--z-ease);
	overflow-y: auto;
}
.site-drawer.is-open .site-drawer__scrim { opacity: 1; }
.site-drawer.is-open .site-drawer__panel { transform: none; }
.site-drawer__head {
	display: flex; justify-content: space-between; align-items: center;
	height: var(--z-header-h); padding: 0 var(--z-pad);
	border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.site-drawer__head .z-label { margin: 0; }
.site-drawer__nav { padding: 1.5rem var(--z-pad); flex: 1; }
.site-drawer__foot { padding: 1.5rem var(--z-pad) 2rem; border-top: 1px solid rgba(255, 255, 255, .1); }

.drawer-menu, .drawer-menu ul { list-style: none; margin: 0; padding: 0; }
.drawer-menu > li { border-bottom: 1px solid rgba(255, 255, 255, .1); counter-increment: drawer; }
.drawer-menu > li > a {
	display: flex; align-items: baseline; gap: 1rem;
	padding: 1rem 0; text-decoration: none;
	font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 300; letter-spacing: -0.02em;
}
.drawer-menu > li > a::before {
	content: counter(drawer, decimal-leading-zero);
	font: 500 .7rem var(--z-mono); letter-spacing: .14em; color: var(--z-muted-on-dark);
}
.drawer-menu a:hover, .drawer-menu .current-menu-item > a { color: var(--z-white); text-decoration: underline; }
.drawer-menu .sub-menu { padding: 0 0 1rem 2.4rem; }
.drawer-menu .sub-menu a { display: block; padding: .3rem 0; color: var(--z-muted-on-dark); text-decoration: none; }
body.drawer-open { overflow: hidden; }

/* ==========================================================================
   Panel grid
   ========================================================================== */
.grid {
	display: grid;
	gap: var(--z-gap);
	background: var(--z-ink);
	border-bottom: var(--z-gap) solid var(--z-ink);
}

.panel {
	position: relative;
	padding: var(--z-pad);
	min-width: 0;
}
.panel--dark  { background: var(--z-dark); color: var(--z-text-on-dark); }
.panel--mid   { background: var(--z-mid);  color: var(--z-text-on-dark); }
.panel--light { background: var(--z-paper); color: var(--z-text-on-light); }
.panel--light .muted, .panel--light .z-label { color: var(--z-muted-on-light); }
.panel--flush { padding: 0; margin: 0; }
.panel--flush img { width: 100%; height: 100%; object-fit: cover; }

/* Subtle measurement-grid texture on figure panels */
.panel--figure {
	background-image:
		linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
	background-size: 32px 32px;
	background-position: -1px -1px;
}

/* Hero quadrants */
.quad { grid-template-columns: 1fr; }
.quad > .panel { display: flex; flex-direction: column; }
.quad__a { justify-content: flex-end; min-height: calc(72svh - var(--z-header-h)); }
.quad__a .z-label { margin-bottom: auto; padding-bottom: 2rem; }
@media (min-width: 900px) {
	.quad { grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(calc((100svh - var(--z-header-h)) / 2), auto); }
	.quad__a { min-height: 0; }
}

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }

.figure-scale { margin: auto; width: min(100%, 420px); color: var(--z-text-on-dark); }
.figure-scale svg { width: 100%; }

.spec-list { margin: 0; display: grid; grid-template-columns: 1fr; }
.spec-list > div {
	display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
	padding: .7rem 0; border-top: 1px solid rgba(255, 255, 255, .16);
}
.spec-list > div:last-child { border-bottom: 1px solid rgba(255, 255, 255, .16); }
.spec-list dt { font-weight: 400; }
.spec-list dd { margin: 0; font-family: var(--z-mono); font-size: .8rem; color: var(--z-muted-on-dark); text-align: right; }
@media (min-width: 640px) {
	.spec-list { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
	.spec-list > div:nth-last-child(2) { border-bottom: 1px solid rgba(255, 255, 255, .16); }
}

.app-split { display: grid; gap: 2rem; align-items: center; flex: 1; }
.figure-phone { width: 150px; margin: 0 auto; color: var(--z-text-on-dark); }
@media (min-width: 560px) {
	.app-split { grid-template-columns: 1fr auto; }
	.figure-phone { width: 170px; }
}

/* Feature tiles */
.tiles { grid-template-columns: 1fr; }
@media (min-width: 640px)  { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { min-height: 280px; display: flex; flex-direction: column; }
.tile .h3 { margin-top: auto; }
.tile p { margin: 0; }

/* Two-up split */
.split { grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.split > .panel { min-height: 340px; }

/* Journal row: header + 3 cards */
.journal { grid-template-columns: 1fr; }
@media (min-width: 700px)  { .journal { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .journal { grid-template-columns: repeat(4, 1fr); } }
.journal__head { display: flex; flex-direction: column; }
.journal__head .text-link { margin-top: auto; }

/* Archive card grid */
.cards { grid-template-columns: 1fr; }
@media (min-width: 700px)  { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card { padding: 0; }
.card__link { display: flex; flex-direction: column; height: 100%; padding: var(--z-pad); text-decoration: none; }
.card__media { display: block; margin: calc(var(--z-pad) * -1) calc(var(--z-pad) * -1) var(--z-pad); aspect-ratio: 4 / 3; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: transform .6s var(--z-ease), filter .6s; }
.card__link:hover .card__media img { transform: scale(1.03); filter: grayscale(.4); }
.card__link:hover .card__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.card .text-link { margin-top: auto; }

.entry-meta { font-family: var(--z-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--z-muted-on-dark); margin-bottom: 1rem; }
.entry-meta a { text-decoration: none; }
.page-head { padding-top: calc(var(--z-pad) * 1.6); padding-bottom: calc(var(--z-pad) * 1.2); }

/* ==========================================================================
   Buttons, links, forms
   ========================================================================== */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
	min-height: 48px; padding: 0 1.4rem;
	border: 1px solid currentColor; border-radius: 0;
	background: transparent; cursor: pointer;
	font-size: .9rem; font-weight: 500; letter-spacing: .02em;
	text-decoration: none; white-space: nowrap;
	transition: background .2s, color .2s, border-color .2s;
}
.btn svg { width: 18px; height: 18px; transition: transform .25s var(--z-ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--light { background: var(--z-white); border-color: var(--z-white); color: var(--z-ink); }
.btn--light:hover { background: transparent; color: var(--z-white); }
.btn--ghost { color: var(--z-text-on-dark); border-color: rgba(255, 255, 255, .4); }
.btn--ghost:hover { border-color: var(--z-white); }
.panel--light .btn--light { background: var(--z-ink); border-color: var(--z-ink); color: var(--z-white); }
.panel--light .btn--light:hover { background: transparent; color: var(--z-ink); }

.text-link { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 500; text-decoration: none; }
.text-link svg { width: 18px; height: 18px; transition: transform .25s var(--z-ease); }
a:hover .text-link svg, .text-link:hover svg { transform: translateX(3px); }

.inline-form, .search-form { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.inline-form input, .search-form input[type="search"],
.prose input[type="text"], .prose input[type="email"], .prose input[type="url"], .prose textarea {
	flex: 1 1 220px; min-height: 48px; padding: 0 1rem;
	background: transparent; border: 1px solid rgba(255, 255, 255, .4); border-radius: 0;
}
.inline-form input:focus, .search-form input:focus { outline: none; border-color: var(--z-white); }
.panel--light .search-form input, .prose input, .prose textarea { border-color: #bdbdbd; }
.prose textarea { padding: .75rem 1rem; width: 100%; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: .7rem 0; border-top: 1px solid rgba(255, 255, 255, .16); }
.plain-list li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .16); }

/* Shop teaser */
.product-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: rgba(255,255,255,.12); }
.product-mini li { background: var(--z-mid); }
.product-mini a { display: grid; grid-template-columns: 72px 1fr auto; gap: 1rem; align-items: center; padding: .9rem 0; text-decoration: none; }
.product-mini__img img { width: 72px; height: 72px; object-fit: cover; filter: grayscale(1); }

/* ==========================================================================
   Long-form content
   ========================================================================== */
.prose { max-width: 720px; margin: 0 auto; font-size: 1.0625rem; line-height: 1.72; color: var(--z-text-on-light); }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: 1.75rem; font-weight: 400; margin-top: 2em; }
.prose h3 { font-size: 1.3rem; font-weight: 500; margin-top: 1.8em; }
.prose a { color: var(--z-ink); }
.prose blockquote { margin: 2em 0; padding-left: 1.25rem; border-left: 2px solid var(--z-ink); font-size: 1.2rem; font-weight: 300; }
.prose code, .prose pre { font-family: var(--z-mono); font-size: .875em; }
.prose pre { background: var(--z-white); padding: 1rem; overflow-x: auto; border: 1px solid var(--z-rule); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid #d0d0d0; }
.prose th { font-family: var(--z-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; }
.prose img { height: auto; }
.prose figcaption, .wp-element-caption { font-family: var(--z-mono); font-size: .75rem; color: var(--z-muted-on-light); margin-top: .5rem; }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100%; max-width: none; }
@media (min-width: 1000px) { .prose .alignwide { margin-left: -120px; margin-right: -120px; max-width: none; } }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.tags { margin: 2.5rem auto 0; max-width: 720px; color: var(--z-muted-on-light); }

.comment-list { list-style: none; padding: 0; }
.comment-list .comment-body { padding: 1rem 0; border-top: 1px solid #d0d0d0; }
.comment-form .submit { min-height: 48px; padding: 0 1.4rem; background: var(--z-ink); color: var(--z-white); border: 0; cursor: pointer; }

/* Prev/next */
.post-nav a { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; }
.post-nav .z-label { margin: 0; }

/* Pagination */
.pager .nav-links { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: center; }
.pager .page-numbers {
	display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .75rem;
	font-family: var(--z-mono); font-size: .85rem; text-decoration: none; border: 1px solid transparent;
}
.pager .page-numbers.current, .pager a.page-numbers:hover { border-color: currentColor; }

/* Full-width template */
.full-width { background: var(--z-white); color: var(--z-text-on-light); }
.full-width > *:not(.alignfull) { max-width: 1100px; margin-left: auto; margin-right: auto; padding-left: var(--z-pad); padding-right: var(--z-pad); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--z-ink); }
.site-footer__grid { grid-template-columns: 1fr; }
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } .site-footer__brand { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .site-footer__grid { grid-template-columns: repeat(4, 1fr); } .site-footer__brand { grid-column: span 2; } }
.site-footer__grid .panel { min-height: 240px; }
.site-footer__brand .site-logo img { height: 22px; margin-bottom: 1.5rem; }
.site-footer .widget-title { font: 500 .72rem var(--z-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--z-muted-on-dark); margin-bottom: 1.75rem; }
.footer-menu, .site-footer .drawer-menu { list-style: none; margin: 0; padding: 0; }
.footer-menu li, .site-footer .drawer-menu li { margin: 0 0 .5rem; border: 0; }
.footer-menu a, .site-footer .drawer-menu a { text-decoration: none; font-size: 1rem; padding: 0; display: inline; }
.site-footer .drawer-menu > li > a::before { content: none; }
.footer-menu a:hover, .site-footer .drawer-menu a:hover { text-decoration: underline; }
.site-footer__legal {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem;
	padding: 1.25rem var(--z-pad); font-size: .8rem; color: var(--z-muted-on-dark);
}
