/* ══════════════════════════════════════════════════════════════════════
   bento.css — the shared block-mosaic system
   ──────────────────────────────────────────────────────────────────────
   The idea: the page is divided by SHAPE, not by a row of identical cards.
   A bento is a 6-column grid; every tile declares how much of it it owns.
   Big tile + small tiles + one wide tile read as a composition; three equal
   cards read as a list. That difference is the whole point of this file.

   Colours, radius and shadow come only from the existing Vitalité tokens
   (gold-blue-theme / vitalite-skin). Nothing new is invented here.

   Usage
     <div class="bento">
       <a class="bt b-w4 b-tall"  href="…">…</a>   <- big block
       <a class="bt b-w2"         href="…">…</a>   <- small block
       <a class="bt b-w2"         href="…">…</a>
       <a class="bt b-w6"         href="…">…</a>   <- full-width band
     </div>

   Spans: b-w1…b-w6 (columns) · b-tall / b-tall3 (rows)
   Faces: (default) solid · bt--line outlined · bt--quiet tinted ·
          bt--ink accent-tinted · bt--photo image-filled
   ══════════════════════════════════════════════════════════════════════ */

/* ── the grid ─────────────────────────────────────────────────────────── */
.bento{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  grid-auto-rows:minmax(96px,auto);
  gap:16px;
  align-items:stretch;
}
/* A bento that sits inside a narrow column behaves the same, just smaller.
   position:relative lets any child host a corner .bt-tag. */
.bento > *{min-width:0;min-height:0;position:relative}

.b-w1{grid-column:span 1}
.b-w2{grid-column:span 2}
.b-w3{grid-column:span 3}
.b-w4{grid-column:span 4}
.b-w5{grid-column:span 5}
.b-w6{grid-column:span 6}
.b-tall{grid-row:span 2}
.b-tall3{grid-row:span 3}

/* ── the tile ─────────────────────────────────────────────────────────── */
.bt{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:24px;
  background:var(--surface,#fff);
  border:1px solid var(--border,#DDE7EE);
  border-radius:var(--radius,16px);
  color:inherit;
  text-decoration:none;
  overflow:hidden;
  transition:transform .18s cubic-bezier(.16,1,.3,1),
             box-shadow .18s cubic-bezier(.16,1,.3,1),
             border-color .18s ease;
}
a.bt{cursor:pointer}
.bt:hover,.bt:focus-visible{
  transform:translateY(-2px);
  box-shadow:var(--shadow,0 4px 14px rgba(10,24,40,.08));
  border-color:var(--border2,#CBD9E2);
}
.bt:focus-visible{outline:2px solid var(--accent2,#A9741E);outline-offset:2px}
/* Flat at rest, shadow only on hover — a mosaic is a plane, not a stack of
   floating cards. Shadow depth is what makes grids look like a template. */

/* ── faces ────────────────────────────────────────────────────────────── */
.bt--line{background:transparent;border-color:var(--border2,#CBD9E2)}
.bt--quiet{background:var(--surface2,#F1F6F9);border-color:var(--border,#DDE7EE)}
.bt--ink{
  background:var(--accent-bg,#FBF3E0);
  border-color:color-mix(in srgb,var(--accent,#B8860B) 34%,transparent);
}
.bt--photo{padding:0;min-height:200px;justify-content:flex-end}

/* ── parts ────────────────────────────────────────────────────────────── */
.bt-ico{
  display:inline-flex;align-items:center;justify-content:center;
  width:30px;height:30px;border-radius:var(--radius-sm,10px);
  background:var(--surface2,#F1F6F9);
  color:var(--accent,#B8860B);
  margin-bottom:2px;
}
.bt-ico svg{width:16px;height:16px;display:block}
.bt--ink .bt-ico,.bt--quiet .bt-ico{background:color-mix(in srgb,var(--accent,#B8860B) 12%,transparent)}

.bt-eyebrow{
  font-size:.68rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;
  color:var(--text3,#7C8FA3);
}
.bt-title{
  font-family:var(--font-heading,Georgia,serif);
  font-weight:600;line-height:1.22;
  font-size:1.06rem;
  color:var(--text,#0A1828);
}
.b-w4 .bt-title,.b-w5 .bt-title,.b-w6 .bt-title,.b-tall .bt-title{font-size:1.28rem}
.bt-body{
  font-size:.86rem;line-height:1.55;color:var(--text2,#3C4E62);
  margin-top:2px;
}
.bt-foot{margin-top:auto;padding-top:10px;display:flex;align-items:center;gap:8px}
.bt-go{
  font-size:.78rem;font-weight:700;color:var(--accent,#B8860B);
  display:inline-flex;align-items:center;gap:5px;
  transition:transform .18s cubic-bezier(.16,1,.3,1);
}
.bt:hover .bt-go{transform:translateX(3px)}
.bt-meta{font-size:.74rem;color:var(--text3,#7C8FA3)}

/* Category tag — the small coloured chip pinned to a tile's top-right corner.
   This is the signature of the reference dashboards: every block announces
   what KIND of thing it is. Colours come only from the existing semantic
   tokens (--accent gold / --green / --red / --amber), so no new palette. */
.bt-tag{
  position:absolute;top:14px;right:14px;z-index:2;
  font-size:.6rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;
  padding:.24rem .58rem;border-radius:99px;white-space:nowrap;
  background:color-mix(in srgb,var(--accent,#B8860B) 15%,var(--surface,#fff));
  color:var(--accent,#B8860B);
  border:1px solid color-mix(in srgb,var(--accent,#B8860B) 32%,transparent);
}
.bt-tag--green{
  background:color-mix(in srgb,var(--green,#2E7D5B) 15%,var(--surface,#fff));
  color:var(--green,#2E7D5B);
  border-color:color-mix(in srgb,var(--green,#2E7D5B) 34%,transparent);
}
.bt-tag--red{
  background:color-mix(in srgb,var(--red,#C05A74) 15%,var(--surface,#fff));
  color:var(--red,#C05A74);
  border-color:color-mix(in srgb,var(--red,#C05A74) 34%,transparent);
}
.bt-tag--amber{
  background:color-mix(in srgb,var(--amber,#B8860B) 15%,var(--surface,#fff));
  color:var(--amber,#B8860B);
  border-color:color-mix(in srgb,var(--amber,#B8860B) 34%,transparent);
}
/* a tile with a corner tag clears its text away from the chip */
.bt:has(> .bt-tag){padding-right:76px}
.bt--photo:has(> .bt-tag){padding-right:24px}

/* Big number tile — the block that gives a bento its weight. */
.bt-num{
  font-family:var(--font-heading,Georgia,serif);
  font-weight:700;line-height:.92;letter-spacing:-.02em;
  font-size:clamp(2.4rem,5vw,3.4rem);
  color:var(--accent,#B8860B);
}
.bt-num small{display:block;font-size:.72rem;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:var(--text3,#7C8FA3);margin-top:8px;font-family:var(--font-ui,system-ui,sans-serif)}

/* List tile */
.bt-list{list-style:none;margin:2px 0 0;padding:0;display:grid;gap:5px}
.bt-list li{
  font-size:.82rem;line-height:1.45;color:var(--text2,#3C4E62);
  padding-left:13px;position:relative;
}
.bt-list li::before{
  content:"";position:absolute;left:0;top:.58em;
  width:5px;height:5px;border-radius:50%;
  background:color-mix(in srgb,var(--accent,#B8860B) 55%,transparent);
}

/* ── photo tile ───────────────────────────────────────────────────────── */
.bt--photo .bt-img{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;display:block;
  filter:saturate(.78) contrast(1.02);
  transition:transform .4s cubic-bezier(.16,1,.3,1),filter .3s ease;
  z-index:0;
}
.bt--photo::after{
  content:"";position:absolute;inset:0;z-index:1;
  background:linear-gradient(to top,
    color-mix(in srgb,var(--text,#0A1828) 90%,transparent) 0%,
    color-mix(in srgb,var(--text,#0A1828) 62%,transparent) 40%,
    color-mix(in srgb,var(--text,#0A1828) 24%,transparent) 68%,
    transparent 100%);
  transition:opacity .3s ease;
}
.bt--photo:hover .bt-img{transform:scale(1.03);filter:saturate(.92)}
.bt--photo > .bt-cap{position:relative;z-index:2;display:flex;flex-direction:column;gap:5px;padding:20px 22px;color:#fff}
.bt--photo .bt-title{color:#fff}
.bt--photo .bt-body{color:color-mix(in srgb,#fff 78%,transparent)}
.bt--photo .bt-credit{
  position:absolute;z-index:2;right:12px;top:10px;
  font-size:.62rem;letter-spacing:.02em;color:color-mix(in srgb,#fff 62%,transparent);
}

/* ── responsive: the mosaic flattens, it never overflows ───────────────── */
@media(max-width:1080px){
  .bento{grid-template-columns:repeat(4,minmax(0,1fr))}
  .b-w5,.b-w6{grid-column:span 4}
  .b-w4{grid-column:span 4}
  .b-w3{grid-column:span 2}
}
@media(max-width:760px){
  .bento{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
  .b-w3,.b-w4,.b-w5,.b-w6{grid-column:span 2}
  .b-w1,.b-w2{grid-column:span 1}
  .b-tall,.b-tall3{grid-row:span 1}
  .bt{padding:20px}
  .bt--photo{min-height:170px}
}
@media(max-width:480px){
  .bento{grid-template-columns:1fr}
  .b-w1,.b-w2,.b-w3,.b-w4,.b-w5,.b-w6{grid-column:span 1}
  .bt{padding:16px}
}

/* ── motion & forced colours ──────────────────────────────────────────── */
@media(prefers-reduced-motion:reduce){
  .bt,.bt-go,.bt--photo .bt-img{transition:none}
  .bt:hover,.bt:focus-visible{transform:none}
  .bt--photo:hover .bt-img{transform:none}
}
@media(forced-colors:active){
  .bt{border:1px solid CanvasText}
  .bt--photo::after{display:none}
}

/* ══════════════════════════════════════════════════════════════════════
   Integration — home.html runs the journal skin (body.jr-home), which
   flattens the directory into dotted ruled lines and forces a 3-column
   grid, all with !important. When those cards are bento tiles (.bt) we
   restore the block surface and the 6-column mosaic, but leave the
   journal typography and colours alone (they are the page's own skin).
   ══════════════════════════════════════════════════════════════════════ */
body.jr-home .hmx-grid.bento{
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:16px!important;
  padding:0!important;
}
body.jr-home .hmx-grid.bento .hmx-card.bt{
  display:flex!important;flex-direction:column!important;gap:6px!important;
  align-items:stretch!important;
  background:var(--surface)!important;
  border:1px solid var(--border)!important;
  border-top:1px solid var(--border)!important;
  border-radius:var(--radius,16px)!important;
  box-shadow:none!important;
  padding:24px!important;
}
body.jr-home .hmx-grid.bento .hmx-card.bt:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow)!important;
  border-color:var(--border2)!important;
}
body.jr-home .hmx-grid.bento .hmx-card.bt:focus-visible{
  outline:2px solid var(--accent2,#A9741E)!important;outline-offset:2px;
}
body.jr-home .hmx-grid.bento .hmx-ico.bt-ico{
  grid-row:auto!important;
  display:inline-flex!important;align-items:center;justify-content:center;
  width:30px!important;height:30px!important;
  background:var(--surface2)!important;
  border:1px solid var(--border)!important;
  border-radius:var(--radius-sm,10px)!important;
  color:var(--accent)!important;
  align-self:flex-start;
}
body.jr-home .hmx-grid.bento .hmx-ico.bt-ico svg{width:16px!important;height:16px!important;display:block}
body.jr-home .hmx-grid.bento .hmx-name.bt-title{font-size:1.06rem!important;font-style:normal!important}
body.jr-home .hmx-grid.bento .hmx-card.bt.b-tall .hmx-name.bt-title,
body.jr-home .hmx-grid.bento .hmx-card.bt.b-w4 .hmx-name.bt-title,
body.jr-home .hmx-grid.bento .hmx-card.bt.b-w6 .hmx-name.bt-title{font-size:1.28rem!important}
body.jr-home .hmx-grid.bento .hmx-desc.bt-body{font-size:.86rem!important;font-style:normal!important;line-height:1.55!important}

@media(max-width:1080px){ body.jr-home .hmx-grid.bento{grid-template-columns:repeat(4,minmax(0,1fr))!important} }
@media(max-width:760px){ body.jr-home .hmx-grid.bento{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important} }
@media(max-width:480px){ body.jr-home .hmx-grid.bento{grid-template-columns:1fr!important} }

