/* SEEK2LRN — blog index (seek2lrn-blog.html, built from pages-src/blog.html).
 *
 * A 2x2 bento, left and right halves:
 *
 *   featured today (one big card)  |  exam prep: one wide card each for SAT, AP, ACT
 *   latest (3 cards, See all)      |  comparisons row
 *
 * then every post in a grid (#all). Cards are flat and editorial: square
 * corners, no shadows, hairline rules. Title, photo, the post's opening
 * paragraph, then a byline (author, position, subject, date) with share links
 * on its right (assets/js/blog-share.js). The exam-prep cards lie on their
 * side: photo left, text beside it. Blue design system (design-system/DESIGN_SYSTEM.md).
 */

.s2l-bidx {
  --bx-primary: #1558D6;
  --bx-primary-dark: #0E3FA3;
  --bx-primary-fade: #F4F8FE;
  --bx-ink: #16203A;
  --bx-ink-2: #374151;
  --bx-muted: #475569;
  --bx-line: #E3E8F3;
  --bx-panel: #0D1B3E;
  --bx-pad: clamp(16px, 3.5vw, 56px);
  --bx-gap: 1.5rem; /* between cards */

  max-width: 1760px;
  margin: 0 auto;
  padding: calc(58px + 1.75rem) var(--bx-pad) 5rem; /* 58px: the fixed nav */
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-weight: 300;
  color: var(--bx-ink-2);
}

/* ── page head: the "seek2lrn blog." wordmark from the post photo cards, on white ── */
.s2l-bidx-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-bottom: 2rem;
}
.s2l-bidx-brand {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.s2l-bidx-word {
  margin: 0;
  font-family: 'Roboto Slab', Georgia, serif;
  font-weight: 800;
  font-size: clamp(2rem, 3vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--bx-ink);
}
.s2l-bidx-word .two { color: var(--bx-primary); }
.s2l-bidx-word .dot { color: var(--bx-panel); } /* on white, so the period keeps the ink */
.s2l-bidx-word .l2 { font-weight: 400; } /* "blog", lighter, as on a masthead */
/* dateline: the viewer's date, time and zone (blog-index.js) */
.s2l-bidx-date {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--bx-muted);
  text-align: right;
}
.s2l-bidx-dek {
  margin: 0;
  font-size: 1rem;
  color: var(--bx-muted);
}

/* ── the bento ── */
.s2l-bento {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "featured exams"
    "latest   compare";
  gap: 3rem 0; /* no column gap: each half pads itself, so the rules run to the middle */
}
/* the vertical rule between the halves: the same 2px ink as the section rules,
   meeting them at the top and in the middle, and running down to All posts' rule */
.s2l-bento::before {
  content: '';
  position: absolute; /* out of flow, so it takes no grid cell */
  top: 0;
  bottom: -4rem; /* .s2l-bsec--all's margin-top */
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--bx-ink);
}
.s2l-bsec--featured,
.s2l-bsec--latest { padding-right: 1.75rem; }
.s2l-bsec--exams,
.s2l-bsec--compare { padding-left: 1.75rem; }
.s2l-bsec--featured { grid-area: featured; }
.s2l-bsec--latest   { grid-area: latest; }
.s2l-bsec--exams    { grid-area: exams; }
.s2l-bsec--compare  { grid-area: compare; }

.s2l-bsec {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* a heavy ink rule over each section, its label under it, newspaper style;
     on the section itself so it spans the padding and meets the middle rule */
  border-top: 2px solid var(--bx-ink);
  padding-top: 0.6rem;
}
.s2l-bsec-label,
.s2l-bsec-head { margin: 0 0 1.25rem; }
.s2l-bsec-head .s2l-bsec-label { margin: 0; }
.s2l-bsec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.s2l-bsec-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bx-ink);
}
.s2l-blm .s2l-bsec-all {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--bx-primary);
  text-decoration: none;
}
.s2l-blm .s2l-bsec-all:hover { color: var(--bx-primary-dark); text-decoration: underline; text-underline-offset: 3px; }

/* exam prep: three rows, the exam's name to the left of its one card */
.s2l-bexam {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--bx-gap);
  flex: 1 1 0;
}
.s2l-bexam + .s2l-bexam {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bx-line);
}
.s2l-bexam-name {
  margin: 0;
  font-family: 'Roboto Slab', Georgia, serif;
  font-weight: 300;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--bx-ink);
}

/* ── card rows ── */
.s2l-brow {
  margin: 0;
  padding: 0;
  list-style: none;
}
.s2l-brow li { min-width: 0; }
.s2l-brow--three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--bx-gap);
}
/* scrolling row: part of the next card shows at the right edge */
.s2l-brow--scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * var(--bx-gap)) / 2.6);
  gap: var(--bx-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--bx-line) transparent;
  padding-bottom: 0.75rem;
}
.s2l-brow--scroll li { scroll-snap-align: start; }
.s2l-brow--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2.75rem var(--bx-gap);
}

.s2l-bsec--all {
  margin-top: 4rem;
  scroll-margin-top: 58px;
}
/* category bar: a second navbar, pinned under the site nav while the list scrolls */
.s2l-bcats {
  position: sticky;
  top: 58px;
  z-index: 5;
  display: flex;
  gap: 2rem;
  margin: -0.5rem 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
  border-bottom: 1px solid var(--bx-line);
}
.s2l-bcat {
  flex-shrink: 0;
  padding: 0.85rem 0 0.75rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  font: 500 0.9rem/1.2 'Inter', 'Segoe UI', Arial, sans-serif;
  color: var(--bx-muted);
  cursor: pointer;
}
.s2l-bcat:hover { color: var(--bx-ink); }
.s2l-bcat[aria-pressed="true"] { color: var(--bx-ink); border-bottom-color: var(--bx-primary); }
.s2l-bcat:focus-visible { outline: 2px solid var(--bx-primary); outline-offset: -2px; }
.s2l-bcat-n {
  margin-left: 0.2rem;
  font-weight: 400;
  font-size: 0.75rem;
  color: #9CA3AF;
}

/* ── the card: flat, square, text on white ── */
.s2l-bcard {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.s2l-bcard-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: calc(1.3em * 3); /* three lines held, so photos in a row line up */
  margin: 0 0 0.75rem;
  font-family: 'Roboto Slab', Georgia, serif;
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--bx-ink);
}
.s2l-blm .s2l-bcard-title a { color: inherit; text-decoration: none; }
.s2l-blm .s2l-bcard-title a:hover { color: var(--bx-primary); }
.s2l-bcard-title a:focus-visible { outline: 2px solid var(--bx-primary); outline-offset: 2px; }
.s2l-bcard-img {
  display: block;
  overflow: hidden;
  background: var(--bx-line);
}
.s2l-bcard-img img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
}
.s2l-bcard-img:hover img { opacity: 0.9; }
.s2l-bcard-dek {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0.85rem 0 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--bx-ink-2);
}

/* byline: author and position left, share links right, over a hairline */
.s2l-bcard-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--bx-line);
}
.s2l-bcard-by {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
}
.s2l-bcard-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--bx-ink);
}
.s2l-bcard-role,
.s2l-bcard-meta {
  font-size: 0.75rem;
  color: var(--bx-muted);
}
.s2l-bcard-subject {
  font-weight: 500;
  color: var(--bx-primary);
}
.s2l-bcard-meta time { white-space: nowrap; } /* a narrow card breaks after the subject, never mid-date */
.s2l-share {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.s2l-blm .s2l-share-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--bx-muted);
  text-decoration: none;
}
.s2l-blm .s2l-share-btn:hover { color: var(--bx-primary); background: var(--bx-primary-fade); }
.s2l-share-btn:focus-visible { outline: 2px solid var(--bx-primary); outline-offset: 1px; }
/* small cards are narrow: the four links sit 2x2, beside the three-line byline */
.s2l-bcard:not(.s2l-bcard--big):not(.s2l-bcard--wide) .s2l-share {
  display: grid;
  grid-template-columns: repeat(2, 28px);
}
.s2l-bcard:not(.s2l-bcard--big):not(.s2l-bcard--wide) .s2l-share-btn { width: 28px; height: 26px; }

/* featured: the same card, large */
.s2l-bcard--big .s2l-bcard-title,
.s2l-bcard--wide .s2l-bcard-title { min-height: 0; -webkit-line-clamp: 4; }
.s2l-bcard--big .s2l-bcard-title {
  margin-bottom: 1.1rem;
  font-weight: 300;
  font-size: clamp(2rem, 2.8vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.s2l-bcard--big .s2l-bcard-img img { aspect-ratio: 16 / 10; }
.s2l-bcard--big .s2l-bcard-dek {
  -webkit-line-clamp: 4;
  margin: 1.1rem 0 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.7;
}
.s2l-bcard--big .s2l-bcard-name { font-size: 0.9rem; }
.s2l-bcard--big .s2l-bcard-role,
.s2l-bcard--big .s2l-bcard-meta { font-size: 0.8125rem; }

/* exam prep: lying on its side, photo left and the text beside it */
.s2l-bcard--wide {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  gap: var(--bx-gap);
}
.s2l-bcard--wide .s2l-bcard-img img { height: 100%; min-height: 180px; aspect-ratio: auto; }
.s2l-bcard-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.s2l-bcard--wide .s2l-bcard-title { font-size: 1.25rem; margin-bottom: 0; }
.s2l-bcard--wide .s2l-bcard-dek { margin-top: 0.6rem; }

/* the "Link copied" note from blog-share.js */
.s2l-share-status {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1000;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 0.6rem 1rem;
  background: #16203A;
  color: #fff;
  font: 400 0.875rem/1.4 'Inter', 'Segoe UI', Arial, sans-serif;
}
.s2l-share-status:empty { display: none; }

/* ── narrower screens: one column ── */
@media (max-width: 1100px) {
  .s2l-bento::before { display: none; }
  .s2l-bento > .s2l-bsec { padding-left: 0; padding-right: 0; }
  .s2l-bento {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "featured" "latest" "exams" "compare";
  }
}
@media (max-width: 640px) {
  .s2l-bidx { padding-top: calc(52px + 1.25rem); }
  .s2l-bcats { top: 52px; gap: 1.5rem; }
  .s2l-bsec--all { scroll-margin-top: 52px; }
  .s2l-bcard--big .s2l-bcard-title { font-size: 1.8rem; }
  .s2l-bcard--big .s2l-bcard-img img { aspect-ratio: 4 / 3; }
  /* every row is one card per line (it used to scroll sideways) */
  .s2l-brow--three, .s2l-brow--scroll {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
    padding-bottom: 0;
  }
  .s2l-blm .s2l-share-btn, .s2l-bcard:not(.s2l-bcard--big):not(.s2l-bcard--wide) .s2l-share-btn { width: 44px; height: 44px; }
  .s2l-bcard:not(.s2l-bcard--big):not(.s2l-bcard--wide) .s2l-share { grid-template-columns: repeat(2, 44px); }
  .s2l-blm .s2l-bsec-all { display: inline-flex; align-items: center; min-height: 44px; }
  /* exam cards stand up again: name, photo, then text */
  .s2l-bexam { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .s2l-bcard--wide { grid-template-columns: minmax(0, 1fr); }
  .s2l-bcard--wide .s2l-bcard-img img { height: auto; min-height: 0; aspect-ratio: 4 / 3; }
  .s2l-bexam-name { font-size: 1.3rem; }
}
