/* Holzwerk: styles that theme.json cannot express. Tokens come from theme.json presets. */

:root {
  --hw-paper: var(--wp--preset--color--paper);
  --hw-surface: var(--wp--preset--color--surface);
  --hw-sand: var(--wp--preset--color--sand);
  --hw-ink: var(--wp--preset--color--ink);
  --hw-muted: var(--wp--preset--color--muted);
  --hw-line: var(--wp--preset--color--line);
  --hw-line-strong: #7f8588;
  --hw-chalk: var(--wp--preset--color--chalk);
  --hw-chalk-soft: var(--wp--preset--color--chalk-soft);
  --hw-error: #a3271d;
  --hw-radius: var(--wp--custom--radius--small);
  --hw-radius-m: var(--wp--custom--radius--medium);
  --hw-ease: var(--wp--custom--ease);
  --hw-duration: var(--wp--custom--duration);
  --hw-gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 6rem; -webkit-text-size-adjust: 100%; }
body { text-rendering: optimizeLegibility; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--hw-chalk); outline-offset: 3px; border-radius: 2px; }
img, svg { max-width: 100%; }

.screen-reader-text, .visually-hidden {
  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.screen-reader-text:focus {
  clip: auto; width: auto; height: auto; margin: 0; padding: 0.75rem 1rem; z-index: 100;
  left: 1rem; top: 1rem; background: var(--hw-ink); color: var(--hw-surface); border-radius: var(--hw-radius);
}

.eyebrow { font-size: var(--wp--preset--font-size--small); font-weight: 650; color: var(--hw-chalk); margin-bottom: 0.5rem; }
.eyebrow a { color: inherit; }
.lead { font-size: var(--wp--preset--font-size--large); color: var(--hw-muted); max-width: 38rem; }
.muted { color: var(--hw-muted); }
.empty-note { color: var(--hw-muted); padding: 2rem 0; }

/* Buttons */
.wp-element-button, .wp-block-button__link { transition: background-color var(--hw-duration), color var(--hw-duration); }
.wp-block-button.is-style-outline > .wp-block-button__link {
  background: transparent; color: var(--hw-ink); border: 1.5px solid var(--hw-ink);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--hw-ink); color: var(--hw-surface); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--hw-paper) 94%, transparent); border-bottom: 1px solid var(--hw-line); backdrop-filter: saturate(1.2) blur(6px); }
.site-header__bar { min-height: 4.5rem; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--hw-ink); text-decoration: none; }
.brand:hover { color: var(--hw-ink); }
.brand__mark { width: 30px; height: 30px; flex: none; color: var(--hw-chalk); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--wp--preset--font-family--display); font-size: 1.2rem; }
.brand__sub { font-size: 0.8125rem; color: var(--hw-muted); }
.site-nav { margin-left: auto; }
.site-nav__list { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.site-nav__list a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 550; color: var(--hw-ink); }
.site-nav__list a:hover, .site-nav__list .current-menu-item > a, .site-nav__list .current-menu-ancestor > a, .site-nav__list .current_page_parent > a { color: var(--hw-chalk); }
.site-nav__list .current-menu-item > a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.5em; }
.site-nav__toggle { display: none; }
.site-header__cta { flex: none; }

@media (max-width: 52rem) {
  .site-header .site-header__cta { display: none; }
  .site-nav__toggle {
    display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0 1rem;
    border: 1.5px solid var(--hw-ink); border-radius: var(--hw-radius); background: transparent;
    font: inherit; font-weight: 600; color: var(--hw-ink); cursor: pointer;
  }
  .site-nav__bars, .site-nav__bars::before, .site-nav__bars::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
  .site-nav__bars::before, .site-nav__bars::after { content: ''; position: absolute; left: 0; }
  .site-nav__bars::before { top: -6px; }
  .site-nav__bars::after { top: 6px; }
  .js .site-nav__panel { display: none; }
  .js .site-nav[data-open] .site-nav__panel {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--hw-paper); border-bottom: 1px solid var(--hw-line); padding: 0.5rem var(--hw-gutter) 1.5rem;
    box-shadow: 0 16px 30px -24px rgba(30, 36, 39, 0.45);
  }
  .site-nav__list { flex-direction: column; gap: 0; }
  .site-nav__list a { width: 100%; min-height: 52px; border-bottom: 1px solid var(--hw-line); }
  html:not(.js) .site-nav__toggle { display: none; }
  html:not(.js) .site-nav__list { flex-direction: row; flex-wrap: wrap; gap: 0 1rem; }
}

/* Page frame */
.site-main { padding-bottom: var(--wp--preset--spacing--70); }
.page-head { padding-top: var(--wp--preset--spacing--70); padding-bottom: var(--wp--preset--spacing--50); }
.page-head h1 { margin-top: 0; margin-bottom: 1rem; }
.page-body > * + h2 { margin-top: 2.5rem; }
.page-body h2 { font-size: var(--wp--preset--font-size--x-large); }

/* Home: hero */
.hero { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--70); }
.hero__grid { gap: clamp(2rem, 1rem + 4vw, 4.5rem) !important; align-items: center !important; }
.hero h1 { max-width: 13ch; margin-top: 0.25rem; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 2rem; }
.hero__actions .wp-block-buttons { margin: 0; }
.hero__phone { margin: 0; font-weight: 600; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--hw-line); font-size: var(--wp--preset--font-size--small); }
.hero__facts p { margin: 0; color: var(--hw-muted); }
.hero__facts strong { display: block; color: var(--hw-ink); font-weight: 650; }

/* Home: sections */
.section { padding-top: var(--wp--preset--spacing--70); padding-bottom: var(--wp--preset--spacing--70); }
.section--sand { background: var(--hw-sand); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 2.5rem; }
.section__head h2 { margin: 0; max-width: 20ch; }
.section__head p { margin: 0; max-width: 34rem; color: var(--hw-muted); }
.more-link { font-weight: 650; }

.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0 !important; border-top: 1.5px solid var(--hw-ink); }
.service { padding: 1.75rem 1.5rem 1.75rem 0; border-bottom: 1px solid var(--hw-line); }
.service h3 { font-size: var(--wp--preset--font-size--large); margin: 0 0 0.5rem; }
.service p { margin: 0; color: var(--hw-muted); }
.service .service__time { margin-top: 1rem; color: var(--hw-ink); font-size: var(--wp--preset--font-size--small); font-weight: 600; }

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; }
.steps li { counter-increment: step; position: relative; padding-top: 3.25rem; color: var(--hw-muted); }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0; display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border: 1.5px solid var(--hw-chalk); border-radius: 50%;
  color: var(--hw-chalk); font-weight: 650;
}
.steps li::after { content: ''; position: absolute; top: 1.125rem; left: 3rem; right: -1rem; border-top: 1px dashed var(--hw-line-strong); }
.steps li:last-child::after { display: none; }
.steps strong { display: block; color: var(--hw-ink); font-size: var(--wp--preset--font-size--large); font-weight: 650; margin-bottom: 0.35rem; }

.cta { padding: var(--wp--preset--spacing--60) 0; border-top: 1px solid var(--hw-line); }
.cta__inner { gap: 1.5rem 3rem !important; }
.cta h2 { margin: 0; max-width: 18ch; }
.cta p { margin: 0.5rem 0 0; color: var(--hw-muted); }

/* Project grid and cards */
.project-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1.5rem; }
@media (max-width: 60rem) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 36rem) { .project-grid { grid-template-columns: 1fr; } }
.project-card__link { display: block; text-decoration: none; color: var(--hw-ink); }
.project-card__swatch { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: var(--hw-radius-m); transition: transform 300ms var(--hw-ease); }
.project-card__link:hover .project-card__swatch { transform: scale(0.985); }
.project-card__title { font-family: var(--wp--preset--font-family--display); font-weight: 400; font-size: var(--wp--preset--font-size--large); line-height: 1.25; margin: 1rem 0 0.35rem; }
.project-card__link:hover .project-card__title { color: var(--hw-chalk); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.project-card__facts { margin: 0; font-size: var(--wp--preset--font-size--small); color: var(--hw-muted); }

.room-filter { margin-bottom: 2.5rem; }
.room-filter ul { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.room-filter a {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--hw-line-strong); border-radius: 999px; text-decoration: none; color: var(--hw-ink); font-weight: 550;
}
.room-filter a:hover { border-color: var(--hw-ink); color: var(--hw-ink); }
.room-filter a[aria-current] { background: var(--hw-ink); border-color: var(--hw-ink); color: var(--hw-surface); }
.room-filter__count { font-size: 0.8125rem; color: inherit; opacity: 0.75; }

/* Single project */
.project-layout { gap: clamp(2rem, 1rem + 3vw, 4rem) !important; margin-bottom: var(--wp--preset--spacing--70); }
.project-story > p:first-child { margin-top: 0; }
.project-story h2 { font-size: var(--wp--preset--font-size--x-large); margin-top: 2.5rem; }
.project-facts { background: var(--hw-surface); border: 1px solid var(--hw-line); border-radius: var(--hw-radius-m); overflow: hidden; }
.project-facts__swatch { display: block; width: 100%; height: 7rem; }
.project-facts__list { margin: 0; padding: 0.5rem 1.5rem 1rem; }
.project-facts__list div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--hw-line); }
.project-facts__list div:last-child { border-bottom: 0; }
.project-facts__list dt { font-weight: 650; }
.project-facts__list dd { margin: 0; color: var(--hw-muted); text-align: right; }
.cutlist { margin-top: 2rem; }
.cutlist__title { font-size: var(--wp--preset--font-size--large); margin: 0 0 0.75rem; }
.cutlist__scroll { overflow-x: auto; }
.cutlist table { width: 100%; border-collapse: collapse; font-size: var(--wp--preset--font-size--small); }
.cutlist th, .cutlist td { text-align: left; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--hw-line); vertical-align: top; }
.cutlist thead th { font-size: 0.8125rem; color: var(--hw-muted); border-bottom: 1.5px solid var(--hw-ink); }
.cutlist tbody th { font-weight: 600; }
.cutlist .num { text-align: right; padding-right: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.more-projects { padding-top: var(--wp--preset--spacing--60); border-top: 1px solid var(--hw-line); }
.more-projects h2 { font-size: var(--wp--preset--font-size--x-large); margin-bottom: 2rem; }

/* Woods */
.woods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; }
.wood { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; align-items: center; padding: 1rem; background: var(--hw-surface); border: 1px solid var(--hw-line); border-radius: var(--hw-radius-m); }
.wood__swatch { width: 100%; height: 4.5rem; border-radius: var(--hw-radius); display: block; }
.wood__name { font-family: var(--wp--preset--font-family--body); font-size: var(--wp--preset--font-size--base); font-weight: 650; margin: 0 0 0.25rem; }
.wood p { margin: 0; font-size: var(--wp--preset--font-size--small); color: var(--hw-muted); }

/* Planner */
.planner { background: var(--hw-surface); border: 1px solid var(--hw-line); border-radius: 16px; padding: clamp(1rem, 0.6rem + 1.5vw, 1.75rem); box-shadow: 0 1px 2px rgba(30, 36, 39, 0.04), 0 22px 44px -28px rgba(30, 36, 39, 0.35); }
.planner__title { font-size: var(--wp--preset--font-size--x-large); margin: 0 0 0.25rem; }
.planner__hint { margin: 0 0 1rem; color: var(--hw-muted); font-size: var(--wp--preset--font-size--small); }
.planner__drawing { position: relative; aspect-ratio: 560 / 380; background-color: #fbfbf9; background-image: linear-gradient(var(--hw-line) 1px, transparent 1px), linear-gradient(90deg, var(--hw-line) 1px, transparent 1px); background-size: 20px 20px; background-position: -1px -1px; border-radius: var(--hw-radius); border: 1px solid var(--hw-line); overflow: hidden; }
.planner__svg { display: block; width: 100%; height: 100%; }
.planner__noscript { position: absolute; inset: auto 1rem 1rem; margin: 0; font-size: var(--wp--preset--font-size--small); }
.planner__summary { min-height: 3.2em; margin: 0.9rem 0 0.25rem; font-size: var(--wp--preset--font-size--small); }
.planner__controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 1.25rem; }
.planner__range { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.planner__range label { font-weight: 650; font-size: var(--wp--preset--font-size--small); }
.planner__range output { font-size: var(--wp--preset--font-size--small); color: var(--hw-muted); }
.planner__range input { grid-column: 1 / -1; width: 100%; min-height: 40px; accent-color: var(--hw-chalk); cursor: pointer; margin: 0; }
.planner__woods { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; border: 0; padding: 0; margin: 0.5rem 0 0; }
.planner__woods legend { font-weight: 650; font-size: var(--wp--preset--font-size--small); margin-bottom: 0.5rem; padding: 0; }
.planner__wood { position: relative; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 40px; padding: 0 0.85rem 0 0.5rem; border: 1px solid var(--hw-line-strong); border-radius: 999px; font-size: var(--wp--preset--font-size--small); font-weight: 550; cursor: pointer; }
.planner__wood input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.planner__wood:has(input:checked) { border-color: var(--hw-ink); background: var(--hw-ink); color: var(--hw-surface); }
.planner__wood:has(input:focus-visible) { outline: 3px solid var(--hw-chalk); outline-offset: 2px; }
.planner__chip { width: 22px; height: 22px; border-radius: 50%; background: var(--chip); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.planner__send { display: inline-flex; align-items: center; min-height: 44px; margin-top: 1rem; font-weight: 650; color: var(--hw-chalk); }
.planner__send:hover { color: var(--hw-ink); }

.planner__svg .cab { stroke: var(--hw-ink); stroke-width: 1.5; }
.planner__svg .grain { fill: none; stroke-width: 0.7; opacity: 0.45; }
.planner__svg .gap { stroke: var(--hw-ink); stroke-width: 1; }
.planner__svg .handle { stroke: var(--hw-ink); stroke-width: 2.5; stroke-linecap: round; }
.planner__svg .floor { stroke: var(--hw-ink); stroke-width: 1.5; }
.planner__svg .hatch { stroke: var(--hw-line-strong); stroke-width: 0.8; }
.planner__svg .dim { stroke: var(--hw-chalk); stroke-width: 1; fill: none; }
.planner__svg .dim-label { fill: var(--hw-chalk); font: 600 12px var(--wp--preset--font-family--body); }
.planner__svg .dim-label--small { font-size: 10.5px; font-weight: 500; }
.planner__svg .dim-bg { fill: #fbfbf9; }

@media (prefers-reduced-motion: no-preference) {
  .planner.is-drawing .dim { stroke-dasharray: var(--len, 600); stroke-dashoffset: var(--len, 600); animation: hw-draw 900ms var(--hw-ease) forwards; animation-delay: 250ms; }
  .planner.is-drawing .dim-label { opacity: 0; animation: hw-fade 400ms ease forwards 900ms; }
}
@keyframes hw-draw { to { stroke-dashoffset: 0; } }
@keyframes hw-fade { to { opacity: 1; } }

/* Enquiry form */
.enquiry { display: grid; gap: 1.25rem; max-width: 40rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field label { display: block; font-weight: 650; margin-bottom: 0.4rem; }
.field__optional { font-weight: 400; color: var(--hw-muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.85rem; font: inherit; font-size: 1rem; color: var(--hw-ink);
  background: var(--hw-surface); border: 1.5px solid var(--hw-line-strong); border-radius: var(--hw-radius);
  transition: border-color var(--hw-duration);
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--hw-ink); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--hw-chalk); outline-offset: 1px; border-color: var(--hw-ink); }
.field [aria-invalid="true"] { border-color: var(--hw-error); }
.field__error { margin: 0.35rem 0 0; color: var(--hw-error); font-size: var(--wp--preset--font-size--small); font-weight: 550; }
.field__error:empty { display: none; }
.field--check { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start; }
.field--check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--hw-chalk); }
.field--check label { font-weight: 400; margin: 0; }
.field--check .field__error { grid-column: 2; }
.enquiry__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.enquiry__submit { justify-self: start; border: 0; cursor: pointer; min-height: 48px; }
.enquiry__submit[disabled] { opacity: 0.7; cursor: progress; }
.enquiry__note { margin: 0; font-size: var(--wp--preset--font-size--small); color: var(--hw-muted); }
.enquiry__status:empty { display: none; }
.enquiry__status { padding: 1rem 1.25rem; border-radius: var(--hw-radius); background: var(--hw-chalk-soft); border-left: 3px solid var(--hw-chalk); }
.enquiry__status[data-state="error"] { background: #f7e3e1; border-left-color: var(--hw-error); }

.contact-layout { gap: clamp(2rem, 1rem + 4vw, 5rem) !important; }
.contact-card { background: var(--hw-surface); border: 1px solid var(--hw-line); border-radius: var(--hw-radius-m); padding: 1.5rem; }
.contact-card h2 { font-size: var(--wp--preset--font-size--large); margin-top: 0; }

/* Footer */
.site-footer { background: var(--hw-ink); color: #dfe3e4; padding-top: var(--wp--preset--spacing--60); font-size: var(--wp--preset--font-size--small); }
.site-footer a { color: #ffffff; }
.site-footer a:hover { color: #b9d0ef; }
.site-footer__grid { gap: 2.5rem !important; padding-bottom: 2rem; }
.site-footer__name { font-family: var(--wp--preset--font-family--display); font-size: 1.35rem; color: #ffffff; margin-bottom: 0.75rem; }
.site-footer__heading { font-family: var(--wp--preset--font-family--body); font-size: var(--wp--preset--font-size--small); font-weight: 650; color: #ffffff; margin: 0 0 0.75rem; }
.site-footer p { line-height: 1.8; }
.site-footer__links { list-style: none; padding: 0; margin: 0; }
.site-footer__links li { margin-bottom: 0.4rem; }
.site-footer__bottom { padding: 1.25rem 0; border-top: 1px solid rgba(255, 255, 255, 0.18); gap: 1rem; }
.site-footer__bottom p { margin: 0; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-footer__demo { color: #b6bec1; font-size: 0.8125rem; padding-bottom: 1.5rem; margin: 0; }

@media (max-width: 48rem) {
  .field-row { grid-template-columns: 1fr; }
  .planner__controls { grid-template-columns: 1fr; }
  .steps li::after { display: none; }
}
@media (max-width: 26rem) {
  .brand__sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
