/* Furniture service pages: /custom-furniture, /dining-tables, /beds-bedroom-furniture.
   Tokens only (spec 4.1); body 17px and up, captions 15px, nothing lighter than --ink-3. */

/* Photo cards for "How it's built": photo on top, heading and body below. */
.fcard { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--c-rule); border-radius: var(--r-card); background: var(--c-card); }
.fcard picture { flex: none; }
.fcard__body { display: grid; align-content: start; gap: 8px; padding: 18px 20px 22px; }
.fcard__title { font: 700 20px/1.25 var(--font-ui); color: var(--c-head); }
.fcard__body p { font-size: 17px; line-height: 1.6; color: var(--c-text); }

/* Tablets: the cards turn into rows with the photo beside the text, so portrait photos don't
   stretch a 2 x 2 grid to two screens, and three cards don't leave a 2 + 1 orphan. */
@media (min-width: 640px) and (max-width: 1099.98px) {
  .fcards:not(.fcards--3) .fcard { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
  .fcards:not(.fcards--3) .fcard picture, .fcards:not(.fcards--3) .fcard img { height: 100%; }
  .fcards:not(.fcards--3) .fcard img.fit { aspect-ratio: auto; min-height: 100%; object-fit: cover; }
  .fcards:not(.fcards--3) .fcard__body { padding: 18px 20px; }
}
@media (min-width: 640px) and (max-width: 959.98px) {
  .fcards--3 { grid-template-columns: minmax(0, 1fr); }
  .fcards--3 .fcard { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); }
  .fcards--3 .fcard picture, .fcards--3 .fcard img { height: 100%; }
  .fcards--3 .fcard img.fit { object-fit: cover; }
  .fcards--3 .fcard__body { align-content: center; padding: 20px 24px; }
}

/* Phones: the photo sits beside the text so four cards don't stack four tall photos. */
@media (max-width: 639.98px) {
  .fcard { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); }
  .fcard picture, .fcard img { height: 100%; }
  .fcard img.fit { aspect-ratio: auto; min-height: 100%; object-fit: cover; }
  .fcard__body { padding: 14px 14px 16px; gap: 6px; }
  .fcard__title { font-size: 18px; }
}

.fcard__link { margin-top: 4px; font-size: 15px; }

/* Live edge: copy beside the two console photos, then a row of cited slab facts. */
.live { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.live .shead { margin-bottom: 20px; }
.live__intro { margin-top: 1em; margin-bottom: 12px; }
.live__media .gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.live__media .caption { margin-top: 12px; }
.live__actions { margin-top: 28px; align-items: center; }
@media (max-width: 899.98px) { .live { grid-template-columns: minmax(0, 1fr); } .live__media { max-width: 560px; } }

/* Cited facts: a big figure, what it means, and the source. Three columns on wide screens. */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 3vw, 44px); margin: clamp(32px, 4vw, 48px) 0 0; border-top: 1px solid var(--c-rule-2); }
.facts__row { display: grid; align-content: start; gap: 8px; padding: 18px 0 4px; }
.facts__v { font: 780 clamp(1.5rem, 1.2rem + .9vw, 2rem)/1.1 var(--font-display); font-stretch: 110%; letter-spacing: -.01em; color: var(--c-head); }
.facts__t { margin: 0; font-size: 17px; line-height: 1.55; color: var(--c-text); }
.facts__src { display: block; margin-top: 6px; font: 600 15px/1.4 var(--font-ui); color: var(--c-sec); }
@media (max-width: 899.98px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts__row { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 6px 18px; padding: 16px 0; border-bottom: 1px solid var(--c-rule); }
}
@media (max-width: 479.98px) { .facts__row { grid-template-columns: minmax(0, 1fr); } }

/* Dining tables: the planning questions and the Janka comparison. */
.asks { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: ask; }
.asks li { position: relative; padding: 14px 0 14px 48px; border-top: 1px solid var(--c-rule); counter-increment: ask; font-size: 17px; line-height: 1.6; color: var(--c-text); }
.asks li::before { content: counter(ask, decimal-leading-zero); position: absolute; left: 0; top: 14px; font: 700 15px/1.6 var(--font-ui); letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--c-accent); }
.asks strong { font-family: var(--font-ui); font-weight: 700; color: var(--c-head); }

.janka { margin: 0; padding: clamp(20px, 2.6vw, 32px); border: 1px solid var(--c-rule); border-radius: var(--r-card); background: var(--c-card); }
.janka__title { font: 700 20px/1.3 var(--font-ui); color: var(--c-head); }
.janka__sub { margin-top: 8px; font-size: 17px; line-height: 1.55; color: var(--c-text); }
.janka__list { display: grid; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.janka__row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 3.4rem; align-items: center; gap: 14px; }
.janka__name { font: 600 16px/1.3 var(--font-ui); color: var(--c-head); }
.janka__track { position: relative; height: 18px; border-left: 1px solid var(--c-rule-2); }
.janka__bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 0 4px 4px 0; background: var(--walnut); }
.janka__val { font: 700 16px/1.3 var(--font-ui); font-variant-numeric: tabular-nums; text-align: right; color: var(--c-head); }
.janka .caption { margin-top: 20px; }
@media (max-width: 479.98px) {
  .janka__row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .janka__track { grid-column: 1 / -1; grid-row: 2; }
}

/* Beds: the shop and home toggle beside the copy and two more nightstands. */
.nstand { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); grid-template-areas: "copy cmp" "more cmp"; grid-template-rows: auto 1fr; gap: 0 clamp(32px, 5vw, 72px); align-items: start; }
.nstand__copy { grid-area: copy; }
.nstand__compare { grid-area: cmp; width: 100%; max-width: 460px; justify-self: end; }
.nstand__others { grid-area: more; }
.nstand .shead { margin-bottom: 20px; }
.nstand__more { margin-top: 18px; }
.nstand__h { margin: 28px 0 14px; font: 700 20px/1.25 var(--font-ui); }
.nstand .gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; }
@media (max-width: 899.98px) {
  .nstand { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "cmp" "more"; grid-template-rows: auto; }
  .nstand__compare { max-width: 420px; justify-self: start; margin-top: 28px; }
}

/* Dining tables: the six planning questions beside the Janka chart. */
.plan { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 899.98px) { .plan { grid-template-columns: minmax(0, 1fr); } }
.live__copy p + p { margin-top: 1em; }
