/*
Theme Name: TTJ Holding
Theme URI: https://ttjholding.nl
Author: DvA Digital Agency
Description: Lightweight one-page theme that shows TTJ Holding's companies as a tree. Companies are managed under "Bedrijven" in wp-admin. Bilingual via Polylang.
Version: 1.0.0
Requires PHP: 8.1
License: Proprietary
Text Domain: ttjholding
*/
:root {
  --paper: #f4f1ea;
  --paper-2: #fffcf7;
  --ink: #171816;
  --muted: #5c5953;
  --faint: #8a867e;
  --rule: #ddd7cc;
  --line: #c3bdb2;
  --pine: #1c3d32;
  --pine-deep: #132b24;
  --copper: #8f6a3e;
  --copper-soft: #f3eadc;
  --shadow: 0 1px 1px rgba(23, 24, 22, 0.04), 0 10px 28px rgba(23, 24, 22, 0.07);
  --radius: 16px;
  --font: "Segoe UI", "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  --measure: 38rem;
  --store-w: 12.25rem;
  --store-gap: 0.75rem;
  --col: calc(var(--store-w) * 2 + var(--store-gap));
  --branch-gap: 2rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(28, 61, 50, 0.06), transparent 50%),
    var(--paper);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--pine); text-underline-offset: 0.18em; }
a:hover { color: var(--pine-deep); }

a:focus-visible,
button:focus-visible,
.skip:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper-2);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  z-index: 20;
  text-decoration: none;
}

.skip:focus { top: 0.75rem; }

/* Language-specific copy: default Dutch if data-lang is unset */
html[data-lang="en"] .t[data-t="nl"],
html:not([data-lang="en"]) .t[data-t="en"] { display: none; }

.wrap {
  width: min(1100px, calc(100% - 4rem));
  margin-inline: auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 0 1.2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.mark {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 8px;
  background: var(--pine);
  color: #f6f3ee;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.brand-name {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 0 0 auto;
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0.14rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-2);
}

.lang button {
  appearance: none;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0.38rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

.lang button[aria-pressed="true"] {
  background: var(--pine);
  color: #f6f3ee;
}

.lang button:hover:not([aria-pressed="true"]) {
  color: var(--ink);
}

nav a {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

nav a:hover { color: var(--ink); }

.hero {
  padding: 3.25rem 0 2.75rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper);
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.35rem, 6vw, 4.15rem);
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.lede {
  margin: 0 auto;
  max-width: var(--measure);
  font-size: 1.125rem;
  color: var(--muted);
  line-height: 1.65;
}

.tree-section {
  padding: 1rem 0 4.5rem;
}

.tree-section h2 {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 2.25rem;
}

.tree,
.tree ul {
  list-style: none;
  margin: 0;
}

.tree {
  padding: 0;
  display: flex;
  justify-content: center;
}

.tree > li {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.card {
  position: relative;
  z-index: 1;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.2rem;
  width: 16.5rem;
  box-shadow: var(--shadow);
  text-align: left;
}

.card.root {
  width: 17.5rem;
  background: var(--pine);
  border-color: var(--pine-deep);
  color: #f4f1ea;
  text-align: center;
  padding: 1.35rem 1.4rem 1.4rem;
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.card.root h3 {
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.role,
.desc {
  margin: 0.3rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

.card.root .role {
  color: rgba(244, 241, 234, 0.78);
}

.card.mid {
  width: min(22rem, 100%);
}

.card.leaf {
  width: var(--store-w);
  padding: 0.85rem 0.95rem 0.95rem;
}

.brand-label {
  display: block;
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.card.leaf h3 {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

@media (min-width: 801px) {
  .card.leaf {
    min-height: 6.5rem;
  }
}

.badge {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--copper-soft);
  color: var(--copper);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.7rem;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.card-link::after {
  content: "↗";
  font-size: 0.75rem;
}

ul.branches {
  display: grid;
  grid-template-columns: var(--col) var(--col);
  column-gap: var(--branch-gap);
  padding: 2rem 0 0;
  position: relative;
}

.branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.card.root::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1rem;
  height: 1rem;
  border-left: 1px solid var(--line);
}

.branch::before {
  content: "";
  position: absolute;
  top: -1rem;
  left: 50%;
  height: 1rem;
  border-left: 1px solid var(--line);
}

.branch:first-child::after,
.branch:last-child::after {
  content: "";
  position: absolute;
  top: -1rem;
  width: calc(50% + var(--branch-gap) / 2);
  border-top: 1px solid var(--line);
}

.branch:first-child::after { left: 50%; }
.branch:last-child::after { right: 50%; }

ul.stores {
  display: grid;
  grid-template-columns: var(--store-w) var(--store-w);
  gap: 0.7rem var(--store-gap);
  padding: 2rem 0 0;
  position: relative;
  width: var(--col);
}

.stores > li {
  display: block;
  position: relative;
}

ul.stores::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  height: 1rem;
  border-left: 1px solid var(--line);
}

.stores > li:nth-child(1)::before,
.stores > li:nth-child(2)::before {
  content: "";
  position: absolute;
  top: -1rem;
  left: 50%;
  height: 1rem;
  border-left: 1px solid var(--line);
}

.stores > li:nth-child(1)::after,
.stores > li:nth-child(2)::after {
  content: "";
  position: absolute;
  top: -1rem;
  width: calc(50% + var(--store-gap) / 2);
  border-top: 1px solid var(--line);
}

.stores > li:nth-child(1)::after { left: 50%; }
.stores > li:nth-child(2)::after { right: 50%; }

.contact {
  border-top: 1px solid var(--rule);
  padding: 3.5rem 0 3.75rem;
  text-align: center;
}

.contact h2 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.contact a.mail {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 1.35rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.contact a.mail:hover {
  color: var(--pine);
  border-bottom-color: var(--pine);
}

footer {
  padding: 0 0 2.5rem;
  text-align: center;
  color: var(--faint);
  font-size: 0.8rem;
}

@media (max-width: 800px) {
  .wrap { width: min(1100px, calc(100% - 1.75rem)); }

  .hero { padding: 2.25rem 0 2rem; }

  .tree {
    display: block;
    width: min(26rem, 100%);
    margin-inline: auto;
  }

  .tree > li { align-items: stretch; }

  .card.root::after,
  .branch::before,
  .branch::after,
  .branch:first-child::after,
  .branch:last-child::after,
  ul.stores::before,
  .stores > li::before,
  .stores > li::after,
  .stores > li:nth-child(1)::before,
  .stores > li:nth-child(2)::before,
  .stores > li:nth-child(1)::after,
  .stores > li:nth-child(2)::after {
    content: none;
    display: none;
    border: 0;
  }

  ul.branches,
  ul.stores {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: auto;
    grid-template-columns: none;
    column-gap: 0;
    padding: 0.35rem 0 0.15rem 1.15rem;
    margin-left: 0.85rem;
    border-left: 1px solid var(--line);
  }

  .branch,
  .stores > li {
    display: block;
    padding: 0.85rem 0 0.15rem;
  }

  .branch::before,
  .stores > li::before,
  .stores > li:nth-child(1)::before,
  .stores > li:nth-child(2)::before {
    display: block;
    content: "";
    position: absolute;
    left: -1.15rem;
    top: 1.85rem;
    width: 1.15rem;
    height: 0;
    border: 0;
    border-top: 1px solid var(--line);
  }

  .card,
  .card.root,
  .card.mid,
  .card.leaf {
    width: 100%;
    text-align: left;
  }
}

@media print {
  body { background: #fff; }
  header, .skip { display: none; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* WordPress additions: language switch rendered as links */
.lang a {
  display: inline-block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0.38rem 0.55rem;
  border-radius: 999px;
  text-decoration: none;
}
.lang a[aria-current="true"] { background: var(--pine); color: #f6f3ee; }
.lang a:hover:not([aria-current="true"]) { color: var(--ink); }
.lede p { margin: 0; }
.lede p + p { margin-top: 0.75rem; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* Company logos on cards */
.card-logo {
  display: block;
  height: 2.1rem;
  width: auto;
  max-width: 8.5rem;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 0.7rem;
}
.card.leaf .card-logo { height: 1.9rem; max-width: 7.5rem; margin-bottom: 0.55rem; }
