/* ══════════════════════════════════════════════════════════════
   THEME: Literary
   Warm parchment cream, aged-ink dark brown, dusty sage accent.
   Evokes quality long-form writing — think LRB, NYRB, or the
   endpapers of a well-made book. Restrained, considered, serious.
   ══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f7f3ec;
  --text: #1e1a14;
  --accent: #4a6741;          /* muted sage/forest green */
  --accent-warm: #8b4a2b;     /* terracotta — used sparingly for badges/years */
  --muted: #7a7060;
  --border: #ddd6c8;
  --preview-bg: #f2ece2;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.65;
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ── Site Wrapper ─────────────────────────────────────────────── */
.site-wrapper {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
  padding: 28px 0 0;
  background: var(--bg);
  flex-shrink: 0;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding-bottom: 18px;
}

.site-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.8rem, 5.5vw, 4.2rem);
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.08;
  color: var(--text);
}

.tagline {
  font-size: 0.73rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 7px;
  font-style: normal;
}

.header-awards {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.award-chip {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 3px 9px;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  font-family: 'Inter', system-ui, sans-serif;
}

.award-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.header-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.contact-email {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 400;
  font-style: italic;
  transition: opacity 0.15s;
}

.contact-email:hover { opacity: 0.7; }

.social-icons {
  display: flex;
  gap: 7px;
  align-items: center;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 50%;            /* circular — softer feel */
  transition: color 0.2s, border-color 0.2s;
}

.social-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.header-rule {
  height: 1px;
  background: var(--border);
  border: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

/* ── Main 3-Column Layout ─────────────────────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: 220px 1fr 380px;
  gap: 0;
  overflow: hidden;
  min-height: 0;
}

/* ── Left: Info Column ────────────────────────────────────────── */
.col-info {
  padding: 24px 20px 24px 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.info-photo img {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--border);
  /* Slight warm filter for the parchment mood */
  filter: sepia(8%) contrast(0.97);
}

.info-bio {
  font-size: 0.82rem;
  line-height: 1.68;
  color: var(--muted);
}

.info-avail {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.info-avail a {
  color: var(--accent);
  font-weight: 500;
  transition: opacity 0.15s;
}

.info-avail a:hover { opacity: 0.75; }

.avail-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #5d8c50;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 3s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.info-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

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

.info-pub-list li {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
  opacity: 0.85;
}

/* ── Center: List Column ─────────────────────────────────────── */
.col-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  border-right: 1px solid var(--border);
}

/* Tabs */
.list-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  padding: 0 24px;
  background: var(--bg);
}

.list-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  padding: 14px 14px 12px;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.list-tab:hover { color: var(--text); }

.list-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Item list (scrollable) */
.item-list {
  display: none;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  padding: 0 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.item-list.active { display: flex; }

.item-list::-webkit-scrollbar { width: 4px; }
.item-list::-webkit-scrollbar-track { background: transparent; }
.item-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 0; }

/* Individual rows */
.list-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 0 13px 0;
  border-left: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  min-width: 0;
}

.list-item:hover {
  background: rgba(74, 103, 65, 0.05);
  padding-left: 6px;
  margin-left: -6px;
  transition: background 0.2s, padding-left 0.2s;
}

.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.item-pub {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.item-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.item-year {
  font-size: 0.67rem;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 400;
}

.item-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.57rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: transparent;
  color: var(--accent-warm);
  border: 1px solid var(--accent-warm);
  border-radius: 0;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.6;
}

.item-badge.campaign {
  background: var(--accent-warm);
  color: var(--bg);
}

/* ── Right: Preview Pane ─────────────────────────────────────── */
.col-preview {
  position: relative;
  overflow: hidden;
  background: var(--preview-bg);
  border-left: 1px solid var(--border);
}

.preview-inner {
  position: relative;
  height: 100%;
  width: 100%;
}

.preview-default,
.preview-content {
  position: absolute;
  inset: 0;
  padding: 30px 30px 26px;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.preview-default { opacity: 1; pointer-events: auto; }
.preview-content { opacity: 0; pointer-events: none; }

.preview-inner.showing-content .preview-default { opacity: 0; pointer-events: none; }
.preview-inner.showing-content .preview-content { opacity: 1; pointer-events: auto; }

.preview-photo img {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 18px;
  filter: sepia(8%) contrast(0.97);
}

.preview-default-bio {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.75;
  font-style: italic;
}

.preview-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 14px;
  display: block;
}

.preview-pub {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.preview-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 12px;
}

.preview-date {
  font-size: 0.73rem;
  color: var(--muted);
  margin-bottom: 16px;
  font-weight: 400;
}

.preview-excerpt {
  font-size: 0.875rem;
  color: #5a5040;
  line-height: 1.8;
  margin-bottom: 20px;
}

.preview-excerpt:empty { display: none; }

.preview-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0;
  margin-bottom: 12px;
  background: transparent;
  color: var(--accent-warm);
  border: 1px solid var(--accent-warm);
}

.preview-badge.campaign {
  background: var(--accent-warm);
  color: var(--bg);
}

.preview-cta {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  transition: opacity 0.15s;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  font-style: italic;
}

.preview-cta:hover { opacity: 0.7; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.site-footer p {
  font-size: 0.73rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--accent);
  transition: opacity 0.15s;
}

.site-footer a:hover { opacity: 0.7; }

/* ── Mobile (≤900px) ─────────────────────────────────────────── */
@media (max-width: 900px) {
  html, body { overflow: auto; }

  .site-wrapper {
    height: auto;
    overflow: auto;
    padding: 0 16px;
    grid-template-rows: auto auto auto;
  }

  .header-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .header-awards,
  .header-contact { align-items: flex-start; }

  .header-awards {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .main-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .col-info {
    display: grid;
    grid-template-columns: 100px 1fr;
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 12px;
    align-items: start;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    flex-direction: unset;
    flex-wrap: unset;
  }

  .info-photo {
    grid-row: 1 / 2;
    grid-column: 1 / 2;
  }

  .info-bio,
  .contact-email,
  .social-icons {
    grid-column: 2 / 3;
  }

  .info-published {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    padding-top: 12px;
  }

  .info-photo img { max-width: 100px; }

  .col-list {
    border-right: none;
    overflow: visible;
  }

  .item-list {
    overflow: visible;
    max-height: none;
  }

  .col-preview { display: none; }

  .list-tabs {
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .list-tabs::-webkit-scrollbar { display: none; }
  .list-tab { white-space: nowrap; flex-shrink: 0; }

  .item-list { padding: 0 4px; }

  .item-title {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .list-item {
    min-height: 56px;
  }

  .list-item:active {
    border-left-color: var(--accent);
    background: rgba(74, 103, 65, 0.06);
  }
}
