/* Homepage: the books lead, followed by the writing section. */
#activities .activity-grid {
  grid-template-columns: minmax(0, 1fr);
}
#activities :is(#books, #words) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, .79fr) minmax(0, 2.21fr);
  grid-template-areas: "intro covers" "all covers";
  align-items: center;
  align-content: center;
  column-gap: clamp(18px, 3vw, 38px);
  row-gap: 15px;
  padding: clamp(24px, 3.3vw, 42px);
  background: #f2f7e9;
  border-color: #d3e0c5;
}
:is(#books, #words) .shelf-entry-intro { grid-area: intro; align-self: end; }
:is(#books, #words) .shelf-entry-intro .card-en,
:is(#books, #words) .shelf-entry-intro h3,
:is(#books, #words) .shelf-entry-intro .card-tagline { text-align: left; }
:is(#books, #words) .shelf-entry-intro h3 {
  font-size: clamp(1.4rem, 2.55vw, 1.85rem);
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}
:is(#books, #words) .shelf-entry-intro .card-tagline {
  padding: 0;
  border: 0;
  margin-top: 7px;
  font-size: .96rem;
  font-weight: 600;
  line-height: 1.65;
}
:is(#books, #words) .shelf-entry-lead,
:is(#books, #words) .shelf-entry-note { font-size: .9rem; line-height: 1.75; }
:is(#books, #words) .shelf-entry-lead { margin: 11px 0 0; }
:is(#books, #words) .shelf-entry-note { margin: 6px 0 0; }
#books .shelf-entry-covers {
  grid-area: covers;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: clamp(9px, 2vw, 22px);
  list-style: none;
  margin: 0;
  padding: 0;
}
#books .shelf-entry-covers li { min-width: 0; }
#books .shelf-entry-covers a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  padding: 5px 5px 7px;
  min-height: 44px;
  border-radius: 7px;
  color: var(--green);
}
#books .shelf-entry-rank {
  border-radius: 999px;
  padding: 3px .65em;
  background: #e4edcf;
  color: #496042;
  font-size: .78rem;
  line-height: 1.45;
  white-space: nowrap;
}
#books .shelf-entry-image {
  display: block;
  position: relative;
  width: min(100%, 104px);
  aspect-ratio: 2 / 3;
}
#books li:first-child .shelf-entry-image { width: min(100%, 144px); }
#books .shelf-entry-image img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(2px 3px 3px #334c3527);
}
#books .shelf-entry-title {
  display: block;
  min-block-size: 3em;
  text-decoration: underline;
  text-underline-offset: .22em;
  font-size: .83rem;
  line-height: 1.55;
  color: #365337;
  overflow-wrap: anywhere;
}
#books .shelf-entry-covers a:hover,
#books .shelf-entry-covers a:focus-visible { background: #e8f0dc; }
#books .shelf-entry-covers a:focus-visible,
:is(#books, #words) .shelf-entry-all:focus-visible { outline: 2px solid #567543; outline-offset: 3px; }
/* Direct entrances to the activity pages. */
#activities .activity-card > .card-link {
  box-sizing: border-box;
  width: 100%;
  max-width: 22rem;
  min-width: 0;
  min-height: 54px;
  padding: 12px 18px;
  justify-content: center;
  justify-self: start;
  gap: .65em;
  border-radius: 10px;
  background: #45643b;
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.125rem);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
}
#activities .activity-card > .card-link span { flex: none; font-size: 1.15em; }
#activities .activity-card > .card-link:hover { background: #304b29; }
#activities .activity-card > .card-link:focus-visible {
  outline: 2px solid #385331;
  outline-offset: 3px;
}
:is(#books, #words) .shelf-entry-all { grid-area: all; align-self: start; }
#books .shelf-entry-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 780px) {
  #activities .activity-grid { grid-template-columns: minmax(0, 1fr); }
  #activities :is(#books, #words) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "covers" "all";
    row-gap: 14px;
    padding: clamp(14px, 4vw, 26px);
  }
  #books .shelf-entry-covers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px 12px;
    width: 100%;
    max-width: 365px;
    justify-self: center;
  }
  #books .shelf-entry-covers li:first-child {
    grid-column: 1 / -1;
    border-bottom: 1px solid #d3e0c5;
    padding-bottom: 8px;
  }
  #books .shelf-entry-image { width: min(100%, 126px); }
  #books li:first-child .shelf-entry-image { width: min(54%, 164px); }
  #books .shelf-entry-title { min-block-size: 0; font-size: .92rem; }
  #books li:first-child .shelf-entry-title { font-size: 1.01rem; }
}
