/* ==========================================================================
   Bob De Schutter — site stylesheet
   Everything visual is controlled from here. Change the tokens in :root
   (light) and [data-theme="dark"] (dark) and the whole site follows.
   ========================================================================== */

:root {
  /* Type */
  --font-display: "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --title-size: clamp(2.4rem, 7vw, 5.25rem);
  --title-weight: 600;
  --title-tracking: 0.06em;

  --subtitle-size: clamp(0.7rem, 2.2vw, 0.95rem);
  --subtitle-tracking: 0.28em;

  --nav-size: 0.82rem;
  --nav-tracking: 0.18em;

  --section-title-size: 1.4rem;
  --section-title-tracking: 0.02em;

  --body-size: 1.0rem;
  --body-line: 1.85;

  /* Layout */
  --page-max: 980px;
  --page-pad: 24px;
  --header-pad-top: 56px;
  --header-pad-bottom: 8px;

  /* Light palette */
  --bg: #ffffff;
  --fg: #2b2b2b;          /* body text */
  --fg-strong: #111111;   /* title */
  --fg-muted: #9a9a9a;    /* subtitle / nav */
  --fg-faint: #c4c4c4;
  --link: #2b2b2b;
  --link-hover: #000000;
  --rule: #e6e6e6;
  --accent: #111111;
  --btn-bg: #111111;
  --btn-fg: #ffffff;
  --btn-bg-hover: #000000;
}

[data-theme="dark"] {
  --bg: #131313;
  --fg: #cfcfcf;
  --fg-strong: #f5f5f5;
  --fg-muted: #777777;
  --fg-faint: #4a4a4a;
  --link: #e0e0e0;
  --link-hover: #ffffff;
  --rule: #2a2a2a;
  --accent: #f5f5f5;
  --btn-bg: #f5f5f5;
  --btn-fg: #131313;
  --btn-bg-hover: #ffffff;
}

/* --------------------------------------------------------------------- base */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-line);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

.container {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* ------------------------------------------------------------------- header */

.site-header {
  text-align: center;
  padding: var(--header-pad-top) var(--page-pad) var(--header-pad-bottom);
}

.site-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--title-weight);
  font-size: var(--title-size);
  letter-spacing: var(--title-tracking);
  line-height: 1.02;
  color: var(--fg-strong);
  text-transform: uppercase;
}
.site-title a { color: inherit; text-decoration: none; }

.site-subtitle {
  margin: 18px 0 0;
  font-size: var(--subtitle-size);
  letter-spacing: var(--subtitle-tracking);
  color: var(--fg-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* ----------------------------------------------------------------------- nav */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 26px;
  margin: 34px auto 0;
  padding: 0 var(--page-pad);
}

.site-nav a {
  font-size: var(--nav-size);
  letter-spacing: var(--nav-tracking);
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 0;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--fg-strong); }

.site-nav button.nav-theme {
  font-family: inherit;
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  font-size: var(--nav-size);
  letter-spacing: var(--nav-tracking);
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
}
.site-nav button.nav-theme:hover { color: var(--fg-strong); }

.theme-toggle {
  background: none;
  border: 1px solid var(--rule);
  color: var(--fg-muted);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 24px;
}
.theme-toggle:hover { color: var(--fg-strong); border-color: var(--fg-muted); }

/* -------------------------------------------------------------------- content */

.page-content {
  padding: 48px 0 96px;
}

.page-content p { margin: 0 0 1.2em; }
.page-content p:last-child { margin-bottom: 0; }
.page-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--section-title-size);
  letter-spacing: var(--section-title-tracking);
  line-height: 1.2;
  color: var(--fg-strong);
  margin: 0;
}
.page-content h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--fg-strong);
  margin: 0;
}

/* Brukel-style metadata column */
.meta { text-align: right; }
.meta.align-left   { text-align: left; }
.meta.align-center { text-align: center; }
/* .meta .meta-* uses specificity (0,2,0) to beat .page-content p at (0,1,1) */
.meta .meta-label {
  margin: 0;
  font-weight: 700;
  color: var(--fg-strong);
  line-height: 1.4;
}
.meta .meta-value {
  margin: 0 0 22px;
  color: var(--fg);
  line-height: 1.5;
}
.meta .meta-value:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------- blocks */

/* GRID */
.block-grid {
  display: grid;
  width: 100%;
}
.grid-cell > *:first-child { margin-top: 0; }
.grid-cell > *:last-child  { margin-bottom: 0; }

/* HTML */
.block-html[data-align="center"] { text-align: center; }
.block-html[data-align="right"]  { text-align: right; }

/* BUTTON */
.block-button { margin: 8px 0 24px; }
.block-button[data-align="center"] { text-align: center; }
.block-button[data-align="right"]  { text-align: right; }
.btn {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 2px;
}
.btn:hover { background: var(--btn-bg-hover); color: var(--btn-fg); }

/* VIDEO */
.block-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 24px;
  background: #000;
  overflow: hidden;
}
.block-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* portfolio thumbnails (built with HTML blocks) */
.thumb { display: block; text-decoration: none; color: var(--fg); }
.thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--rule);
}
.thumb-caption {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-top: 12px;
}
.thumb:hover .thumb-caption { color: var(--fg-strong); }

/* IMAGE GALLERY */
.block-gallery { display: grid; gap: 12px; margin: 0 0 24px; }
.block-gallery.bordered .gallery-item img { border: 1px solid var(--rule); }
.gallery-item { cursor: zoom-in; }
.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--rule);
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.lightbox-cap {
  position: absolute;
  bottom: 24px; left: 0; right: 0;
  text-align: center;
  color: #ddd;
  font-size: 0.85rem;
}
.lightbox-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: #fff;
  font-size: 2.4rem; cursor: pointer; padding: 16px;
  opacity: 0.7;
}
.lightbox-btn:hover { opacity: 1; }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-close { top: 16px; right: 16px; transform: none; font-size: 2rem; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--rule);
  text-align: center;
  padding: 28px var(--page-pad);
  color: var(--fg-faint);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
}

/* --------------------------------------------------------------- mobile */
@media (max-width: 640px) {
  :root { --header-pad-top: 36px; }

  /* every grid collapses to a single stacked column on phones */
  .block-grid { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* meta: default left; per-block mobile-align overrides desktop alignment */
  .meta, .meta.align-center              { text-align: left; }
  .meta[data-mobile-align="left"]        { text-align: left; }
  .meta[data-mobile-align="center"]      { text-align: center; }
  .meta[data-mobile-align="right"]       { text-align: right; }
  .meta .meta-value { margin-bottom: 16px; }

  /* html block: per-block mobile-align */
  .block-html[data-mobile-align="left"]    { text-align: left; }
  .block-html[data-mobile-align="center"]  { text-align: center; }
  .block-html[data-mobile-align="right"]   { text-align: right; }

  /* button block: per-block mobile-align */
  .block-button[data-mobile-align="left"]  { text-align: left; }
  .block-button[data-mobile-align="center"]{ text-align: center; }
  .block-button[data-mobile-align="right"] { text-align: right; }
}

/* accessibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
