/* The home page (src/templates/home.html, its blocks from src/build/widgets.mjs through home.mjs).
   The hero: a dark band on the page with the site's sentence (its collection words in the bright blue), the line under
   it, two actions, and at the right the newest pictured work in a window with two small cards of facts over it.
   Then the four collections as cards in a row. Then two columns of the same shape (a title, one line, the box): the
   series, and the topics with something on them. Phone below 48rem, tablet 48rem to 79.9375rem, desktop 80rem and
   up. */

/* ---------- The hero: a band (css/base.css) with the sentence at the left and the window at the right ---------- */
.hero-in {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  align-items: center;
  column-gap: var(--space-10);
  width: 100%;
  max-width: var(--page-max);
  min-height: 24rem;
  margin: 0 auto;
  padding-inline: calc(var(--page-pad) + var(--space-4));
}
.hero-words { min-width: 0; }
.hero-eyebrow { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.hero-title {
  margin-top: var(--space-4);
  font-size: 3rem;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--link);   /* flipped (Bakr, 2026-11-09): the sentence in the accent, its linked keywords in the text colour */
  text-wrap: balance;
}
.hero-title a { color: var(--text); text-decoration: underline; text-decoration-color: var(--link); text-decoration-thickness: 0.125rem; text-underline-offset: 0.3rem; }   /* a keyword is a door: underlined in the accent, always, so a phone reader sees it too (Bakr, 2026-11-09) */
.hero-title .hero-mark { color: var(--text); }   /* the comma or period after a linked word, in the word's colour */
.hero-title a:hover { color: var(--current-fg); text-decoration-color: var(--current-fg); text-decoration-thickness: 0.1875rem; }
.hero-actions { margin-top: var(--space-8); }
.hero-cta { height: 3rem; padding-inline: var(--space-6); border-radius: 1.5rem; font-size: var(--fs-body); }

/* the window: the newest posts on their spine behind a title bar */
.hero-visual { position: relative; min-width: 0; padding: 0 0 0 var(--space-6); }
.hero-window { overflow: hidden; border: var(--line); border-radius: var(--r-card); background: var(--surface-raised); box-shadow: var(--shadow-2); }   /* a solid box on the band: the raised surface of the dark set, its hairline round it */
.hero-window-bar { display: flex; align-items: center; gap: var(--space-3); padding: 0.625rem var(--space-4); border-bottom: var(--line); }
.hero-window-dots { display: flex; gap: 0.375rem; }
.hero-window-dots i { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--hairline); }
.hero-window-title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.hero-window-title .i { color: var(--link); }
.hero-window .log { --log-gap: var(--space-4); padding: var(--space-5); }
.hero-window .log-item .node { box-shadow: 0 0 0 0.1875rem var(--surface-raised); }
.hero-window .log-title { font-size: var(--fs-body); line-height: 1.5rem; }

/* ---------- The collections as cards ---------- */
.collections { margin-bottom: var(--space-16); }
.collection-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); margin: 0; padding: 0; list-style: none; }
.collection-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 17rem;
  padding: var(--space-6);
  background: var(--surface-raised);
  border: var(--line);
  border-radius: var(--r-bar);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease), background-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.collection-card:hover, .collection-card:focus-within {
  --text: var(--on-primary); --text-muted: var(--on-primary); --link: var(--on-primary); --surface: rgb(255 255 255 / 0.16); --hairline: transparent;
  transform: translateY(-0.25rem);
  background: var(--primary);
  border-color: transparent;
  box-shadow: var(--shadow-2);
}
.collection-card-icon { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: var(--space-2); border-radius: 50%; background: var(--surface); color: var(--link); }
.collection-card-name { font-size: 1.5rem; line-height: 2rem; font-weight: 700; letter-spacing: -0.015em; }
.collection-card-name a { color: var(--text); text-decoration: none; }
.collection-card-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* the whole card answers */
.collection-card-name a:focus-visible { outline: none; }
.collection-card:has(.collection-card-name a:focus-visible) { outline: 0.125rem solid var(--focus-ring); outline-offset: 0.125rem; }
.collection-card-verb { margin-top: -0.25rem; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.collection-card-lead { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-muted); }
.collection-card-badge { margin: var(--space-2) 0 0; }   /* Coming Soon! on a collection with nothing (Bakr, 2026-11-09) */
/* a collection's categories, structure first: small links, each its icon, its name, its count; above the card's own link */
.collection-card-categories { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 0.375rem; margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.collection-card-category { display: inline-flex; align-items: center; gap: 0.3125rem; height: 1.75rem; padding-inline: 0.5rem; border: var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 0.8125rem; line-height: 1rem; font-weight: 550; text-decoration: none; }
.collection-card-category .i { flex: none; width: 0.875rem; height: 0.875rem; color: var(--link); }
.collection-card-category small { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.collection-card-category:hover { border-color: var(--link); color: var(--link); text-decoration: none; }
.collection-card-count { margin-top: auto; padding-top: var(--space-3); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 600; color: var(--text); }
.collection-card-newest { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-muted); }
.collection-card-newest span { margin-right: 0.25rem; font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.collection-card-newest a { position: relative; z-index: 1; color: var(--link); font-weight: 600; }

/* ---------- A row of blocks (src/site.json, widgets.home): side by side, each in its box, the boxes one height ---------- */
.home-row { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: var(--space-8); align-items: stretch; }
.home-block { display: flex; flex-direction: column; min-width: 0; }
.home-block-title { display: flex; align-items: center; gap: var(--space-2); }
.home-block-title .i { color: var(--link); }
.home-block-title a { color: inherit; text-decoration: none; }   /* a block's title leads to its page (Bakr, 2026-11-07) */
.home-block-title a:hover { color: var(--link); text-decoration: underline; }
.home-block-line { margin: var(--space-1) 0 var(--space-4); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-muted); }
.home-block-box { display: flex; flex-direction: column; flex: 1; padding: var(--space-2) var(--space-5); background: var(--surface); border: var(--line); border-radius: var(--r-card); }
.home-block-box .topic-chips { padding-block: var(--space-3); }
.home-block-box > :first-child { display: flex; flex: 1; flex-direction: column; justify-content: space-around; }   /* the list spreads over its box, so the two boxes of a row hold no hole */
.home-block-box > .topic-chips { flex-direction: row; flex-wrap: wrap; align-content: center; justify-content: flex-start; }
.block-all { margin-top: auto; padding-block: var(--space-3); border-top: var(--line); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 600; }
.block-all a { display: inline-flex; align-items: center; gap: var(--space-1); }

/* the courses (Bakr, 2026-11-06: they lead): four cards a row in their box, two on a tablet, one on a phone; a card's
   icon small where it has no picture (css/base.css, .courses-cards) */
.home-courses { margin-bottom: var(--space-16); }
.home-courses .home-block-box { padding-block: var(--space-4); }
.home-courses .home-block-box > .cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.home-courses .block-all { margin-top: var(--space-4); padding-bottom: 0; }

/* the series as a line each: its icon, its name, its line, its facts, its parts as nodes on a short rail */
.series-titles { margin: 0; padding: 0; list-style: none; }
.series-title-row { position: relative; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); padding-block: var(--space-3); }
.series-title-row + .series-title-row { border-top: var(--line); }
.series-title-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--r-image); background: var(--surface-raised); color: var(--link); box-shadow: inset 0 0 0 var(--hairline-w) var(--hairline); }
.series-title-main { display: grid; gap: 0.125rem; min-width: 0; }
.series-title-name { font-size: var(--fs-body); line-height: 1.375rem; font-weight: 650; color: var(--link); }
.series-title-name a { color: inherit; text-decoration: none; }
.series-title-name a::after { content: ""; position: absolute; inset: 0; }   /* the whole row answers */
.series-title-row:hover .series-title-name { text-decoration: underline; }
.series-title-line { overflow: hidden; font-size: 0.8125rem; line-height: 1.125rem; color: var(--text-muted); white-space: nowrap; text-overflow: ellipsis; }
.series-title-facts { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); font-size: 0.8125rem; line-height: 1.125rem; color: var(--text); }
.series-title-facts span { display: inline-flex; align-items: center; gap: 0.25rem; }
.series-title-facts .i { width: 0.8125rem; height: 0.8125rem; color: var(--link); }
.series-title-nodes { display: flex; align-items: center; gap: 0.375rem; padding-inline: 0.125rem; background: linear-gradient(var(--rail), var(--rail)) center / 100% 0.125rem no-repeat; }
.series-title-nodes i { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--node-bg); box-shadow: 0 0 0 0.1875rem var(--surface); }
.series-title-nodes b { padding-inline: 0.25rem; background: var(--surface); font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }

/* Explore by subject (Bakr, 2026-11-07): the fields as tiles, four a row on a desktop and a tablet, two on a phone; each
   its icon, its name, its count, its largest topics as small links */
.home-fields { margin-bottom: var(--space-16); }
.home-fields .home-block-box { padding-block: var(--space-4); }
.home-fields .home-block-box > .field-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
.field-tile { display: grid; align-content: start; gap: var(--space-2); min-width: 0; padding: var(--space-4); border: var(--line); border-radius: var(--r-card); background: var(--surface-raised); }
.field-tile-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--surface); color: var(--link); }
.field-tile-name { font-size: 1.0625rem; line-height: 1.375rem; font-weight: 700; letter-spacing: -0.01em; }
.field-tile-name a { color: var(--text); text-decoration: none; }
.field-tile-name a:hover { color: var(--link); text-decoration: underline; }
.field-tile-n { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-muted); }
.field-tile-n b { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.field-tile-topics { display: grid; gap: 0.125rem; margin: var(--space-1) 0 0; padding: 0; list-style: none; font-size: var(--fs-caption); line-height: var(--lh-caption); }
.field-tile-topics a { font-weight: 600; color: var(--link); }
.home-fields .block-all { margin-top: var(--space-4); padding-bottom: 0; }

/* the closing picture (Bakr, 2026-11-07): the newest post with a picture, large, its place, its name and its line beside it */
.home-picture { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: center; gap: var(--space-10); margin-bottom: var(--space-16); }
.home-picture-media { display: block; overflow: hidden; border: var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-2); }
.home-picture-media img { display: block; width: 100%; height: auto; }
.home-picture-words { display: grid; gap: var(--space-3); min-width: 0; }
.home-picture-place { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.home-picture-name { font-size: 2rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.home-picture-name a { color: var(--text); text-decoration: none; }
.home-picture-name a:hover { color: var(--link); text-decoration: underline; }
.home-picture-line { font-size: 1.0625rem; line-height: 1.6; color: var(--text-muted); }

/* ---------- A collection's band (src/site.json widgets.home, a collection's id; Off-topics', Bakr, 2026-11-07, the fuller plan
   2.1): set apart from the cards, on a wash of its own colour, its icon, verb, name, line and badge, then its newest posts ---------- */
.home-band { display: grid; gap: var(--space-5); margin-bottom: var(--space-16); padding: var(--space-6); border-radius: var(--r-card); background: color-mix(in srgb, var(--tint) 7%, var(--page)); box-shadow: inset 0 0 0 var(--hairline-w) color-mix(in srgb, var(--tint) 40%, var(--hairline)); }
.home-band-head { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-4); }
.home-band-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--surface-raised); color: var(--tint); box-shadow: inset 0 0 0 var(--hairline-w) color-mix(in srgb, var(--tint) 40%, var(--hairline)); }
.home-band-words { display: grid; gap: 0.125rem; min-width: 0; }
.home-band-verb { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.home-band-name { font-size: 1.5rem; line-height: 2rem; font-weight: 700; letter-spacing: -0.015em; }
.home-band-name a { color: var(--tint); text-decoration: none; }
.home-band-name a:hover { text-decoration: underline; }
.home-band-line { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-muted); }
.home-band-posts { margin: 0; }
.home-band-posts .card { background: var(--surface-raised); }

/* ---------- Tablet ---------- */
@media (max-width: 79.9375rem) {
  .hero-in { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-8); min-height: 0; padding-inline: var(--page-pad); }
  .hero-title { font-size: 2.5rem; }
  .hero-visual { padding: 0 0 0 var(--space-4); }
  .collections { margin-bottom: var(--space-12); }
  .collection-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
  .collection-card { min-height: 15rem; padding: var(--space-5); }
  .home-row { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-10); }
  .home-courses { margin-bottom: var(--space-12); }
  .home-courses .home-block-box > .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-fields { margin-bottom: var(--space-12); }
  .home-band { margin-bottom: var(--space-12); padding: var(--space-5); }
  .home-picture { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); margin-bottom: var(--space-12); }
}

/* ---------- Phone ---------- */
@media (max-width: 47.9375rem) {
  .hero-in { row-gap: var(--space-6); }
  .hero-title { font-size: 2rem; line-height: 1.15; }
  .hero-actions { margin-top: var(--space-6); }
  .hero-cta { width: 100%; }
  .hero-visual { padding: 0 0 0 var(--space-3); }
  .collections { margin-bottom: var(--space-10); }
  .collection-cards { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .collection-card { min-height: 0; padding: var(--space-4); }
  .home-row { row-gap: var(--space-8); }
  .home-block-box { padding-inline: var(--space-4); }
  .home-courses { margin-bottom: var(--space-10); }
  .home-courses .home-block-box > .cards { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .series-title-row { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .series-title-nodes { display: none; }   /* on a phone the count says it */
  .home-fields { margin-bottom: var(--space-10); }
  .home-fields .home-block-box > .field-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .field-tile { padding: var(--space-3); }
  .home-band { margin-bottom: var(--space-10); padding: var(--space-4); }
  .home-band-head { grid-template-columns: 2.5rem minmax(0, 1fr); row-gap: var(--space-2); }
  .home-band-icon { width: 2.5rem; height: 2.5rem; }
  .home-band-badge { grid-column: 2; }
  .home-picture { margin-bottom: var(--space-10); }
  .home-picture-name { font-size: 1.5rem; }
}
