/* ==================================================================
   Blog styles for the Nursing Home Complaints Directory.
   Shared by the published blog pages (_post_base.html / index.html)
   AND by the CKEditor WYSIWYG iframe in admin_editor.html, so what you
   see while writing matches what the published post looks like.
   ================================================================== */

:root {
  --nh-primary:   #0d6efd;
  --nh-primary-d: #0b5ed7;
  --nh-ink:       #212529;
  --nh-muted:     #6c757d;
  --nh-border:    #e9ecef;
  --nh-bg:        #f7f8fa;
  --nh-surface:   #ffffff;
  --nh-surface-2: #f8f9fb;
  --nh-primary-lt:#eaf2ff;
  --nh-gold:      #E8A020;
  --nh-gold-lt:   #FEF3DC;

  --border:     var(--nh-border);
  --ink-3:      #495057;
  --ink-4:      #adb5bd;
  --surface-2:  var(--nh-surface-2);
  --primary-lt: var(--nh-primary-lt);
  --bs-primary: var(--nh-primary);
  --gold:       var(--nh-gold);
  --gold-lt:    var(--nh-gold-lt);
}

body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--nh-bg);
  color: var(--nh-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .serif {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--nh-ink);
}
a { color: var(--nh-primary); }
a:hover { color: var(--nh-primary-d); }

/* ---- Top bar ---- */
.blog-topbar {
  background: #fff;
  border-bottom: 1px solid var(--nh-border);
  padding: .85rem 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.blog-brand {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--nh-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.blog-brand:hover { color: var(--nh-primary); }
.blog-topbar-links {
  display: flex;
  gap: 1.25rem;
  font-size: .9rem;
  font-weight: 600;
}
.blog-topbar-links a {
  color: var(--nh-muted);
  text-decoration: none;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.blog-topbar-links a:hover,
.blog-topbar-links a.active {
  color: var(--nh-primary);
  border-bottom-color: var(--nh-primary);
}

/* ---- Shell + two-column layout ---- */
.blog-shell { padding: 2.5rem 0 4rem; }
.blog-main { min-width: 0; }
.blog-sidebar { min-width: 0; }
@media (min-width: 992px) {
  .blog-sidebar { position: sticky; top: 5rem; }
}

/* ---- Blog index header ---- */
.blog-header { margin-bottom: 2rem; }
.section-kicker {
  display: inline-block;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--nh-primary); background: var(--nh-primary-lt);
  border-radius: 40px; padding: .35rem .9rem; margin-bottom: 1rem;
}
.section-h {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0 0 .5rem;
}
.clear-filter-link {
  display: inline-block;
  font-size: .85rem;
  color: var(--nh-muted);
  text-decoration: none;
  margin-top: .25rem;
}
.clear-filter-link:hover { color: var(--nh-primary); }

/* ---- Post list ---- */
.post-list { display: flex; flex-direction: column; gap: 1.25rem; }
.post-list-item {
  background: var(--nh-surface);
  border: 1px solid var(--nh-border);
  border-radius: 14px;
  padding: 1.75rem 1.75rem 1.5rem;
  transition: box-shadow .15s, transform .15s;
}
.post-list-item:hover {
  box-shadow: 0 8px 24px rgba(13,110,253,.07);
  transform: translateY(-2px);
}
.post-list-item h2 {
  font-size: 1.4rem;
  margin: 0 0 .4rem;
  line-height: 1.25;
}
.post-list-item h2 a { color: var(--nh-ink); text-decoration: none; }
.post-list-item h2 a:hover { color: var(--nh-primary); }
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .82rem;
  color: var(--nh-muted);
  margin-bottom: .85rem;
}
.post-meta i { margin-right: .3rem; }
.post-tags { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.post-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--nh-primary);
  background: var(--nh-primary-lt);
  border-radius: 40px;
  padding: .2rem .6rem;
  text-decoration: none;
}
.post-tag:hover { background: #d7e6ff; color: var(--nh-primary-d); }
.post-excerpt {
  color: var(--nh-muted);
  font-size: .95rem;
  margin: 0 0 1rem;
  max-width: 62ch;
}
.read-more {
  font-weight: 600;
  font-size: .9rem;
  color: var(--nh-primary);
  text-decoration: none;
}
.read-more:hover { text-decoration: underline; }
.post-list-empty {
  background: var(--nh-surface);
  border: 1px dashed var(--nh-border);
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
  color: var(--nh-muted);
}

/* ---- Pagination ---- */
.blog-pagination {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 2rem;
}

/* ---- Sidebar ---- */
.blog-search-form {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.5rem;
}
.blog-search-input {
  border-radius: 40px !important;
  font-size: .88rem;
  padding: .5rem .9rem;
}
.blog-search-btn {
  border-radius: 40px !important;
  padding: .5rem 1rem;
}
.sidebar-block {
  background: var(--nh-surface);
  border: 1px solid var(--nh-border);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}
.sidebar-heading {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: .95rem;
  margin: 0 0 .75rem;
}
.sidebar-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .88rem;
}
.sidebar-post-list li {
  border-bottom: 1px solid var(--nh-border);
  padding: .5rem 0;
}
.sidebar-post-list li:last-child { border-bottom: none; }
.sidebar-post-list a {
  color: var(--nh-ink);
  text-decoration: none;
  display: block;
}
.sidebar-post-list a:hover { color: var(--nh-primary); }
.sidebar-post-list li.active a { color: var(--nh-primary); font-weight: 600; }
.sidebar-empty { color: var(--nh-muted); font-style: italic; border: none; }

/* ---- Article ---- */
.blog-article {
  background: var(--nh-surface);
  border: 1px solid var(--nh-border);
  border-radius: 14px;
  padding: 2.5rem 2.5rem 2rem;
}
.blog-article h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin: 0 0 .75rem;
  line-height: 1.15;
}
.blog-article h2 { font-size: 1.5rem; margin: 2rem 0 .75rem; }
.blog-article h3 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; }
.blog-article p,
.blog-article li {
  font-size: 1rem;
  line-height: 1.75;
}
.blog-article p { margin: 0 0 1rem; }
.blog-article ul,
.blog-article ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.blog-article li { margin-bottom: .35rem; }
.blog-article blockquote {
  border-left: 4px solid var(--nh-primary);
  padding: .5rem 1rem;
  background: var(--nh-surface-2);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--nh-muted);
  margin: 1.25rem 0;
}
.blog-article img,
.blog-article figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  display: block;
}
.blog-article a { text-decoration: underline; }
.blog-article code {
  background: #f1f3f5;
  padding: .05rem .35rem;
  border-radius: 4px;
  font-size: .88em;
}
.blog-article pre {
  background: #1a1d21;
  color: #e9ecef;
  padding: 1rem 1.15rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: .88em;
}
.blog-article pre code { background: transparent; color: inherit; padding: 0; }
.blog-article hr {
  border: none;
  border-top: 1px solid var(--nh-border);
  margin: 2rem 0;
}
.blog-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .92rem;
}
.blog-article th,
.blog-article td {
  border: 1px solid var(--nh-border);
  padding: .5rem .7rem;
  text-align: left;
}
.blog-article th { background: var(--nh-surface-2); font-weight: 700; }
@media (max-width: 575px) {
  .blog-article { padding: 1.5rem 1.25rem 1.25rem; }
}

/* ==================================================================
   Severity tier swatch block — used in blog post bodies.
   Styled entirely with classes (no inline styles) so CKEditor's
   content filter preserves the markup when a post is opened in the
   admin editor and re-saved.
   ================================================================== */
.nh-swatch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}
.nh-swatch-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nh-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}
.nh-swatch-minor    { background: #28a745; }
.nh-swatch-potential { background: #ffc107; }
.nh-swatch-actual   { background: #fd7e14; }
.nh-swatch-jeopardy { background: #dc3545; }

/* ---- Comments ---- */
.blog-comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0,0,0,.08);
}
.comments-heading {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.comments-loading { color: var(--nh-muted); font-size: .9rem; }
.comment-composer textarea { resize: vertical; min-height: 84px; }
.comment-composer .comment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .5rem;
}
.text-muted-ink { color: var(--nh-muted); }
.comment-signup-cta {
  border: 1px dashed rgba(0,0,0,.15);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.comment-thread { list-style: none; padding-left: 0; margin: 1.5rem 0 0; }
.comment-thread .comment-thread {
  margin-left: 1.75rem;
  margin-top: .9rem;
  border-left: 2px solid rgba(0,0,0,.08);
  padding-left: 1rem;
}
.comment-item { padding: .85rem 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.comment-thread .comment-thread .comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--nh-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; flex-shrink: 0;
  text-transform: uppercase;
}
.comment-body-row { display: flex; gap: .65rem; }
.comment-author { font-weight: 600; font-size: .92rem; }
.comment-meta { font-size: .78rem; color: #8a8a97; }
.comment-text { margin: .3rem 0 .4rem; white-space: pre-wrap; word-break: break-word; }
.comment-text.removed { font-style: italic; color: #8a8a97; }
.comment-controls { display: flex; align-items: center; gap: .9rem; font-size: .82rem; }
.comment-vote-btn {
  background: none; border: none; padding: 0 .15rem;
  color: #8a8a97; cursor: pointer;
}
.comment-vote-btn.active { color: var(--nh-primary); font-weight: 700; }
.comment-vote-btn:hover { color: var(--nh-primary); }
.comment-score { font-weight: 600; min-width: 1.2em; text-align: center; display: inline-block; }
.comment-reply-btn, .comment-mod-btn {
  background: none; border: none; color: #8a8a97;
  font-size: .82rem; cursor: pointer; padding: 0;
}
.comment-reply-btn:hover, .comment-mod-btn:hover {
  color: var(--nh-primary); text-decoration: underline;
}
.comment-mod-btn.danger:hover { color: #d9534f; }
.comment-mod-badge {
  font-size: .68rem; padding: .1rem .45rem; border-radius: 40px;
  background: #fff3cd; color: #7a5c00; margin-left: .4rem;
}
.comment-reply-form { margin-top: .6rem; }
.comment-empty { color: #8a8a97; font-size: .9rem; }

/* ---- Footer ---- */
.blog-footer {
  background: #1a1d21;
  color: #adb5bd;
  padding: 2.5rem 0;
  margin-top: 3rem;
  font-size: .88rem;
}
.blog-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.blog-footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.blog-footer a { color: #adb5bd; text-decoration: none; }
.blog-footer a:hover { color: #fff; }