/*
  Home page, Direction B "Willow ledger". Redesign group "home" (2026-11-17, branch eli-redesign-home).
  Linked from home.html only. Every rule is scoped to .page-home and uses the --w- tokens from willo.css.
  Signed out: the green cover with logo B beside the four phrases.
  Signed in: the projects as ledger rows (project, type or owner, last updated, actions).
*/

/* ---------- Signed out: the cover ---------- */

/* main.html gives the signed-out home a bare <div>, not .content-wrapper. Let the cover fill the
   space between the header and the footer, so the green runs from the header to the footer. */
.page-home:not(.signed-in) .w-main { display: flex; flex-direction: column; }
.page-home:not(.signed-in) .w-main > div:last-child { flex: 1 0 auto; display: flex; flex-direction: column; }

.page-home .home-cover {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  background: var(--w-willow);
  color: var(--w-on-willow);
  border-top: 1px solid var(--w-willow-2);
  border-bottom: 1px solid var(--w-willow-2);
  padding: var(--w-s5) 0 var(--w-s6);
}
@media (min-width: 900px) {
  .page-home .home-cover { padding: var(--w-s6) 0 var(--w-s7); }
}

.page-home .home-cover__inner {
  flex: 1 1 auto;
  display: grid;
  gap: var(--w-s4);
  justify-items: start;
}
@media (min-width: 720px) {
  .page-home .home-cover__inner {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--w-s5);
  }
}

.page-home .home-cover__logo { display: block; border-radius: var(--w-radius); }
.page-home .home-cover__logo .w-crop { --size: 128px; }
@media (min-width: 720px) {
  .page-home .home-cover__logo .w-crop { --size: 176px; }
}

.page-home .home-cover__text { min-width: 0; }

/* The four phrases share one grid cell, so the heading keeps the width of the longest one and
   nothing moves when they change. */
.page-home .home-say {
  display: grid;
  margin: 0;
  font-family: var(--w-font-head);
  font-size: var(--w-t-xxl);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--w-on-willow);
}
.page-home .home-say__word {
  grid-area: 1 / 1;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.3em);
}
.page-home .home-say__word.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.5s ease-out 0.3s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}
.page-home .home-say__word.is-off {
  transform: translateY(-0.3em);
  transition: opacity 0.3s ease-in, transform 0.3s ease-in, visibility 0s linear 0.3s;
}

.page-home .home-cover__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--w-s2);
  margin-top: var(--w-s4);
}
.page-home .home-btn { min-height: 56px; padding: 0 var(--w-s5); font-size: var(--w-t-md); }
.page-home .home-btn--light,
.page-home .w-on-green .home-btn--light {
  background: var(--w-on-willow);
  border-color: var(--w-on-willow);
  color: var(--w-willow);
}
.page-home .w-on-green .home-btn--light:hover { background: var(--w-advantage); border-color: var(--w-advantage); color: var(--w-willow); }
@media (max-width: 599.98px) {
  .page-home .home-btn { padding: 0 var(--w-s4); font-size: var(--w-t-base); }
}

@media (prefers-reduced-motion: reduce) {
  .page-home .home-say__word,
  .page-home .home-say__word.is-on,
  .page-home .home-say__word.is-off { transition: none; transform: none; }
}

/* ---------- Signed in: greeting ---------- */

.page-home .home-greet {
  display: grid;
  gap: var(--w-s4);
  justify-items: start;
  padding: var(--w-s4) 0 var(--w-s5);
}
@media (min-width: 900px) {
  .page-home .home-greet {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: var(--w-s6);
    padding-top: var(--w-s5);
  }
}
.page-home .home-greet h1 { margin: 0; font-size: var(--w-t-xl); overflow-wrap: anywhere; }
.page-home .home-greet__lead {
  max-width: var(--w-measure);
  margin: var(--w-s2) 0 0;
  font-size: var(--w-t-md);
  color: var(--w-ink-2);
}
.page-home .home-greet__count {
  margin: var(--w-s3) 0 0;
  font-family: var(--w-font-head);
  font-size: var(--w-t-lg);
  font-weight: 600;
  line-height: 1.2;
  color: var(--w-willow);
}

/* ---------- Signed in: ledger rows ---------- */

.page-home .home-ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: var(--w-rule-strong);
  font-variant-numeric: tabular-nums lining-nums;
}
.page-home .home-ledger:not(:has(li)) { display: none; }

.page-home .home-row {
  display: grid;
  gap: var(--w-s1);
  padding: var(--w-s3) 0;
  border-bottom: var(--w-rule);
}

.page-home .home-row__project { display: flex; gap: var(--w-s3); align-items: flex-start; min-width: 0; }
.page-home .home-row__text { min-width: 0; }
.page-home .home-row__name {
  margin: 0;
  font-size: var(--w-t-md);
  overflow-wrap: anywhere;
}
.page-home .home-row__desc,
.page-home .home-row__type {
  margin: 2px 0 0;
  max-width: var(--w-measure);
  font-size: var(--w-t-sm);
  color: var(--w-ink-2);
  overflow-wrap: anywhere;
}
/* Long descriptions stay readable in the list; the whole text is on the project's own pages. */
.page-home .home-row__desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.page-home .home-row__desc:empty { display: none; }

/* Thumbnail fixed at 96x60 so rows keep one height. */
.page-home .home-thumb {
  flex: 0 0 96px;
  width: 96px;
  height: 60px;
  border: 1px solid var(--w-line);
  border-radius: 4px;
  background: var(--w-page);
  object-fit: contain;
}
.page-home .home-thumb--empty rect { fill: var(--w-field); }
.page-home .home-thumb--empty text {
  fill: var(--w-ink-2);
  font-family: var(--w-font-body);
  font-size: 11px;
}

.page-home .home-row__cell {
  margin: 0;
  font-size: var(--w-t-sm);
  overflow-wrap: anywhere;
}
.page-home .home-row__label { color: var(--w-ink-2); }

.page-home .home-row__acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--w-s1);
  margin-top: var(--w-s1);
}
.page-home .home-row__pdf { margin: 0 var(--w-s1) 0 0; }
.page-home .home-row__pdf .w-btn { white-space: nowrap; }
.page-home .home-row__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--w-tap);
  padding: 0 var(--w-s1);
  font-size: var(--w-t-sm);
  font-weight: 600;
}
/* Delete sits at the end of the row, apart from Edit and Invite; the rule before it is added from 720px up. */
.page-home .home-row__delete {
  margin-left: auto;
  color: var(--w-danger);
}
.page-home .home-row__delete:hover { color: var(--w-danger); background: var(--w-danger-bg); border-radius: var(--w-radius); }

.page-home .home-shared-head { padding: var(--w-s6) 0 var(--w-s3); }
.page-home .home-shared-head h2 { margin: 0; font-size: var(--w-t-lg); }
.page-home .home-shared-head p { margin: var(--w-s1) 0 0; color: var(--w-ink-2); }

/* Tablets and up: labels sit above their values, like column heads, and Delete gets its rule. */
@media (min-width: 720px) {
  .page-home .home-row { column-gap: var(--w-s4); }
  .page-home .home-row__cell { padding-top: 2px; }
  .page-home .home-row__label { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; }
  .page-home .home-row__acts { margin-top: 0; flex-wrap: nowrap; }
  .page-home .home-row__delete {
    padding-left: var(--w-s2);
    border-left: var(--w-rule);
    border-radius: 0;
  }
}

/* Tablets: the project on its own line, then the figures and the actions under it. */
@media (min-width: 720px) and (max-width: 1199.98px) {
  .page-home .home-row {
    grid-template-columns: 10.5rem minmax(0, 1fr) auto;
    align-items: center;
    row-gap: var(--w-s2);
  }
  .page-home .home-row__project { grid-column: 1 / -1; }
}

/* Wide screens: one ruled row per project, with columns lined up down the list. */
@media (min-width: 1200px) {
  .page-home .home-row {
    grid-template-columns: minmax(0, 1fr) 10.5rem 12.5rem 19.5rem;
    align-items: start;
  }
}
