/* ==========================================================================
   zcast-theme-davidhewitson
   Editorial sliding-panes theme — Libre Franklin, Anders Noren "Hamilton"
   aesthetic, matched to davidhewitson.co.uk.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Self-hosted Libre Franklin (OFL) — served from /_zcast/theme/fonts/
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/_zcast/theme/fonts/libre-franklin-v12-latin-ext_latin-300.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/_zcast/theme/fonts/libre-franklin-v12-latin-ext_latin-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Franklin";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/_zcast/theme/fonts/libre-franklin-v12-latin-ext_latin-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/_zcast/theme/fonts/libre-franklin-v12-latin-ext_latin-500.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/_zcast/theme/fonts/libre-franklin-v12-latin-ext_latin-700.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Franklin";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/_zcast/theme/fonts/libre-franklin-v12-latin-ext_latin-700italic.woff2") format("woff2");
}

/* --------------------------------------------------------------------------
   Design tokens (Layer 1 of the theme contract)
   Dark is the default so a locked dark site has literally nothing to flash.
   -------------------------------------------------------------------------- */

:root {
  /* Typography */
  --zcast-font-body: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --zcast-font-heading: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --zcast-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --zcast-text-base: 1.0625rem;
  --zcast-leading-body: 1.7;
  --zcast-measure: 62ch;

  /* Chrome & elevation */
  --zcast-radius: 6px;
  --zcast-header-height: 60px;
  --zcast-shadow-popover: 0 8px 28px rgba(0, 0, 0, 0.12);
  --zcast-z-popover: 40;
  --zcast-z-toolbar: 50;
  --zcast-z-modal: 60;

  /* Sliding panes */
  --zcast-pane-width: 620px;
  --zcast-pane-padding-block: 3.5rem;
  --zcast-pane-padding-inline: clamp(1.75rem, 4vw, 3.25rem);

  /* Dark palette (default) */
  color-scheme: dark;
  --zcast-bg: #1d1d1d;
  --zcast-surface: #252525;
  --zcast-surface-elevated: #2e2e2e;
  --zcast-text: rgba(255, 255, 255, 0.92);
  --zcast-text-strong: #ffffff;
  --zcast-text-muted: rgba(255, 255, 255, 0.55);
  --zcast-border: rgba(255, 255, 255, 0.13);
  --zcast-accent: #ffffff;
  --zcast-accent-subtle: rgba(255, 255, 255, 0.06);
  --zcast-code-bg: rgba(255, 255, 255, 0.12);

  /* Text selection: light ink on a translucent wash, never accent-on-bg. */
  --zcast-selection-bg: rgba(255, 255, 255, 0.24);
  --zcast-selection-text: var(--zcast-text-strong);
}

/* Explicit dark keeps the same palette but re-asserts `color-scheme`
   for form controls and native scrollbars. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --zcast-bg: #1d1d1d;
  --zcast-surface: #252525;
  --zcast-surface-elevated: #2e2e2e;
  --zcast-text: rgba(255, 255, 255, 0.92);
  --zcast-text-strong: #ffffff;
  --zcast-text-muted: rgba(255, 255, 255, 0.55);
  --zcast-border: rgba(255, 255, 255, 0.13);
  --zcast-accent: #ffffff;
  --zcast-accent-subtle: rgba(255, 255, 255, 0.06);
  --zcast-code-bg: rgba(255, 255, 255, 0.12);
  --zcast-selection-bg: rgba(255, 255, 255, 0.24);
  --zcast-selection-text: var(--zcast-text-strong);
}

:root[data-theme="light"] {
  color-scheme: light;
  --zcast-bg: #ffffff;
  --zcast-surface: #f7f7f7;
  --zcast-surface-elevated: #ffffff;
  --zcast-text: #111111;
  --zcast-text-strong: #000000;
  --zcast-text-muted: rgba(0, 0, 0, 0.55);
  --zcast-border: rgba(0, 0, 0, 0.13);
  --zcast-accent: #000000;
  --zcast-accent-subtle: rgba(0, 0, 0, 0.06);
  --zcast-code-bg: rgba(0, 0, 0, 0.08);
  --zcast-selection-bg: rgba(0, 0, 0, 0.14);
  --zcast-selection-text: var(--zcast-text-strong);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

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

body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--zcast-bg);
  color: var(--zcast-text);
  font-family: var(--zcast-font-body);
  font-size: var(--zcast-text-base);
  line-height: var(--zcast-leading-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1;
}

::selection {
  background: var(--zcast-selection-bg);
  color: var(--zcast-selection-text);
}

:focus-visible {
  outline: 2px solid var(--zcast-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.zcast-skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: calc(var(--zcast-z-modal) + 1);
  transform: translateY(-120%);
  padding: 0.6rem 1rem;
  background: var(--zcast-surface-elevated);
  color: var(--zcast-text-strong);
  border: 1px solid var(--zcast-border);
  border-radius: var(--zcast-radius);
  text-decoration: none;
  font-size: 0.9rem;
}

.zcast-skip-link:focus {
  transform: translateY(0.5rem);
  left: 0.5rem;
}

/* --------------------------------------------------------------------------
   Links & editorial typography
   -------------------------------------------------------------------------- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--zcast-text-muted);
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

a:hover,
a:focus-visible {
  color: var(--zcast-text-strong);
  text-decoration-color: currentColor;
}

/* Admin-mode affordance for nota-yet-created cards. */
[data-zcast-unresolved],
.zcast-unresolved {
  color: var(--zcast-text-muted);
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.zcast-body--admin .zcast-unresolved {
  color: var(--zcast-text);
  text-decoration-style: dotted;
  text-decoration-color: var(--zcast-text-muted);
}

.zcast-body--admin .zcast-unresolved:hover,
.zcast-body--admin .zcast-unresolved:focus-visible {
  color: var(--zcast-text-strong);
  text-decoration-color: currentColor;
}

p,
ul,
ol,
blockquote,
pre,
table,
figure {
  margin: 0 0 1.35em;
}

ul,
ol {
  padding-left: 1.4em;
}

li + li {
  margin-top: 0.3em;
}

li::marker {
  color: var(--zcast-text-muted);
}

blockquote {
  margin-inline: 0;
  padding: 0.15em 0 0.15em 1.25em;
  border-left: 2px solid var(--zcast-border);
  color: var(--zcast-text-muted);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

hr {
  height: 0;
  margin: 2.75em 0;
  border: 0;
  border-top: 1px solid var(--zcast-border);
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
  border-radius: var(--zcast-radius);
}

figure {
  margin-inline: 0;
}

figcaption {
  margin-top: 0.6em;
  color: var(--zcast-text-muted);
  font-size: 0.85rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.55em 0.75em;
  text-align: left;
  border-bottom: 1px solid var(--zcast-border);
}

th {
  color: var(--zcast-text-strong);
  font-weight: 600;
}

code,
kbd,
samp,
pre {
  font-family: var(--zcast-font-mono);
}

code {
  padding: 0.14em 0.36em;
  border-radius: 4px;
  background: var(--zcast-code-bg);
  font-size: 0.9em;
}

pre {
  padding: 1rem 1.15rem;
  overflow-x: auto;
  border: 1px solid var(--zcast-border);
  border-radius: var(--zcast-radius);
  background: var(--zcast-code-bg);
  font-size: 0.875rem;
  line-height: 1.55;
  scrollbar-width: thin;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

mark {
  background: var(--zcast-accent-subtle);
  color: var(--zcast-text-strong);
  padding: 0 0.15em;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Sticky header: site title + clickable breadcrumb trail + actions slot
   -------------------------------------------------------------------------- */

.zcast-header {
  position: sticky;
  top: 0;
  z-index: var(--zcast-z-toolbar);
  flex: 0 0 auto;
  border-bottom: 1px solid var(--zcast-border);
  background: var(--zcast-bg);
  background: color-mix(in srgb, var(--zcast-bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  backdrop-filter: saturate(150%) blur(10px);
}

.zcast-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--zcast-header-height);
  padding: 0 clamp(1rem, 3vw, 1.75rem);
}

.zcast-site-title {
  flex: 0 0 auto;
  color: var(--zcast-text-strong);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}

.zcast-site-title:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: currentColor;
}

/* Breadcrumb trail ------------------------------------------------------- */

.zcast-breadcrumbs {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.zcast-breadcrumbs__list {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.zcast-breadcrumbs__list::-webkit-scrollbar {
  display: none;
}

.zcast-breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.2;
}

.zcast-breadcrumbs__item + .zcast-breadcrumbs__item::before {
  content: "/";
  margin: 0 0.55rem;
  color: var(--zcast-text-muted);
  font-size: 0.8rem;
}

.zcast-breadcrumbs__link {
  color: var(--zcast-text-muted);
  text-decoration: none;
  border-radius: 3px;
  transition: color 140ms ease;
}

.zcast-breadcrumbs__link:hover,
.zcast-breadcrumbs__link:focus-visible {
  color: var(--zcast-text-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.zcast-breadcrumbs__item--current .zcast-breadcrumbs__link {
  color: var(--zcast-text);
  font-weight: 500;
  text-decoration: none;
}

/* Unsaved drafts have no slug yet, so they render as a plain label. */
.zcast-breadcrumbs__label {
  color: var(--zcast-text-muted);
}

.zcast-breadcrumbs__item--current .zcast-breadcrumbs__label {
  color: var(--zcast-text);
  font-weight: 500;
}

/* Header actions slot ---------------------------------------------------- */

.zcast-header__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.zcast-header__actions > * {
  margin: 0;
}

/* Colour-scheme toggle (auto mode only) ---------------------------------- */

.zcast-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--zcast-border);
  border-radius: 999px;
  background: transparent;
  color: var(--zcast-text-muted);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.zcast-theme-toggle:hover {
  color: var(--zcast-text-strong);
  border-color: var(--zcast-text-muted);
  background: var(--zcast-accent-subtle);
}

.zcast-theme-toggle__icon {
  display: none;
  width: 17px;
  height: 17px;
}

.zcast-theme-toggle__icon--moon {
  display: block;
}

:root[data-theme="dark"] .zcast-theme-toggle__icon--moon {
  display: none;
}

:root[data-theme="dark"] .zcast-theme-toggle__icon--sun {
  display: block;
}

:root[data-theme="light"] .zcast-theme-toggle__icon--sun {
  display: none;
}

:root[data-theme="light"] .zcast-theme-toggle__icon--moon {
  display: block;
}

/* Header buttons (slot-provided chrome, e.g. `+ New Note`) ---------------- */

/* Slot markup ships bare `<button class="zcast-header-btn">` elements, so the
   theme owns the whole chrome. Without this, a slot setting `border-color`
   (e.g. `[data-draft-active="true"]`) exposes Firefox's native 3D outset
   bevel instead of the editorial pill used by the toggle and card toolbar. */
.zcast-header-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--zcast-border);
  border-radius: 999px;
  background: transparent;
  color: var(--zcast-text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.zcast-header-btn:hover {
  color: var(--zcast-text-strong);
  border-color: var(--zcast-text-muted);
  background: var(--zcast-accent-subtle);
}

/* Active draft: a flat muted pill. `border-style: solid` is explicit so no
   browser can substitute its native 3D `outset` bevel. */
.zcast-header-btn[data-draft-active="true"] {
  border-style: solid;
  border-color: var(--zcast-border);
  background: var(--zcast-accent-subtle);
  color: var(--zcast-text-muted);
  opacity: 0.78;
}

.zcast-header-btn[data-draft-active="true"]:hover {
  border-color: var(--zcast-text-muted);
  color: var(--zcast-text-strong);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Sliding panes
   -------------------------------------------------------------------------- */

.zcast-main {
  flex: 1 1 auto;
  min-height: 0;
}

.zcast-panes {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  /* `auto` (not `smooth`) keeps native trackpad/wheel momentum scrolling
     crisp; JS still animates via `scrollTo({ behavior: 'smooth' })`. */
  scroll-behavior: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--zcast-border) transparent;
  overscroll-behavior-x: contain;
}

.zcast-panes::-webkit-scrollbar {
  height: 8px;
}

.zcast-panes::-webkit-scrollbar-track {
  background: transparent;
}

.zcast-panes::-webkit-scrollbar-thumb {
  background: var(--zcast-border);
  border-radius: 999px;
}

.zcast-card {
  position: relative;
  flex: 0 0 var(--zcast-pane-width);
  width: var(--zcast-pane-width);
  max-width: 100vw;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--zcast-pane-padding-block) var(--zcast-pane-padding-inline);
  border-right: 1px solid var(--zcast-border);
  background: var(--zcast-bg);
  scrollbar-width: thin;
  scrollbar-color: var(--zcast-border) transparent;
  /* Vertical scrolling stays inside the pane, but horizontal two-finger
     trackpad swipes must chain up to `.zcast-panes` (macOS Safari/Firefox). */
  overscroll-behavior-y: contain;
  overscroll-behavior-x: auto;
}

.zcast-card::-webkit-scrollbar {
  width: 8px;
}

.zcast-card::-webkit-scrollbar-track {
  background: transparent;
}

.zcast-card::-webkit-scrollbar-thumb {
  background: var(--zcast-border);
  border-radius: 999px;
}

.zcast-card:last-child {
  border-right: 0;
}

/* Pane close button — a ghost `×` in the top-right chrome. It sits above the
   toolbar/title padding so it never overlaps them on desktop or mobile. */
.zcast-card__close {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--zcast-text-muted);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.zcast-card__close:hover {
  color: var(--zcast-text-strong);
  border-color: var(--zcast-border);
  background: var(--zcast-accent-subtle);
}

.zcast-card__close:focus-visible {
  outline: 2px solid var(--zcast-accent);
  outline-offset: 2px;
}

/* The root/leftmost card is the entry point of the stack: never closable. */
.zcast-card:first-child [data-zcast-close-pane] {
  display: none;
}

/* Brief, tasteful pulse when a slug is already open (avoids duplicates). */
@keyframes zcast-pane-pulse {
  0% {
    background-color: var(--zcast-surface-elevated);
  }
  100% {
    background-color: var(--zcast-bg);
  }
}

.zcast-card--highlight {
  animation: zcast-pane-pulse 1.2s ease-out;
}

/* Newly opened/created panes slide in from the right. */
@keyframes zcast-card-slide-in {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.zcast-card--entering {
  animation: zcast-card-slide-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.zcast-card__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
}

.zcast-card__toolbar:empty {
  display: none;
}

.zcast-card__toolbar button,
.zcast-card__toolbar .zcast-button {
  padding: 0.32rem 0.72rem;
  border: 1px solid var(--zcast-border);
  border-radius: 999px;
  background: transparent;
  color: var(--zcast-text-muted);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.3;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.zcast-card__toolbar button:hover,
.zcast-card__toolbar .zcast-button:hover {
  color: var(--zcast-text-strong);
  border-color: var(--zcast-text-muted);
  background: var(--zcast-accent-subtle);
}

.zcast-card__header {
  margin-bottom: 1.8rem;
}

.zcast-card-title {
  max-width: var(--zcast-measure);
  margin: 0;
  color: var(--zcast-text-strong);
  font-family: var(--zcast-font-heading);
  font-size: clamp(1.85rem, 3.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.12;
  text-wrap: balance;
}

.zcast-card__body {
  max-width: var(--zcast-measure);
}

.zcast-card-body {
  max-width: var(--zcast-measure);
  overflow-wrap: break-word;
}

.zcast-card-body > :first-child {
  margin-top: 0;
}

.zcast-card-body > :last-child {
  margin-bottom: 0;
}

.zcast-card-body h1,
.zcast-card-body h2,
.zcast-card-body h3,
.zcast-card-body h4,
.zcast-card-body h5,
.zcast-card-body h6 {
  margin: 2.1em 0 0.65em;
  color: var(--zcast-text-strong);
  font-family: var(--zcast-font-heading);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.25;
  text-wrap: balance;
}

.zcast-card-body h1 {
  font-size: 1.65rem;
}

.zcast-card-body h2 {
  font-size: 1.38rem;
}

.zcast-card-body h3 {
  font-size: 1.16rem;
}

.zcast-card-body h4,
.zcast-card-body h5,
.zcast-card-body h6 {
  font-size: 1rem;
  letter-spacing: 0;
}

/* Backlinks footer — "Linked from" --------------------------------------- */

.zcast-card__footer {
  max-width: var(--zcast-measure);
  margin-top: 1rem;
}

.zcast-card__footer:empty {
  display: none;
}

.zcast-backlinks {
  margin-top: 3.25rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--zcast-border);
}

.zcast-backlinks__title {
  margin: 0 0 0.75rem;
  color: var(--zcast-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.zcast-backlinks__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.zcast-backlinks__item {
  margin: 0;
}

.zcast-backlinks__link {
  color: var(--zcast-text);
  font-size: 0.92rem;
  text-decoration-color: var(--zcast-border);
  text-underline-offset: 0.2em;
}

.zcast-backlinks__link:hover {
  color: var(--zcast-text-strong);
  text-decoration-color: currentColor;
}

/* --------------------------------------------------------------------------
   Error pages
   -------------------------------------------------------------------------- */

.zcast-main--error {
  overflow-y: auto;
}

.zcast-error {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 40rem;
  min-height: 60vh;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.zcast-error__status {
  margin: 0 0 0.75rem;
  color: var(--zcast-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.zcast-error__title {
  margin: 0 0 1rem;
  color: var(--zcast-text-strong);
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.15;
}

.zcast-error__message {
  margin: 0 0 2rem;
  color: var(--zcast-text-muted);
}

.zcast-error__home {
  margin: 0;
}

.zcast-error__home-link {
  color: var(--zcast-text-strong);
}

/* --------------------------------------------------------------------------
   Mobile: single-pane, full-width reading with breadcrumb navigation
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  html,
  body {
    height: auto;
  }

  body {
    display: block;
    overflow: visible;
  }

  .zcast-header {
    position: sticky;
    top: 0;
  }

  .zcast-header__inner {
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    min-height: 0;
    padding: 0.7rem 1rem;
  }

  .zcast-breadcrumbs {
    order: 3;
    flex-basis: 100%;
  }

  .zcast-header__actions {
    margin-left: auto;
  }

  .zcast-main {
    min-height: 0;
  }

  .zcast-panes {
    display: block;
    height: auto;
    overflow: visible;
  }

  /* Only the active (rightmost) pane is presented. */
  .zcast-card {
    display: none;
    width: 100%;
    max-width: none;
    height: auto;
    overflow: visible;
    /* Extra top padding keeps the absolute close button clear of the title. */
    padding: 3rem 1.25rem 3.5rem;
    border-right: 0;
  }

  .zcast-card__close {
    top: 0.6rem;
    right: 0.85rem;
  }

  .zcast-card:last-child {
    display: block;
  }

  .zcast-card-title {
    font-size: 1.75rem;
  }

  .zcast-backlinks {
    margin-top: 2.5rem;
  }

  .zcast-error {
    min-height: 50vh;
    padding: 3rem 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Motion & print
   -------------------------------------------------------------------------- */

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

  .zcast-card--entering {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

@media print {
  .zcast-header,
  .zcast-card__toolbar,
  .zcast-card__close,
  .zcast-skip-link {
    display: none !important;
  }

  body {
    display: block;
    background: #ffffff;
    color: #000000;
  }

  .zcast-panes {
    display: block;
    height: auto;
    overflow: visible;
  }

  .zcast-card {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 0;
    border: 0;
  }
}
