/* ANC0 v47: final archive-card correction, loaded after all legacy CSS. */
@media (min-width:701px){
  body.archive #main #list .toc.grid,
  body.search #main #list .toc.grid,
  body.search-results #main #list .toc.grid{
    height:auto !important;
    min-height:0 !important;
    padding:10px !important;
  }

  body.archive #main #list .toc.grid > section,
  body.search #main #list .toc.grid > section,
  body.search-results #main #list .toc.grid > section{
    display:grid !important;
    grid-template-columns:150px minmax(0,1fr) !important;
    grid-auto-flow:row !important;
    grid-auto-rows:min-content !important;
    align-content:center !important;
    align-items:center !important;
    gap:4px 18px !important;
    height:auto !important;
    min-height:0 !important;
    padding:0 !important;
  }

  body.archive #main #list .toc.grid > section > figure.term,
  body.search #main #list .toc.grid > section > figure.term,
  body.search-results #main #list .toc.grid > section > figure.term{
    grid-column:1 !important;
    grid-row:1 / -1 !important;
    align-self:center !important;
    width:150px !important;
    min-width:150px !important;
    max-width:150px !important;
    height:150px !important;
    min-height:150px !important;
    max-height:150px !important;
  }

  body.archive #main #list .toc.grid > section > figure.term img,
  body.search #main #list .toc.grid > section > figure.term img,
  body.search-results #main #list .toc.grid > section > figure.term img{
    width:150px !important;
    min-width:150px !important;
    max-width:150px !important;
    height:150px !important;
    min-height:150px !important;
    max-height:150px !important;
    object-fit:cover !important;
  }

  body.archive #main #list .toc.grid .excerpt,
  body.search #main #list .toc.grid .excerpt,
  body.search-results #main #list .toc.grid .excerpt{
    display:block !important;
    overflow:hidden !important;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    height:3.1em !important;
    max-height:3.1em !important;
    margin:0 !important;
    padding:0 !important;
    line-height:1.55 !important;
  }

  body.archive #main #list .toc.grid .excerpt > .exsp,
  body.search #main #list .toc.grid .excerpt > .exsp,
  body.search-results #main #list .toc.grid .excerpt > .exsp{
    display:inline !important;
    margin:0 !important;
    padding:0 !important;
  }

  body.archive #main #list .toc.grid .excerpt p,
  body.search #main #list .toc.grid .excerpt p,
  body.search-results #main #list .toc.grid .excerpt p{
    display:inline !important;
    margin:0 !important;
    padding:0 !important;
  }

  body.archive #main #list .toc.grid .read-more,
  body.search #main #list .toc.grid .read-more,
  body.search-results #main #list .toc.grid .read-more{
    position:static !important;
    grid-column:2 !important;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    margin:2px 0 0 !important;
    padding:0 !important;
    text-align:right !important;
  }
}

/* ANC0 v51: archive/search date metadata.
   Luxeritas renders a second <p class="meta meta-u"> inside .excerpt.
   That inner row is where the update mark / update date was appearing.
   Keep only the card-header meta row, which contains the publication date. */
body.archive #main #list .toc.grid .excerpt > .exsp > .meta,
body.search #main #list .toc.grid .excerpt > .exsp > .meta,
body.search-results #main #list .toc.grid .excerpt > .exsp > .meta{
  display:none !important;
  visibility:hidden !important;
  height:0 !important;
  min-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
}

/* Publication date in the card header must stay visible. */
body.archive #main #list .toc.grid > section > .meta > .date,
body.archive #main #list .toc.grid > section > .meta > .date > time,
body.search #main #list .toc.grid > section > .meta > .date,
body.search #main #list .toc.grid > section > .meta > .date > time,
body.search-results #main #list .toc.grid > section > .meta > .date,
body.search-results #main #list .toc.grid > section > .meta > .date > time{
  display:inline !important;
  visibility:visible !important;
}


/* =========================================================
   ANC0 v52: compact archive/search cards
   - keep the natural order: title -> publication date/category -> excerpt
   - card outer height matches the 150px thumbnail on desktop
   - excerpt flexes/shrinks inside the remaining space (up to ~3 lines)
   - read-more stays in its own bottom-right row
========================================================= */
@media (min-width:701px){
  body.archive #main #list .toc.grid,
  body.search #main #list .toc.grid,
  body.search-results #main #list .toc.grid{
    box-sizing:border-box !important;
    height:150px !important;
    min-height:150px !important;
    max-height:150px !important;
    padding:0 !important;
    overflow:hidden !important;
  }

  body.archive #main #list .toc.grid > section,
  body.search #main #list .toc.grid > section,
  body.search-results #main #list .toc.grid > section{
    display:grid !important;
    grid-template-columns:150px minmax(0,1fr) !important;
    grid-template-rows:auto auto minmax(0,1fr) auto !important;
    column-gap:12px !important;
    row-gap:1px !important;
    box-sizing:border-box !important;
    width:100% !important;
    height:150px !important;
    min-height:150px !important;
    max-height:150px !important;
    margin:0 !important;
    padding:0 10px 0 0 !important;
    align-content:stretch !important;
    align-items:start !important;
    overflow:hidden !important;
  }

  body.archive #main #list .toc.grid > section > figure.term,
  body.search #main #list .toc.grid > section > figure.term,
  body.search-results #main #list .toc.grid > section > figure.term{
    grid-column:1 !important;
    grid-row:1 / 5 !important;
    align-self:stretch !important;
    width:150px !important;
    min-width:150px !important;
    max-width:150px !important;
    height:150px !important;
    min-height:150px !important;
    max-height:150px !important;
    margin:0 !important;
    overflow:hidden !important;
  }

  body.archive #main #list .toc.grid > section > figure.term img,
  body.search #main #list .toc.grid > section > figure.term img,
  body.search-results #main #list .toc.grid > section > figure.term img{
    width:150px !important;
    height:150px !important;
    min-width:150px !important;
    min-height:150px !important;
    max-width:150px !important;
    max-height:150px !important;
    object-fit:cover !important;
  }

  body.archive #main #list .toc.grid > section > h2.entry-title,
  body.search #main #list .toc.grid > section > h2.entry-title,
  body.search-results #main #list .toc.grid > section > h2.entry-title{
    grid-column:2 !important;
    grid-row:1 !important;
    align-self:start !important;
    margin:6px 0 1px !important;
    padding:0 !important;
    line-height:1.35 !important;
  }

  /* Keep publication date/category directly under the title — Luxeritas' natural order. */
  body.archive #main #list .toc.grid > section > .meta,
  body.search #main #list .toc.grid > section > .meta,
  body.search-results #main #list .toc.grid > section > .meta{
    grid-column:2 !important;
    grid-row:2 !important;
    align-self:start !important;
    margin:0 0 2px !important;
    padding:0 !important;
    line-height:1.25 !important;
  }

  body.archive #main #list .toc.grid > section > .excerpt,
  body.search #main #list .toc.grid > section > .excerpt,
  body.search-results #main #list .toc.grid > section > .excerpt{
    grid-column:2 !important;
    grid-row:3 !important;
    align-self:stretch !important;
    display:block !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    max-height:calc(1.45em * 3) !important;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    line-height:1.45 !important;
  }

  body.archive #main #list .toc.grid > section > .excerpt > .exsp,
  body.search #main #list .toc.grid > section > .excerpt > .exsp,
  body.search-results #main #list .toc.grid > section > .excerpt > .exsp{
    display:-webkit-box !important;
    -webkit-box-orient:vertical !important;
    -webkit-line-clamp:3 !important;
    width:100% !important;
    max-height:calc(1.45em * 3) !important;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    line-height:1.45 !important;
  }

  body.archive #main #list .toc.grid > section > .read-more,
  body.search #main #list .toc.grid > section > .read-more,
  body.search-results #main #list .toc.grid > section > .read-more{
    grid-column:2 !important;
    grid-row:4 !important;
    align-self:end !important;
    position:static !important;
    inset:auto !important;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    margin:0 0 5px !important;
    padding:0 !important;
    text-align:right !important;
    overflow:visible !important;
    transform:none !important;
  }
}

/* =========================================================
   ANC0 v53: compact, but not cramped
   2026-09-22
   - restore a little breathing room around the 150px thumbnail
   - keep publication date/category in the current natural position
   - guarantee the read-more CTA remains visible
========================================================= */
@media (min-width:701px){
  body.archive #main #list .toc.grid,
  body.search #main #list .toc.grid,
  body.search-results #main #list .toc.grid{
    box-sizing:border-box !important;
    height:170px !important;
    min-height:170px !important;
    max-height:170px !important;
    padding:10px !important;
    overflow:hidden !important;
  }

  body.archive #main #list .toc.grid > section,
  body.search #main #list .toc.grid > section,
  body.search-results #main #list .toc.grid > section{
    grid-template-columns:150px minmax(0,1fr) !important;
    grid-template-rows:auto auto minmax(0,1fr) auto !important;
    column-gap:16px !important;
    row-gap:2px !important;
    box-sizing:border-box !important;
    height:150px !important;
    min-height:150px !important;
    max-height:150px !important;
    padding:0 !important;
    overflow:visible !important;
    align-items:start !important;
  }

  body.archive #main #list .toc.grid > section > figure.term,
  body.search #main #list .toc.grid > section > figure.term,
  body.search-results #main #list .toc.grid > section > figure.term{
    align-self:stretch !important;
    width:150px !important;
    height:150px !important;
    min-width:150px !important;
    min-height:150px !important;
    max-width:150px !important;
    max-height:150px !important;
  }

  body.archive #main #list .toc.grid > section > h2.entry-title,
  body.search #main #list .toc.grid > section > h2.entry-title,
  body.search-results #main #list .toc.grid > section > h2.entry-title{
    margin:0 0 2px !important;
    line-height:1.35 !important;
    display:-webkit-box !important;
    -webkit-box-orient:vertical !important;
    -webkit-line-clamp:2 !important;
    overflow:hidden !important;
  }

  body.archive #main #list .toc.grid > section > .meta,
  body.search #main #list .toc.grid > section > .meta,
  body.search-results #main #list .toc.grid > section > .meta{
    margin:0 0 3px !important;
    line-height:1.25 !important;
  }

  body.archive #main #list .toc.grid > section > .excerpt,
  body.search #main #list .toc.grid > section > .excerpt,
  body.search-results #main #list .toc.grid > section > .excerpt{
    min-height:0 !important;
    height:auto !important;
    max-height:calc(1.45em * 3) !important;
    overflow:hidden !important;
    margin:0 !important;
    line-height:1.45 !important;
  }

  body.archive #main #list .toc.grid > section > .read-more,
  body.search #main #list .toc.grid > section > .read-more,
  body.search-results #main #list .toc.grid > section > .read-more{
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    align-self:end !important;
    justify-self:stretch !important;
    width:100% !important;
    min-height:24px !important;
    margin:3px 0 0 !important;
    padding:0 !important;
    overflow:visible !important;
    text-align:right !important;
    position:static !important;
    inset:auto !important;
    z-index:2 !important;
  }

  body.archive #main #list .toc.grid > section > .read-more .read-more-link,
  body.search #main #list .toc.grid > section > .read-more .read-more-link,
  body.search-results #main #list .toc.grid > section > .read-more .read-more-link{
    display:inline-flex !important;
    visibility:visible !important;
    opacity:1 !important;
    position:static !important;
    inset:auto !important;
    margin:0 !important;
    white-space:nowrap !important;
  }
}

/* =========================================================
   ANC0 v54: true vertical centering inside compact cards
   2026-09-22
   - v53 used 170px border-box height + 10px top/bottom padding.
     With the card border included, the 150px inner section overflowed
     the content box by ~2px, which made the bottom gap look missing.
   - 172px gives: 1px border + 10px padding + 150px content +
     10px padding + 1px border = 172px.
   - keep thumbnail/content at 150px and center the whole section.
========================================================= */
@media (min-width:701px){
  body.archive #main #list .toc.grid,
  body.search #main #list .toc.grid,
  body.search-results #main #list .toc.grid{
    display:flex !important;
    align-items:center !important;
    box-sizing:border-box !important;
    height:172px !important;
    min-height:172px !important;
    max-height:172px !important;
    padding:10px !important;
    overflow:hidden !important;
  }

  body.archive #main #list .toc.grid > section,
  body.search #main #list .toc.grid > section,
  body.search-results #main #list .toc.grid > section{
    flex:1 1 auto !important;
    width:100% !important;
    height:150px !important;
    min-height:150px !important;
    max-height:150px !important;
    margin:auto 0 !important;
    align-self:center !important;
  }
}

/* =========================================================
   ANC0 v55: nudge compact card contents upward by 7px
   2026-09-22
   - keep v54 card/thumbnail sizing unchanged
   - move the whole 150px inner section slightly upward so the
     visual top/bottom breathing room feels balanced
========================================================= */
@media (min-width:701px){
  body.archive #main #list .toc.grid > section,
  body.search #main #list .toc.grid > section,
  body.search-results #main #list .toc.grid > section{
    transform:translateY(-7px) !important;
  }
}
