﻿/* ==========================================================================
   The Land Ledger (house.html) — a trifold paper insert taped into the book,
   same mechanism as the C&C guest list: folded it shows the essentials, each
   unfold swings a real 3D flap open to reveal more columns. Plus sort/filter.
   ========================================================================== */

/* ---- the paper insert ---------------------------------------------------- */

.lf-paper {
  --pp: #f1e7cc;                 /* ledger stock: a shade warmer than cc's */
  --pp-crease: rgba(84, 62, 28, 0.38);
  position: relative;
  display: inline-block;
  vertical-align: top;
  background:
    radial-gradient(ellipse 260px 130px at 12% 3%, rgba(138, 90, 20, 0.05), transparent 60%),
    var(--pp);
  border: 1px solid rgba(80, 60, 30, 0.45);
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  margin: 4px 0 14px;
  max-width: none;
}
@media (prefers-color-scheme: dark) {
  .lf-paper { --pp: #e0d2ab; }
}

/* tape holding it into the journal */
.lf-tape {
  position: absolute;
  top: -9px;
  width: 52px; height: 16px;
  background: rgba(255, 252, 240, 0.5);
  border: 1px solid rgba(120, 100, 60, 0.25);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transform: rotate(-2deg);
  pointer-events: none;
  z-index: 6;
}
.lf-tape.l { left: 22px; }
.lf-tape.r { left: 330px; transform: rotate(1.5deg); }

.lf-clip {
  overflow-x: clip;
  overflow-y: visible;
  width: 444px;                  /* land.js applyFold() sets the real width */
  will-change: width;
}

/* ---- the ledger table (fixed layout so fold lines land between panels) --- */

table.land {
  width: 1200px;                 /* exact sum of LCOLS in land.js */
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #241c14;                /* ink on paper stock, both themes */
}
table.land th {
  font-family: var(--sans);
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6d5a3e;
  text-align: left;
  background: rgba(84, 62, 28, 0.08);
  border-bottom: 1px solid var(--pp-crease);
  padding: 5px 7px;
  white-space: nowrap;
  overflow: hidden;
}
table.land th.sort { cursor: pointer; user-select: none; }
table.land th.sort:hover { color: #9d4418; }
table.land th.sort::after { content: " ↕"; opacity: .45; }
table.land th.sorted-asc::after  { content: " ↑"; opacity: 1; }
table.land th.sorted-desc::after { content: " ↓"; opacity: 1; }
table.land td {
  padding: 4px 7px;
  border-top: 1px solid rgba(120, 95, 50, 0.22);
  vertical-align: top;
  overflow: hidden;
}
/* fold creases printed on the paper where the panels hinge */
table.land td.crease, table.land th.crease { border-left: 1px dashed var(--pp-crease); }
table.land tr.pick td { background: rgba(185, 138, 46, 0.16); }
table.land tr:hover td { background: rgba(185, 138, 46, 0.24); }
td.num { font-family: var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.loc a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
td.loc a:hover { color: #9d4418; }
td.note { font-size: 0.71rem; color: #574636; }
td.u { text-align: center; font-family: var(--sans); }

.grade {
  display: inline-block; font-family: var(--sans);
  font-size: 0.7rem; font-weight: 700;
  border-radius: 2px; padding: 1px 6px; white-space: nowrap;
}
.gA { background: #4d6b45; color: #f5efdf; }
.gB { color: #44603d; border: 1px solid #44603d; }
.gC { color: #8a6820; border: 1px solid #8a6820; }
.fl { font-family: var(--sans); font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.fl-low { color: #44603d; }
.fl-med { color: #8a6820; }
.fl-high { color: #9d3a24; }
.st {
  display: inline-block; font-family: var(--sans);
  font-size: 0.56rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; border-radius: 2px; padding: 1px 5px; white-space: nowrap;
}
.st-av { color: #44603d; border: 1px solid #44603d; }
.st-pend { color: #f5efdf; background: #8a6820; }
.st-sold { color: #f5efdf; background: #9d3a24; }

/* ---- unfold edge + swinging flap (ported from the C&C trifold) ----------- */

.lf-unfoldedge {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 22px;
  border: none;
  border-left: 1px dashed var(--pp-crease);
  background: linear-gradient(90deg, rgba(60, 40, 10, 0.1), rgba(60, 40, 10, 0.02) 60%);
  color: #6d5a3e;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 5;
  padding: 0;
}
.lf-unfoldedge:hover { color: #9d4418; background: linear-gradient(90deg, rgba(138, 90, 20, 0.16), rgba(138, 90, 20, 0.03) 60%); }

.lf-flap {
  position: absolute;
  top: 0;
  z-index: 30;
  transform-origin: left center;
  transform-style: preserve-3d;
  pointer-events: none;
  will-change: transform;
}
.lf-flap-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--pp, #f1e7cc);
  border: 1px solid rgba(80, 60, 30, 0.4);
  box-shadow: -10px 2px 20px rgba(0, 0, 0, 0.22);
}
.lf-flap-front::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 22px;
  background: linear-gradient(90deg, rgba(54, 34, 8, 0.15), transparent);
  pointer-events: none;
}
.lf-flap-back {
  transform: rotateY(180deg);
  background:
    linear-gradient(90deg, rgba(54, 34, 8, 0.14), transparent 24px),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(120, 95, 50, 0.08) 30px 31px),
    #f1e7cc;
}
.lf-flap-print {
  position: absolute;
  top: 0;
  width: 1200px;
  overflow: visible;
  pointer-events: none;
}
.lf-flap.opening { transform: rotateY(-179deg); }
.lf-flap.opening.go {
  transform: rotateY(0deg);
  transition: transform 640ms cubic-bezier(.22, .72, .18, 1);
}
.lf-flap.closing { transform: rotateY(0deg); }
.lf-flap.closing.go {
  transform: rotateY(-179deg);
  transition: transform 640ms cubic-bezier(.55, .04, .72, .32);
}
@media (prefers-reduced-motion: reduce) {
  .lf-flap { display: none; }
  .lf-clip { transition: none !important; }
}

/* ---- filter bar + fold controls (on the page, not the paper) ------------- */

.lf-filters {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  font-family: var(--sans); font-size: 0.78rem;
  margin: 0 0 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  padding: 9px 14px;
  max-width: 860px;
}
.lf-filters b {
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
}
.lf-filters label {
  display: inline-flex; gap: 5px; align-items: center; margin: 0; cursor: pointer;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 400;
  text-transform: none; letter-spacing: 0; color: var(--ink);
}
.lf-filters input { cursor: pointer; }
.lf-filters .lf-count { color: var(--ink-3); font-size: 0.72rem; margin-left: auto; }

.lf-foldctl { display: inline-flex; align-items: center; gap: 8px; }
.lf-foldctl b {
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
}
.lf-foldctl button {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  color: var(--ink-2); background: var(--panel);
  border: 1px solid rgba(80, 60, 30, 0.4); border-radius: 2px;
  padding: 4px 11px; cursor: pointer;
}
.lf-foldctl button:hover:not(:disabled) { color: #bf5a25; border-color: #bf5a25; }
.lf-foldctl button:disabled { opacity: 0.4; cursor: default; }
.lf-foldctl .lf-foldlbl { font-size: 0.72rem; color: var(--ink-3); font-style: italic; }

/* the insert may hang past the page edge when fully open, like a real map */
.lf-host { position: relative; overflow: visible; }


/* fine-print note rows: full-width under each entry, wrap freely, and only
   surface when the sheet is fully unfolded */
.lf-noterow td {
  border-top: 0;
  padding: 0 10px 6px 62px;
  font-size: 0.71rem;
  font-style: italic;
  color: #574636;
}
.lf-noterow[data-pick] td { background: rgba(185, 138, 46, 0.16); }
.lf-clip:not([data-fold="2"]) .lf-noterow { display: none !important; }

/* the to-the-dream cost line inside each entry's fine print */
.lf-cost {
  display: block;
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.66rem;
  color: #44603d;
  margin-top: 1px;
}