/*
Theme Name: 38 Digital
Theme URI: https://38digital.co.nz
Author: 38 Digital
Author URI: https://38digital.co.nz
Description: Block theme for 38 Digital. Home page focused on practical AI for small and medium businesses, plus digital consultation and web design.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: thirtyeight-digital
*/

/* ---------- Tokens ---------- */
:root {
	--t38-ink: var(--wp--preset--color--ink, #0a0a0a);
	--t38-paper: var(--wp--preset--color--paper, #ffffff);
	--t38-blue: var(--wp--preset--color--brand-blue, #1ab0ff);
	--t38-mist: var(--wp--preset--color--mist, #f2f2f2);
	--t38-slate: var(--wp--preset--color--slate, #3a3a3a);
	--t38-line: var(--wp--preset--color--line, #d0d0d0);
	--t38-display: var(--wp--preset--font-family--display, "Bebas Neue", Impact, sans-serif);
	--t38-gutter: clamp(20px, 4.5vw, 64px);
	--t38-max: 1440px;
	--t38-rule: 2px solid var(--t38-ink);
}

html { scroll-behavior: smooth; }
.wp-site-blocks > * { margin-block: 0; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
:where(.t38-home, .t38-header, .t38-footer) * { box-sizing: border-box; }
[id] { scroll-margin-top: 24px; }

/* Spacing inside theme sections is handled with gap, not flow margins. */
.t38-home .is-layout-flow > *,
.t38-home .is-layout-constrained > *,
.site-header .is-layout-flow > *,
.site-footer .is-layout-flow > * { margin-block: 0; }
.t38-home :where(h1, h2, h3, p, ul) { margin: 0; }

.t38-home a:where(:not(.wp-element-button)) { color: inherit; }

/* Shared section frame */
.t38-hero, .t38-principles, .t38-examples, .t38-team, .t38-services, .t38-faq, .t38-contact {
	padding-inline: max(var(--t38-gutter), calc((100% - var(--t38-max)) / 2 + var(--t38-gutter)));
}

.t38-display {
	font-family: var(--t38-display);
	font-weight: 400;
	font-size: clamp(3rem, 8vw, 7.5rem);
	line-height: 0.9;
	letter-spacing: 0;
}

/* Buttons */
.t38-home .wp-block-buttons,
.site-header .wp-block-buttons { gap: 12px; }
.wp-block-button__link { transition: background-color .15s ease, color .15s ease; }
.t38-btn-outline .wp-block-button__link {
	background: transparent;
	color: var(--t38-ink);
	border: var(--t38-rule);
	padding: calc(1.25rem - 2px) calc(1.75rem - 2px);
}
.t38-btn-outline .wp-block-button__link:hover { background: var(--t38-ink); color: var(--t38-paper); }
.t38-btn-blue .wp-block-button__link { background: var(--t38-blue); color: var(--t38-ink); }
.t38-btn-blue .wp-block-button__link:hover { background: var(--t38-paper); color: var(--t38-ink); }
.wp-block-button__link:focus-visible,
.t38-home a:focus-visible,
.t38-header a:focus-visible { outline: 3px solid var(--t38-blue); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header { border-bottom: var(--t38-rule); background: var(--t38-paper); }
.t38-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: var(--t38-max);
	margin: 0 auto;
	padding: 20px var(--t38-gutter);
}
.t38-logo { margin: 0; flex: none; }
.t38-logo img { display: block; width: 184px !important; max-width: 184px; height: auto !important; }
.t38-header__nav { display: flex; align-items: center; gap: 40px; }
.t38-nav .wp-block-navigation-item__content {
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
}
.t38-nav .wp-block-navigation__container { gap: 36px; }
.t38-header__cta .wp-block-button__link { padding: 14px 22px; font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.06em; }
.t38-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--t38-paper);
	padding: 32px var(--t38-gutter);
}
.t38-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.5rem; }

/* ---------- Hero ---------- */
.t38-hero {
	display: flex;
	flex-direction: column;
	gap: 40px;
	padding-top: clamp(48px, 7vw, 88px);
	padding-bottom: clamp(56px, 7vw, 96px);
}
.t38-kicker {
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.t38-hero__title {
	font-family: var(--t38-display);
	font-weight: 400;
	font-size: clamp(3.75rem, 13.4vw, 12.5rem);
	line-height: 0.86;
	letter-spacing: 0;
}
.t38-hero__title strong {
	font-weight: 400;
	background: var(--t38-blue);
	padding: 0 0.08em;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}
.t38-hero__foot {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	align-items: end;
}
.t38-hero__lede { font-size: clamp(1.125rem, 1.6vw, 1.375rem); line-height: 1.5; font-weight: 500; max-width: 40em; }
.t38-hero__ctas { flex-direction: column; align-items: stretch !important; }
.t38-hero__ctas .wp-block-button, .t38-hero__ctas .wp-block-button__link { width: 100%; text-align: left; }

/* ---------- Principles ---------- */
.t38-principles {
	display: flex;
	flex-direction: column;
	gap: 56px;
	padding-top: clamp(64px, 7vw, 96px);
	padding-bottom: clamp(64px, 7vw, 96px);
	background: var(--t38-blue);
	color: var(--t38-ink);
}
.t38-principles__head { display: grid; gap: 24px; align-items: end; }
.t38-principles__intro { font-size: 1.125rem; }
.t38-principles__grid { display: grid; gap: 32px; }
.t38-principle { display: flex; flex-direction: column; gap: 12px; padding-top: 24px; border-top: var(--t38-rule); }
.t38-principle h3 { font-size: 1.5rem; }

/* ---------- Section heads ---------- */
.t38-section-head { display: grid; gap: 24px; align-items: end; }
.t38-section-head__intro { font-size: 1.125rem; }

/* ---------- Examples ---------- */
.t38-examples {
	display: flex;
	flex-direction: column;
	gap: 40px;
	padding-top: clamp(72px, 8vw, 112px);
	padding-bottom: clamp(72px, 8vw, 112px);
}
.t38-legend { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.t38-legend__item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.t38-legend__item::before { content: ""; width: 14px; height: 14px; flex: none; box-sizing: border-box; }
.t38-legend__item--quick::before { background: var(--t38-blue); }
.t38-legend__item--short::before { border: 2px solid var(--t38-ink); }
.t38-legend__item--big::before { background: var(--t38-ink); }

.t38-cards {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	border-top: var(--t38-rule);
	border-left: var(--t38-rule);
}
.t38-card {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: clamp(24px, 2.6vw, 36px);
	border-right: var(--t38-rule);
	border-bottom: var(--t38-rule);
}
.t38-card__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.t38-card__team { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.t38-tag {
	padding: 6px 10px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	white-space: nowrap;
}
.t38-tag--quick { background: var(--t38-blue); }
.t38-tag--short { border: 2px solid var(--t38-ink); padding: 4px 8px; }
.t38-tag--big { background: var(--t38-ink); color: var(--t38-paper); }
.t38-card__title { font-family: var(--t38-display); font-weight: 400; font-size: clamp(2.25rem, 3vw, 2.75rem); line-height: 1; }
.t38-card__body { color: var(--t38-slate); }
.t38-card__gain { margin-top: auto !important; padding-top: 16px; border-top: 1px solid var(--t38-line); font-size: 0.9375rem; }

.t38-callout {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px 32px;
	padding: 28px clamp(24px, 2.6vw, 36px);
	background: var(--t38-mist);
}
.t38-callout__text { font-size: 1.25rem; font-weight: 500; }
.t38-callout__link a, .t38-also a { font-weight: 700; text-decoration: none; border-bottom: var(--t38-rule); }

/* ---------- Team ---------- */
.t38-team {
	display: flex;
	flex-direction: column;
	gap: 48px;
	padding-top: clamp(72px, 8vw, 104px);
	padding-bottom: clamp(72px, 8vw, 104px);
	background: var(--t38-ink);
	color: var(--t38-paper);
}
.t38-team__grid { display: grid; gap: 24px; }
.t38-role { display: flex; flex-direction: column; border: 2px solid #3a3a3a; }
.t38-role__name { padding: 24px 28px; font-size: 1.375rem; border-bottom: 2px solid #3a3a3a; }
.t38-role__row { display: flex; flex-direction: column; gap: 10px; padding: 24px 28px; font-size: 1.0625rem; line-height: 1.5; }
.t38-role__row:not(.t38-role__row--more) { border-bottom: 1px solid #3a3a3a; }
.t38-role__label { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #a8a8a8; }
.t38-role__row--more .t38-role__label { color: var(--t38-blue); }

/* ---------- Services ---------- */
.t38-services {
	display: flex;
	flex-direction: column;
	gap: 48px;
	padding-top: clamp(72px, 8vw, 112px);
	padding-bottom: clamp(72px, 8vw, 112px);
}
.t38-packages { display: grid; gap: 24px; }
.t38-package { display: flex; flex-direction: column; gap: 20px; padding: clamp(28px, 3vw, 40px); border: var(--t38-rule); }
.t38-package--featured { background: var(--t38-blue); }
.t38-package__num { font-family: var(--t38-display); font-size: 3.5rem; line-height: 1; }
.t38-package__title { font-size: 1.75rem; }
.t38-package p:not(.t38-package__num) { color: var(--t38-slate); }
.t38-package--featured p:not(.t38-package__num) { color: var(--t38-ink); }
.t38-package__list { display: flex; flex-direction: column; gap: 10px; padding-left: 20px; font-size: 0.9375rem; }
.t38-more { display: grid; gap: 24px; }
.t38-more__item { display: flex; flex-direction: column; gap: 16px; padding: clamp(28px, 3vw, 40px); background: var(--t38-mist); }
.t38-more__title { font-family: var(--t38-display); font-weight: 400; font-size: clamp(2.5rem, 4vw, 3.5rem); line-height: 1; }
.t38-more__title a { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-decoration: none; }
.t38-more__title span { font-family: var(--wp--preset--font-family--body); font-size: 2rem; }
.t38-more__item p { color: var(--t38-slate); }
.t38-also { font-weight: 500; }

/* ---------- FAQ ---------- */
.t38-faq {
	display: grid;
	gap: 40px;
	padding-bottom: clamp(72px, 8vw, 112px);
}
.t38-faq > .t38-display { font-size: clamp(3rem, 6.5vw, 6rem); }
.t38-faq__list { display: flex; flex-direction: column; border-top: var(--t38-rule); }
.t38-faq__item { display: flex; flex-direction: column; gap: 10px; padding: 28px 0; border-bottom: var(--t38-rule); }
.t38-faq__item h3 { font-size: 1.375rem; }
.t38-faq__item p { color: var(--t38-slate); }

/* ---------- Contact ---------- */
.t38-contact {
	display: grid;
	gap: 40px;
	padding-top: clamp(72px, 8vw, 104px);
	padding-bottom: clamp(72px, 8vw, 104px);
	background: var(--t38-ink);
	color: var(--t38-paper);
}
.t38-contact__logo { margin: 0; }
.t38-contact__logo img { display: block; width: clamp(120px, 14vw, 200px) !important; height: auto !important; }
.t38-contact__body { display: flex; flex-direction: column; gap: 32px; }
.t38-contact__body strong { font-weight: 400; color: var(--t38-blue); }
.t38-contact__intro { max-width: 38em; font-size: 1.1875rem; color: #d0d0d0; }
.t38-contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; }
.t38-contact__link { font-size: 1.25rem; font-weight: 500; }
.t38-contact__link a { color: var(--t38-paper); text-decoration: none; border-bottom: 2px solid var(--t38-blue); }
.t38-contact__link a:hover { color: var(--t38-blue); }

/* ---------- Footer ---------- */
.site-footer { background: var(--t38-ink); color: #bdbdbd; }
.t38-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px 32px;
	max-width: var(--t38-max);
	margin: 0 auto;
	padding: 32px var(--t38-gutter);
	border-top: 1px solid #2a2a2a;
	font-size: 0.875rem;
}
.t38-footer p { margin: 0; }
.t38-footer__links { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.t38-footer a { color: #bdbdbd; text-decoration: none; }
.t38-footer a:hover { color: var(--t38-blue); }

/* ---------- Basic pages (for pages added later) ---------- */
.t38-page { padding: clamp(48px, 6vw, 96px) var(--t38-gutter); }
.t38-page__title { font-family: var(--t38-display); font-weight: 400; font-size: clamp(3rem, 7vw, 6rem); line-height: 0.95; }

/* ---------- Breakpoints ---------- */
@media (min-width: 700px) {
	.t38-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.t38-hero__ctas { flex-direction: row; }
	.t38-hero__ctas .wp-block-button, .t38-hero__ctas .wp-block-button__link { width: auto; }
}

@media (min-width: 960px) {
	.t38-hero__foot { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; }
	.t38-hero__ctas { flex-direction: column; }
	.t38-hero__ctas .wp-block-button, .t38-hero__ctas .wp-block-button__link { width: 100%; }
	.t38-principles__head { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 48px; }
	.t38-section-head { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px; }
	.t38-principles__grid,
	.t38-team__grid,
	.t38-packages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
	.t38-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.t38-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.t38-faq { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 48px; }
	.t38-contact { grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: 48px; }
}

@media (max-width: 781px) {
	.site-header .t38-header__nav { gap: 16px; }
	.site-header .t38-header__cta .wp-block-button__link { padding: 12px 14px; font-size: 0.8125rem; white-space: nowrap; }
	.t38-logo img { width: 140px !important; max-width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}
