/* ==========================================================================
   /notes/ — three design explorations (preview only)
   ?notes-layout=editorial | sheets | index
   content.js adds  body.nk2.notes-preview.notes-layout-<name>  so the shared
   Nikkalma 2.0 header / footer / focus styles from nikkalma-2.css apply.
   Without the parameter nothing in this file matches: /notes/ is unchanged.
   All three variants restyle the same five links — no duplicated data.
   ========================================================================== */

/* --- Shared: cinematic canvas, header, footer, heading --- */
body.notes-preview {
  --nk2-graphite: #0e0f0f;
  --nk2-surface: rgba(25, 27, 29, .62);
  --nk2-footer: #0b0c0c;
  --nk2-sage: #b9c0c7;                       /* accent → silver */
  --nk2-sage-fill: rgba(218, 224, 230, .1);
  --nk2-line: rgba(218, 224, 230, .2);
  --nk2-line-soft: rgba(218, 224, 230, .12);
  --np-silver: #b9c0c7;
  --np-meta: rgba(241, 235, 221, .62);
  padding: 0;
  background: var(--nk2-graphite);
}

body.notes-preview .site-canvas {
  width: 100%;
  margin: 0;
  overflow: visible;
  overflow-x: clip;
  border: 0;
  border-radius: 0;
  background: var(--nk2-graphite);
}

/* Footer: the approved compact footer — same markup and rules as the homepage
   and project pages (nikkalma-2.css, .nk2 footer); only the rule colour here. */
body.notes-preview .site-canvas > footer { border-top-color: rgba(218, 224, 230, .14); }

body.notes-preview main#content.notes-index {
  display: block;
  max-width: none;
  margin: 0;
  padding: clamp(48px, 6vw, 88px) var(--nk2-pad) clamp(64px, 7vw, 112px);
}

body.notes-preview .notes-index > h1.visually-hidden {        /* the page's own H1, made visible */
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  color: var(--nk2-cream);
  font-size: clamp(3rem, 7.4vw, 6.4rem);
  font-weight: 300;
  line-height: .95;
  letter-spacing: -.055em;
}

body.notes-preview .notes-intro {
  max-width: 38ch;
  margin: 18px 0 clamp(40px, 5vw, 72px);
  color: var(--nk2-text);
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.55;
  letter-spacing: 0;
}

/* Reset the legacy collage: positions, materials, drag cursor.
   :where() keeps these resets weak, so every variant below can override them. */
body.notes-preview :where(.notes-triptych) {
  margin: 0;
  column-gap: 0;
}

body.notes-preview :where(.notes-triptych .note-slab) {
  grid-column: auto;
  grid-row: auto;
  width: auto;
  max-width: none;
  margin: 0;
  align-self: stretch;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--nk2-cream);
  cursor: pointer;
  transform: none;
}
body.notes-preview :where(.note-slab)::before,
body.notes-preview :where(.note-slab)::after { content: none; }

body.notes-preview .note-slab-id,
body.notes-preview .note-slab-meta {
  opacity: 1;
  color: var(--np-meta);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .14em;
}

body.notes-preview .note-slab-arrow {
  opacity: 1;
  color: var(--np-silver);
  transition: transform .2s ease;
}

body.notes-preview .note-slab:hover .note-slab-arrow,
body.notes-preview .note-slab:focus-visible .note-slab-arrow { transform: translateX(4px); }

body.notes-preview .note-slab:focus-visible {
  outline: 2px solid var(--np-silver);
  outline-offset: 4px;
}

@media (max-width: 680px) {
  body.notes-preview main#content.notes-index { padding-top: 36px; padding-bottom: 56px; }
}

/* ==========================================================================
   A — Editorial archive: one featured note, asymmetric journal grid
   ========================================================================== */
.notes-layout-editorial .notes-triptych {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 2.6vw, 40px);
  row-gap: 0;
  align-items: stretch;
}

.notes-layout-editorial .notes-triptych .note-slab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px 20px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--nk2-line);
}
.notes-layout-editorial .note-slab-id { grid-column: 1; grid-row: 1; }
.notes-layout-editorial .note-slab-title { grid-column: 1 / -1; grid-row: 2; font-size: clamp(1.25rem, 1.7vw, 1.6rem); font-weight: 400; line-height: 1.18; letter-spacing: -.025em; }
.notes-layout-editorial .note-slab-meta { grid-column: 1; grid-row: 4; align-self: end; }
.notes-layout-editorial .note-slab-arrow { grid-column: 2; grid-row: 4; align-self: end; }

/* Featured: the newest note (005) leads the page. */
.notes-layout-editorial .notes-triptych .note-pos--e {
  order: -1;
  grid-column: 1 / 8;
  grid-row: span 2;
  gap: 18px 24px;
  padding: clamp(28px, 3vw, 44px) clamp(24px, 3vw, 44px) clamp(28px, 3vw, 40px);
  border: 1px solid rgba(210, 214, 218, .1);
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(214, 218, 222, .07), transparent 60%),
    rgba(25, 27, 29, .62);
}
.notes-layout-editorial .note-pos--e .note-slab-title {
  font-size: clamp(2.2rem, 4.6vw, 4.2rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.045em;
  max-width: 14ch;
}
.notes-layout-editorial .note-pos--e .note-slab-arrow { font-size: 1.5rem; }

.notes-layout-editorial .notes-triptych .note-pos--d { grid-column: 8 / 13; margin-left: clamp(0px, 1vw, 12px); }
.notes-layout-editorial .notes-triptych .note-pos--c { grid-column: 8 / 13; margin-left: clamp(0px, 1vw, 12px); }
.notes-layout-editorial .notes-triptych .note-pos--b { grid-column: 1 / 6; margin-top: clamp(28px, 3vw, 44px); }
.notes-layout-editorial .notes-triptych .note-pos--a { grid-column: 6 / 13; margin-top: clamp(28px, 3vw, 44px); }
.notes-layout-editorial .note-pos--d { order: 1; }
.notes-layout-editorial .note-pos--c { order: 2; }
.notes-layout-editorial .note-pos--b { order: 3; }
.notes-layout-editorial .note-pos--a { order: 4; }

.notes-layout-editorial .notes-triptych .note-slab:not(.note-pos--e):hover .note-slab-title { color: var(--np-silver); }

@media (max-width: 960px) {
  .notes-layout-editorial .notes-triptych .note-slab { grid-column: 1 / -1; margin: 0; }
  .notes-layout-editorial .notes-triptych .note-pos--e { grid-row: auto; margin-bottom: 12px; }
}

/* ==========================================================================
   B — Archival sheets: floating paper on the black canvas
   ========================================================================== */
.notes-layout-sheets .notes-triptych {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 0;
  row-gap: 0;
  align-items: start;
  max-width: 1240px;
  padding: 8px 0 24px;
}

.notes-layout-sheets .notes-triptych .note-slab {
  --sheet-tilt: 0deg;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  gap: 14px 16px;
  min-height: clamp(220px, 19vw, 270px);
  padding: clamp(22px, 2vw, 30px);
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 22px 48px rgba(0, 0, 0, .5), 0 4px 10px rgba(0, 0, 0, .35);
  transform: rotate(var(--sheet-tilt));
  transition: transform .25s ease, box-shadow .25s ease;
}
/* Paper grain (existing asset) above the surface, below the text. */
.notes-layout-sheets .notes-triptych .note-slab::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("/assets/sand-grain-alpha.png") repeat;
  background-size: 128px;
  opacity: .12;
  pointer-events: none;
}
.notes-layout-sheets .note-slab-id { grid-column: 1; grid-row: 1; }
.notes-layout-sheets .note-slab-title { grid-column: 1 / -1; grid-row: 2; align-self: start; font-size: clamp(1.3rem, 1.75vw, 1.7rem); font-weight: 400; line-height: 1.14; letter-spacing: -.03em; }
.notes-layout-sheets .note-slab-meta { grid-column: 1; grid-row: 3; align-self: end; }
.notes-layout-sheets .note-slab-arrow { grid-column: 2; grid-row: 3; align-self: end; }

/* Materials: warm off-white (sand), silver-gray (glass), charcoal (dark). */
.notes-layout-sheets .notes-triptych .note-slab--sand { background: #ebe5d8; color: #1d1d1b; }
.notes-layout-sheets .notes-triptych .note-slab--glass { background: #c4c8cc; color: #18191a; }
.notes-layout-sheets .notes-triptych .note-slab--dark { background: #222426; color: var(--nk2-cream); }
.notes-layout-sheets :is(.note-slab--sand, .note-slab--glass) :is(.note-slab-id, .note-slab-meta) { color: rgba(24, 24, 22, .66); }
.notes-layout-sheets :is(.note-slab--sand, .note-slab--glass) .note-slab-arrow { color: rgba(24, 24, 22, .7); }
.notes-layout-sheets .note-slab--dark::after { opacity: .06; }

/* Placement: neighbours overlap only by their empty padding (≤ 18px). */
.notes-layout-sheets .notes-triptych .note-pos--a { grid-column: 1 / 5;  grid-row: 1; --sheet-tilt: -1.2deg; margin-right: -18px; z-index: 1; }
.notes-layout-sheets .notes-triptych .note-pos--b { grid-column: 5 / 9;  grid-row: 1; --sheet-tilt: .8deg;  margin-top: 64px; z-index: 2; }
.notes-layout-sheets .notes-triptych .note-pos--c { grid-column: 9 / 13; grid-row: 1; --sheet-tilt: -.5deg; margin-top: 18px; margin-left: -18px; z-index: 3; }
.notes-layout-sheets .notes-triptych .note-pos--d { grid-column: 2 / 7;  grid-row: 2; --sheet-tilt: .6deg;  margin-top: -14px; margin-right: 24px; z-index: 4; }
.notes-layout-sheets .notes-triptych .note-pos--e { grid-column: 7 / 12; grid-row: 2; --sheet-tilt: -.9deg; margin-top: 30px; margin-left: -12px; z-index: 5; }

/* Hover / focus: the sheet comes forward (transform only — no layout shift). */
.notes-layout-sheets .notes-triptych .note-slab:hover,
.notes-layout-sheets .notes-triptych .note-slab:focus-visible {
  z-index: 10;
  transform: rotate(0deg) translateY(-6px) scale(1.015);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 34px 70px rgba(0, 0, 0, .6), 0 6px 14px rgba(0, 0, 0, .4);
}

@media (max-width: 960px) {
  .notes-layout-sheets .notes-triptych {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .notes-layout-sheets .notes-triptych .note-slab {
    --sheet-tilt: 0deg;
    min-height: 0;
    margin: 0;
  }
}

/* ==========================================================================
   C — Observation index: full-width rows, systematic rhythm
   ========================================================================== */
.notes-layout-index .notes-triptych {
  display: block;
  border-bottom: 1px solid var(--nk2-line);
}

.notes-layout-index .notes-triptych .note-slab {
  display: grid;
  grid-template-columns: clamp(96px, 10vw, 150px) minmax(0, 1fr) clamp(140px, 16vw, 230px) 32px;
  align-items: baseline;
  gap: 8px clamp(16px, 2.4vw, 36px);
  padding: clamp(22px, 2.4vw, 34px) clamp(4px, 1vw, 12px);
  border-top: 1px solid var(--nk2-line);
  transition: background-color .2s ease;
}
.notes-layout-index .note-slab-id { grid-column: 1; grid-row: 1; }
.notes-layout-index .note-slab-title {
  grid-column: 2; grid-row: 1;
  font-size: clamp(1.45rem, 2.5vw, 2.3rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.notes-layout-index .note-slab-meta { grid-column: 3; grid-row: 1; }
.notes-layout-index .note-slab-arrow { grid-column: 4; grid-row: 1; justify-self: end; font-size: 1.2rem; }

.notes-layout-index .notes-triptych .note-slab:hover,
.notes-layout-index .notes-triptych .note-slab:focus-visible { background-color: rgba(218, 224, 230, .045); }
.notes-layout-index .notes-triptych .note-slab:focus-visible { outline-offset: -2px; }

@media (max-width: 680px) {
  .notes-layout-index .notes-triptych .note-slab {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
    padding: 22px 0;
  }
  .notes-layout-index .note-slab-id { grid-column: 1; grid-row: 1; }
  .notes-layout-index .note-slab-meta { grid-column: 1; grid-row: 3; }
  .notes-layout-index .note-slab-title { grid-column: 1 / -1; grid-row: 2; font-size: clamp(1.35rem, 6.4vw, 1.7rem); }
  .notes-layout-index .note-slab-arrow { grid-column: 2; grid-row: 3; }
}

@media (prefers-reduced-motion: reduce) {
  body.notes-preview .note-slab,
  body.notes-preview .note-slab-arrow { transition: none; }
  .notes-layout-sheets .notes-triptych .note-slab:hover,
  .notes-layout-sheets .notes-triptych .note-slab:focus-visible { transform: rotate(0deg); }
  body.notes-preview .note-slab:hover .note-slab-arrow,
  body.notes-preview .note-slab:focus-visible .note-slab-arrow { transform: none; }
}

/* ==========================================================================
   D — Editorial index (?notes-layout=editorial-index)
   An opening story followed by a typeset archive. One hanging margin column
   (number / category) runs through the whole page and ties the featured note
   to the rows below. The list is shown newest-first (content.js reverses the
   DOM order for this layout only, so tab order = visual order); the first
   item — the latest note — is the featured one. Nothing is tied to a title.
   ========================================================================== */
.notes-layout-editorial-index .notes-triptych {
  --ei-margin: clamp(150px, 19vw, 280px);       /* hanging metadata column */
  --ei-title: minmax(0, 44rem);
  --ei-meta: minmax(120px, 1fr);
  --ei-arrow: 40px;
  display: block;
  border-bottom: 1px solid var(--nk2-line);
}

.notes-layout-editorial-index .notes-triptych .note-slab {
  display: grid;
  grid-template-columns: var(--ei-margin) var(--ei-title) var(--ei-meta) var(--ei-arrow);
  align-items: baseline;
  column-gap: clamp(16px, 2.2vw, 32px);
  row-gap: 8px;
  padding: clamp(20px, 2vw, 28px) 0;
  border-top: 1px solid var(--nk2-line);
  transition: border-color .2s ease;
}
.notes-layout-editorial-index .note-slab-id { grid-column: 1; grid-row: 1; }
.notes-layout-editorial-index .note-slab-title {
  grid-column: 2; grid-row: 1;
  font-size: clamp(1.3rem, 1.95vw, 1.75rem);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -.028em;
  transition: color .2s ease;
}
.notes-layout-editorial-index .note-slab-meta { grid-column: 3; grid-row: 1; }
.notes-layout-editorial-index .note-slab-arrow {
  grid-column: 4; grid-row: 1;
  justify-self: end;
  opacity: .55;
  transition: opacity .2s ease, transform .2s ease;
}

/* Opening story: same columns, more air, larger type, a stronger rule.
   Number and category hang in the margin column; the title spans wide. */
.notes-layout-editorial-index .notes-triptych .note-slab:first-child {
  grid-template-rows: auto auto;
  align-items: start;
  row-gap: 14px;
  padding: clamp(36px, 4vw, 60px) 0 clamp(44px, 5vw, 76px);
  border-top-color: rgba(218, 224, 230, .34);
}
.notes-layout-editorial-index .note-slab:first-child .note-slab-id { grid-row: 1; padding-top: .9em; }
.notes-layout-editorial-index .note-slab:first-child .note-slab-meta { grid-column: 1; grid-row: 2; }
.notes-layout-editorial-index .note-slab:first-child .note-slab-title {
  grid-column: 2 / 4;
  grid-row: 1 / 3;
  max-width: 15ch;
  font-size: clamp(2.5rem, 5.4vw, 5rem);
  font-weight: 300;
  line-height: .98;
  letter-spacing: -.05em;
}
.notes-layout-editorial-index .note-slab:first-child .note-slab-arrow {
  grid-row: 1 / 3;
  align-self: end;
  font-size: 1.4rem;
}

/* Hover / focus: silver emphasis only — rule, title and arrow. No lift. */
.notes-layout-editorial-index .notes-triptych .note-slab:hover,
.notes-layout-editorial-index .notes-triptych .note-slab:focus-visible { border-top-color: rgba(218, 224, 230, .5); }
.notes-layout-editorial-index .note-slab:hover .note-slab-title,
.notes-layout-editorial-index .note-slab:focus-visible .note-slab-title { color: #e4e7ea; }
.notes-layout-editorial-index .note-slab:hover .note-slab-arrow,
.notes-layout-editorial-index .note-slab:focus-visible .note-slab-arrow { opacity: 1; }

/* Tablet: category drops under the title, columns stay aligned. */
@media (max-width: 960px) {
  .notes-layout-editorial-index .notes-triptych { --ei-margin: clamp(110px, 17vw, 150px); }
  .notes-layout-editorial-index .notes-triptych .note-slab {
    grid-template-columns: var(--ei-margin) minmax(0, 1fr) var(--ei-arrow);
  }
  .notes-layout-editorial-index .note-slab-meta { grid-column: 2; grid-row: 2; }
  .notes-layout-editorial-index .note-slab-arrow { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .notes-layout-editorial-index .note-slab:first-child .note-slab-title { grid-column: 2; grid-row: 1 / 3; }
  .notes-layout-editorial-index .note-slab:first-child .note-slab-arrow { grid-column: 3; }
}

/* Mobile: one editorial column — number above, title, category below. */
@media (max-width: 680px) {
  .notes-layout-editorial-index .notes-triptych .note-slab,
  .notes-layout-editorial-index .notes-triptych .note-slab:first-child {
    grid-template-columns: minmax(0, 1fr) var(--ei-arrow);
    grid-template-rows: auto auto auto;
    row-gap: 10px;
  }
  .notes-layout-editorial-index .notes-triptych .note-slab .note-slab-id { grid-column: 1; grid-row: 1; padding-top: 0; }
  .notes-layout-editorial-index .notes-triptych .note-slab .note-slab-title { grid-column: 1 / -1; grid-row: 2; }
  .notes-layout-editorial-index .notes-triptych .note-slab .note-slab-meta { grid-column: 1; grid-row: 3; }
  .notes-layout-editorial-index .notes-triptych .note-slab .note-slab-arrow { grid-column: 2; grid-row: 3; align-self: center; }
  .notes-layout-editorial-index .notes-triptych .note-slab:first-child .note-slab-title { font-size: clamp(2.1rem, 10vw, 2.6rem); }
  .notes-layout-editorial-index .notes-triptych .note-slab:first-child { padding: 28px 0 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .notes-layout-editorial-index .notes-triptych .note-slab,
  .notes-layout-editorial-index .note-slab-title,
  .notes-layout-editorial-index .note-slab-arrow { transition: none; }
}
