/* ============================================================
   Commercial Space NJ — blog styles
   Loaded only on /blog pages, after /css/content.css.
   Reuses the .csx-* content system and the navy/blue tokens;
   everything here is additive and namespaced .csx-post / .csx-blog.
   ============================================================ */

/* ---------- Post hero ---------- */
.csx-post-hero h1 {
  max-width: 26ch;
  text-wrap: balance;
  font-size: clamp(1.875rem, 3.8vw, 2.875rem);
}
.csx-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
  margin: 0;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.78);
  font-variant-numeric: tabular-nums;
}
.csx-byline img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid rgba(255, 255, 255, 0.25);
}
.csx-byline strong {
  font-weight: 700;
  color: #fff;
}
.csx-by,
.csx-by-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}
.csx-by-meta span[aria-hidden] {
  opacity: 0.4;
}
@media only screen and (min-width: 40rem) {
  .csx-by-meta {
    padding-left: 0.875rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
  }
}

/* ---------- Article layout: body + sticky contents ---------- */
.csx-post {
  padding: clamp(2.75rem, 5vw, 4rem) 1rem 0;
}
.csx-post-grid {
  display: grid;
  gap: 2rem;
}
.csx-toc {
  background-color: #fff;
  border: 1px solid var(--csxHairline);
  border-radius: 14px;
  box-shadow: var(--csxCardShadow);
  padding: 1.25rem 1.375rem;
}
.csx-toc h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--royalBlue);
  margin: 0 0 0.75rem;
}
.csx-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.125rem;
}
.csx-toc a {
  display: block;
  padding: 0.4rem 0 0.4rem 0.875rem;
  border-left: 2px solid var(--csxHairline);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--csxInkSoft);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.csx-toc a:hover {
  color: var(--headerColor);
  border-left-color: var(--royalBlue);
}
.csx-post-body section + section {
  margin-top: clamp(2.5rem, 4.5vw, 3.25rem);
}
.csx-post-body .csx-h2 {
  font-size: clamp(1.375rem, 2.3vw, 1.75rem);
  max-width: 36ch;
  text-wrap: balance;
}
/* Contents links land below the fixed header */
.csx-post-body .csx-h2,
#faq-title {
  scroll-margin-top: 6.5rem;
}
.csx-post-body .csx-body p {
  max-width: 70ch;
}
@media only screen and (min-width: 64rem) {
  .csx-post-grid {
    grid-template-columns: minmax(0, 1fr) 17rem;
    gap: 4rem;
    align-items: start;
  }
  .csx-toc {
    position: sticky;
    top: 7rem;
    order: 2;
  }
}

/* ---------- Author card ---------- */
.csx-author {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  background-color: #fff;
  border: 1px solid var(--csxHairline);
  border-radius: 14px;
  box-shadow: var(--csxCardShadow);
  padding: clamp(1.5rem, 3vw, 2rem);
  max-width: 60rem;
}
.csx-author img {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
}
.csx-author-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--royalBlue);
  margin-bottom: 0.35rem;
}
.csx-author h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--headerColor);
  margin: 0 0 0.5rem;
}
.csx-author p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--csxInk);
  margin: 0;
  max-width: 68ch;
}
.csx-author a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(4, 70, 241, 0.35);
  text-underline-offset: 0.15em;
}
@media only screen and (min-width: 40rem) {
  .csx-author {
    grid-template-columns: auto 1fr;
    gap: 1.75rem;
  }
}

/* ---------- Blog index ---------- */
.csx-blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.csx-post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #fff;
  border: 1px solid var(--csxHairline);
  border-radius: 14px;
  box-shadow: var(--csxCardShadow);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.csx-post-card:hover,
.csx-post-card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--csxCardShadowHover);
  border-color: rgba(4, 70, 241, 0.25);
}
.csx-post-cat {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--royalBlue);
  margin-bottom: 0.6rem;
}
.csx-post-card h2 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--headerColor);
  margin: 0 0 0.625rem;
  text-wrap: balance;
}
/* Whole card is the click target; the title link carries the name */
.csx-post-card h2 a {
  color: inherit;
}
.csx-post-card h2 a:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
}
.csx-post-card h2 a:focus-visible {
  outline: none;
}
.csx-post-card:has(h2 a:focus-visible) {
  outline: 2px solid var(--royalBlue);
  outline-offset: 3px;
}
.csx-post-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--csxInkSoft);
  margin: 0 0 1.25rem;
}
.csx-post-meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--csxHairline);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--csxInkSoft);
  font-variant-numeric: tabular-nums;
}
.csx-post-meta em {
  font-style: normal;
  font-weight: 700;
  color: var(--royalBlue);
}

/* Featured (first) post spans the full row */
.csx-post-card.csx-featured {
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
  background: linear-gradient(135deg, #fff 0%, #f5f8ff 100%);
  border-color: rgba(4, 70, 241, 0.18);
}
.csx-featured h2 {
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  font-weight: 800;
  line-height: 1.25;
  max-width: 34ch;
}
.csx-featured p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--csxInk);
  max-width: 68ch;
}
@media only screen and (min-width: 40rem) {
  .csx-blog-list {
    grid-template-columns: 1fr 1fr;
  }
  .csx-blog-list > li:first-child {
    grid-column: 1 / -1;
  }
}
@media only screen and (min-width: 64rem) {
  .csx-blog-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .csx-post-card,
  .csx-toc a {
    transition: none;
  }
  .csx-post-card:hover,
  .csx-post-card:focus-within {
    transform: none;
  }
}
