/* CodeOrder Theme — base layout & typography. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	font-family: var(--font-body);
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	font-size: 16px;
	line-height: 1.55;
}
img, svg { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; }
button { font-family: inherit; }

.screen-reader-text {
	border: 0; clip: rect(1px,1px,1px,1px); -webkit-clip-path: inset(50%); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}
.skip-link {
	position: absolute; top: -40px; left: 0; background: var(--brand-ink); color: var(--on-brand); padding: 8px 16px; z-index: 100;
}
.skip-link:focus { top: 0; }

.display {
	font-family: var(--font-display);
	font-weight: 500;
	line-height: 1.02;
	letter-spacing: -0.01em;
	text-wrap: balance;
}
.eyebrow {
	font-family: var(--font-eyebrow);
	text-transform: uppercase;
	letter-spacing: 0.22em;
	font-size: 11px;
	font-weight: 600;
}

/* .wrap is THE page grid — header, hero, every front-page section, page and
   single templates all use it, so one left edge runs down the whole site.
   .wrap-narrow is not a general container: reach for it only when the whole
   block is centred and self-contained (the 404, the centred minimal hero). For
   a reading measure inside normal content, constrain the prose (see
   .page-content > p below) instead of narrowing the container — otherwise a
   shortcode or plugin UI dropped into the page gets squeezed with it. */
.wrap        { max-width: 1320px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 14px 22px;
	border-radius: 999px;
	font-family: var(--font-body);
	font-size: 13px; font-weight: 600;
	letter-spacing: 0.1em; text-transform: uppercase;
	text-decoration: none; cursor: pointer; border: none;
	transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.btn-primary       { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-deep); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn-ghost         { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover   { border-color: var(--brand-text); color: var(--brand-text); }
.btn-light         { background: rgba(255,255,255,0.96); color: var(--brand-ink); }
.btn-light:hover   { background: #fff; transform: translateY(-1px); }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.5); }
.btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn-arrow {
	width: 22px; height: 22px; border-radius: 50%;
	background: rgba(255,255,255,0.15);
	display: inline-grid; place-items: center;
	transition: transform 200ms;
}
.btn:hover .btn-arrow { transform: translateX(3px); }

/* Section heads */
.section-head { margin-bottom: 48px; }
.section-head .eyebrow { color: var(--brand-text); display: inline-block; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(36px, 5vw, 64px); margin: 0; color: var(--heading); }
.section-head h2 em { font-style: italic; color: var(--accent-text); }
.section-head.text-center { text-align: center; }

/* Live open/closed dot — used by every hero variant and by the mobile drawer,
   so it lives in the base sheet rather than in a hero-<variant>.css. */
.open-pulse {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--ok-dot);
}
.open-pulse::after {
	content: '';
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 1px solid var(--ok-dot);
	opacity: 0.5;
	animation: codeon-rv2-pulse 2s ease-out infinite;
}
.open-pulse.closed { background: var(--muted); }
.open-pulse.closed::after { animation: none; opacity: 0; }
@keyframes codeon-rv2-pulse {
	0%   { transform: scale(0.8); opacity: 0.7; }
	100% { transform: scale(1.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.open-pulse::after { animation: none; opacity: 0.35; }
}

/* Image placeholder */
.img-placeholder {
	width: 100%; height: 100%; min-height: 200px;
	background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
}

/* 404 */
.error-404-inner { padding: 140px 0; text-align: center; }
.error-404-inner .eyebrow { display: inline-block; color: var(--brand-text); }
.error-404-inner h1 {
	margin: 16px 0 24px;
	color: var(--heading);
	font-size: clamp(40px, 6vw, 84px);
}
.error-404-inner h1 em { font-style: italic; color: var(--accent-text); }
.error-404-inner p {
	max-width: 480px;
	margin: 0 auto 32px;
	color: var(--ink-soft);
	font-size: 17px;
}
@media (max-width: 600px) {
	.error-404-inner { padding: 88px 0; }
}

/* Blog / pages */
/* Article templates run on the page grid (.wrap, 1320px) like the header and
   every front-page section — they used to sit in .wrap-narrow (1080px), 240px
   narrower than the navbar. The reading measure now lives on the prose itself,
   which is what lets a shortcode or plugin UI dropped into a page use the full
   grid width instead of being squeezed into a text column. */
.page-head { margin: 72px 0 48px; text-align: left; }
.page-head .eyebrow { color: var(--brand-text); display: inline-block; margin-bottom: 12px; }
.page-head h1 { font-size: clamp(36px, 5vw, 72px); margin: 0; color: var(--heading); }
.page-content { font-size: 17px; line-height: 1.75; color: var(--ink-soft); padding-bottom: 96px; }

/* Reading measure — applied to text-level children only. Anything else (a
   shortcode's <div>, an embed, a plugin app root) keeps the full grid width. */
.page-content > p,
.page-content > h2,
.page-content > h3,
.page-content > h4,
.page-content > ul,
.page-content > ol,
.page-content > dl,
.page-content > pre,
.page-content > blockquote,
.post-content > p,
.post-content > h2,
.post-content > h3,
.post-content > h4,
.post-content > ul,
.post-content > ol,
.post-content > dl,
.post-content > pre,
.post-content > blockquote {
	max-width: 72ch;
}
/* Standard WordPress opt-outs still win. */
.page-content > .alignwide,
.page-content > .alignfull,
.post-content > .alignwide,
.post-content > .alignfull {
	max-width: none;
}
.page-content h2, .page-content h3 { font-family: var(--font-display); color: var(--heading); margin: 48px 0 16px; }
.page-content a { color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; }
.page-content blockquote { border-left: 3px solid var(--brand); padding: 8px 0 8px 24px; font-style: italic; font-family: var(--font-display); font-size: 22px; color: var(--heading); }

.posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 32px;
	padding: 48px 0 96px;
}
.post-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	overflow: hidden;
	transition: transform 250ms, box-shadow 250ms;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.post-card-thumb img { width: 100%; height: 220px; object-fit: cover; display: block; }
.post-card-body { padding: 24px 24px 28px; }
.post-card-body .eyebrow { color: var(--brand-text); display: block; margin-bottom: 10px; }
.post-card-body h2 { font-size: 24px; margin: 0 0 12px; color: var(--heading); }
.post-card-body h2 a { text-decoration: none; }
.post-card-body h2 a:hover { color: var(--brand-text); }
.post-card-body .excerpt { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 16px; }
.post-card-more { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-text); text-decoration: none; }

/* Single */
.single-post-wrap .post-head { margin: 64px 0 32px; text-align: left; }
.single-post-wrap .post-head .eyebrow { color: var(--muted); display: block; margin-bottom: 12px; }
.single-post-wrap .post-head h1 { font-size: clamp(36px, 5vw, 72px); margin: 0; color: var(--heading); }
.single-post-wrap .post-thumb { margin: 0 0 48px; border-radius: 12px; overflow: hidden; }
.single-post-wrap .post-thumb img { width: 100%; height: auto; }
.single-post-wrap .post-content { font-size: 17px; line-height: 1.8; color: var(--ink-soft); padding-bottom: 64px; }
.post-nav { display: flex; justify-content: space-between; padding: 32px 0 96px; border-top: 1px solid var(--line); margin-top: 32px; }
.post-nav a { color: var(--brand-text); text-decoration: none; font-weight: 500; }

/* Comments */
.comments-area { padding: 48px 0; border-top: 1px solid var(--line); }
.comments-title { font-size: 28px; color: var(--heading); margin-bottom: 24px; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 14px; background: var(--surface);
}
.comment-form textarea { min-height: 140px; }

/* Search form */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
	flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; font-family: inherit; font-size: 14px; background: var(--surface);
}

/* Pagination */
.pagination, .navigation.pagination { padding: 24px 0 96px; text-align: center; }
.pagination .page-numbers, .navigation.pagination .page-numbers {
	display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; margin: 0 4px;
}
.pagination .page-numbers.current { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* ============ SITE-WIDE: FOOTER + LAYOUT GUTTERS ============ */
/* Moved from home.css, which now loads on the home page only: the footer and
   the page gutters are on every page, the rest of home.css is not. */
.footer { background: var(--brand-ink); color: color-mix(in srgb, var(--on-brand) 80%, transparent); padding: 100px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 60px; margin-bottom: 64px; }
.footer-brand .custom-logo { height: 70px; width: auto; margin-bottom: 24px; filter: brightness(0) invert(1); }
.footer-brand p { font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--on-brand); line-height: 1.4; margin: 0 0 24px; }
.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
	width: 40px; height: 40px;
	border-radius: 50%;
	border: 1px solid color-mix(in srgb, var(--on-brand) 20%, transparent);
	display: grid; place-items: center;
	text-decoration: none;
	color: color-mix(in srgb, var(--on-brand) 85%, transparent);
	transition: background-color 200ms, color 200ms, border-color 200ms;
}
.footer-socials a:hover { background: var(--on-brand); color: var(--brand-ink); border-color: var(--on-brand); }
.footer .footer-title { line-height: 1.4; font-family: var(--font-eyebrow); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--on-brand-accent); margin: 0 0 24px; font-weight: 600; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 12px; }
.footer a { text-decoration: none; color: color-mix(in srgb, var(--on-brand) 75%, transparent); font-size: 14px; transition: color 200ms; }
.footer a:hover { color: var(--on-brand); }
.footer-contact .item { font-size: 14px; line-height: 1.6; margin-bottom: 14px; }
.footer-bottom {
	padding-top: 32px;
	border-top: 1px solid color-mix(in srgb, var(--on-brand) 12%, transparent);
	display: flex; justify-content: space-between; align-items: center;
	font-size: 12px; color: color-mix(in srgb, var(--on-brand) 66%, transparent);
}
.footer-legal { display: flex; gap: 18px; list-style: none; padding: 0; margin: 0; }

@media (max-width: 1180px) {
	.wrap, .wrap-narrow { padding: 0 24px; }
}
@media (max-width: 920px) {
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
	.footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}
@media (max-width: 600px) {
	.wrap, .wrap-narrow { padding: 0 18px; }
	.footer { padding: 72px 0 28px; }
	.footer-grid { grid-template-columns: 1fr; gap: 36px; }
	.footer-brand p { font-size: 18px; }
	.btn { padding: 12px 18px; font-size: 12px; letter-spacing: 0.08em; }
}
.footer-note { font-size: 13px; line-height: 1.6; color: color-mix(in srgb, var(--on-brand) 70%, transparent); }
