/* Blog (/blog/, /blog/<slug>/) - a rich-text content column and a right
   sidebar (the site's one sold 300x250 ad slot + Local Businesses) on the
   post page, a full-width "More from NoVa Near Me" card strip
   (.blog-recent-section) below that, and a card grid on the index -
   .blog-recent-section reuses that same .blog-index-grid/.grid--3 styling,
   3 cards across, rather than its own layout. A post's cover image isn't
   shown as a banner on its own page - see render.js's renderBlogPostPage -
   only as the index/recent-posts card thumbnail (.blog-index-grid rules
   below). Layout mirrors guides.css's .topic-guide-grid; content typography
   is scoped under .blog-post-content since it's raw admin-authored HTML
   (sanitized server-side, see blog.js's sanitizeBlogHtml), not markup this
   file already has selectors for. */

/* The index page's own 728x90 leaderboard, above the breadcrumb/hero -
   same .promo-slot--leaderboard styling nova.css already defines for the
   city page's own top banner (city-shell.js's .city-top-ad), just a
   dedicated wrapper class rather than reusing that city-specific one. */
.blog-top-ad {
  padding: 18px 0;
}

/* Blog's own styled hero band, matching the pattern every other content
   type gets (.topic-guide-hero, .directory-hero, .city-hero) instead of
   reusing business-profile's plain .profile-hero. Blue gradient (not
   .topic-guide-hero's orange-eyebrow ink gradient) so the blog reads as
   its own section, not a guide. */
.blog-hero {
  background: linear-gradient(135deg, var(--ink) 0%, var(--blue) 160%);
  color: #fff;
  padding: 56px 0 44px;
}
.blog-hero .eyebrow {
  display: block;
  margin-bottom: 10px;
  color: #9ecbff;
}
.blog-hero .lead {
  color: #dce6f3;
}
.blog-hero .blog-post-meta {
  color: #dce6f3;
}
/* The published date sits on its own line below the byline, not inline
   after a middot the way it used to - same light blue as the eyebrow
   above it (#9ecbff), with the card meta row's own calendar icon
   (render.js's BLOG_CALENDAR_ICON) so it reads as its own labeled line
   rather than a trailing detail on the author line. */
.blog-post-date {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
  color: #9ecbff;
  font-size: 14px;
}
.blog-post-date svg {
  flex: 0 0 auto;
}
/* A post's <h1> gets a small document icon (render.js's BLOG_TITLE_ICON) -
   sized in em so it scales with .display--lg's own clamp() instead of
   sitting a fixed size next to responsive type. Blue accent (matching the
   eyebrow above it), not white like the title text, so it reads as a
   label mark rather than blending into the heading itself. */
.blog-post-title {
  display: flex;
  align-items: center;
  gap: 0.2em;
}
.blog-post-title svg {
  width: 0.62em;
  height: 0.62em;
  flex: 0 0 auto;
  color: #9ecbff;
}
/* Same green business-profile-controller.js uses for a listing's "Open
   Now" indicator (see .featured-open-dot/.featured-hours-line strong in
   business-profile.css) - the brighter #1db954 shade of that green
   (rather than the darker #0a7d35 text color, meant for a white card)
   since this sits on .blog-hero's dark gradient. */
.blog-post-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 12px 0 0;
  color: #1db954;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
.blog-post-category:hover,
.blog-post-category:focus-visible {
  text-decoration: underline;
}

/* Index card - photo with its own radius sitting inside the card's own
   padding (not bled to the card edges the way .card.guide's negative-
   margin trick works elsewhere), blue title, excerpt, a tag/date meta row
   with small inline icons, and a full-width pill "View Post" button. A
   dedicated .blog-card component (not .card.guide) since this shape - the
   photo radius, the pill button - is specific to the blog, not something
   guides.css's own cards should also pick up. */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 5px 14px rgba(11, 26, 46, 0.04);
  transition: box-shadow 0.2s ease;
}
.blog-card:hover {
  box-shadow: 0 10px 24px rgba(11, 26, 46, 0.09);
}
.blog-card__media {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.blog-card__media img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.blog-card:hover .blog-card__media img {
  transform: scale(1.06);
}
.blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card__body h2 {
  margin: 0 0 10px;
  font: 700 20px var(--sans);
}
.blog-card__body h2 a {
  color: var(--blue);
  text-decoration: none;
}
.blog-card__body h2 a:hover,
.blog-card__body h2 a:focus-visible {
  text-decoration: underline;
}
.blog-card__body > p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}
.blog-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.blog-card__meta-item svg {
  color: var(--orange);
  flex: 0 0 auto;
}
.blog-card__category {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}
.blog-card__category:hover,
.blog-card__category:focus-visible {
  text-decoration: underline;
}
.blog-card__cta {
  display: block;
  width: 100%;
  margin-top: auto;
  padding: 13px 0;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  min-height: 0;
}
.blog-card__cta:hover,
.blog-card__cta:focus-visible {
  background: #0046ad;
  color: #fff;
}

/* --- Tag pills (/blog/?tag=<slug>) --------------------------------------
   A post can carry several (unlike category, one per card/post) - shown
   below the card's meta row on the index, and in a post's own header (not
   the bottom, so a reader sees them before reading rather than after),
   both linking out to the same filtered-index state a category pill
   already uses. Deliberately plainer than .blog-category-filter's pill
   buttons (no active/selected state to show here, since a post can match
   more than one tag at once) so they read as lightweight labels, not
   another set of primary actions competing with "View Post". */
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.blog-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.blog-tag svg {
  flex: 0 0 auto;
}
.blog-tag:hover,
.blog-tag:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}
/* Post header sits on .blog-hero's dark gradient (see below) - the plain
   light-card colors above would be nearly invisible there, so this is a
   separate light-on-dark variant, not just a spacing tweak. */
.blog-hero .blog-tags {
  margin: 14px 0 0;
}
.blog-hero .blog-tag {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.blog-hero .blog-tag:hover,
.blog-hero .blog-tag:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: #fff;
  color: #fff;
}

/* --- Category filter chips (/blog/?category=<slug>) -------------------- */
.blog-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.blog-category-filter a {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.blog-category-filter a:hover,
.blog-category-filter a:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}
.blog-category-filter a.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.blog-post-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.blog-post-meta {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 14px;
}

/* Everything below styles the raw HTML a Quill-produced post body actually
   contains (see blog.js's ALLOWED_TAGS) - no class selectors, since none
   of these tags carry one. */
.blog-post-content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  /* No fixed max-width - .blog-post-grid's 1fr content column already
     caps this at container-width minus the 300px sidebar and 40px gap,
     so a fixed cap here just left dead white space between the text and
     the sidebar on wide screens instead of doing anything useful. */
}
.blog-post-content > *:first-child {
  margin-top: 0;
}
/* A left/right-floated image (see the size-preset rules below) is pulled
   out of normal flow, so if one ends up as the last thing in the post the
   container would otherwise collapse to zero height under it. */
.blog-post-content::after {
  content: '';
  display: table;
  clear: both;
}
.blog-post-content p,
.blog-post-content div {
  margin: 0 0 18px;
}
.blog-post-content h2 {
  font: 400 30px var(--serif);
  margin: 36px 0 14px;
}
.blog-post-content h3 {
  font: 400 24px var(--serif);
  margin: 30px 0 12px;
}
.blog-post-content h4 {
  font: 700 16px var(--sans);
  margin: 24px 0 10px;
}
.blog-post-content ul,
.blog-post-content ol {
  margin: 0 0 18px;
  padding-left: 24px;
}
.blog-post-content li {
  margin-bottom: 8px;
}
.blog-post-content blockquote {
  margin: 0 0 18px;
  padding: 4px 20px;
  border-left: 3px solid var(--blue);
  color: var(--muted);
  font-style: italic;
}
.blog-post-content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(0, 84, 204, 0.35);
  text-underline-offset: 2px;
}
.blog-post-content a:hover,
.blog-post-content a:focus-visible {
  text-decoration-color: var(--blue);
}
.blog-post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 8px auto 22px;
  border-radius: 10px;
}
/* Size presets the admin editor's image toolbar applies (see
   admin-blog-controller.js) - the only styling an inline image can carry,
   see blog.js's sanitizeBlogHtml IMG_CLASS_ALLOWED. Unclassed images stay
   full-width (the default rule above). */
.blog-post-content img.blog-img--small { max-width: 280px; }
.blog-post-content img.blog-img--medium { max-width: 480px; }
.blog-post-content img.blog-img--large { max-width: 720px; }
/* Float/wrap presets, same toolbar - override the block-and-centered
   default above so the following paragraph's text wraps around the image
   instead of sitting below it. */
.blog-post-content img.blog-img--float-left {
  float: left;
  margin: 4px 15px 15px 0;
}
.blog-post-content img.blog-img--float-right {
  float: right;
  margin: 4px 0 15px 15px;
}
.blog-post-content hr {
  margin: 32px 0;
  border: none;
  border-top: 1px solid var(--line);
}

.blog-sidebar {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 24px;
}
.blog-sidebar__block h3 {
  font: 400 20px var(--serif);
  margin: 0 0 12px;
  color: var(--ink);
}

/* "Local Businesses" - a post-page-only sidebar card styled after
   Google's own web-result list (source icon + label, bold title, one-line
   snippet, a thumbnail, divider rules between rows) but linking to real
   directory listings instead of an external source. render.js's
   renderBlogBusinessItem/renderBlogSidebar picks the businesses (Featured
   listings only, 3 random ones per request - getHomePopularBusinesses
   called with featuredOnly: true, random: true) - not content matched to
   the post itself, since there's no per-post business linking in the
   data model. */
.blog-sidebar__businesses {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 8px;
}
.blog-sidebar__businesses h3 {
  padding: 0 2px;
}
.blog-business-list {
  display: grid;
  overflow: hidden;
  /* Approximate 2-item height so there's no flash of the full (up to 10)
     list before JS measures the real heights and takes over - see
     blog-controller.js's wireBusinessListToggle. */
  max-height: 260px;
  transition: max-height 0.25s ease;
}
.blog-business-list.is-expanded {
  overflow-y: auto;
}
.blog-business-list__toggle {
  display: block;
  width: 100%;
  margin: 6px 0 0;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}
.blog-business-list__toggle:hover,
.blog-business-list__toggle:focus-visible {
  text-decoration: underline;
}
.blog-business-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.blog-business-item:first-child {
  border-top: none;
  padding-top: 0;
}
.blog-business-item__body {
  min-width: 0;
  flex: 1;
}
.blog-business-item__source {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}
.blog-business-item__source img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.blog-business-item__title {
  margin: 0 0 4px;
  font: 700 15px var(--sans);
  color: var(--ink);
  line-height: 1.3;
}
.blog-business-item:hover .blog-business-item__title,
.blog-business-item:focus-visible .blog-business-item__title {
  color: var(--blue);
  text-decoration: underline;
}
.blog-business-item__snippet {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-business-item__media {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
}
.blog-business-list__all {
  display: block;
  margin: 4px 0 10px;
  padding: 10px 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
}
.blog-business-list__all:hover,
.blog-business-list__all:focus-visible {
  background: var(--line);
}

.blog-sidebar__promo {
  width: 300px;
  max-width: 100%;
  aspect-ratio: 300 / 250;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 22px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.blog-sidebar__promo:has(.promo-slot__link) {
  background: none;
  border: none;
  padding: 0;
  aspect-ratio: auto;
}
.blog-sidebar__promo .promo-slot__link {
  width: 100%;
}
.blog-sidebar__promo .promo-slot__link img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}
.blog-sidebar__promo-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
  margin-bottom: 8px;
}
.blog-sidebar__promo p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

@media (max-width: 900px) {
  .blog-post-grid { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
  .blog-sidebar__promo { margin: 0 auto; }
}
