/* Blog homepage only (body.site-home): tagline, search bars, the
 * Recently Updated list, and the All Notes directory tree. Scoped so it
 * never touches the ordinary bullet lists or wider reading measure used by
 * article pages, which load this same stylesheet. */

/* === Blog homepage (body.site-home) ===
 * A tighter, left-aligned index layout on top of the shared look above —
 * scoped so it never touches the ordinary bullet lists or wider reading
 * measure used by article pages, which load this same stylesheet.
 */

body.site-home #postamble {
  display: none;
}

body.site-home #preamble .site-nav,
body.site-home #preamble .site-subnav,
body.site-home #content {
  max-width: 46rem;
}

body.site-home #content > h1.title {
  text-align: left;
  font-family: var(--site-serif);
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

body.site-home .site-tagline {
  max-width: 34rem;
  margin: 0 0 1.75rem;
  color: var(--site-dim);
  font-size: 1.05rem;
  line-height: 1.55;
}

body.site-home .site-search {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 2.5rem;
  padding: 0.65rem 0.9rem 0.65rem 1.9rem;
  border: 1px solid var(--site-rule);
  border-radius: 0.4rem;
  background:
    #fff
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="none" stroke="%237c8a93" stroke-width="1.6" d="M13 13l4 4M4 9a5 5 0 1 1 10 0 5 5 0 0 1-10 0z"/></svg>')
    no-repeat 0.7rem center;
  background-size: 0.95rem;
  font-family: var(--site-mono);
  font-size: 0.88rem;
  color: var(--site-ink);
}

body.site-home .site-search::placeholder {
  color: var(--site-dim);
}

body.site-home .site-search:focus {
  outline: none;
  border-color: var(--site-accent);
  box-shadow: 0 0 0 3px rgba(82, 125, 154, 0.18);
}

body.site-home h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.9rem;
}

body.site-home .site-recent {
  margin: 0 0 2.75rem;
}

body.site-home .site-recent > ul.org-ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.site-home .site-recent li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.65em;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--site-rule);
}

body.site-home .site-recent li:last-child {
  border-bottom: none;
}

/* Undo the `display: flex' above for batches not yet revealed by scroll. */
body.site-home .site-recent li[hidden] {
  display: none;
}

body.site-home .site-recent-sentinel {
  height: 1px;
}

body.site-home .site-recent li i {
  order: -1;
  font-style: normal;
  font-family: var(--site-mono);
  font-size: 0.76rem;
  color: var(--site-dim);
  min-width: 5.4rem;
}

body.site-home .site-recent li b {
  font-family: var(--site-serif);
  font-weight: 600;
}

body.site-home .site-recent li a {
  color: var(--site-ink);
}

body.site-home .site-recent li a:hover {
  color: var(--site-accent);
}

body.site-home .site-recent li .site-desc {
  flex-basis: 100%;
  margin-top: 0.15rem;
  color: var(--site-dim);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* The signature piece: a directory-style browser. Clicking a folder
 * replaces the list with its contents (see enhanceHomeIndex in home.js);
 * the bar above the list is the way back out. Because only one level is
 * ever on screen at once, depth never has to be conveyed visually the way
 * a nested nested list would — every row here is a direct child of
 * whatever folder is currently open. */

body.site-home .site-index {
  border: 1px solid var(--site-rule);
  border-radius: 0.6rem;
  padding: 0.3rem 0.7rem;
  background: #fff;
}

body.site-home .site-index-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--site-rule);
}

body.site-home .site-index-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid var(--site-rule);
  border-radius: 0.45rem;
  background: #fff;
  color: var(--site-ink);
  cursor: pointer;
}

body.site-home .site-index-back svg {
  width: 0.85rem;
  height: 0.85rem;
}

body.site-home .site-index-back:disabled {
  opacity: 0.35;
  cursor: default;
}

body.site-home .site-index-back:not(:disabled):hover {
  border-color: var(--site-accent);
  color: var(--site-accent);
}

body.site-home .site-index-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  min-width: 0;
  font-family: var(--site-serif);
  font-size: 0.92rem;
}

body.site-home .site-index-crumbs button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-family: inherit;
  color: var(--site-dim);
  padding: 0.1rem 0.3rem;
  border-radius: 0.3rem;
  cursor: pointer;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.site-home .site-index-crumbs button:hover {
  color: var(--site-accent);
  background: rgba(82, 125, 154, 0.08);
}

body.site-home .site-index-crumbs button[aria-current="page"] {
  color: var(--site-ink);
  font-weight: 600;
  cursor: default;
}

body.site-home .site-index-crumbs button[aria-current="page"]:hover {
  background: none;
}

body.site-home .site-index-sep {
  color: var(--site-rule);
  font-size: 0.8rem;
}

body.site-home .site-index ul.org-ul,
body.site-home .site-index-results {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.site-home .site-index li {
  border-bottom: 1px dashed var(--site-rule);
}

body.site-home .site-index li:last-child {
  border-bottom: none;
}

/* Folders get a solid divider instead of a post's dashed one, so a folder
   row reads as a section break rather than another card. */
body.site-home .site-index li.folder {
  border-bottom: 1px solid var(--site-rule);
}

body.site-home .site-index .row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.15rem;
  border-radius: 0.4rem;
  text-decoration: none;
  color: inherit;
}

body.site-home .site-index a.row {
  align-items: baseline;
}

/* Undo the `display: flex' above for a row hidden because its own folder
   is further up the current breadcrumb (see showLevel in home.js). */
body.site-home .site-index .row[hidden] {
  display: none;
}

body.site-home .site-index .folder-row:hover,
body.site-home .site-index .folder-row:focus-visible {
  background: var(--site-mono-tint);
}

/* A post's hover/focus highlight covers the whole card — title, date, and
   description together — not just the title bar, since the description
   is a separate element below the link rather than part of it. */
body.site-home .site-index li.post:hover,
body.site-home .site-index li.post:focus-within {
  background: var(--site-mono-tint);
  border-radius: 0.4rem;
}

body.site-home .site-index .folder-row {
  cursor: pointer;
}

body.site-home .site-index .folder-icon {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--site-accent);
}

body.site-home .site-index .name {
  font-family: var(--site-serif);
  font-weight: 600;
  font-size: 1rem;
  color: var(--site-ink);
}

body.site-home .site-index .count {
  font-family: var(--site-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  color: var(--site-dim);
}

body.site-home .site-index .folder-row .enter {
  margin-left: auto;
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  color: var(--site-rule);
  transition: color 0.15s ease, transform 0.15s ease;
}

body.site-home .site-index .folder-row:hover .enter {
  color: var(--site-accent);
  transform: translateX(2px);
}

body.site-home .site-index .post-row b {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--site-serif);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--site-ink);
}

body.site-home .site-index li.post:hover .post-row b,
body.site-home .site-index li.post:focus-within .post-row b {
  color: var(--site-accent);
}

body.site-home .site-index .post-row .date {
  flex: none;
  font-style: normal;
  font-family: var(--site-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  color: var(--site-dim);
}

/* Descriptions are metadata, not body text: the sans face and a two-line
   clamp keep a large folder scannable (the native title tooltip carries
   the full text). */
body.site-home .site-index .site-desc {
  display: -webkit-box;
  margin: -0.1rem 0 0.5rem;
  padding: 0 0.15rem;
  font-family: var(--site-sans);
  font-weight: 400;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--site-dim);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Shown above a search result that lives inside a subfolder of the
   current directory, since a flat result list can no longer rely on
   nesting to show where a post actually is. */
body.site-home .site-index .result-path {
  display: block;
  padding: 0 0.15rem;
  font-family: var(--site-mono);
  font-size: 0.68rem;
  color: var(--site-accent);
}

body.site-home .site-index-empty {
  padding: 2rem 0.5rem;
  text-align: center;
  color: var(--site-dim);
  font-size: 0.88rem;
  border-bottom: none;
}

@media (max-width: 640px) {
  body.site-home #content {
    padding: 2rem 1.1rem 3.5rem;
  }

  body.site-home #content > h1.title {
    font-size: 2rem;
  }
}
