/* Facts ledger (Fantastic Frank kit).
   A 12px ledger: a label column ("Facts") and key/value rows in a sub-grid, groups split by hairline rules at 10%
   ink, and a "Shortcuts" group whose rows are buttons with a thin chevron in the value column (hover = underline).
   Desktop (>=1024px): the ledger is a 5-column grid (label 1 col, rows 4 cols: key 2 / value 2, 4px gaps).
   Phone: a 12-column grid (label 3 / rows 9: key 2 / value 3 of 5, 16px gaps), chevrons pushed to the right edge.
   Placed in a taller row (beside floorplan-column) the ledger's own rows stretch, so the groups spread down to the
   plans' height and both columns end together (CSS grid's default align-content; --fl-align: start packs them). */

.fl {
  --fl-size: 12px;                   /* every line in the ledger */
  --fl-leading: 1.15;
  --fl-ink: #23221e;
  --fl-rule: rgb(35 34 30 / .1);     /* group rules: charcoal at 10% */
  --fl-row-gap: 8px;                 /* space under each row (mb-2) */
  --fl-gap: 4px;                     /* desktop grid gaps (gap-1) */
  --fl-gap-phone: 16px;              /* phone grid gaps (gap-4) */
  --fl-rule-above: 16px;
  --fl-rule-below: 24px;
  --fl-align: normal;                /* normal = stretch rows to the row height beside; start = pack to the top */
  --fl-sans: "Messina Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--fl-gap-phone);
  align-content: var(--fl-align);
  color: var(--fl-ink);
  font: 400 var(--fl-size)/var(--fl-leading) var(--fl-sans);
  letter-spacing: -.015rem;
}
.fl__label {
  grid-column: span 3;
  margin: 0 0 var(--fl-row-gap);
  font: inherit;
  letter-spacing: inherit;
}
.fl__rows { grid-column: span 9; margin: 0; padding: 0; }
.fl__row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--fl-gap-phone);
  margin: 0 0 var(--fl-row-gap);
}
.fl__row > :first-child { grid-column: span 2; }
.fl__row > :last-child { grid-column: span 3; }
.fl__row dt, .fl__row dd { margin: 0; }
.fl__rule {
  grid-column: 1 / -1;
  height: 0;
  margin: var(--fl-rule-above) 0 var(--fl-rule-below);
  border: 0;
  border-top: 1px solid var(--fl-rule);
}

/* shortcut rows: the whole row is the button */
.fl__go {
  box-sizing: border-box;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.fl__chev { display: block; place-self: end; line-height: 0; }
.fl__chev svg { display: block; width: 16px; height: 16px; }
@media (hover: hover) { .fl__go:hover { text-decoration: underline; } }

@media (min-width: 1024px) {
  .fl { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--fl-gap); }
  .fl__label { grid-column: span 1; }
  .fl__rows { grid-column: span 4; }
  .fl__row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--fl-gap); }
  .fl__row > :last-child { grid-column: span 2; }
  .fl__chev { place-self: start; }
}

/* Row icons (optional, any mode; render() row ['Size', '120 m²', 'area'] or <span class="fl__icon" data-fl-icon>):
   a 20px line icon before the key, 10px gap, at 60% (Casa Momo's Feature List: 20px icon box, key text 30px in). */
.fl__icon {
  display: inline-flex;
  flex: none;
  width: var(--fl-icon-size, 20px);
  height: var(--fl-icon-size, 20px);
  margin-right: var(--fl-icon-gap, 10px);
  vertical-align: middle;
  color: var(--fl-ink);
  opacity: var(--fl-icon-opacity, .6);
}
.fl__icon svg { display: block; width: 100%; height: 100%; }

/* Draw mode, data-fl-mode="draw" on the ledger (casamomo.at apartment page 'Feature List', override Rt, teardown 11-23):
   every row is a line of its own, 12px above and below, with a 1px rule (ink at 10%) along its bottom edge; key
   (icon + text) left at 60%, value flush right at full ink; 18px / 1.2 type (15px under 810px). When 15% of the
   ledger is on screen, once (part.js adds .is-drawn), each rule grows scaleX 0 -> 1 from the left over 1.2s
   cubic-bezier(.3,0,0,1), .1s after the row above, and each icon fades 0 -> .6 over 1s cubic-bezier(.37,0,.63,1)
   from .2s + .1s x its order. Measured on the clone: 1440 rows 45.6px apart (21.6 + 12 + 12; the first row 33.6,
   no top padding), list 666px wide at x 726, key at +30px, label 'Features' 18px at 60% beside the list; 390 rows
   44px apart (20px icon box sets the height), 15px / 18px type, label above the list (list 40px below its top).
   Group rules turn invisible (each row already has one); phones (< 1024px) put the label above the rows. */
.fl[data-fl-mode="draw"] {
  --fl-size: 18px;
  --fl-leading: 1.2;
  --fl-draw-pad: 12px;                         /* row padding above + below (first row of a group: below only) */
  --fl-key-mix: 60%;                           /* key text strength (Casa: its text box at opacity .6) */
  --fl-draw-dur: 1.2s;                         /* each rule */
  --fl-draw-ease: cubic-bezier(.3, 0, 0, 1);
  --fl-draw-step: .1s;                         /* between rows (rules and icons) */
  --fl-icon-dur: 1s;
  --fl-icon-ease: cubic-bezier(.37, 0, .63, 1);
  --fl-icon-delay: .2s;                        /* icons start this long after their row's rule */
  letter-spacing: -.01em;
}
@media (max-width: 809.98px) { .fl[data-fl-mode="draw"] { --fl-size: 15px; } }
.fl[data-fl-mode="draw"] .fl__label { color: color-mix(in srgb, var(--fl-ink) var(--fl-key-mix), transparent); }
.fl[data-fl-mode="draw"] .fl__row {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 24px;
  align-items: center;
  margin: 0;
  padding: var(--fl-draw-pad) 0;
}
.fl[data-fl-mode="draw"] .fl__rows > .fl__row:first-child { padding-top: 0; }
.fl[data-fl-mode="draw"] .fl__row > :first-child,
.fl[data-fl-mode="draw"] .fl__row > :last-child { grid-column: auto; }
.fl[data-fl-mode="draw"] .fl__row > dt { display: flex; align-items: center; color: color-mix(in srgb, var(--fl-ink) var(--fl-key-mix), transparent); }
.fl[data-fl-mode="draw"] .fl__row > dd { text-align: right; }
.fl[data-fl-mode="draw"] .fl__chev { place-self: center end; }
.fl[data-fl-mode="draw"] .fl__rule { border-top-color: transparent; }
.fl[data-fl-mode="draw"] .fl__row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--fl-rule);
  transform-origin: 0 50%;
  pointer-events: none;
}
.fl[data-fl-mode="draw"].fl-draw-armed:not(.is-drawn) .fl__row::after { transform: scaleX(0); }
.fl[data-fl-mode="draw"].fl-draw-armed:not(.is-drawn) .fl__icon { opacity: 0; }
.fl[data-fl-mode="draw"].is-drawn .fl__row::after {
  transition: transform var(--fl-draw-dur) var(--fl-draw-ease) calc(var(--fl-i, 0) * var(--fl-draw-step));
}
.fl[data-fl-mode="draw"].is-drawn .fl__icon {
  transition: opacity var(--fl-icon-dur) var(--fl-icon-ease) calc(var(--fl-ii, 0) * var(--fl-draw-step) + var(--fl-icon-delay));
}
@media (prefers-reduced-motion: reduce) {
  .fl[data-fl-mode="draw"].is-drawn .fl__row::after, .fl[data-fl-mode="draw"].is-drawn .fl__icon { transition: none; }
}
@media (max-width: 1023.98px) {
  .fl[data-fl-mode="draw"] .fl__label, .fl[data-fl-mode="draw"] .fl__rows { grid-column: 1 / -1; }
  .fl[data-fl-mode="draw"] .fl__label { margin-bottom: 4px; }    /* + the 16px grid gap: 20px, as on the clone */
}

/* Tiles mode, data-fl-mode="tiles" on the ledger (Mejuma's property facts, mejuma-tuscany.com detail page, teardown
   11-23): every fact is a tile - its key as a small Golos label over its value in the display serif - in a 4-column
   grid (gap 1.5rem; 2 columns under 768px; 1 under 480px with a 1.25rem gap) on a tinted panel (padding 2rem;
   1.5rem under 992px; 1.25rem under 768px). Tile: sand-300 ground, padding 1.5rem (1rem under 480px), .5rem
   between label and value; label 1.125rem / 1.2 (1rem under 768px), value 1.5rem / 1 (2rem under 480px). Measured
   on the clone: tiles 302 x 102 at 1440 (1280px grid), 318 x 91 at 390. The group label is kept for screen readers
   only (data-fl-label="show" shows it above the tiles); group rules go (the gap separates groups).
   Rise (part.js, once): when the panel's top passes 80% of the window (data-fl-rise-at), the tiles come up 2em and
   fade in, .8s power4.inOut (quintic in-out), .1s apart, in reading order. data-fl-rise="block" moves them as one
   (the source's own granularity: its reveal group is the panel's children, the whole grid then the text below);
   data-fl-rise="off" shows them at once. Shortcut rows become tiles with the chevron at the right. */
.fl[data-fl-mode="tiles"] {
  --fl-ink: #38352c;                          /* green-950 */
  --fl-panel: #e8e4e1;                        /* sand-100: the panel */
  --fl-tile: #c5beb4;                         /* sand-300: each tile */
  --fl-panel-pad: 2rem;
  --fl-tile-cols: 4;
  --fl-tile-gap: 1.5rem;
  --fl-tile-pad: 1.5rem;
  --fl-tile-inner: .5rem;                     /* label to value */
  --fl-tile-label: 1.125rem;
  --fl-tile-value: 1.5rem;
  --fl-tile-sans: "Golos Text", Arial, sans-serif;
  --fl-tile-serif: "MADE Mirage", Georgia, serif;
  --fl-rise-y: 2em;
  --fl-rise-dur: .8s;
  --fl-rise-ease: cubic-bezier(.84, 0, .16, 1);   /* power4.inOut within 3%; the exact curve via linear() below */
  --fl-rise-step: .1s;
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--fl-tile-gap);
  padding: var(--fl-panel-pad);
  background: var(--fl-panel);
  font: 400 1rem/1.5 var(--fl-tile-sans);
  letter-spacing: normal;
}
@supports (transition-timing-function: linear(0, 1)) {
  .fl[data-fl-mode="tiles"] {
    --fl-rise-ease: linear(0, 0, 0, 0, 0.0002, 0.0005, 0.0012, 0.0026, 0.0051, 0.0092, 0.0156, 0.0252, 0.0389, 0.058, 0.084, 0.1187, 0.1638, 0.2219, 0.2952, 0.3869, 0.5, 0.6131, 0.7048, 0.7781, 0.8362, 0.8813, 0.916, 0.942, 0.9611, 0.9748, 0.9844, 0.9908, 0.9949, 0.9974, 0.9988, 0.9995, 0.9998, 1, 1, 1, 1);
  }
}
.fl[data-fl-mode="tiles"] .fl__label,
.fl[data-fl-mode="tiles"] .fl__rows { grid-column: 1 / -1; }
.fl[data-fl-mode="tiles"] .fl__label { margin: 0; font: 400 var(--fl-tile-label)/1.2 var(--fl-tile-sans); }
.fl[data-fl-mode="tiles"]:not([data-fl-label="show"]) .fl__label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.fl[data-fl-mode="tiles"] .fl__rule { display: none; }
.fl[data-fl-mode="tiles"] .fl__rows {
  display: grid;
  grid-template-columns: repeat(var(--fl-tile-cols), minmax(0, 1fr));
  gap: var(--fl-tile-gap);
}
.fl[data-fl-mode="tiles"] .fl__row {
  display: flex;
  flex-direction: column;
  gap: var(--fl-tile-inner);
  margin: 0;
  padding: var(--fl-tile-pad);
  background: var(--fl-tile);
}
.fl[data-fl-mode="tiles"] .fl__row > dt { font: 400 var(--fl-tile-label)/1.2 var(--fl-tile-sans); }
.fl[data-fl-mode="tiles"] .fl__row > dd { font: 400 var(--fl-tile-value)/1 var(--fl-tile-serif); }
.fl[data-fl-mode="tiles"] .fl__go {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  font: 400 var(--fl-tile-label)/1.2 var(--fl-tile-sans);
}
.fl[data-fl-mode="tiles"] .fl__go .fl__chev { place-self: auto; }
.fl[data-fl-mode="tiles"].fl-rise-armed:not(.is-risen) .fl__row { opacity: 0; transform: translateY(var(--fl-rise-y)); }
.fl[data-fl-mode="tiles"].is-risen .fl__row {
  transition: opacity var(--fl-rise-dur) var(--fl-rise-ease) calc(var(--fl-ti, 0) * var(--fl-rise-step)),
              transform var(--fl-rise-dur) var(--fl-rise-ease) calc(var(--fl-ti, 0) * var(--fl-rise-step));
}
@media (prefers-reduced-motion: reduce) {
  .fl[data-fl-mode="tiles"].fl-rise-armed:not(.is-risen) .fl__row { opacity: 1; transform: none; }
  .fl[data-fl-mode="tiles"].is-risen .fl__row { transition: none; }
}
@media (max-width: 991.98px) { .fl[data-fl-mode="tiles"] { --fl-panel-pad: 1.5rem; } }
@media (max-width: 767.98px) { .fl[data-fl-mode="tiles"] { --fl-panel-pad: 1.25rem; --fl-tile-cols: 2; --fl-tile-label: 1rem; } }
@media (max-width: 479.98px) { .fl[data-fl-mode="tiles"] { --fl-tile-cols: 1; --fl-tile-gap: 1.25rem; --fl-tile-pad: 1rem; --fl-tile-value: 2rem; } }
