/*
 * nexus-store — Medi Messages (everpsblog) layout. Original work, Nexus Labs 2026.
 * Structure only: column widths, spacing, the card grid and the home strip. Every colour, font and radius
 * is a theme token (var(--nx-*)), so the Theme team's palette/typography rules restyle it without edits here.
 * Markup: themes/nexus-store/modules/everpsblog/views/themes/flat/** (classes listed in docs/design/medi-messages.md).
 * r2 2026-10-14: breadcrumb aligned + ellipsis (see end). .rN in the file name = cache-buster (Cloudflare caches theme CSS by URL); bump N on every change.
 */

/* ---------- page column (listing, category, post) ---------- */
.nx-blog {
  max-width: 820px;
  margin: 0 auto;
  padding: var(--nx-space-6) 0 var(--nx-space-9);
  background: transparent;
  font-family: var(--nx-font);
  color: var(--nx-text);
}
#content.nx-blog { box-shadow: none; border: 0; }

.nx-blog-breadcrumb { margin-bottom: 0; }

.nx-blog__header { margin-bottom: var(--nx-space-7); }
.nx-blog__title {
  margin: 0 0 var(--nx-space-2);
  font-family: var(--nx-font-heading);
  font-size: var(--nx-fs-hero);
  line-height: var(--nx-lh-tight);
  color: var(--nx-text-strong);
}
.nx-blog__intro {
  margin: 0;
  font-size: var(--nx-fs-lg);
  line-height: var(--nx-lh);
  color: var(--nx-text-soft);
}
.nx-blog__text { margin-bottom: var(--nx-space-7); }
.nx-blog__text--bottom { margin: var(--nx-space-7) 0 0; }
.nx-blog__empty { color: var(--nx-text-soft); }
.nx-blog__pinned { margin-bottom: var(--nx-space-5); }
.nx-blog__list { display: flex; flex-direction: column; gap: var(--nx-space-4); }
.nx-blog__pagination { margin-top: var(--nx-space-7); }
.nx-blog__back { margin: var(--nx-space-8) 0 0; }
.nx-blog__back a { color: var(--nx-link); font-weight: 500; }
.nx-blog__back a:hover { color: var(--nx-link-hover); }

/* ---------- card ---------- */
.nx-blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
}
.nx-blog-card__media { display: block; aspect-ratio: 1200 / 630; overflow: hidden; background: var(--nx-surface-2); }
.nx-blog-card__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nx-blog-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--nx-space-2);
  padding: var(--nx-space-5) var(--nx-space-6);
}
.nx-blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--nx-space-3);
  font-size: var(--nx-fs-md);
  letter-spacing: var(--nx-tracking);
  text-transform: uppercase;
  color: var(--nx-text-muted);
}
.nx-blog-card__badge {
  padding: 2px var(--nx-space-2);
  border: 1px solid var(--nx-accent);
  border-radius: var(--nx-radius-pill);
  color: var(--nx-accent);
  font-weight: 600;
}
.nx-blog-card__title {
  margin: 0;
  font-family: var(--nx-font-heading);
  font-size: var(--nx-fs-xl);
  line-height: var(--nx-lh-tight);
  font-weight: 600;
  text-transform: none;
}
.nx-blog-card__title a { color: var(--nx-text-strong); }
.nx-blog-card__title a:hover { color: var(--nx-link-hover); }
.nx-blog-card__excerpt { margin: 0; font-size: var(--nx-fs-body); line-height: var(--nx-lh); color: var(--nx-text-soft); }
.nx-blog-card__link {
  align-self: flex-start;
  margin-top: var(--nx-space-1);
  font-size: var(--nx-fs-ui);
  font-weight: 600;
  color: var(--nx-link);
}
.nx-blog-card__link:hover { color: var(--nx-link-hover); }
.nx-blog-card__arrow { margin-left: var(--nx-space-1); }

.nx-blog-card--pinned { border-color: var(--nx-border-dark); }
.nx-blog-card--pinned .nx-blog-card__title { font-size: var(--nx-fs-h1); }

/* ---------- post ---------- */
.nx-blog-post__header { margin-bottom: var(--nx-space-6); }
.nx-blog-post__meta { margin-bottom: var(--nx-space-2); font-size: var(--nx-fs-md); letter-spacing: var(--nx-tracking); text-transform: uppercase; color: var(--nx-text-muted); }
.nx-blog-post__title {
  margin: 0;
  font-family: var(--nx-font-heading);
  font-size: var(--nx-fs-hero);
  line-height: var(--nx-lh-tight);
  color: var(--nx-text-strong);
}
.nx-blog-post__media { margin: 0 0 var(--nx-space-7); border-radius: var(--nx-radius-lg); overflow: hidden; }
.nx-blog-post__img { display: block; width: 100%; height: auto; }
.nx-blog-post__content { font-size: var(--nx-fs-lg); line-height: var(--nx-lh); color: var(--nx-text); overflow-wrap: anywhere; }
.nx-blog-post__content img { max-width: 100%; height: auto; }
.nx-blog-post__password { display: flex; flex-direction: column; gap: var(--nx-space-3); max-width: 360px; margin-top: var(--nx-space-4); }
.nx-blog-post__products { margin-top: var(--nx-space-8); }
.nx-blog-post__products-title { margin: 0 0 var(--nx-space-5); font-size: var(--nx-fs-h2); color: var(--nx-text-strong); }

/* ---------- home strip (CE home, doc 17) ---------- */
.nx-blog-strip { max-width: var(--nx-container); margin: 0 auto; padding: var(--nx-space-8) var(--nx-space-4); }
.nx-blog-strip__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--nx-space-3);
  margin-bottom: var(--nx-space-6);
}
.nx-blog-strip__title { margin: 0; font-family: var(--nx-font-heading); font-size: var(--nx-fs-h2); color: var(--nx-text-strong); }
.nx-blog-strip__all { font-size: var(--nx-fs-ui); font-weight: 600; color: var(--nx-link); }
.nx-blog-strip__all:hover { color: var(--nx-link-hover); }
.nx-blog-strip__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--nx-space-5); }
.nx-blog-card--compact .nx-blog-card__body { padding: var(--nx-space-4) var(--nx-space-5); flex: 1; }
.nx-blog-card--compact .nx-blog-card__title { font-size: var(--nx-fs-lg); }
.nx-blog-card--compact .nx-blog-card__link { margin-top: auto; }

/* ---------- breakpoints (991 / 767 / 480) ---------- */
@media (max-width: 991px) {
  .nx-blog-strip__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .nx-blog { padding-top: var(--nx-space-4); }
  .nx-blog__title, .nx-blog-post__title { font-size: calc(var(--nx-fs-h1) + 4px); }
  .nx-blog-card__body { padding: var(--nx-space-4); }
  .nx-blog-card--pinned .nx-blog-card__title { font-size: var(--nx-fs-xl); }
  .nx-blog-post__content { font-size: var(--nx-fs-body); }
  .nx-blog-strip { padding: var(--nx-space-7) var(--nx-space-4); }
  .nx-blog-strip__list { grid-template-columns: minmax(0, 1fr); gap: var(--nx-space-4); }
}

/* ---------- r2: breadcrumb on the blog pages ----------
 * The breadcrumb sits in the layout above #content; align it to the same 820px column as the page
 * (custom.css sets `nav.breadcrumb { margin: 0 }`, hence the nav.breadcrumb prefix). On phones the theme keeps its
 * own sideways-scrolling crumb row (custom.css @767), so a long post title scrolls rather than wraps. */
nav.breadcrumb.nx-blog-breadcrumb { max-width: 820px; margin-left: auto; margin-right: auto; }

/* r3 (sandbox #136, 2026-11-04; Marlon: "lock font and font size so all posts will look the same no matter who's
   typing"). Text pasted into the BO editor from Word, Google Docs or a phone carries inline font-family, font-size,
   colour and background. Inside a post body every element falls back to the theme's text style; the editor's
   headings get fixed theme sizes; bold, italic, lists, links and alignment still work. */
.nx-blog-post__content,
.nx-blog-post__content * {
  font-family: var(--nx-font) !important;
  letter-spacing: normal !important;
  font-variant: normal !important;
}
.nx-blog-post__content * {
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  background: transparent !important;
  background-color: transparent !important;
}
.nx-blog-post__content h1, .nx-blog-post__content h2 { font-size: var(--nx-fs-h3) !important; }
.nx-blog-post__content h3 { font-size: var(--nx-fs-xl) !important; }
.nx-blog-post__content h4, .nx-blog-post__content h5, .nx-blog-post__content h6 { font-size: var(--nx-fs-lg) !important; }
.nx-blog-post__content h1, .nx-blog-post__content h2, .nx-blog-post__content h3,
.nx-blog-post__content h4, .nx-blog-post__content h5, .nx-blog-post__content h6 {
  margin: 1.4em 0 .5em !important; font-weight: 700 !important; line-height: 1.3 !important; color: var(--nx-text-strong) !important;
}
.nx-blog-post__content a, .nx-blog-post__content a * { color: var(--nx-link) !important; }
.nx-blog-post__content p { margin: 0 0 1em !important; }

/* r4 2026-11-23: cap tall pictures. Staff uploaded a 1080x1842 portrait as the featured image and it rendered
 * ~1300px tall at column width. Featured and in-text pictures now stop at 70% of the screen (max 640px), stay
 * uncropped and centre; wide banners (1200x630) are unchanged. !important beats TinyMCE's inline width/height. */
.nx-blog-post__media { display: flex; justify-content: center; background: var(--nx-surface-2); }
.nx-blog-post__img { width: auto; max-width: 100%; height: auto; max-height: min(70vh, 640px); object-fit: contain; }
.nx-blog-post__content img {
  display: block !important; width: auto !important; max-width: 100% !important; height: auto !important;
  max-height: min(70vh, 640px) !important; object-fit: contain; margin: 1.5em auto !important; border-radius: var(--nx-radius-lg);
}
