/* =========================================================
   YOUR NAME — Personal site
   Minimalist. Black ground. White type. Red accent.
   ========================================================= */

:root {
  --bg:        #0a0a0a;
  --ink:      #f5f5f0;
  --ink-mute: rgba(245, 245, 240, 0.55);
  --ink-soft: rgba(245, 245, 240, 0.3);
  --rule:     rgba(245, 245, 240, 0.15);
  --red:      #c8442a;   /* tweak this single value to recolor accents */
  --serif:    'EB Garamond', Georgia, 'Times New Roman', serif;
  --display:  'Abril Fatface', 'EB Garamond', Georgia, serif;
  --sans:     'Optima', 'Optima Nova', 'Quattrocento Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Selection color */
::selection { background: var(--red); color: var(--ink); }

/* Highlighted concepts/keywords */
.hl { color: var(--red); }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

/* ---------- Sidebar nav ---------- */

.sidebar {
  padding: 48px 32px;
  border-right: 0.5px solid var(--rule);
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
}

.sidebar-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--ink-mute);
  margin-bottom: 32px;
}

#nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#nav-list a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-mute);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.25s ease;
}

#nav-list a:hover { color: var(--ink); }
#nav-list a.active { color: var(--ink); }

/* ---------- Main column ---------- */

.main {
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.masthead {
  text-align: center;
  margin-bottom: 56px;
}

.masthead .supertitle {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}

.masthead h1 {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 400;
  letter-spacing: 0.08em;
  margin: 0;
  line-height: 1;
}

.rule {
  width: 48px;
  height: 1px;
  background: var(--red);
  margin: 16px auto 0;
}

/* ---------- Panel (content area) ---------- */

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 24px 0;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--red);
  text-align: center;
  margin-bottom: 28px;
}

.prose {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

.prose p {
  margin: 0 0 1.2em;
  color: rgba(245, 245, 240, 0.88);
}

/* Pull-quote / sample poem */
.poem {
  max-width: 460px;
  margin: 32px auto;
  padding-left: 24px;
  border-left: 1px solid var(--red);
  font-style: italic;
  color: rgba(245, 245, 240, 0.78);
  text-align: left;
}

/* ---------- Collections grid ---------- */

.row-label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--ink-mute);
  margin: 0 0 12px;
}

.row-label + .row-label-spacer { margin-top: 28px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 130px);
  justify-content: start;
  gap: 12px;
  max-width: 100%;
  margin: 0 0 20px;
}

.tile {
  aspect-ratio: 2 / 3;
  border: 0.5px solid rgba(245, 245, 240, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  background: transparent;
}

.tile:hover {
  border-color: var(--red);
}

.tile-title {
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.3;
  color: rgba(245, 245, 240, 0.78);
  transition: color 0.25s ease;
}

.tile-year {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin-top: 8px;
}

.tile:hover .tile-title { color: var(--ink); }

.tile.active {
  border-color: var(--red);
  background: rgba(200, 68, 42, 0.08);
}
.tile.active .tile-title { color: var(--ink); }

.tile.forthcoming {
  border-style: dashed;
  border-color: rgba(200, 68, 42, 0.5);
}
.tile.forthcoming .tile-title { color: rgba(245, 245, 240, 0.55); }
.tile.forthcoming:hover .tile-title { color: var(--ink); }

/* Out-of-print: quieter, dotted border, dimmed */
.tile.out-of-print {
  border-style: dotted;
  border-color: rgba(245, 245, 240, 0.18);
  opacity: 0.55;
}
.tile.out-of-print .tile-title { color: rgba(245, 245, 240, 0.55); }
.tile.out-of-print:hover {
  opacity: 1;
  border-color: var(--red);
}
.tile.out-of-print:hover .tile-title { color: var(--ink); }
.tile.out-of-print.has-cover img { filter: grayscale(0.9) brightness(0.7); }
.tile.out-of-print.has-cover:hover img,
.tile.out-of-print.has-cover.active img { filter: grayscale(0) brightness(1); }
.tile.out-of-print.active {
  opacity: 1;
  border-color: var(--red);
  background: rgba(200, 68, 42, 0.06);
}
.tile.out-of-print.active .tile-title { color: var(--ink); }

/* Tiles with cover images */
.tile.has-cover { padding: 0; overflow: hidden; }

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.15) brightness(0.92);
  transition: filter 0.3s ease;
}

.tile.has-cover:hover img,
.tile.has-cover.active img {
  filter: grayscale(0) brightness(1);
}

.detail {
  margin-top: 24px;
  padding: 16px 24px;
  border-left: 1px solid var(--rule);
  min-height: 80px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-mute);
  font-style: italic;
  transition: all 0.3s ease;
}

.detail.has-content {
  font-style: normal;
  color: rgba(245, 245, 240, 0.88);
  border-left-color: var(--red);
}

.detail-head {
  font-family: var(--sans);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.2em;
  color: var(--red);
  margin-bottom: 8px;
}

/* ---------- Poetry scan tiles ---------- */

/* The flowing grid (only for flat mode, e.g. poetry) */
/* Poetry wall — column-based masonry layout */
.grid.grid-flow {
  display: block;            /* override .grid's `display: grid` */
  column-count: 4;
  column-gap: 16px;
  margin: 0 auto 20px;
}

.grid.grid-flow .tile {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  break-inside: avoid;       /* don't split a tile across columns */
}

@media (max-width: 1100px) {
  .grid.grid-flow { column-count: 3; }
}
@media (max-width: 760px) {
  .grid.grid-flow { column-count: 2; column-gap: 10px; }
  .grid.grid-flow .tile { margin-bottom: 10px; }
}

/* Scan tiles override the strict 2:3 aspect ratio */
.tile.tile-scan {
  aspect-ratio: auto;
  padding: 0;
  overflow: hidden;
  background: #0e0e0e;
}

.tile.tile-scan img {
  width: 100%;
  height: auto;                 /* let the image keep its natural ratio */
  display: block;
  filter: grayscale(0.05) brightness(0.92);
  transition: filter 0.3s ease;
}

.tile.tile-scan:hover img,
.tile.tile-scan.active img {
  filter: grayscale(0) brightness(1);
}

/* ---------- Slider ---------- */

.slider-wrap {
  margin-top: 40px;
  padding-top: 24px;
}

#slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 1px;
  background: var(--ink-soft);
  outline: none;
  cursor: pointer;
}

#slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--red);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
}
#slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

#slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--red);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    padding: 24px 24px 0;
    border-right: none;
    border-bottom: 0.5px solid var(--rule);
  }
  #nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 20px;
    margin-bottom: 16px;
  }
  #nav-list a {
    font-size: 15px;          /* slightly larger for touch */
    padding: 4px 0;
  }
  .sidebar-label { margin-bottom: 16px; }
  .main { padding: 32px 24px; }
  .masthead h1 { font-size: 32px; letter-spacing: 0.06em; }

  /* Hide the slider on mobile — the nav row above handles navigation */
  .slider-wrap { display: none; }

  .grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  
}
/* ---------- Lightbox (poetry expand/collapse) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
  padding: 40px;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox[hidden] { display: none; }

/* Hide the detail panel under poetry — lightbox is the interaction */
.grid.grid-flow + .detail { display: none; }
