/* ==========================================================================
   DTHP theme for Grav 2 — based on the Doku WordPress theme palette & type
   ========================================================================== */

:root {
  --accent: #FF5D1D;
  --on-accent: #ffffff;
  /* One orange everywhere: text, links, prices and highlights all use the accent as-is. */
  --accent-ink: var(--accent);
  --accent-light: var(--accent);
  --bg: #f6f6f4;
  --surface: #f0f0ee;
  --card: #ececea;
  --raised: #ffffff;
  --text: #1a1a1a;
  --heading: #0a0a0a;
  --muted: #6a6a6a;
  --border: #d4d4d0;
  --border-strong: #bdbdb8;
  --tip-bg: color-mix(in srgb, var(--accent) 8%, var(--bg));
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --dark-band: #161514;
  --dark-band-text: #e9e9e6;

  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;

  --radius: 6px;
  --radius-lg: 10px;
  --wrap: 1240px;
  --sidebar-w: 280px;
  --toc-w: 220px;
  --header-h: 64px;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .05);
}

:root[data-theme="dark"] {
  --on-accent: #ffffff;
  --accent-ink: var(--accent);
  --bg: #111312;
  --surface: #171a18;
  --card: #1c1f1d;
  --raised: #202421;
  --text: #e4e4e0;
  --heading: #f5f5f2;
  --muted: #9a9c97;
  --border: #2c302d;
  --border-strong: #3a3f3b;
  --dark-band: #0c0b0b;
  --shadow: none;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--font-mono); font-weight: 500; color: var(--heading); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.15rem + .7vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.lead { font-size: 1.125rem; color: var(--text); max-width: 60ch; }
.eyebrow { font: 500 .75rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--accent-ink); margin-bottom: .9rem; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--radius); }
.skip-link:focus { left: 8px; }
kbd { white-space: nowrap; font: 500 .7rem var(--font-mono); padding: 2px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: var(--raised); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5em; font: 500 .95rem/1 var(--font-sans); padding: .85em 1.3em; border-radius: var(--radius); border: 1.5px solid transparent; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.btn-outline { border-color: var(--accent); color: var(--accent-ink); background: transparent; }
.btn-outline:hover { background: var(--accent-soft); }
.btn-sm { padding: .6em 1em; font-size: .85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.5rem; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--raised); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--border-strong); }

/* ---------- topbar ---------- */
.topbar { background: var(--dark-band); color: var(--dark-band-text); font-size: .8rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 36px; flex-wrap: wrap; }
.topbar-items { display: flex; flex-wrap: wrap; gap: 4px 22px; list-style: none; margin: 0; padding: 6px 0; }
.topbar a { color: inherit; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar-label { font: 500 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; opacity: .6; margin-right: 6px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.is-docs .header-inner { max-width: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); flex-shrink: 0; }
.brand-mark { width: 26px; height: 30px; position: relative; }
.brand-mark::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); border-radius: 2px; }
.brand-mark::after { content: ""; position: absolute; left: 8px; top: 4px; width: 0; height: 0; border-top: 11px solid transparent; border-bottom: 11px solid transparent; border-left: 15px solid var(--accent); }
.brand-logo { height: 44px; width: auto; }
.brand-logo.logo-dark { display: none; }
:root[data-theme="dark"] .brand-logo.logo-light { display: none; }
:root[data-theme="dark"] .brand-logo.logo-dark { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-tagline { font-size: .72rem; color: var(--muted); }

.main-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 8px 12px; border-radius: var(--radius); color: var(--text); text-decoration: none; font-size: .93rem; font-weight: 500; }
.main-nav a:hover { background: var(--surface); }
.main-nav .is-active > a { color: var(--accent-ink); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.search { position: relative; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--raised); color: var(--muted); width: 230px; }
.search:focus-within { border-color: var(--accent); }
.search input { border: 0; background: none; outline: none; font: inherit; font-size: .88rem; color: var(--text); width: 100%; min-width: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search-results { position: absolute; top: calc(100% + 6px); right: 0; width: min(420px, 90vw); max-height: 60vh; overflow: auto; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgb(0 0 0 / .15); padding: 6px; z-index: 60; }
.search-results a { display: block; padding: 8px 10px; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.search-results a small { display: block; color: var(--muted); font-size: .78rem; }
.search-results a:hover, .search-results a.is-sel { background: var(--accent-soft); }
.search-results .empty { padding: 10px; color: var(--muted); font-size: .88rem; }

.mode-toggle svg { display: none; }
[data-theme-pref="light"] .mode-toggle .i-sun,
[data-theme-pref="dark"] .mode-toggle .i-moon,
[data-theme-pref="auto"] .mode-toggle .i-auto,
html:not([data-theme-pref]) .mode-toggle .i-auto { display: block; }
.nav-toggle, .sidebar-toggle { display: none; }

/* category bar (dth style) */
.catbar { border-top: 1px solid var(--border); background: var(--surface); }
.catbar ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.catbar a { display: block; white-space: nowrap; padding: 10px 12px; font: 500 .78rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.catbar a:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---------- breadcrumbs ---------- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 1.75rem; font-size: .82rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; opacity: .6; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-ink); }

/* ---------- docs layout ---------- */
.docs-layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.docs-sidebar { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 22px 16px 40px; font-size: .9rem; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sidebar-title { font: 500 .95rem var(--font-mono); color: var(--heading); text-decoration: none; }
.version-pill { font: 500 .7rem var(--font-mono); padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: 99px; color: var(--muted); }
.sidebar-filter { width: 100%; height: 34px; padding: 0 10px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--raised); color: var(--text); font: inherit; font-size: .85rem; }
.sidebar-filter:focus { outline: none; border-color: var(--accent); }
.sidebar-section { margin-bottom: 20px; }
.sidebar-section-title { display: block; font: 500 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); text-decoration: none; padding: 4px 8px; margin-bottom: 4px; }
.sidebar-section-title.is-active, .sidebar-section-title:hover { color: var(--accent-ink); }
.tree { list-style: none; margin: 0; padding: 0; }
.tree li { position: relative; }
.tree a { display: block; padding: 5px 30px 5px 8px; border-radius: var(--radius); color: var(--text); text-decoration: none; line-height: 1.4; }
.tree a small { display: block; font-size: .76rem; color: var(--muted); }
.tree a:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.tree .is-current > a { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; box-shadow: inset 2px 0 0 var(--accent); }
.tree .tree { display: none; margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--border); }
.tree .is-open > .tree { display: block; }
.tree-toggle { position: absolute; right: 2px; top: 3px; width: 24px; height: 24px; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 4px; }
.tree-toggle::before { content: ""; display: block; width: 6px; height: 6px; margin: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.is-open > .tree-toggle::before { transform: rotate(45deg); }
.tree-toggle:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.tree li.is-hidden, .sidebar-section.is-hidden { display: none; }

.docs-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding: 36px 48px 80px; max-width: calc(860px + var(--toc-w) + 144px); }
.has-toc .docs-main { grid-template-columns: minmax(0, 1fr) var(--toc-w); }
.doc { min-width: 0; max-width: 860px; }
.doc-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.doc-meta { font-size: .82rem; color: var(--muted); margin: 0; }
.doc-hero { margin-bottom: 3rem; }
.doc-section { margin: 3.25rem 0; }

.doc-toc { position: sticky; top: calc(var(--header-h) + 36px); align-self: start; font-size: .84rem; max-height: calc(100vh - var(--header-h) - 72px); overflow: auto; }
.toc-title { font: 500 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .6rem; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.doc-toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.doc-toc .lvl-3 a { padding-left: 26px; }
.doc-toc a:hover { color: var(--text); }
.doc-toc a.is-active { color: var(--accent-ink); border-left-color: var(--accent); }

/* ---------- cards ---------- */
.card-grid { display: grid; gap: 16px; }
.card-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--border); font-size: 1rem; margin-bottom: 10px; }
.card-title { font-weight: 700; font-size: .95rem; color: var(--heading); }
.card-text { font-size: .85rem; color: var(--muted); line-height: 1.55; }
.card-link { margin-top: auto; padding-top: 10px; font: 500 .8rem var(--font-mono); color: var(--accent-ink); }
.child-cards { margin-top: 2.5rem; }

/* steps */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 22px 52px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent-ink); background: var(--bg); font: 500 .85rem var(--font-mono); z-index: 1; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 15.5px; top: 30px; bottom: 0; width: 1.5px; background: var(--border); }
.steps p { display: inline; margin: 0; }

/* callouts */
.callout { padding: 16px 18px; border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); margin: 2rem 0; font-size: .93rem; }
.callout > strong { font: 500 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent-ink); margin-right: 8px; }
.callout p { display: inline; margin: 0; }
.callout-warning { --accent: #b26a00; }
.callout-danger { --accent: #c0392b; }
.callout-info { --accent: #1d6fb8; }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.link-list a { font-weight: 500; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; font: 500 .75rem var(--font-mono); padding: 4px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); text-decoration: none; margin-right: 4px; }
.tag:hover { color: var(--accent-ink); border-color: var(--accent); }

.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.pn { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); text-decoration: none; color: var(--heading); font-weight: 500; }
.pn small { font: 500 .72rem var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pn.next { text-align: right; grid-column: 2; }
.pn:hover { border-color: var(--accent); }

/* ---------- prose ---------- */
.prose { font-size: 1rem; }
.prose h2 { margin-top: 2.4em; }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin: .3em 0; }
.prose img { border-radius: var(--radius-lg); border: 1px solid var(--border); margin: 1.5em 0; }
.prose blockquote { margin: 1.5em 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--tip-bg); border-radius: 0 var(--radius) var(--radius) 0; }
.prose blockquote p:last-child { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .92rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { font: 500 .78rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
code { font-family: var(--font-mono); font-size: .86em; color: var(--accent-ink); background: var(--accent-soft); padding: .12em .4em; border-radius: 4px; }
pre { position: relative; background: #171615; color: #e6e6e1; padding: 18px 20px; border-radius: var(--radius-lg); overflow-x: auto; font-size: .86rem; line-height: 1.6; margin: 1.5em 0; border: 1px solid var(--border); }
pre code { color: inherit; background: none; padding: 0; font-size: inherit; }
.copy-btn { position: absolute; top: 8px; right: 8px; font: 500 .7rem var(--font-mono); padding: 4px 8px; border-radius: 4px; border: 1px solid #383533; background: #201f1e; color: #b7bab5; cursor: pointer; opacity: 0; transition: opacity .15s; }
pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }

/* ---------- site pages ---------- */
.boxed { padding-top: 40px; padding-bottom: 72px; }
.boxed.is-full { max-width: none; }
.boxed:has(> .dth-catalogue, > .dth-product) { padding-top: 0; padding-bottom: 0; } /* the catalogue plugin brings its own spacing */
.page { padding: 48px 24px 80px; }
.error-page { padding: 96px 24px 120px; }

/* ==========================================================================
   Front page (dthproducts.com layout)
   ========================================================================== */
.home-hero { padding: 64px 0 24px; }
.home-hero h1 { max-width: 18ch; }

.home-tiles { padding: 40px 0 24px; }
.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; min-height: 520px; border-radius: var(--radius-lg); overflow: hidden; background: var(--card); border: 1px solid var(--border); color: var(--text); text-decoration: none; isolation: isolate; transition: border-color .2s, transform .2s; }
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
/* Photo fills the top of the tile and fades out from about 45% to 66% down,
   so the text below sits on a solid dark panel. */
.tile-img { position: absolute; top: 0; left: 0; right: 0; width: 100%; height: 66%; object-fit: cover; z-index: -2; transition: transform .5s;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 68%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 68%, transparent 100%); transform-origin: 50% 40%; }
.tile:hover .tile-img { transform: scale(1.04); }
.tile.has-image { color: #fff; border-color: transparent;
  /* neutral backdrop behind the photo (shows through cut-out PNGs), fading to black where the text sits */
  background: linear-gradient(to bottom, var(--tile-neutral, #dfdfdc) 0%, var(--tile-neutral, #dfdfdc) 44%, #1c1b1a 68%, #1c1b1a 100%) border-box; background-origin: border-box; }
.tile-body { margin-top: auto; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.tile-label { font: 500 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--accent-ink); }
.tile.has-image .tile-label { color: var(--accent-light); }
.tile-heading { font: 500 1.25rem/1.2 var(--font-mono); color: inherit; }
.tile:not(.has-image) .tile-heading { color: var(--heading); }
.tile-text { font-size: .86rem; opacity: .85; }
.tile-link { margin-top: 8px; font: 500 .75rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; }
.tile:not(.has-image) .tile-link { color: var(--accent-ink); }

.home-feature { padding: 40px 0; }
.feature-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; background: var(--dark-band); color: var(--dark-band-text); border-radius: 14px; padding: 48px; max-width: calc(var(--wrap) - 48px); }
.feature-inner h2 { color: #fff; }
.feature-inner .eyebrow { color: var(--accent-light); }
.feature-inner p { color: #b9bcb6; max-width: 52ch; margin: 0; }
.feature-actions { display: grid; gap: 12px; }
.feature-btn { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 18px 56px 18px 20px; border-radius: var(--radius-lg); border: 1px solid #34312e; background: #1f1d1c; color: #fff; text-decoration: none; transition: border-color .15s, background .15s; }
.feature-btn:hover { border-color: var(--accent-light); background: #26221f; }
.feature-btn-title { font-weight: 700; }
.feature-btn-sub { font-size: .85rem; color: #a7aaa4; }
.feature-btn-arrow { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; color: var(--accent-light); }

.home-products { padding: 48px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 22px; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.section-head h2 { margin: 0; text-transform: uppercase; font-size: 1.05rem; letter-spacing: .08em; }
.section-link { font: 500 .8rem var(--font-mono); text-decoration: none; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.product { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--raised); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.product:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.product-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface); display: grid; place-items: center; overflow: hidden; }
/* whole photo always fits inside the box (shrinks, never crops) */
.product-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 16px; transition: transform .3s; }
.product:hover .product-media img { transform: scale(1.04); }
.product-placeholder { width: 40%; aspect-ratio: 1; border-radius: 50%; background: repeating-linear-gradient(45deg, var(--border) 0 6px, transparent 6px 12px); }
.product-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.product-cat { font: 500 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 6px; }
.product h3 { font-size: 1.05rem; margin: 0 0 8px; }
.product h3 a { color: var(--heading); text-decoration: none; }
.product-text { font-size: .88rem; color: var(--muted); }
.product-price { font: 700 1.05rem var(--font-sans); color: var(--accent); margin: 0 0 12px; }
.product-link { margin-top: auto; font: 500 .78rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; text-decoration: none; }

.home-content { padding: 24px 0 48px; }

.home-clients { padding: 56px 0 72px; border-top: 1px solid var(--border); background: var(--surface); }
.clients-heading { text-align: center; font-size: .82rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 28px; }
/* Four logos per row, spanning the full content width; each logo scales to fill its column */
.logo-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; list-style: none; margin: 0; padding: 0; }
.logo-row li { display: flex; align-items: center; justify-content: center; height: 156px; min-width: 0; }
.client-logo { width: 100%; height: 100%; max-height: none; object-fit: contain; filter: grayscale(1); opacity: .7; transition: filter .2s, opacity .2s; }
.client-logo:hover { filter: none; opacity: 1; }
:root[data-theme="dark"] .client-logo { filter: grayscale(1) invert(1) brightness(1.4); }
.client-name { font: 500 1rem var(--font-mono); color: var(--muted); letter-spacing: .02em; }

/* ---------- footer ---------- */
.site-footer { background: var(--dark-band); color: var(--dark-band-text); font-size: .9rem; }
.is-docs .site-footer { margin-left: 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.footer-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: #fff; margin-bottom: .5rem; }
.footer-sub { color: var(--accent-light); font-size: .82rem; margin-bottom: .6rem; }
.site-footer address { font-style: normal; color: #b0b3ad; margin-bottom: .6rem; }
.footer-meta { display: flex; flex-direction: column; gap: 4px; }
.site-footer a { color: #d9dbd6; text-decoration: none; }
.site-footer a:hover { color: var(--accent-light); }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 22px; border-top: 1px solid #2a2826; color: #8b8e88; font-size: .8rem; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .has-toc .docs-main { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { display: none; }
}
@media (max-width: 1080px) {
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-inner { grid-template-columns: 1fr; padding: 36px; }
  .logo-row li { height: 125px; }
  .search { width: 180px; }
  .header-cta { display: none; }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; }
  .main-nav { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 24px 20px; display: none; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar-toggle { display: inline-grid; }
  .docs-sidebar { position: fixed; z-index: 45; left: 0; top: var(--header-h); width: min(320px, 86vw); transform: translateX(-100%); transition: transform .2s; }
  .docs-sidebar.is-open { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / .2); }
  .sidebar-scrim { position: fixed; inset: var(--header-h) 0 0 0; background: rgb(0 0 0 / .35); z-index: 44; }
  .docs-main { padding: 28px 24px 64px; }
  .card-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .search { width: 40px; padding: 0; justify-content: center; }
  .search input, .search-kbd { display: none; }
  .search.is-expanded { position: fixed; left: 12px; right: 12px; top: 14px; width: auto; padding: 0 10px; z-index: 70; justify-content: flex-start; }
  .search.is-expanded input { display: block; }
  .brand-tagline { display: none; }
  .tile-grid, .card-grid.cols-2, .card-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .tile { min-height: 400px; }
  .logo-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .logo-row li { height: 104px; }
  .home-feature .feature-inner { padding: 32px 22px; border-radius: 0; }
  .topbar-hours { display: none; }
  .prev-next { grid-template-columns: 1fr; }
  .pn.next { grid-column: 1; }
  .footer-bottom { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .site-header, .topbar, .docs-sidebar, .doc-toc, .site-footer, .prev-next { display: none !important; } .docs-layout { display: block; } }

/* ---------- DTH Catalogue plugin: use the theme palette in light and dark ---------- */
body .dth-catalogue, body .dth-product {
  --dth-on-accent: var(--on-accent);
  --dth-border: var(--border);
  --dth-muted: var(--muted);
  --dth-surface: var(--raised);
  --dth-img-bg: var(--surface);
  --dth-label-bg: var(--card);
  --dth-label-text: var(--heading);
  --dth-stripe: var(--surface);
  --dth-info-bg: color-mix(in srgb, var(--accent) 7%, var(--bg));
  /* Regional restriction notice uses the site orange instead of the plugin's amber */
  --dth-warn-border: var(--accent);
  --dth-warn-bg: color-mix(in srgb, var(--accent) 7%, var(--bg));
}
:root[data-theme="dark"] body .dth-catalogue, :root[data-theme="dark"] body .dth-product {
  --dth-label-bg: #262422;
  --dth-stripe: #191817;
  --dth-warn-border: var(--accent);
  --dth-warn-bg: color-mix(in srgb, var(--accent) 12%, var(--bg));
  --dth-info-bg: color-mix(in srgb, var(--accent) 12%, var(--bg));
}
body .dth-specs td { color: var(--text); }
.dth-single__price, .dth-card__price { color: var(--accent-ink) !important; }

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-hero { padding: 64px 0 8px; }
.contact-hero h1 { max-width: 22ch; }
.contact-main { padding: 32px 0 56px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; }

.contact-details { display: grid; gap: 16px; }
.contact-card { position: relative; padding: 24px 24px 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--raised); }
.contact-card.is-primary { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: inset 3px 0 0 var(--accent); }
.contact-card h2 { font-size: 1.3rem; margin: 0 0 .5rem; }
.contact-card-label { font: 500 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 .5rem; }
.contact-card address { font-style: normal; color: var(--text); line-height: 1.55; margin-bottom: 14px; }
.contact-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .95rem; }
.contact-lines li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.contact-key { font: 500 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.contact-lines a { color: var(--heading); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.contact-lines a:hover { color: var(--accent); }
.contact-directions { display: inline-block; margin-top: 14px; font: 500 .78rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; text-decoration: none; color: var(--accent); }
.contact-hours { background: var(--surface); }
.contact-note { margin: 10px 0 0; font-size: .82rem; color: var(--muted); }

.contact-form-card { padding: 32px; border-radius: 14px; background: var(--dark-band); color: var(--dark-band-text); }
.contact-form-card h2 { color: #fff; margin-bottom: .4rem; }
.contact-form-intro, .contact-prose { color: #b9bcb6; margin-bottom: 22px; }
.contact-form-fallback a { color: var(--accent); }

/* Grav Form plugin markup */
.contact-form form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.contact-form .form-field { margin: 0; min-width: 0; }
.contact-form .form-field:has(textarea), .contact-form .form-field:has(select), .contact-form .buttons, .contact-form .form-errors, .contact-form .notices { grid-column: 1 / -1; }
.contact-form .form-label label { display: block; font: 500 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: #a9aca6; margin-bottom: 7px; }
.contact-form .required { color: var(--accent); margin-left: 2px; }
.contact-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), .contact-form select, .contact-form textarea {
  width: 100%; font: inherit; font-size: .95rem; color: #f2f2ef; background: #232120; border: 1px solid #3a3734; border-radius: var(--radius);
  padding: 12px 14px; transition: border-color .15s, background .15s, box-shadow .15s; }
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #a9aca6 50%), linear-gradient(135deg, #a9aca6 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); background: #282523; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.contact-form .form-honeybear, .contact-form .form-field:has(.form-honeybear) { position: absolute !important; left: -9999px !important; }
.contact-form .buttons { margin-top: 6px; }
.contact-form button[type="submit"], .contact-form .button { display: inline-flex; align-items: center; gap: .5em; font: 500 .95rem/1 var(--font-sans); padding: 15px 26px; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); cursor: pointer; transition: background .15s, transform .15s; }
.contact-form button[type="submit"]::after { content: "→"; }
.contact-form button[type="submit"]:hover { background: color-mix(in srgb, var(--accent) 85%, #000); transform: translateY(-1px); }
.contact-form .notices, .contact-form .form-message { padding: 14px 16px; border-radius: var(--radius); font-size: .93rem; margin-bottom: 16px; }
.contact-form .notices.green, .contact-form .notices.success { background: color-mix(in srgb, #2fa36b 18%, #1c1b1a); border: 1px solid #2fa36b; color: #d6f2e3; }
.contact-form .notices.red, .contact-form .notices.error, .contact-form .form-errors { background: color-mix(in srgb, #d6453d 18%, #1c1b1a); border: 1px solid #d6453d; color: #f7d9d6; }
.contact-form .form-errors p, .contact-form .form-errors { margin: 0; font-size: .85rem; }

.contact-map-section { padding: 0 0 80px; }
.contact-map { position: relative; height: 460px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.contact-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: grayscale(.35) contrast(1.05); }
:root[data-theme="dark"] .contact-map iframe { filter: grayscale(.4) invert(.92) hue-rotate(180deg) contrast(.9); }
.contact-map-card { position: absolute; left: 24px; bottom: 24px; max-width: 340px; padding: 20px 22px; border-radius: var(--radius-lg); background: var(--raised); border: 1px solid var(--border); box-shadow: 0 12px 40px rgb(0 0 0 / .18); }
.contact-map-card h2 { font-size: 1.1rem; margin: 0 0 .4rem; }
.contact-map-card address { font-style: normal; font-size: .9rem; color: var(--muted); margin-bottom: 14px; }

@media (max-width: 960px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .contact-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .contact-details { grid-template-columns: minmax(0, 1fr); }
  .contact-form-card { padding: 24px 20px; }
  .contact-form form { grid-template-columns: minmax(0, 1fr); }
  .contact-map { height: 420px; }
  .contact-map-card { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

/* ==========================================================================
   Feature page (photo with hotspots)
   ========================================================================== */
.feature > .wrap:first-child { padding-top: 36px; }
.feature-top { padding: 8px 0 56px; }
.feature-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.feature-layout.no-image { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
.feature-text h1 { margin-bottom: .5em; }
.feature-text .prose ul { list-style: none; padding: 0; }
.feature-text .prose li { position: relative; padding-left: 26px; margin: .65em 0; }
.feature-text .prose li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.feature-text .prose li strong { color: var(--heading); }
.feature-figure-wrap { position: sticky; top: calc(var(--header-h) + 24px); }

.hotspots { position: relative; margin: 0; border-radius: 14px; overflow: visible; background: var(--surface); border: 1px solid var(--border); }
.hotspots-img { width: 100%; height: auto; border-radius: 14px; }
.hotspot { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: var(--accent); color: #fff;
  font: 700 .8rem/1 var(--font-mono); cursor: pointer; display: grid; place-items: center; padding: 0; z-index: 2;
  box-shadow: 0 2px 10px rgb(0 0 0 / .35); transition: transform .15s, background .15s; }
.hotspot::before { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--accent); animation: spot-pulse 2.2s ease-out infinite; pointer-events: none; }
.hotspot:hover, .hotspot[aria-expanded="true"] { transform: translate(-50%, -50%) scale(1.15); background: #fff; color: var(--accent); }
.hotspot[aria-expanded="true"]::before { animation: none; opacity: 0; }
@keyframes spot-pulse { 0% { transform: scale(1); opacity: .9; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hotspot::before { animation: none; opacity: 0; } }

.hotspot-pop { position: absolute; left: var(--x); top: var(--y); z-index: 5; width: min(320px, 80vw); margin: 26px 0 0 -40px;
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px 40px 14px 14px;
  background: var(--raised); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 16px 48px rgb(0 0 0 / .25); }
.hotspot-pop[hidden] { display: none; }
.hotspot-pop.to-left { margin-left: calc(-1 * min(320px, 80vw) + 40px); }
.hotspot-pop.to-top { transform: translateY(-100%); margin-top: -26px; }
.hotspot-pop img { width: 96px; height: 96px; object-fit: contain; border-radius: var(--radius); background: var(--surface); }
.hotspot-pop:not(:has(img)) { grid-template-columns: minmax(0, 1fr); }
.hotspot-pop h3 { font-size: 1rem; margin: 0 0 .35em; }
.hotspot-pop p { font-size: .86rem; line-height: 1.5; margin: 0; color: var(--muted); }
.hotspot-pop .hotspot-pop-num { font: 500 .7rem var(--font-mono); letter-spacing: .1em; color: var(--accent); margin-bottom: 4px; }
.hotspot-close { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.hotspot-close:hover { background: var(--surface); color: var(--text); }
.hotspots-hint { font-size: .8rem; color: var(--muted); text-align: center; margin: 10px 0 0; }

.feature-parts { padding: 24px 0 56px; }
.parts-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.part { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--raised); overflow: hidden; scroll-margin-top: calc(var(--header-h) + 24px); transition: border-color .2s, box-shadow .2s; }
.part.is-flash { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.part-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface); display: grid; place-items: center; }
.part-media { overflow: hidden; }
.part-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.part-num { position: absolute; top: 10px; left: 10px; font: 700 .72rem var(--font-mono); color: #fff; background: var(--accent); border-radius: 99px; padding: 4px 9px; }
.part-body { padding: 16px 18px 18px; }
.part-body h3 { font-size: 1rem; margin: 0 0 .4em; }
.part-body p { font-size: .88rem; color: var(--muted); margin: 0; }
.feature-cta { padding: 8px 0 80px; }

@media (max-width: 1080px) { .parts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .feature-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .feature-figure-wrap { position: static; }
}
@media (max-width: 640px) {
  .hotspot { width: 30px; height: 30px; }
  /* on phones the part card opens as a sheet at the bottom of the screen */
  .hotspot-pop, .hotspot-pop.to-left, .hotspot-pop.to-top { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; margin: 0; transform: none; z-index: 60; }
  .parts-grid { grid-template-columns: minmax(0, 1fr); }
}
