
/* ── Page layout ─────────────────────────────── */
.author-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Hero ────────────────────────────────────── */
.author-hero {
  background: var(--member-accent);
  padding: 3rem 0 0;
  position: relative;
  overflow: hidden;
}
.author-hero::after {
  content: '';
  display: block;
  height: 32px;
  background: var(--bg);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  margin-top: -1px;
}
.author-hero-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 2.5rem 2rem;
  display: flex;
  align-items: flex-end;
  gap: 1.75rem;
  position: relative;
  z-index: 1;
}
.author-ghost-initial {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Cormorant Garamond', serif;
  font-size: 9rem;
  font-weight: 700;
  color: oklch(100% 0 0 / 0.08);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: oklch(100% 0 0 / 0.15);
  border: 2px solid oklch(100% 0 0 / 0.35);
  color: var(--member-on-accent);
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.author-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--member-on-accent);
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.author-sub {
  font-size: 0.75rem;
  color: var(--member-on-accent);
  opacity: 0.78;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

/* ── Nav breadcrumb ──────────────────────────── */
.back-row {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem 2.5rem 0;
}
.back-link {
  font-size: 0.78rem;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.18s var(--ease-out-quart);
}
.back-link:hover {
  color: var(--member-accent-text);
}
.back-arrow {
  font-size: 0.9em;
  transition: transform 0.18s var(--ease-out-quart);
}
.back-link:hover .back-arrow {
  transform: translateX(-3px);
}

/* ── Breadcrumb (Home › Author) ──────────────── */
/* Shared wayfinding trail rendered in .back-row. Mirrors the post page's
   Home › Author › Post crumb so the two page types feel consistent. */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.4;
  list-style: none;
  margin: 0;
  padding: 0;
}
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.18s var(--ease-out-quart);
}
.breadcrumb a:hover { color: var(--member-accent-text); }
.breadcrumb-sep {
  color: var(--border-gold);
  user-select: none;
}
.breadcrumb-current {
  color: var(--ink);
  font-weight: 500;
}

/* ── Post list ───────────────────────────────── */
.posts-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.75rem 2.5rem 5rem;
  flex: 1;
}
.posts-count {
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.post-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  animation: fadeSlideUp 0.4s var(--ease-out-expo) both;
}
.post-item:last-child {
  border-bottom: none;
}
.post-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 0.4rem;
  transition: color 0.18s var(--ease-out-quart);
  line-height: 1.4;
}
.post-title:hover {
  color: var(--member-accent-text);
}
.post-meta {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.post-date {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.post-summary {
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.5;
}
.empty {
  padding: 2.5rem 0;
  text-align: center;
}
.empty-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.empty-sub {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ── Staggered entrance ──────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.author-hero {
  animation: heroIn 0.5s var(--ease-out-expo) both;
}
.back-row {
  animation: fadeSlideUp 0.4s 0.1s var(--ease-out-expo) both;
}
.posts-count {
  animation: fadeSlideUp 0.4s 0.18s var(--ease-out-expo) both;
}
.post-item:nth-child(1)  { animation-delay: 0.22s; }
.post-item:nth-child(2)  { animation-delay: 0.29s; }
.post-item:nth-child(3)  { animation-delay: 0.36s; }
.post-item:nth-child(4)  { animation-delay: 0.43s; }
.post-item:nth-child(5)  { animation-delay: 0.50s; }
.post-item:nth-child(n+6){ animation-delay: 0.55s; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .author-hero-inner { padding: 0 1.25rem 1.75rem; }
  .back-row          { padding: 1rem 1.25rem 0; }
  .posts-container   { padding: 1.5rem 1.25rem 3rem; }
  .author-ghost-initial { font-size: 6rem; opacity: 0.07; }
}


.site-nav {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.1rem 2.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.site-nav-brand .brand-mark {
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out-quart);
}
.site-nav-brand:hover .brand-mark { transform: rotate(-4deg) scale(1.05); }
.site-nav-wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
}
/* Current-page (home) wayfinding: the brand acts as the active "Home" nav item,
   underlined with the accent so users see where they are. On author/post pages
   the brand stays a plain link back home. */
.site-nav-brand--active .site-nav-wordmark {
  border-bottom: 2px solid var(--gold);
  padding-bottom: 1px;
}
.site-nav-search {
  position: relative;
  width: 220px;
}
.site-nav-search input {
  width: 100%;
  padding: 0.45rem 0.9rem 0.45rem 2.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.site-nav-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--gold) 15%, transparent);
}
.site-nav-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  font-size: 0.8rem;
  pointer-events: none;
}
.site-nav .search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px oklch(0% 0 0 / 0.12);
  max-height: 360px;
  overflow-y: auto;
  z-index: 100;
}
.site-nav .search-results.open { display: block; }
.site-nav .search-result-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.12s;
}
.site-nav .search-result-item:last-child { border-bottom: none; }
.site-nav .search-result-item:hover,
.site-nav .search-result-item.active { background: var(--bg-subtle); }
.site-nav .search-result-item.active { outline: 2px solid var(--gold); outline-offset: -2px; }
.site-nav .search-status,
.site-nav .search-count {
  padding: 8px 14px;
  font-size: 0.72rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.site-nav .search-result-title { font-size: 0.88rem; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.site-nav .search-result-meta { font-size: 0.72rem; color: var(--ink-muted); }
.site-nav .search-result-snippet { font-size: 0.78rem; color: var(--ink-muted); margin-top: 3px; line-height: 1.4; }
.site-nav .search-empty { padding: 16px; text-align: center; font-size: 0.85rem; color: var(--ink-muted); }
@media (max-width: 680px) {
  .site-nav { flex-wrap: wrap; padding: 1rem 1.25rem 0; }
  .site-nav-search { width: 100%; }
  .site-nav-search input { font-size: 16px; }
}


/* ── AI Chat Widget ─────────────────────────── */
.ai-chat-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-accent);
  border: none;
  cursor: pointer;
  font-size: 20px;
  box-shadow: 0 4px 16px oklch(0% 0 0 / 0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ai-chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px oklch(0% 0 0 / 0.22);
}
/* Calm reading: on long posts the FAB stays hidden until the reader has scrolled
   into the article, then fades in. JS adds .revealed; without JS it falls back to
   always-visible (the rule below only hides while the gated flag is set). Reveal
   is a gentle fade so it never competes with the prose on first paint. */
.ai-chat-fab.gated {
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out-quart), transform 0.3s var(--ease-out-quart);
}
.ai-chat-fab.gated.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .ai-chat-fab.gated { transition: opacity 0.3s linear; transform: none; }
  .ai-chat-fab.gated.revealed { transform: none; }
}
.ai-chat-panel {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 360px;
  max-height: 480px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 48px oklch(0% 0 0 / 0.15);
  z-index: 1000;
  flex-direction: column;
  overflow: hidden;
}
.ai-chat-panel.open { display: flex; }
.ai-chat-panel.expanded {
  width: min(640px, calc(100vw - 40px));
  max-height: min(720px, calc(100vh - 100px));
  bottom: 20px;
}
.ai-chat-header {
  padding: 10px 14px;
  background: var(--gold);
  color: var(--on-accent);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-chat-header span { flex: 1; }
.ai-chat-header button {
  background: none;
  border: none;
  color: var(--on-accent);
  opacity: 0.8;
  font-size: 15px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.ai-chat-header button:hover {
  /* A dark scrim instead of a white wash so the hover state keeps adequate
     contrast on light/champagne accents (white-on-light washed out before). */
  background: oklch(0% 0 0 / 0.18);
  color: var(--on-accent);
  opacity: 1;
}
/* Header buttons sit on the accent fill, where the page-wide gold focus outline
   has poor contrast. Use the on-accent color for a 2px outline so keyboard focus
   is clearly visible on both light and dark accents. */
.ai-chat-header button:focus-visible {
  outline: 2px solid var(--on-accent);
  outline-offset: 2px;
  opacity: 1;
}
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}
.ai-msg {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.55;
  max-width: 90%;
  word-break: break-word;
}
.ai-msg.user {
  background: var(--gold-tint);
  color: var(--ink);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.ai-msg.bot {
  background: var(--bg-subtle);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.ai-msg.bot.loading::after {
  content: '...';
  animation: dotPulse 1s infinite;
}
@keyframes dotPulse {
  0%,80%,100% { opacity: 0.3; }
  40% { opacity: 1; }
}
.ai-msg.bot p { margin: 0 0 0.5em; }
.ai-msg.bot p:last-child { margin: 0; }
.ai-msg.bot code {
  background: oklch(0% 0 0 / 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.82em;
}
.ai-msg.bot pre {
  background: oklch(0% 0 0 / 0.05);
  padding: 8px 10px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.4em 0;
  font-size: 0.8em;
}
.ai-msg.bot pre code { background: none; padding: 0; }
.ai-msg.bot ul, .ai-msg.bot ol { padding-left: 1.2em; margin: 0.3em 0; }
.ai-msg.bot strong { font-weight: 600; }
.ai-msg.bot h1,.ai-msg.bot h2,.ai-msg.bot h3,.ai-msg.bot h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.5em 0 0.2em;
}
.ai-msg.bot blockquote {
  border-left: 2px solid var(--gold);
  padding-left: 8px;
  margin: 0.3em 0;
  color: var(--ink-muted);
}
.ai-chat-input {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.ai-chat-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.ai-chat-input input:focus { border-color: var(--gold); }
.ai-chat-input button {
  background: var(--gold);
  color: var(--on-accent);
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
}
.ai-chat-input button:disabled { opacity: 0.5; cursor: not-allowed; }
/* Lock background scroll while the chat dialog is open so iOS Safari does not
   scroll the page behind the fixed panel (scroll-through). The fab/panel are
   position:fixed so they stay reachable; only the document body is frozen. */
body.ai-chat-lock { overflow: hidden; }
@media (max-width: 600px) {
  .ai-chat-panel { right: 8px; left: 8px; bottom: 72px; width: auto; max-height: 60vh; }
  .ai-chat-panel.expanded { bottom: 8px; max-height: calc(100vh - 16px); }
  .ai-chat-fab { right: 14px; bottom: 14px; width: 44px; height: 44px; }
  .ai-chat-header button { width: 32px; height: 32px; }
  /* 16px inputs avoid iOS Safari focus auto-zoom. */
  .ai-chat-input input { font-size: 16px; }
}
