/*
Theme Name: Invisible Wall
Theme URI: https://invisible-art-space.example
Author: Kath
Description: Home page pairs a sticky, self-scrolling Now/Next/Soon/Past column with a free-pan wall of image tiles linked to individual posts.
Version: 1.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: invisible-wall
*/

/* ---------- Tokens ---------- */
:root {
  --paper: #000000;
  --paper-dim: #0b0101;
  --ink: #ded2d2;
  --ink-alt: #eaeaea;
  --ink-soft: rgba(234, 234, 234, 0.62);
  --line: rgba(222, 210, 210, 0.18);
  --accent: #50904f;
  --accent-deep: #216b1e;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --col-width: 34%;
}

/* ---------- Reset-ish ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  height: 100%;
}
body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  overflow: hidden; /* the two panes scroll/pan independently */
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Shell ---------- */
.site-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ---------- Left column: Now / Next / Soon / Past ---------- */
.now-column {
  width: var(--col-width);
  min-width: 320px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 3.5rem 2.25rem 6rem;
  border-right: 1px solid var(--line);
  background: var(--paper);
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.now-column:hover {
  scrollbar-color: var(--line) transparent;
}
.now-column::-webkit-scrollbar { width: 6px; }
.now-column::-webkit-scrollbar-track { background: transparent; }
.now-column::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.now-column:hover::-webkit-scrollbar-thumb { background: var(--line); }

.site-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 3rem;
}
.site-title a { text-decoration: none; }
.site-title a:hover { color: var(--accent-deep); }

.now-column h2 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.9rem;
  letter-spacing: -0.01em;
  margin: 3.25rem 0 0.9rem;
  position: sticky;
  top: -3.5rem; /* labels stack visibly as you scroll past */
  background: var(--paper);
  padding-top: 0.15rem;
}
.now-column h2:first-of-type { margin-top: 0; }

.now-column p { margin: 0 0 1.1rem; color: var(--ink); }
.now-column figure { margin: 1.5rem 0; }
.now-column figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}
.now-column hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 3rem 0 0;
}

.empty-note {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.empty-note code {
  background: var(--paper-dim);
  padding: 0.1em 0.4em;
}

/* ---------- Right pane: the wall ---------- */
.wall {
  position: relative;
  width: 66%;
  height: 100vh;
  overflow: hidden;
  background: var(--paper-dim);
}
.wall--canvas { cursor: grab; touch-action: none; }
.wall--canvas.is-grabbing { cursor: grabbing; }

/* ---------- Grid mode: masonry columns, offset like a contact sheet ---------- */
.wall-grid-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.wall-grid {
  padding: 6.5rem 2rem 4rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.wall-grid.is-ready { opacity: 1; }
.wall-grid.is-masonry {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
}
.wall-grid-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.wall--grid .tile {
  position: relative;
  display: block;
  left: auto;
  top: auto;
  width: 100%;
  height: auto;
  margin: 0 0 2.75rem;
}
.wall--grid .tile--sm,
.wall--grid .tile--md,
.wall--grid .tile--lg {
  width: 100%;
  height: auto;
}
.wall--grid .tile img {
  position: static;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}
.wall--grid .tile-fallback {
  height: 220px;
}
.wall--grid .tile-label {
  position: static;
  margin-top: 0.7rem;
}
.wall--grid .tile:hover,
.wall--grid .tile:focus-visible {
  transform: none;
  box-shadow: none;
}
.wall--grid .tile:hover img,
.wall--grid .tile:focus-visible img {
  opacity: 0.88;
}

.wall-menu {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 1.75rem 2.25rem;
  background: linear-gradient(to bottom, var(--paper) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none; /* let drag-pan pass through the gradient area */
}
.wall-menu-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  pointer-events: auto; /* re-enable clicks on the actual menu items */
}
.wall-menu-list a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--ink);
}
.wall-menu-list a:hover { color: var(--accent); }

.wall-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  opacity: 0;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.6s ease;
}
.wall-hint.is-visible { opacity: 1; }

.wall-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1800px;
  height: 1200px;
  transform-origin: 0 0;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.wall-canvas.is-ready { opacity: 1; }

.tile {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: block;
  text-decoration: none;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  padding: 6px;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, z-index 0s;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.tile--sm { width: 160px; height: 200px; }
.tile--md { width: 230px; height: 290px; }
.tile--lg { width: 320px; height: 400px; }

.tile-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  font-family: var(--display);
  font-size: 1rem;
  color: var(--ink-soft);
  background: var(--paper-dim);
}

.tile-label {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -3.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}
.tile-label-lines {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
  min-width: 0; /* allow children to truncate inside a flex item */
}
.tile-label-line1,
.tile-label-line2,
.tile-label-line3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-label-line1 { color: var(--ink); }
.tile-label-line2 { color: var(--ink-soft); font-style: italic; }
.tile-label-line3 { color: var(--ink-soft); font-size: 0.65rem; letter-spacing: 0.04em; }

.tile:hover,
.tile:focus-visible {
  z-index: 5;
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px rgba(0, 0, 0, 0.6),
    0 0 32px rgba(80, 144, 79, 0.16);
  transform: scale(1.06);
}

/* ---------- Responsive: stack on small screens, drop the drag ---------- */
@media (max-width: 860px) {
  body { overflow: auto; }
  .site-shell { flex-direction: column; height: auto; }
  .now-column {
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 2.5rem 1.25rem 3rem;
  }
  .now-column h2 { position: static; }
  .wall {
    width: 100%;
    height: 70vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .wall-canvas { transition: none !important; }
}

/* ---------- Single post (minimal, extend as you like) ---------- */
.single-post {
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  padding-bottom: 6rem;
}
.single-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 2rem 1.5rem 0;
}
.single-post .back-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--ink-soft);
  margin: 0;
}
.single-post .back-link:hover { color: var(--accent); }

.post-menu-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-menu-list a {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--ink);
}
.post-menu-list a:hover { color: var(--accent); }

.single-post .hero-figure {
  margin: 2rem 0;
  width: 100%;
}
.single-post .hero-figure img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.single-post .entry-inner {
  max-width: 720px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
}
.single-post h1 {
  font-family: var(--display);
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 0 0 1.5rem;
}
