/* Lightning Construction NJ — blog-only styles.
 *
 * Loaded ONLY by pages under /blog/, after /styles/global.css. Every rule here
 * is scoped to a .bl-* class or to .bl-prose, so nothing in this file can change
 * how a hand-authored page renders. The blog inherits the real site design by
 * linking the real site stylesheet; this file adds the handful of things the
 * site has never needed before.
 *
 * 🚨 Why this file exists rather than appending to global.css:
 *   1. global.css is under a hard 25KB budget (see CLAUDE.md, Performance).
 *   2. A blog post is the first page type on this site whose BODY contains
 *      author-written h2s, numbered lists, blockquotes and tables. global.css
 *      styles .prose for hand-authored guides, which only ever use h3 and ul —
 *      so it has real gaps that only show up once a post uses the other three.
 *      Fixing them inside .prose would restyle 20 live guide pages.
 */

/* ---------- article body ----------------------------------------------------
 * .bl-prose extends .prose. It is applied as a second class, so everything the
 * site already does (⚡ list bullets, ⚡ link colors, the source line) still
 * applies and stays visually identical to a /resources/ guide.
 */

/* Global h2 is clamp(2.3rem, 5vw, 4rem) — correct for a section banner, absurd
 * for a heading inside body copy, and it would sit 3x larger than the h3 right
 * under it. Posts use ## for their main sections, so this is the single most
 * important rule in this file. */
.bl-prose h2 {
  color: #fff;
  font-size: clamp(1.5rem, 3.4vw, 1.85rem);
  line-height: 1.12;
  margin: 40px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 96px;
}
.bl-prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.bl-prose h3 { margin: 26px 0 8px; }

/* 🚨 .prose li::before paints a ⚡ on EVERY li, and .prose ul kills the marker —
 * but there is no .prose ol rule, so a numbered list renders with a decimal
 * marker AND a bolt, double-indented. Restore real numbering for ol only. */
.bl-prose ol.bol {
  margin: 0 0 18px 0;
  padding-left: 0;
  list-style: none;
  counter-reset: bol;
}
.bl-prose ol.bol > li {
  counter-increment: bol;
  padding: 9px 0 9px 38px;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.bl-prose ol.bol > li::before {
  content: counter(bol);
  position: absolute;
  left: 0;
  top: 9px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(245, 166, 35, .12);
  border: 1px solid rgba(245, 166, 35, .45);
  color: var(--amber);
  font-family: var(--sans);
  font-weight: 800;
  font-size: .8rem;
  line-height: 22px;
  text-align: center;
  filter: none;
}

/* Blockquote / callout. The site has never rendered one. */
.bl-prose .bnote {
  margin: 22px 0;
  padding: 18px 22px;
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  color: var(--text);
}

/* ---------- data tables in body copy ----------------------------------------
 * Reuses the site's .tablewrap/.datatable look. The extra part is the per-cell
 * heading label, which is hidden on desktop and shown when rows restack on a
 * phone — .datatable sets white-space:nowrap and a 520px min-width, which on a
 * 375px screen means a horizontal scroller inside the article. Restacking reads
 * far better for a 3-4 column comparison table in the middle of prose.
 */
.bl-prose .bt-label { display: none; }

/* 🚨 The site's .datatable sets white-space:nowrap and min-width:520px. That is
 * correct for the county data tables it was built for — short numeric cells in
 * a full-width band. It is wrong for a prose comparison table sitting inside a
 * ~600px article column at 1024px, where the sidebar is still alongside: the
 * last column gets clipped mid-word and the only way to read it is a horizontal
 * scroll inside the article. Blog tables wrap to fit instead. */
.bl-prose table.bt { min-width: 0; table-layout: auto; }
.bl-prose table.bt th,
.bl-prose table.bt td { white-space: normal; }
.bl-prose table.bt td:first-child { font-weight: 600; color: var(--text); }

@media (max-width: 640px) {
  .bl-prose .tablewrap { overflow-x: visible; border: 0; border-radius: 0; }
  .bl-prose table.bt { min-width: 0; width: 100%; }
  .bl-prose table.bt thead { display: none; }
  .bl-prose table.bt tr {
    display: block;
    margin-bottom: 14px;
    background: linear-gradient(180deg, var(--panel), var(--bg2));
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
  }
  .bl-prose table.bt td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    white-space: normal;
    padding: 10px 14px;
  }
  .bl-prose table.bt td:first-child {
    background: rgba(245, 166, 35, .08);
    border-bottom: 1px solid var(--line);
  }
  .bl-prose .bt-label {
    display: block;
    flex: 0 0 auto;
    color: var(--amber);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .bl-prose .bt-val { text-align: right; }
  .bl-prose table.bt td:first-child .bt-label { color: var(--muted); }
}

/* ---------- short answer box ---------- */
.bl-answer {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-top: 3px solid var(--amber);
  border-radius: 10px;
  padding: 24px 26px;
  margin-bottom: 32px;
}
.bl-answer h2 {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 10px;
  padding: 0;
  border: 0;
}
.bl-answer p { color: var(--text); margin: 0; font-size: 1.06rem; line-height: 1.65; }
.bl-answer a { color: var(--amber); border-bottom: 1px solid rgba(245, 166, 35, .45); }

/* ---------- table of contents ----------
 * 🚨 The MOBILE table of contents is rendered inside
 * <article class="prose bl-prose">, so it inherits the site's list styling:
 * .prose li::before paints a ⚡ on every entry and .prose li adds 30px of
 * indent plus a bottom border. Stacked on this file's own numbering that gives
 * every line a bolt AND a number, double-indented, with a stray rule under the
 * last item. Reset the inherited list styling for both TOCs before styling them.
 */
.bl-toc li,
.bl-toc-mobile li {
  padding: 0;
  border-bottom: 0;
}
.bl-toc li::before,
.bl-toc-mobile li::before {
  content: none;
  display: none;
}

.bl-toc {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.bl-toc h2 {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 12px;
}
.bl-toc ol { list-style: none; counter-reset: toc; margin: 0; padding: 0; }
.bl-toc li { counter-increment: toc; margin: 0; }
.bl-toc a {
  display: block;
  padding: 7px 0 7px 26px;
  position: relative;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.4;
  border-bottom: 1px solid var(--line);
}
.bl-toc li:last-child a { border-bottom: 0; }
.bl-toc a::before {
  content: counter(toc) ".";
  position: absolute;
  left: 0;
  top: 7px;
  color: var(--amber);
  font-weight: 700;
  font-size: .82rem;
}
.bl-toc a:hover { color: var(--amber); }

.bl-toc-mobile { display: none; }

@media (max-width: 900px) {
  /* The sidebar drops below the article at this width, which puts the desktop
     TOC at the BOTTOM of a 1,200-word post where it is useless. Swap in a
     collapsed one directly under the short answer instead. */
  .bl-toc { display: none; }
  .bl-toc-mobile {
    display: block;
    margin-bottom: 26px;
    background: linear-gradient(180deg, var(--panel), var(--bg2));
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 4px 20px;
  }
  .bl-toc-mobile summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 0;
    font-family: var(--sans);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--amber);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 44px;
  }
  .bl-toc-mobile summary::-webkit-details-marker { display: none; }
  .bl-toc-mobile summary::after {
    content: "+";
    font-size: 1.3rem;
    line-height: 1;
    color: var(--amber);
  }
  .bl-toc-mobile[open] summary::after { content: "\2212"; }
  .bl-toc-mobile ol {
    list-style: none;
    counter-reset: toc;
    margin: 0;
    padding: 0 0 12px;
    border-top: 1px solid var(--line);
  }
  .bl-toc-mobile li { counter-increment: toc; }
  .bl-toc-mobile a {
    display: block;
    position: relative;
    padding: 11px 0 11px 26px;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.4;
    border-bottom: 1px solid var(--line);
  }
  .bl-toc-mobile li:last-child a { border-bottom: 0; }
  .bl-toc-mobile a::before {
    content: counter(toc) ".";
    position: absolute;
    left: 0;
    top: 10px;
    color: var(--amber);
    font-weight: 700;
    font-size: .84rem;
  }
}

/* ---------- hub: category nav ---------- */
.bl-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 34px;
}
.bl-nav a {
  padding: 11px 20px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  transition: .25s ease;
}
.bl-nav a:hover { border-color: var(--amber); color: var(--amber); }
.bl-nav a[aria-current="page"] {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

/* ---------- hub: cards ----------
 * .rcard is the site's own card. These add the meta line and make the whole
 * card a grid so the "Read →" affordance pins to the bottom regardless of how
 * long the title runs — otherwise a 2-line and a 4-line card in the same row
 * put their arrows at different heights.
 */
.bl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* Cards carry the featured image. .rcard was built for the text-only
 * /resources/ hub, so the padding moves onto an inner body and the media sits
 * flush to the card edge. */
.bl-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.bl-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
}
.bl-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.bl-card:hover .bl-card-media img { transform: scale(1.04); }
.bl-card-body {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  padding: 22px 24px 24px;
  flex: 1;
}
.bl-cat {
  color: var(--amber);
  font-weight: 800;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  border-bottom: 1px solid transparent;
}
a.bl-cat:hover { border-bottom-color: var(--amber); }
.bl-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  color: var(--muted);
  font-size: .82rem;
}
.bl-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

/* Lead article on the hub — image beside the copy on desktop, stacked below
 * 900px where the column is too narrow for both. */
.bl-featured {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-top: 3px solid var(--amber);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: stretch;
}
.bl-featured-media {
  display: block;
  overflow: hidden;
  background: var(--bg2);
  min-height: 100%;
}
.bl-featured-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  transition: transform .5s ease;
}
.bl-featured:hover .bl-featured-media img { transform: scale(1.03); }
.bl-featured-body { padding: 34px; align-self: center; }

/* Article hero. The page-hero above it is the site's gradient-and-bolt band, so
 * the photo sits at the top of the article rather than behind the H1 — that
 * keeps the headline on the site's own hero treatment instead of inventing a
 * new one for the blog. */
.bl-hero-img {
  margin: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg2);
  line-height: 0;
}
.bl-hero-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.bl-featured h2 {
  font-size: clamp(1.65rem, 3.6vw, 2.3rem);
  line-height: 1.08;
  margin: 12px 0 12px;
}
.bl-featured h2 a { color: #fff; }
.bl-featured h2 a:hover { color: var(--amber); }
.bl-featured p { font-size: 1.04rem; max-width: 62ch; }
.bl-featured .btn { margin-top: 22px; }

.bl-empty {
  border: 1px dashed var(--line2);
  border-radius: 10px;
  padding: 44px 28px;
  text-align: center;
}
.bl-empty a { color: var(--amber); border-bottom: 1px solid rgba(245, 166, 35, .45); }

/* ---------- /resources/ two-lane chooser -------------------------------------
 * The Advice hub's job on landing is to let someone pick between reference
 * material and the newest writing. Stacking the guides grid above the articles
 * put the second option ~2,500px down, where it may as well not exist. Two
 * lanes side by side, each previewing its own content, does the same job in one
 * screen.
 *
 * auto-fit, not `1fr 1fr`: build/generate.py emits the guides lane and
 * scripts/build_blog.py injects the articles lane on deploy, so the row has to
 * look deliberate with only one child in it.
 */
.advice-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 22px;
  align-items: start;
}
.advice-lane {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-top: 3px solid var(--amber);
  border-radius: 12px;
  padding: 30px 30px 26px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.advice-lane h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.05;
  margin-bottom: 8px;
}
.advice-lane .lane-lede {
  color: var(--muted);
  font-size: .96rem;
  line-height: 1.55;
  margin-bottom: 20px;
}

.lane-row {
  display: block;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  transition: .22s ease;
}
.lane-row:hover .lane-title { color: var(--amber); }
.lane-kicker {
  display: block;
  color: var(--amber);
  font-weight: 800;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.lane-title {
  display: block;
  color: #fff;
  font-family: var(--disp);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .01em;
  font-size: 1.08rem;
  line-height: 1.12;
  transition: color .22s ease;
}
.lane-desc {
  display: block;
  color: var(--muted);
  font-size: .89rem;
  line-height: 1.5;
  margin-top: 6px;
  /* Two lines, so both lanes stay the same visual weight regardless of how long
     a description runs. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Article rows carry a thumbnail; guide rows do not. */
.lane-row-img { display: grid; grid-template-columns: 104px 1fr; gap: 16px; align-items: start; }
.lane-thumb {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: var(--bg2);
  border: 1px solid var(--line);
}
.lane-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lane-row-img .lane-desc { -webkit-line-clamp: 2; }

.lane-cta { margin-top: auto; align-self: flex-start; }
.advice-lane .lane-row + .lane-cta { margin-top: 22px; }

@media (max-width: 640px) {
  .advice-lane { padding: 24px 22px 22px; }
  .lane-row-img { grid-template-columns: 84px 1fr; gap: 13px; }
  .lane-cta { width: 100%; }
}

/* ---------- post footer line ---------- */
.bl-post-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 38px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: .88rem;
  color: var(--muted);
}
.bl-post-foot a { color: var(--amber); font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .bl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .bl-featured { grid-template-columns: 1fr; }
  .bl-featured-media img { min-height: 0; aspect-ratio: 16 / 9; }
  .bl-featured-body { padding: 26px; }
}
@media (max-width: 640px) {
  .bl-grid { grid-template-columns: 1fr; }
  .bl-featured-body { padding: 22px; }
  .bl-card-body { padding: 18px 20px 20px; }
  .bl-hero-img { margin-bottom: 24px; border-radius: 10px; }
  .bl-answer { padding: 20px; }
  .bl-toc-mobile { padding: 2px 16px; }
  .bl-nav { gap: 8px; }
  .bl-nav a { padding: 10px 15px; font-size: .82rem; }
  .bl-prose h2 { margin-top: 32px; padding-top: 22px; }
}
