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

html {
  overflow-x: hidden;
  overflow-x: clip;
  scrollbar-gutter: stable;
  overflow-wrap: break-word;
  text-wrap: pretty;
  font-synthesis: none;
  /* Keep anchored/focused targets clear of the sticky header */
  scroll-padding-block-start: calc(var(--kj-mobile-header-h, 60px) + 16px);
  /* No rubber-band on desktop; keep native bounce on touch */
  overscroll-behavior-y: none;
}

@media (any-pointer: coarse) {
  html {
    overscroll-behavior-y: auto;
  }
}

/*
 * shadcn/ui-style scrollbars: transparent track, rounded zinc thumb.
 * Chromium/Safari get the padded pill via ::-webkit-scrollbar; setting the
 * standard scrollbar-* props there would override it, so those are Firefox-only.
 */
::-webkit-scrollbar {
  width: var(--kj-scrollbar-size);
  height: var(--kj-scrollbar-size);
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--kj-scrollbar-thumb);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--kj-scrollbar-thumb-hover);
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--kj-scrollbar-thumb) transparent;
  }
}

h1,
h2,
h3,
h4 {
  text-wrap: pretty;
}

/* 16px minimum stops iOS Safari zooming in on focus */
input,
select,
textarea {
  font-size: max(16px, 1rem);
}

button,
a,
input,
select,
textarea,
summary,
[role="button"] {
  touch-action: manipulation;
}

/* Prices, dates, times and timers: fixed-width digits so text doesn't jitter */
time,
.post-date-category,
.single-post-date,
.kj-cat-date,
.kj-meta__date,
.kj-meta__date--listing,
.kj-teaser-date,
.arkiva-today__date,
.sidebar-timeline__time,
.kj-ad__timer {
  font-variant-numeric: tabular-nums;
}

/* Press feedback (individual `scale` property composes with existing transforms) */
@media (prefers-reduced-motion: no-preference) {
  button:not(:disabled):active,
  [role="button"]:active {
    scale: 0.97;
  }
}

/* Cross-fade between pages on same-origin navigation */
@view-transition {
  navigation: auto;
}

body {
  background-color: var(--color-white);
  font-family: var(--primaryFont);
  overflow-x: hidden;
  overflow-x: clip;
}

::selection {
  color: var(--color-white);
  background: var(--color-blue);
}

article,
aside,
footer,
header,
nav,
section {
  display: block;
}

ul {
  margin: 0;
}

a {
  text-decoration: none;
  color: var(--text-color);
}

blockquote {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 28px 0;
  padding: 24px 28px;
  border: 0;
  background: color-mix(in srgb, var(--text-primary) 4%, var(--bg-primary));
  color: var(--text-primary);
  font-style: normal;
}

.blockquote__icon-wrap {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
  color: var(--text-primary);
}

.blockquote__icon {
  display: block;
  width: 28px;
  height: auto;
}

blockquote p {
  margin: 0;
  font-family: var(--primaryFont);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 400;
  font-style: normal;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

blockquote p + p {
  margin-top: 12px;
}

blockquote cite {
  display: block;
  margin-top: 6px;
  font-family: var(--primaryFont);
  font-size: 13px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.4;
  color: color-mix(in srgb, var(--text-primary) 58%, transparent);
}

/*
 * Layout system
 *
 * .layout-band   — full-width section (backgrounds, borders). No horizontal padding.
 * .kj-layout-shell  — constrained content column; aligns header, body, footer.
 * .kj-layout-bleed  — break out to viewport edges inside a shell (hero images, sliders).
 *
 * .container and .hero-container are legacy aliases for .kj-layout-shell.
 */
.layout-band {
  width: 100%;
}

.kj-layout-shell,
.container,
.hero-container,
.footer-container {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding-x);
}

.kj-layout-bleed {
  width: 100vw;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

/* Fluid main + sidebar row — no fixed sidebar width; columns share space naturally. */
.kj-layout-split {
  display: flex;
  align-items: flex-start;
  gap: var(--kj-layout-sidebar-gap);
  min-width: 0;
}

.kj-layout-split__main {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
}

.kj-layout-split__sidebar {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
}
