/* ==================
   PRINTS INDEX - Editorial Style
   Light warm theme
   ================== */

/* IBM Plex Mono from CDN */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@100;400;500&display=swap');

/* Local fonts - commented out for now
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-Thin.woff2') format('woff2');
  font-weight: 100;
  font-display: swap;
}
*/

:root {
  --bg: #f5f2ed;
  --text: #2d2a26;
  --accent: #c54b2a;
  --accent-secondary: #b8860b;
  --highlight: #1a1a1a;
  --sidebar-width: 340px;
  --column-width: 500px;
  --column-gap: 40px;
}

* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
  min-height: 100vh;
}

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

/* ==================
   Layout
   ================== */
.page {
  display: flex;
  min-height: 100vh;
}

/* ==================
   Sidebar - Fixed, full height
   ================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  padding: 0 40px 20px 40px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: transform 0.3s;
}

.sidebar-top {
  flex: 1;
}

.sidebar-bottom {
  margin-top: auto;
}

/* Pilcrow markers */
.pilcrow {
  font-size: 14px;
  margin-bottom: 4px;
  opacity: 0.3;
  line-height: 1.4;
}

/* Filter sections */
.filter-section {
  margin-bottom: 16px;
}

.filter-header {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

.filter-list {
  list-style: none;
  padding-left: 20px;
}

.filter-list li {
  margin-bottom: 4px;
}

.filter-list a {
  font-size: 12px;
  font-weight: 400;
  transition: color 0.2s;
}

.filter-list a:hover,
.filter-list a.active {
  font-weight: 500;
  color: var(--accent);
}

/* Nested list - more indent */
.filter-list .nested {
  padding-left: 20px;
}

/* Bottom section - staggered blocks bleeding left */
.sidebar-bottom {
  margin-left: -40px;
  padding-left: 0;
}

.sidebar-intro {
  margin-bottom: 16px;
}

.sidebar-tagline {
  background: var(--highlight);
  color: var(--bg);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 3px 12px 3px 40px;
  display: block;
  line-height: 1.4;
  margin-bottom: 0;
}

.sidebar-about-text {
  background: var(--highlight);
  color: var(--bg);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 400;
  padding: 3px 12px 3px 40px;
  display: inline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.sidebar-site {
  background: var(--accent);
  color: var(--bg);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2px;
  padding: 4px 10px 4px 40px;
  display: table;
  margin-bottom: 4px;
  text-transform: uppercase;
  transition: background 0.2s;
}

.sidebar-site:hover {
  background: var(--accent-secondary);
}

.sidebar-email {
  background: var(--accent);
  color: var(--bg);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  padding: 4px 10px 4px 40px;
  margin-bottom: 12px;
  display: table;
  transition: background 0.2s;
}

.sidebar-email:hover {
  background: var(--accent-secondary);
}

.sidebar-credits {
  font-size: 9px;
  line-height: 1.5;
  color: var(--text);
  padding-left: 40px;
  opacity: 0.5;
}

/* Sidebar toggle arrow */
.menu-toggle {
  position: fixed;
  left: var(--sidebar-width);
  top: 0;
  z-index: 101;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  padding: 0 8px;
  transition: left 0.3s;
  font-family: inherit;
  opacity: 0.3;
  line-height: 1.4;
}

.menu-toggle:hover {
  opacity: 0.6;
}

.menu-toggle::after {
  content: '←';
}

.sidebar-closed .menu-toggle {
  left: 0;
}

.sidebar-closed .menu-toggle::after {
  content: '→';
}

/* Sidebar closed state */
.sidebar-closed .sidebar {
  transform: translateX(-100%);
}

.sidebar-closed .prints-index {
  margin-left: 30px;
}

/* ==================
   Main Index - Columns
   ================== */

/* Hide any header from base layout */
.page > header,
.page h1:first-child,
h1.page-title {
  display: none;
}

.prints-index {
  margin-left: var(--sidebar-width);
  margin-top: 0;
  padding: 0 30px 40px 40px;
  transition: margin-left 0.3s;
  
  column-width: var(--column-width);
  column-gap: var(--column-gap);
}

/* Entries flow continuously */
.print-entry {
  display: block;
  text-decoration: none;
  margin: 0;
  padding: 0;
  break-inside: avoid;
}

/* Hide any header that might be injected by base layout */
.prints-index h1,
.prints-index h2,
.prints-index header {
  display: none;
}

.print-entry:first-child {
  margin-top: 0;
}

.print-entry:hover .entry-pilcrow,
.print-entry:hover .pilcrow-stack,
.print-entry:hover .entry-pilcrow-end {
  color: var(--accent);
  opacity: 1;
}

.print-entry:hover .print-title {
  color: var(--accent);
}

.entry-container {
  margin: 0;
  padding: 0;
}

/* Family tags - accent boxes */
.print-families {
  margin-top: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.family-tag {
  display: inline-block;
  background: var(--highlight);
  color: var(--bg);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 4px 8px;
}

.family-separator {
  color: var(--text);
  font-size: 11px;
  font-weight: 400;
}

/* Title */
.print-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0;
  transition: color 0.2s;
}

/* Pilcrow markers */
.entry-pilcrow {
  font-size: 14px;
  opacity: 0.3;
  line-height: 1.4;
  transition: color 0.2s, opacity 0.2s;
}

/* Multiple pilcrows for rhythm */
.pilcrow-stack {
  font-size: 14px;
  opacity: 0.3;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  transition: color 0.2s, opacity 0.2s;
}

/* First entry in each column should touch top edge */
.prints-index > .print-entry:first-child .pilcrow-stack,
.prints-index > .print-entry:first-child {
  margin-top: 0;
  padding-top: 0;
}

/* Image */
.print-image {
  max-width: 100%;
  height: auto;
  display: block;
  padding: 1px 0;
}

/* Size classes (φ-based) */
.print-image.size-a,
.print-image.size-b,
.print-image.size-c { width: 500px; }
.print-image.size-d,
.print-image.size-e,
.print-image.size-f { width: 310px; }
.print-image.size-g,
.print-image.size-h { width: 190px; }

/* Description - justified */
.description-wrap {
  width: min(100%, 500px);
}

.print-description {
  font-size: 12px;
  line-height: 1.6;
  font-weight: 400;
  margin-bottom: 0;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Metadata */
.print-meta {
  font-size: 11px;
  line-height: 1.8;
  font-weight: 400;
}

.meta-row {
  display: flex;
}

.meta-label {
  font-weight: 500;
  margin-right: 8px;
  white-space: nowrap;
}

.meta-value {
  font-weight: 400;
}

/* Closing pilcrow stack */
.entry-pilcrow-end {
  font-size: 14px;
  opacity: 0.3;
  line-height: 1.4;
  transition: color 0.2s, opacity 0.2s;
}

/* ==================
   Detail Page
   ================== */
.detail-page {
  --detail-left-margin: 250px;
  padding: 120px 40px 60px var(--detail-left-margin);
  max-width: none;
  margin: 0;
}

.back-link {
  display: inline-block;
  font-size: 12px;
  opacity: 0.5;
  margin-bottom: 40px;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 1;
}

/* Section header with line extending left */
.detail-header {
  margin-bottom: 30px;
}

.detail-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
  position: relative;
}

.detail-title::before {
  content: '';
  position: absolute;
  right: 100%;
  margin-right: 20px;
  top: 50%;
  width: 100vw;
  height: 1px;
  background: var(--text);
}

.detail-families {
  margin-bottom: 8px;
}

/* Line style for subtitles in markdown content */
.detail-content h2,
.detail-content .section-line {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin: 60px 0 20px 0;
  position: relative;
}

.detail-content h2::before,
.detail-content .section-line::before {
  content: '';
  position: absolute;
  right: 100%;
  margin-right: 20px;
  top: 50%;
  width: 100vw;
  height: 1px;
  background: var(--text);
}

/* Hero image - starts at text edge, extends right */
.detail-hero {
  display: block;
  height: auto;
  max-width: calc(100vw - var(--detail-left-margin) - 40px);
  margin: 40px 0;
}

/* Content area */
.detail-content {
  font-size: 14px;
  line-height: 1.7;
}

.detail-content p {
  max-width: 680px;
  margin-bottom: 1.5em;
}

/* Image size classes for markdown content */
.detail-content img {
  display: block;
  height: auto;
  margin: 2em 0;
}

.detail-content img.t {
  max-width: 680px;
  width: 100%;
}

.detail-content img.w {
  max-width: 900px;
  width: 100%;
}

.detail-content img.f {
  max-width: calc(100vw - var(--detail-left-margin) - 40px);
  width: 100%;
}

/* Meta section with line */
.detail-meta-section {
  position: relative;
  margin-top: 60px;
  padding-top: 30px;
}

.detail-meta-section::before {
  content: '';
  position: absolute;
  right: 100%;
  margin-right: 20px;
  top: 0;
  width: 100vw;
  height: 1px;
  background: var(--text);
}

.detail-meta {
  font-size: 11px;
  line-height: 1.8;
  font-weight: 400;
  max-width: 680px;
}

/* Navigation with line */
.detail-nav {
  position: relative;
  margin-top: 60px;
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  max-width: 680px;
}

.detail-nav::before {
  content: '';
  position: absolute;
  right: 100%;
  margin-right: 20px;
  top: 0;
  width: 100vw;
  height: 1px;
  background: var(--text);
}

.detail-nav a {
  opacity: 0.5;
  transition: opacity 0.2s;
}

.detail-nav a:hover {
  opacity: 1;
}

.detail-nav .disabled {
  opacity: 0.2;
}

.nav-prev,
.nav-next {
  min-width: 80px;
}

.nav-next {
  text-align: right;
}

/* ==================
   Responsive
   ================== */
@media (max-width: 768px) {
  .sidebar {
    width: 300px;
  }
  
  .menu-toggle {
    left: 0;
  }
  
  .menu-toggle::after {
    content: '→';
  }
  
  .sidebar-closed .sidebar,
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  
  .sidebar-open .menu-toggle {
    left: 300px;
  }
  
  .sidebar-open .menu-toggle::after {
    content: '←';
  }
  
  .prints-index,
  .sidebar-closed .prints-index {
    margin-left: 30px;
    column-width: auto;
    columns: 1;
  }
  
  .detail-page {
    --detail-left-margin: 40px;
    padding: 80px 20px 40px var(--detail-left-margin);
  }
  
  .detail-title::before,
  .detail-content h2::before,
  .detail-content .section-line::before,
  .detail-meta-section::before,
  .detail-nav::before {
    margin-right: 10px;
  }
  
  .detail-content img.f {
    max-width: calc(100vw - 60px);
  }
}