/* ── julie-in-the-loop — shared site styles ─────────────────────────────────
   Palette lives in custom properties so light/dark and future retints are a
   one-place change. Page-specific styles (wordmark, chat, article, blog list)
   stay inline in each page's <style> block. */

:root {
  /* right-side sidebar footprint (right gap 24px + max-width 220px).
     content centers in the viewport MINUS this column → biased left. */
  --nav-width: 244px;

  --bg:          #fff0f0;   /* page background            */
  --ink:         #544b45;   /* darkest — headings, logo   */
  --body:        #73675f;   /* body copy                  */
  --muted:       #7d6e63;   /* dates, captions (AA on bg) */
  --accent:      #b98a86;   /* wordmark, hover accents    */
  --accent-warm: #e3a8d6;   /* chat send hover            */
  --card:        #ffffff;   /* raised cards, chat output  */
  --border:      rgba(115, 103, 95, 0.15);
  --btn-bg:      #73675f;
  --btn-fg:      #ffffff;
  --btn-disabled:#b8afa8;

  --mono: 'Courier New', Courier, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #1c1614;
    --ink:         #f2e4de;
    --body:        #d9c8bf;
    --muted:       #a99a90;
    --accent:      #d9a09b;
    --accent-warm: #e3a8d6;
    --card:        #241d1a;
    --border:      rgba(217, 200, 191, 0.14);
    --btn-bg:      #d9a09b;
    --btn-fg:      #1c1614;
    --btn-disabled:#5a4f49;
  }
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--mono);
  background-color: var(--bg);
  color: var(--body);
}

/* pages with centered content shrink their field to sit left of the sidebar */
body.has-sidebar-column {
  box-sizing: border-box;
  padding-right: var(--nav-width);
}

/* ── topbar + ascii logo ─────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 24px;
  padding-right: calc(24px + var(--nav-width));  /* keep the logo over the content column */
  font-family: var(--mono);
  color: var(--ink);
  z-index: 20;
  background-color: var(--bg);
  pointer-events: none;       /* don't cover the sidebar links below */
}

.topbar .logo {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  pointer-events: auto;       /* but the logo itself stays clickable */
}

.logo-art {
  margin: 0;
  font-family: var(--mono);
  font-size: 5px;
  line-height: 1.05;
  white-space: pre;
  color: var(--ink);
  transition: color 0.2s;
}

.topbar .logo:hover .logo-art {
  color: var(--accent);
}

/* ── sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 100px;
  bottom: 24px;
  right: 24px;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;           /* short landscape viewports don't clip contact */
  color: var(--body);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  z-index: 15;
}

.sidebar-section + .sidebar-section {
  margin-top: 20px;
}

.sidebar .sidebar-title {
  display: inline-block;
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  text-decoration: none;
}

.sidebar .sidebar-title:hover {
  text-decoration: underline;
}

/* current page: named but not a live link */
.sidebar .sidebar-title[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  cursor: default;
}

.sidebar p {
  margin: 0;
}

.sidebar-contact {
  margin-top: 60px;
}

.sidebar-contact .icon-row {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
}

.sidebar-contact .email {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.sidebar-contact .icon-row a {
  display: inline-flex;
  opacity: 1;
  transition: opacity 0.2s;
}

.sidebar-contact .icon-row a:hover {
  opacity: 0.6;
}

.sidebar-contact .icon-row img {
  width: 18px;
  height: 18px;
  display: block;
}

/* dark mode: the icon PNGs are dark line art — lift them so they read on charcoal */
@media (prefers-color-scheme: dark) {
  .sidebar-contact .icon-row img {
    filter: invert(1) brightness(0.92);
  }
}

/* ── raised content card (blog + posts) ──────────────────────────────────── */
.body-card {
  background-color: var(--card);
  border-radius: 16px;
  padding: 20px 24px;
}

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

/* ── single collapse point for the whole site ────────────────────────────── */
@media (max-width: 1000px) {
  :root {
    --nav-width: 0px;    /* sidebar stacks — no right column to avoid */
  }

  body.has-sidebar-column {
    padding-right: 0;
  }

  /* sidebar becomes a compact nav row directly under the topbar */
  .sidebar {
    position: static;
    max-width: none;
    overflow: visible;
    margin: 88px 24px 8px;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
  }

  .sidebar-section + .sidebar-section {
    margin-top: 0;
  }

  /* on mobile the verbose blurbs get in the way — titles are enough to navigate */
  .sidebar-section p {
    display: none;
  }

  .sidebar-contact {
    margin-top: 16px;
  }
}

/* screen-reader-only — keeps a heading in the a11y tree without showing it.
   used for the page-title <h1> when the design doesn't want a visible label. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
