/*
Theme Name: HAPPIX EBC
Theme URI: https://ebc.happixinc.com/blog/
Author: HAPPIX
Description: The blog of the Express Business Check-up in the product's own design — ink and a yellow marker on warm paper, Oswald for headlines, Onest for text. Blog posts and the FAQ (the HAPPIX FAQ must-use plugin) apart.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: Proprietary
Text Domain: happix-ebc
*/

/* --- tokens: the same as the EBC app (src/app/globals.css, DESIGN.md) -------------------------- */
:root {
	--ink: #101010;
	--ink-2: #3a3833;
	--ink-3: #46433e;
	--graphite: #5e5b55;
	--muted: #66635c;
	--faint: #a8a49b;
	--page: #f2f1ed;
	--surface: #ffffff;
	--panel: #f7f6f3;
	--paper: #faf9f6;
	--soft: #efede8;
	--line: #e6e4de;
	--line-mid: #e3e1db;
	--line-field: #dcdad3;
	--line-strong: #c9c6be;
	--brand: #ffd11a;
	--brand-deep: #f0b800;
	--brand-wash: #fff4ce;
	--link-hover: #8a6d00;
	--d-text: #a19d96;
	--d-dim: #8d8981;
	--d-nav: #a8a49b;
	--d-nav-hover: #1e1e1e;
	--d-nav-active: #242424;
	--d-line: #262626;
	--font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-display: "Oswald", "Onest", sans-serif;
	--gutter: clamp(16px, 4vw, 36px);
	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@font-face { font-family: "Onest"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/Onest-Regular.ttf") format("truetype"); }
@font-face { font-family: "Onest"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/Onest-Medium.ttf") format("truetype"); }
@font-face { font-family: "Onest"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/Onest-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Onest"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/Onest-Bold.ttf") format("truetype"); }
@font-face { font-family: "Oswald"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/Oswald-Medium.ttf") format("truetype"); }
@font-face { font-family: "Oswald"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/Oswald-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Oswald"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/Oswald-Bold.ttf") format("truetype"); }

/* --- base ---------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--page);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 2px; border-radius: 4px; }
.screen-reader-text, .sr-only {
	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 { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brand); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: calc(760px + 2 * var(--gutter)); }
.site-main { flex: 1; }

/* --- shared pieces ------------------------------------------------------------------------------- */
.display { font-family: var(--font-display); }
.highlight { background: linear-gradient(transparent 60%, var(--brand) 60%); padding: 0 3px; }
.eyebrow-row { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.eyebrow-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.eyebrow-row .rule { flex: 1; min-width: 12px; height: 1px; background: var(--line-field); }
.eyebrow { font-family: var(--font-display); font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
a.eyebrow:hover { color: var(--link-hover); }
.headline { color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: clamp(31px, 4.3vw, 56px); line-height: 1.04; letter-spacing: -0.005em; margin: 0 0 16px; text-wrap: balance; }
.lead { font-size: 16.5px; line-height: 1.6; color: var(--graphite); max-width: 640px; margin: 0; }
.link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.link:hover { text-decoration-color: var(--link-hover); }

.btn-cta {
	display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap;
	height: 46px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent;
	background: var(--ink); color: var(--surface);
	font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1;
	text-decoration: none; cursor: pointer;
	transition: transform 160ms ease, box-shadow 200ms ease, background-color 200ms ease;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgba(16, 16, 16, 0.85); }
.btn-cta--brand { background: var(--brand); color: var(--ink); }
.btn-cta--brand:hover { box-shadow: 0 16px 34px -14px rgba(255, 209, 26, 0.75); color: var(--ink); }
.btn-cta--lg { height: 56px; border-radius: 14px; font-size: 13px; padding: 0 26px; }
.btn-cta svg { flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
	display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 999px;
	border: 1px solid var(--line-field); background: var(--surface); color: var(--graphite);
	font-size: 13.5px; text-decoration: none; white-space: nowrap;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-on, .chip.is-on:hover { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.chip-count { font-family: var(--font-display); font-size: 11.5px; color: var(--muted); }
.chip.is-on .chip-count { color: rgba(255, 255, 255, 0.65); }

/* --- header -------------------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(16, 16, 16, 0.96); backdrop-filter: blur(14px); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px clamp(12px, 2vw, 26px); min-height: 68px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand img { display: block; height: 28px; width: auto; }
.brand-badge { font-family: var(--font-display); font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--d-dim); }
.site-nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; }
.nav-link { color: var(--d-nav); font-size: 14px; text-decoration: none; padding: 8px 12px; border-radius: 9px; transition: background-color 150ms ease, color 150ms ease; }
.nav-link:hover { background: var(--d-nav-hover); color: var(--surface); }
.nav-link[aria-current="page"] { background: var(--d-nav-active); color: var(--surface); }
.header-cta { height: 42px; padding: 0 18px; font-size: 11.5px; }
@media (max-width: 560px) {
	.brand-badge { display: none; }
	.header-cta { margin-left: auto; }
	.site-nav { order: 3; flex-basis: 100%; margin-left: -12px; }
}

/* --- hero ---------------------------------------------------------------------------------------- */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(20px, 3vw, 34px); }
.hero .chips { margin-top: 24px; }

/* --- post cards ---------------------------------------------------------------------------------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(14px, 2vw, 20px); padding-bottom: 8px; }
.post-card {
	position: relative; display: flex; flex-direction: column; background: var(--surface);
	border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
	transition: transform 220ms var(--ease-out), box-shadow 220ms ease, border-color 160ms ease;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 24px 48px -36px rgba(16, 16, 16, 0.55); }
.post-card__media { display: block; aspect-ratio: 16 / 9; background: var(--ink); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__media--empty {
	aspect-ratio: 16 / 6; display: flex; align-items: flex-end; padding: 18px 20px;
	background: radial-gradient(120% 90% at 85% 10%, rgba(255, 209, 26, 0.28), transparent 55%), var(--ink);
}
.post-card__media--empty span { font-family: var(--font-display); font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brand); }
.post-card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.post-card__cat { display: flex; align-items: center; gap: 8px; }
.post-card__cat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.post-card__title { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.2; margin: 0; text-wrap: balance; }
.post-card__title a { text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card__excerpt { margin: 0; color: var(--graphite); font-size: 14.5px; line-height: 1.55; }
.post-card__meta { margin-top: auto; padding-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 12.5px; }
.post-card__cat a { position: relative; z-index: 1; }

.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 18px; padding: 40px 24px; text-align: center; color: var(--graphite); }
.empty strong { display: block; font-family: var(--font-display); font-size: 20px; color: var(--ink); margin-bottom: 6px; }

/* --- pagination ---------------------------------------------------------------------------------- */
.pagination { margin: clamp(26px, 4vw, 40px) 0 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.page-numbers {
	min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-field);
	background: var(--surface); display: inline-flex; align-items: center; justify-content: center;
	font-size: 14px; text-decoration: none; color: var(--ink-3);
}
a.page-numbers:hover { border-color: var(--ink); color: var(--ink); }
.page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.page-numbers.dots { border-color: transparent; background: transparent; }

/* --- article ------------------------------------------------------------------------------------- */
.article { padding: clamp(28px, 5vw, 56px) 0 0; }
.article__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 4vw, 48px); line-height: 1.06; margin: 0 0 14px; text-wrap: balance; }
.article__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13.5px; }
.article__cover { margin: clamp(22px, 3vw, 32px) 0 0; }
.article__cover img { display: block; width: 100%; height: auto; border-radius: 18px; }
.article__body { margin-top: clamp(24px, 3vw, 36px); }
.article__tags { margin-top: 28px; }
.post-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; margin-top: 34px; }
.post-nav a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; text-decoration: none; transition: border-color 160ms ease; }
.post-nav a:hover { border-color: var(--ink); }
.post-nav small { display: block; font-family: var(--font-display); font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.post-nav span { font-weight: 600; line-height: 1.35; }
.post-nav .next { text-align: right; }

/* --- prose: what an author writes in the editor -------------------------------------------------- */
.prose { font-size: 17.5px; line-height: 1.72; color: var(--ink-2); }
.prose > * { margin-top: 0; margin-bottom: 1.1em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-display); font-weight: 600; color: var(--ink); line-height: 1.15; text-wrap: balance; }
.prose h2 { font-size: clamp(24px, 2.6vw, 31px); margin: 1.8em 0 0.6em; }
.prose h3 { font-size: 21px; margin: 1.6em 0 0.5em; }
.prose h4 { font-size: 18px; margin: 1.4em 0 0.4em; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brand-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { color: var(--link-hover); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--brand-deep); font-weight: 700; }
.prose blockquote { margin: 1.6em 0; padding: 2px 0 2px 20px; border-left: 4px solid var(--brand); color: var(--ink); font-size: 19px; }
.prose blockquote cite { display: block; margin-top: 8px; font-size: 14px; font-style: normal; color: var(--muted); }
.prose figure { margin: 1.6em 0; }
.prose img { border-radius: 14px; }
.prose figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); text-align: center; }
.prose code { background: var(--soft); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }
.prose pre { background: var(--ink); color: #f2f1ed; padding: 18px 20px; border-radius: 14px; overflow: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; height: 1px; background: var(--line-mid); margin: 2.2em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); border-radius: 12px; overflow: hidden; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite); background: var(--panel); }
.prose .wp-block-button__link { display: inline-flex; align-items: center; height: 50px; padding: 0 24px; border-radius: 12px; background: var(--brand); color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; }
.prose .alignwide { width: min(1040px, calc(100vw - 2 * var(--gutter))); margin-left: 50%; transform: translateX(-50%); }
.prose .alignfull { width: 100vw; margin-left: 50%; transform: translateX(-50%); border-radius: 0; }
.prose .alignleft { float: left; margin: 0.3em 1.4em 1em 0; max-width: 50%; }
.prose .alignright { float: right; margin: 0.3em 0 1em 1.4em; max-width: 50%; }
.prose .aligncenter { margin-left: auto; margin-right: auto; }
.prose::after { content: ""; display: table; clear: both; }

/* --- call to action: the check-up ---------------------------------------------------------------- */
.cta {
	display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px;
	margin: clamp(36px, 5vw, 56px) 0 0; padding: clamp(22px, 3vw, 36px);
	background: var(--ink); color: var(--surface); border-radius: 22px;
	box-shadow: 0 30px 60px -44px rgba(16, 16, 16, 0.8);
}
.cta__text { flex: 1 1 320px; min-width: 0; }
.cta .eyebrow { color: var(--brand); }
/* the heading colour is set here explicitly: WordPress' global styles paint every heading ink */
.cta .cta__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.12; margin: 10px 0 8px; text-wrap: balance; color: var(--surface); }
.cta__lead { margin: 0; color: var(--d-text); font-size: 15px; line-height: 1.55; }

/* --- FAQ ----------------------------------------------------------------------------------------- */
.faq-group { margin-top: clamp(26px, 4vw, 40px); }
.faq-group__title { font-family: var(--font-display); font-weight: 600; font-size: 22px; margin: 0 0 12px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color 160ms ease, box-shadow 200ms ease; }
.faq-item[open] { border-color: var(--line-strong); box-shadow: 0 24px 48px -40px rgba(16, 16, 16, 0.55); }
.faq-item summary { position: relative; list-style: none; cursor: pointer; padding: 18px 62px 18px 20px; font-weight: 600; font-size: 16.5px; line-height: 1.4; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
	content: ""; position: absolute; right: 18px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%;
	background:
		linear-gradient(var(--ink), var(--ink)) center / 12px 2px no-repeat,
		linear-gradient(var(--ink), var(--ink)) center / 2px 12px no-repeat,
		var(--brand);
	transition: transform 220ms var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--link-hover); }
.faq-item__answer { padding: 0 20px 18px; }
.faq-item__answer .prose { font-size: 16px; }
.faq-item__answer .prose > :last-child { margin-bottom: 0; }
.faq-item__link { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--muted); }
.faq-related { margin-top: 34px; }
.faq-related h2 { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin: 0 0 12px; }
.faq-related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.faq-related a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; text-decoration: none; font-weight: 500; }
.faq-related a:hover { border-color: var(--ink); }

/* --- search -------------------------------------------------------------------------------------- */
.search-form { display: flex; gap: 8px; max-width: 520px; margin-top: 22px; }
.search-form input[type="search"] {
	flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-field);
	background: var(--surface); font: inherit; font-size: 15px; color: var(--ink);
}
.search-form input[type="search"]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-wash); }

/* --- footer -------------------------------------------------------------------------------------- */
.site-footer { margin-top: clamp(48px, 7vw, 88px); background: var(--ink); color: var(--d-text); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; padding-block: 34px; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 420px; }
.footer-brand img { height: 26px; width: auto; display: block; }
.footer-brand p { margin: 0; font-size: 13.5px; line-height: 1.55; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.footer-nav a { color: var(--d-nav); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.footer-nav a:hover { color: var(--surface); background: var(--d-nav-hover); }
.footer-copy { border-top: 1px solid var(--d-line); padding-block: 16px; font-size: 12.5px; color: var(--d-dim); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
