/* LODox Data Viewer demo site — page chrome only.
   Card internals are themed through --lod-card-* custom properties
   and ::part() selectors further down. */

:root {
  --ink: #16181d;
  --muted: #5b6472;
  --line: #dfe3ea;
  --bg: #fbfbfc;
  --panel: #ffffff;
  --accent: #1e3a8a;
  --accent-soft: #eef2fb;
  --radius: 10px;
  --measure: 68ch;
  --wrap: 1180px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

a { color: var(--accent); }
a:hover { color: #0f245c; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding: 0.7rem 0;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.05rem;
}
.brand span { color: var(--accent); }

.site-nav {
  display: flex;
  gap: 1.1rem;
  margin-right: auto;
  font-size: 0.9rem;
}
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* --------------------------------------------------------------- controls */

.controls { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

.control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.control label { white-space: nowrap; }

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--panel);
}

.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.28rem 0.7rem;
  color: var(--muted);
  cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--accent-soft); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ------------------------------------------------------------------- hero */

.hero { padding: 4rem 0 2.5rem; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}
.hero p { max-width: var(--measure); color: var(--muted); font-size: 1.08rem; margin: 0 0 1rem; }
.hero .cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--panel);
}
.btn.primary { background: var(--accent); color: #fff; }
.btn:hover { filter: brightness(1.08); }

.pillrow { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.pill {
  font-size: 0.76rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

/* --------------------------------------------------------------- sections */

.section { padding: 2.5rem 0 3.5rem; border-top: 1px solid var(--line); }
.section > .wrap > header { max-width: var(--measure); margin-bottom: 1.75rem; }
.section h2,
.section h3 {
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.section h2 { font-size: 1.5rem; }
.section h3 { font-size: 1.2rem; }

.section h2 .tag,
.section h3 .tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.section p { color: var(--muted); margin: 0.35rem 0; }
.section .filelinks { font-size: 0.85rem; margin-top: 0.85rem; }
.section .filelinks code { font-size: 0.85em; }

/* ------------------------------------------------------- bundle selector */

.bundle-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.bundle-bar .field-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 260px;
}
.bundle-bar .field-group > span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

select.field {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  max-width: 100%;
}
select.field:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Two classes, so this outranks the `.section p` margin reset. */
.bundle-bar .bundle-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0 auto;
  text-align: right;
}
.bundle-bar .bundle-meta a { margin-left: 0.75rem; }

.bundle-desc { max-width: var(--measure); margin: 1.75rem 0; }
.bundle-desc h2 { margin-bottom: 0.5rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f1f3f7;
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

pre {
  background: #14161b;
  color: #e6e9ef;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
}
pre code { background: none; color: inherit; padding: 0; }

.notice {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.8rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: var(--ink);
  margin: 1rem 0;
}

.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card-note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.card-note h3 { display: block; margin: 0 0 0.4rem; font-size: 1rem; }
.card-note p { font-size: 0.9rem; margin: 0; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer p { margin: 0.3rem 0; }

/* ============================================================== card themes
   Theme "default" sets no --lod-card-* variables, so the per-record header
   colours in the *.cards.json sidecars come through. The other two themes
   set page-level properties, which by design outrank the sidecar. */

lod-bundle { display: block; --lod-bundle-gap: 1.25rem; }

body[data-theme="ink"] {
  --ink: #e8eaf0;
  --muted: #9aa3b2;
  --line: #2a2f3a;
  --bg: #0f1116;
  --panel: #171a21;
  --accent: #8ab4ff;
  --accent-soft: #1b2233;
  color-scheme: dark;
}
body[data-theme="ink"] code { background: #222633; color: #e8eaf0; }
/* The dark theme's accent is light, so filled controls need dark text. */
body[data-theme="ink"] .btn.primary,
body[data-theme="ink"] .seg button[aria-pressed="true"] { color: #0f1116; }
body[data-theme="ink"] lod-bundle {
  --lod-card-bg: #171a21;
  --lod-card-color: #e8eaf0;
  --lod-card-text-color: #c3cad6;
  --lod-card-name-color: #e8eaf0;
  --lod-card-subtitle-color: #8ab4ff;
  --lod-card-header-bg: #232a38;
  --lod-card-header-color: #f2f4f8;
  --lod-card-border: 1px solid #2a2f3a;
  --lod-card-border-color: #2a2f3a;
  --lod-card-row-border: #262b36;
  --lod-card-shadow: none;
  --lod-card-media-bg: #10131a;
  --lod-card-details-bg: #2c3550;
  --lod-card-details-color: #dbe3f5;
  --lod-card-dot-color: #8ab4ff;
  --lod-card-link-color: #8ab4ff;
  --lod-card-link-hover-color: #b9d0ff;
  --lod-card-id-bg: #2b3750;
  --lod-card-id-color: #cddcff;
  --lod-card-sources-bg: #12151b;
  --lod-card-source-bg: #2b3750;
  --lod-card-source-color: #cddcff;
  --lod-card-source-hover-bg: #364566;
  --lod-bundle-error-bg: #2a1618;
  --lod-bundle-error-border: #7f2b2f;
  --lod-bundle-error-color: #ffb4b4;
}
body[data-theme="ink"] lod-bundle::part(row):hover { background: #1e222c; }

body[data-theme="press"] {
  --bg: #f7f3ea;
  --panel: #fffdf8;
  --line: #e0d7c5;
  --accent: #6b2d1f;
  --accent-soft: #f2e8dc;
  --ink: #241f1a;
  --muted: #6a5f52;
}
body[data-theme="press"] {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", "Noto Serif SC", serif;
}
body[data-theme="press"] lod-bundle {
  --lod-card-font: Georgia, "Iowan Old Style", "Times New Roman", "Noto Serif SC", serif;
  --lod-card-bg: #fffdf8;
  --lod-card-color: #241f1a;
  --lod-card-text-color: #3b332b;
  --lod-card-name-color: #241f1a;
  --lod-card-subtitle-color: #8a5a2b;
  --lod-card-header-bg: #6b2d1f;
  --lod-card-header-color: #fdf6ec;
  --lod-card-border: 1px solid #e0d7c5;
  --lod-card-border-color: #e0d7c5;
  --lod-card-row-border: #ece2d2;
  --lod-card-radius: 2px;
  --lod-card-shadow: none;
  --lod-card-media-bg: #f2ece1;
  --lod-card-details-bg: #6b2d1f;
  --lod-card-details-color: #fdf6ec;
  --lod-card-dot-color: #a8552f;
  --lod-card-link-color: #6b2d1f;
  --lod-card-link-hover-color: #a8552f;
  --lod-card-id-bg: #8a5a2b;
  --lod-card-id-color: #fffdf8;
  --lod-card-sources-bg: #f6efe4;
  --lod-card-source-bg: #6b2d1f;
  --lod-card-source-color: #fdf6ec;
  --lod-card-source-hover-bg: #8a3b28;
}
body[data-theme="press"] lod-bundle::part(title) { letter-spacing: 0.01em; }
body[data-theme="press"] lod-bundle::part(type) { text-transform: uppercase; letter-spacing: 0.08em; }

@media (max-width: 700px) {
  .site-nav { width: 100%; order: 3; }
  .bundle-bar .bundle-meta { margin-left: 0; text-align: left; width: 100%; }
}
