/* ============================================================
   DOSSIER STYLESHEET
   All values reference tokens from theme.css.
   Do NOT edit this file for design changes — edit theme.css.
   ============================================================ */

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem; /* no top nav on desktop; overridden on mobile */
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-background);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

/* --- MOBILE HEADER (hidden on desktop, shown on small screens) --- */
.site-header {
  display: none;
}

/* --- LEFT SIDEBAR NAV --- */
.site-sidebar {
  width: var(--sidebar-nav-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--color-border);
  background: var(--color-background);
  overflow: hidden;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2rem 1.5rem 1.5rem;
}

.sidebar-top {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-heading);
  text-decoration: none;
  display: block;
  letter-spacing: var(--letter-spacing-heading);
  line-height: 1.25;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.sidebar-name:hover {
  color: var(--color-accent);
}

.sidebar-subtitle {
  font-size: 0.775rem;
  color: var(--color-text-light);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 0.35rem;
}

.sidebar-nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-light);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  display: block;
  transition: color 0.15s, background 0.15s;
}

.sidebar-nav a:hover {
  color: var(--color-accent);
  background: #e8e2d8; /* darker, slightly more saturated shade of page background */
}

.sidebar-nav a.active {
  color: var(--color-accent);
  background: #e8e2d8;
}

/* Bottom buttons — stacked, full width, uniform height */
.sidebar-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.btn-reading-list,
.btn-print {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  font-weight: 600;
  color: var(--color-text-light);
  background: none;
  border: 1px solid var(--color-border);
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-reading-list:hover,
.btn-print:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-reading-list .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--color-border);
  color: var(--color-text-light);
  border-radius: 50%;
  margin-left: auto;
  transition: background 0.15s, color 0.15s;
}

.btn-reading-list.has-items .count {
  background: var(--color-accent);
  color: #fff;
}

/* --- LAYOUT --- */
.layout {
  display: flex;
  max-width: calc(var(--sidebar-nav-width) + var(--content-max-width) + var(--sidebar-width) + 5rem);
  margin: 0 auto;
  min-height: 100vh;
}

.content {
  flex: 1;
  max-width: var(--content-max-width);
  padding: 2rem 2.5rem 4rem;
}

/* --- HERO / INTRO --- */
.dossier-intro {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.dossier-intro h1 {
  font-family: var(--font-heading);
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--color-heading);
  letter-spacing: var(--letter-spacing-heading);
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.dossier-intro .subtitle {
  font-size: 1rem;
  color: var(--color-text-light);
  margin-bottom: 1.25rem;
}

.dossier-intro .contact {
  font-size: var(--font-size-small);
  color: var(--color-text-light);
}

.dossier-intro .contact a {
  color: var(--color-accent);
  text-decoration: none;
}

/* --- SECTIONS --- */
.dossier-section {
  margin-bottom: var(--section-gap);
}

.dossier-section > h2 {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--color-heading);
  letter-spacing: var(--letter-spacing-heading);
  margin-bottom: var(--subsection-gap);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-heading);
}

.section-intro {
  max-width: 68ch;
  margin-bottom: 2rem;
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--color-text-light);
  font-style: italic;
}

.section-intro p {
  margin-bottom: 1em;
}

.subsection {
  margin-bottom: var(--subsection-gap);
}

.subsection h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-h3);
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: var(--entry-gap);
}

/* --- ENTRY CARDS --- */
.entry {
  position: relative;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--entry-color, var(--color-border));
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  margin-bottom: var(--entry-gap);
  background: var(--color-background);
  transition: border-color 0.15s;
}

.entry:hover {
  border-color: var(--entry-color, var(--color-accent));
  border-left-color: var(--entry-color, var(--color-accent));
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.entry-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--entry-color, var(--color-heading));
  line-height: 1.35;
}

.entry-meta {
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.entry-meta span + span::before {
  content: ' · ';
}

/* --- ENTRY PREVIEW (thumbnail + intro) --- */
.entry-preview {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.entry-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: calc(var(--card-radius) - 2px);
  background: var(--color-surface);
  display: block;
}

/* Placeholder when no thumbnail image exists yet */
.entry-thumb-placeholder {
  width: 120px;
  height: 120px;
  border-radius: calc(var(--card-radius) - 2px);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: var(--font-size-small);
}

.entry-intro {
  font-size: 0.925rem;
  color: var(--color-text);
  line-height: var(--line-height);
}

.entry-intro p {
  margin: 0;
}

/* Entries without a thumbnail — single column */
.entry-preview.no-thumb {
  grid-template-columns: 1fr;
}

/* --- FEATURED ENTRY TILES ---
   featured: true in frontmatter → 16:9 banner image above header.
   Standard tile layout (thumb + intro grid) is suppressed; banner takes its place.
   ----------------------------------------------------------------- */
.entry.featured {
  padding-top: 0;
  overflow: hidden;   /* clips banner corners to card border-radius */
}

/* Full-bleed banner: negative margins cancel out card padding + borders */
.entry-banner {
  margin-left:   calc(-1 * var(--card-padding) - 3px);  /* left border is 3px */
  margin-right:  calc(-1 * var(--card-padding) - 1px);  /* right border is 1px */
  margin-top:    0;
  margin-bottom: var(--card-padding);
  aspect-ratio:  16 / 9;
  overflow:      hidden;
  background:    var(--color-surface);
}

.entry-banner img {
  width:      100%;
  height:     100%;
  object-fit: cover;
  display:    block;
}

.entry-banner-placeholder {
  width:           100%;
  height:          100%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  color:           var(--color-text-light);
  font-size:       var(--font-size-small);
  font-style:      italic;
}

/* Featured preview: no thumbnail — intro text runs full width */
.entry.featured .entry-preview {
  display: block;
}

/* --- ENTRY SUBNAV (highlighted bullet list linking to sub-items within a tile) --- */
.entry-subnav-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.entry-subnav-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--font-size-small);
  font-weight: 600;
  color: var(--color-text-light);
  text-decoration: none;
  padding: 0.2rem 0;
  transition: color 0.15s;
}

.entry-subnav-list a::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border);
  flex-shrink: 0;
  transition: background 0.15s;
}

.entry-subnav-list a:hover {
  color: var(--entry-color, var(--color-accent));
}

.entry-subnav-list a:hover::before {
  background: var(--entry-color, var(--color-accent));
}

/* Sub-item section headers (## in markdown → h5 in HTML) */
.entry-body h5 {
  font-family: var(--font-heading);
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--entry-color, var(--color-heading));
  margin: 1.75rem 0 0.5rem;
  padding-top: 0.25rem;
  scroll-margin-top: calc(var(--nav-height) + 1rem);
}

.entry-body h5:first-of-type {
  margin-top: 0.5rem;
}

/* Detail heading (### in markdown → h6 in HTML) */
.entry-body h6 {
  font-size: var(--font-size-small);
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1rem 0 0.25rem;
}

/* --- EXPAND/COLLAPSE TOGGLE --- */
.entry-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.35rem;
}

.expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  color: var(--color-text-light);
}

.expand-btn:hover {
  background: var(--color-surface);
  color: var(--color-accent);
}

.expand-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}

.entry.expanded .expand-btn svg {
  transform: rotate(180deg);
}

/* --- EXPANDABLE BODY --- */
.entry-body {
  font-size: 0.925rem;
  color: var(--color-text);
  line-height: var(--line-height);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  opacity: 0;
}

.entry.expanded .entry-body {
  max-height: 3000px; /* large enough for any content */
  opacity: 1;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.entry-body p + p {
  margin-top: 0.5rem;
}

/* --- MEDIA FIGURES (images, video with captions) --- */
.entry-body figure {
  margin: 1rem 0;
}

.entry-body figure img,
.entry-body figure video {
  display: block;
  max-width: 100%;
  border-radius: calc(var(--card-radius) - 2px);
}

.entry-body figcaption {
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  margin-top: 0.4rem;
  line-height: 1.4;
  font-style: italic;
}

/* Video responsive wrapper */
.entry-body .video-wrap {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  margin: 1rem 0;
  border-radius: calc(var(--card-radius) - 2px);
  overflow: hidden;
}

.entry-body .video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Image gallery grid (optional — use class="entry-gallery") */
.entry-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.entry-gallery figure {
  margin: 0;
}

/* --- TAGS --- */
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.tag {
  display: inline-block;
  font-size: var(--font-size-tag);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  background: var(--color-surface);
  color: var(--color-text-light);
}

.tag.thread-perception {
  background: color-mix(in srgb, var(--color-thread-perception) 12%, white);
  color: var(--color-thread-perception);
}

.tag.thread-language {
  background: color-mix(in srgb, var(--color-thread-language) 12%, white);
  color: var(--color-thread-language);
}

.tag.thread-access {
  background: color-mix(in srgb, var(--color-thread-access) 12%, white);
  color: var(--color-thread-access);
}

.tag.status-funded {
  background: color-mix(in srgb, var(--color-status-funded) 12%, white);
  color: var(--color-status-funded);
}

.tag.status-pending {
  background: color-mix(in srgb, var(--color-status-pending) 12%, white);
  color: var(--color-status-pending);
}

.tag.status-closed {
  color: var(--color-status-closed);
}

/* --- BOOKMARK BUTTON --- */
.bookmark-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  color: var(--color-bookmark);
}

.bookmark-btn:hover {
  background: var(--color-surface);
  color: var(--color-accent);
}

.bookmark-btn.active {
  color: var(--color-bookmark-active);
}

.bookmark-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* --- READING LIST SIDEBAR --- */
.reading-list {
  position: sticky;
  top: 1.5rem;
  width: var(--sidebar-width);
  max-height: calc(100vh - 2rem);
  flex-shrink: 0;
  background: var(--color-sidebar-bg);
  border-left: 1px solid var(--color-sidebar-border);
  padding: 1.25rem;
  overflow-y: auto;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
  pointer-events: none;
}

.reading-list.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.reading-list h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-h3);
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 1rem;
}

.reading-list-empty {
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  font-style: italic;
  line-height: 1.5;
}

.rl-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: var(--color-text);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
  line-height: 1.35;
}

.rl-item:hover {
  border-color: var(--color-accent);
}

.rl-item .rl-item-section {
  display: block;
  font-size: var(--font-size-tag);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
  margin-bottom: 0.15rem;
}

.rl-item .rl-item-remove {
  float: right;
  font-size: var(--font-size-tag);
  color: var(--color-text-light);
  cursor: pointer;
  padding: 0 0.25rem;
}

.rl-item .rl-item-remove:hover {
  color: var(--color-accent);
}

.reading-list-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.reading-list-actions button {
  flex: 1;
  font-family: var(--font-body);
  font-size: var(--font-size-tag);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  background: var(--color-background);
  color: var(--color-text-light);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.reading-list-actions button:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* --- PRINT MODAL --- */
.print-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.print-modal-overlay.open {
  display: flex;
}

.print-modal {
  background: var(--color-background);
  border-radius: 6px;
  padding: 2rem;
  width: 340px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.print-modal h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-h3);
  margin-bottom: 1rem;
}

.print-modal button {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  background: var(--color-background);
  color: var(--color-text);
  cursor: pointer;
  margin-bottom: 0.5rem;
  text-align: left;
  transition: border-color 0.15s;
}

.print-modal button:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.print-modal button span {
  display: block;
  font-size: var(--font-size-small);
  font-weight: 400;
  color: var(--color-text-light);
  margin-top: 0.15rem;
}

.print-modal .close-modal {
  margin-top: 0.75rem;
  text-align: center;
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  background: none;
  border: none;
  padding: 0.35rem;
  width: auto;
}

/* --- CV TYPOGRAPHY (from kappenstein-color-system.html — web column) ---
   Overrides inline <style> values to match the design system spec exactly.
   ------------------------------------------------------------------- */

/* Section headers: "Academic History" — 15.2px Georgia 700 #757679 uppercase */
.cv-section-title {
  font-size: 0.95rem;      /* 15.2px at 16px base */
  font-weight: 700;
  color: #757679;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Subsection headers: "Education" — 15.2px Georgia 700 #bd3b17 */
.cv-subsection-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #bd3b17;
}

/* Year column — 14px Georgia #231f20 */
.cv-year {
  font-size: 0.875rem;     /* 14px */
  color: #231f20;
}

/* Entry content — 14px Georgia #57585a lh 1.45 */
.cv-content {
  font-size: 0.875rem;
  color: #57585a;
  line-height: 1.45;
}

/* Entry grid — 14px Georgia #57585a lh 1.45 */
.cv-entry {
  font-size: 0.875rem;
  line-height: 1.45;
}

/* Descriptive lines — 13.2px Georgia #57585a lh 1.4 */
.cv-desc {
  font-size: 0.825rem;     /* 13.2px */
  color: #57585a;
  line-height: 1.4;
}

/* --- EDUCATION TABLE (compact) --- */
.compact-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
  margin-bottom: var(--entry-gap);
}

.compact-table th {
  text-align: left;
  font-size: var(--font-size-tag);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.compact-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, white);
  vertical-align: top;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  /* Sidebar morphs into a sticky top bar */
  .site-sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    overflow: visible;
  }

  .sidebar-inner {
    flex-direction: row;
    align-items: center;
    padding: 0.65rem 1rem;
    height: var(--nav-height);
    gap: 0.75rem;
  }

  .sidebar-top {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 0.75rem;
    overflow: visible;
    min-height: unset;
  }

  .sidebar-subtitle {
    display: none;
  }

  .sidebar-name {
    font-size: 1rem;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    gap: 0;
    overflow-x: auto;
    flex-shrink: 1;
  }

  .sidebar-nav li {
    margin-bottom: 0;
  }

  .sidebar-nav a {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    white-space: nowrap;
  }

  .sidebar-bottom {
    flex-direction: row;
    gap: 0.35rem;
    border-top: none;
    margin-top: 0;
    padding-top: 0;
    flex-shrink: 0;
  }

  .btn-reading-list,
  .btn-print {
    width: auto;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }

  .layout {
    flex-direction: column;
    min-height: unset;
  }

  html {
    scroll-padding-top: calc(var(--nav-height) + 1.5rem);
  }

  .content {
    padding: 1.5rem 1rem 3rem;
  }

  .reading-list {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    max-height: 100vh;
    z-index: 150;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  }

  .entry-preview {
    grid-template-columns: 90px 1fr;
    gap: 0.75rem;
  }

  .entry-thumb,
  .entry-thumb-placeholder {
    width: 90px;
    height: 90px;
  }
}
