/* Shared site-wide styles — palette matches the existing Isms book/app
   branding (navy/cream/gold) so the new site feels continuous with it. */

:root {
  --bg: #f4f3ee;
  --text: #232220;
  --muted: #6b6860;
  --navy: #1c2a4a;
  --link: #0c447c;
  --gold: #b99432;
  --border: #ddd8cc;
  --badge-bg: #e6f1fb;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}

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

/* ── Top bar ─────────────────────────────────────────────────────────── */

.topbar {
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  color: var(--navy);
}

.topbar .brand a { color: inherit; }

#pub-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--navy);
}

/* ── Two-pane layout ─────────────────────────────────────────────────── */

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
  align-items: start;
}

.main-pane { min-width: 0; }

.main-pane h1 {
  font-family: var(--serif);
  font-size: 30px;
  margin: 0 0 6px;
  color: var(--navy);
}

.main-pane .subtitle {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 24px;
}

.main-pane p {
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0 0 16px;
}

/* ── Publications panel (right pane) ─────────────────────────────────── */

#pub-panel {
  border-left: 1px solid var(--border);
  padding-left: 28px;
}

.pub-panel-heading {
  font-family: var(--serif);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 600;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

/* Single-line items (title + inline type/status) -- condensed from the
   original 3-line type/title/badge stack so an 18-item list fits a laptop
   window without scrolling. See renderPubPanel() in site.js. */
.pub-item {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--text);
  line-height: 1.35;
}

a.pub-item:hover {
  background: var(--badge-bg);
  text-decoration: none;
}

.pub-item.active {
  background: var(--navy);
  color: #fff;
}

.pub-item.active .pub-meta { color: rgba(255,255,255,0.65); }

.pub-item.coming-soon { opacity: 0.72; }

/* Thin rule marking a new thematic category (philosophical/political,
   religion, family history, children's) -- see publications.js. Kept to a
   hairline plus a little breathing room rather than a full text header, so
   it doesn't undo the height savings from condensing to single-line items. */
.pub-item.category-start {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 9px;
}

/* Full text label for categories that need to announce themselves (see
   CATEGORY_LABELS in site.js) -- bolder and larger than the plain hairline
   divider above, in the site's gold accent so it stands out against the
   otherwise muted panel. */
.pub-category-label {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--gold);
  margin: 10px 8px 4px;
}

.pub-title {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 600;
}

/* Items with real content to view get the site's link-blue title so they
   visually stand out from the still-muted placeholder entries -- the opacity
   dimming above was too subtle on its own. Driven by the `.has-content`
   class (see hasContent in site.js), not directly by published/coming-soon
   status -- an entry can be blue while still showing "coming soon" text
   (e.g. Worldview Builder: not on the App Store yet, but its page is
   already live on the site). Excluded when the item is the active/current
   page, which already has its own white-on-navy treatment. */
.pub-item.has-content:not(.active) .pub-title {
  color: var(--link);
}

.pub-meta {
  font-size: 10px;
  color: var(--muted);
  margin-left: 5px;
}

/* ── Companion-app callout (used on the Isms book page) ──────────────── */

.companion-callout {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--badge-bg);
  border: 1px solid #cfe2f3;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 8px 0 28px;
}

.companion-callout .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--link);
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
}

.companion-callout .name {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--navy);
}

.companion-callout a.cta {
  margin-left: auto;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--navy);
  color: #fff;
  padding: 8px 16px;
  border-radius: 7px;
}
.companion-callout a.cta:hover { text-decoration: none; opacity: 0.9; }

/* ── CTA buttons ──────────────────────────────────────────────────────── */

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; }

.btn {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { text-decoration: none; opacity: 0.92; }
.btn.secondary { border: 1px solid var(--link); color: var(--link); }
.btn.secondary:hover { text-decoration: none; background: var(--badge-bg); }

/* ── Footer ───────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* ── Responsive: stack panels on narrow screens ──────────────────────── */

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  #pub-toggle { display: inline-block; }

  #pub-panel {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 20px;
    display: none;
  }

  #pub-panel.open { display: block; }
}
