/* ── Blog list & single post pages ── */
:root {
  --yellow: #FFDB00;
  --blue: #0058A3;
  --dark-blue: #003E74;
  --white: #FFFFFF;
  --off-white: #F7F6F1;
  --light-gray: #ECEAE3;
  --dark: #111111;
  --mid: #5A5A5A;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Barlow', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--sans); background: var(--white); color: var(--dark); }
html.mbs-embedded,
html.mbs-embedded body {
  overflow-x: clip;
  min-height: 100%;
}

.blog-page-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ── Blog LIST page: sidebar + main area ── */
.blogs-page {
  position: relative;
  z-index: 0;
  background: var(--off-white);
  padding-bottom: 64px;
}
.blogs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-areas: "sidebar main";
  gap: 36px;
  padding-top: 28px;
  padding-bottom: 32px;
  align-items: start;
  width: 100%;
}
.blogs-sidebar { grid-area: sidebar; }
.blogs-main { grid-area: main; }
.blogs-list-header,
.blogs-main {
  min-width: 0;
  width: 100%;
}
.blogs-sidebar {
  display: block;
  min-width: 220px;
  position: sticky;
  top: 130px;
  z-index: 1;
}
/* SPA iframe: parent page already shows the site header */
html.mbs-embedded .blogs-sidebar {
  top: 20px;
}
.blogs-sidebar .sidebar-block {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: 14px;
  padding: 18px 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,62,116,0.04);
}
.blogs-sidebar .sidebar-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--dark-blue);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--yellow);
  display: inline-block;
}

/* Categories list — yellow panel inside the white sidebar card */
.blogs-sidebar-cats {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: static;
  background: var(--yellow);
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
  box-shadow: none;
}
.blogs-sidebar-loading {
  font-size: 13px;
  color: var(--dark-blue);
  padding: 10px 14px;
  font-weight: 500;
}
.blogs-sidebar-cats a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark-blue);
  text-decoration: none;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
.blogs-sidebar-cats a:hover {
  background: rgba(0, 62, 116, 0.08);
  color: var(--dark-blue);
}
.blogs-sidebar-cats a.is-active {
  background: rgba(0, 62, 116, 0.12);
  color: var(--dark-blue);
  font-weight: 700;
}
.blogs-sidebar-cats .sidebar-cat-count {
  font-size: 11px;
  color: var(--dark-blue);
  font-weight: 600;
  background: var(--white);
  border-radius: 999px;
  padding: 2px 9px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.blogs-sidebar-cats a:hover .sidebar-cat-count,
.blogs-sidebar-cats a.is-active .sidebar-cat-count {
  background: var(--white);
}
.blogs-sidebar-cats .sidebar-cat-count--sub {
  background: rgba(255, 255, 255, 0.7);
}
/* Subcategories nested under a root cat — keep on yellow */
.blogs-sidebar-cats .subcats {
  background: rgba(255, 255, 255, 0.18);
  margin: 0;
  padding: 4px 0;
  border-left: none;
}
.blogs-sidebar-cats .subcats a {
  padding: 7px 14px 7px 28px;
  font-size: 12.5px;
  font-weight: 500;
}
.blogs-sidebar-cats .subcat-toggle {
  color: var(--dark-blue);
}
.blogs-sidebar-cats .subcat-toggle:hover {
  background: rgba(0, 62, 116, 0.1);
}
.blogs-sidebar-cats .sidebar-cat-count--sub {
  font-size: 10.5px;
  padding: 1px 6px;
  background: transparent;
  color: var(--mid);
}
.blogs-sidebar-cats .subcats a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.blogs-sidebar-cats .subcat-toggle {
  flex-shrink: 0;
  background: transparent;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--mid);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  padding: 0;
  transition: background 0.15s, transform 0.2s;
}
.blogs-sidebar-cats .subcat-toggle:hover { background: var(--light-gray); color: var(--dark-blue); }
.blogs-sidebar-cats .subcat-toggle.is-open { transform: rotate(90deg); }
.blogs-sidebar-cats .cat-group { display: flex; flex-direction: column; }
.blogs-sidebar-cats .cat-row { display: flex; align-items: center; gap: 4px; }
.blogs-sidebar-cats .cat-row > a { flex: 1; }
.blogs-sidebar-cats .subcats {
  margin-left: 14px;
  border-left: 2px solid var(--light-gray);
  padding-left: 8px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.blogs-sidebar-cats .subcats.is-open { max-height: 600px; }
.blogs-sidebar-cats .subcats a {
  font-size: 13px;
  font-weight: 400;
  padding: 6px 10px;
}

.blogs-main { min-width: 0; }

/* List header toolbar (count + view toggle) */
.blogs-list-toolbar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.blogs-result-count {
  font-size: 13px;
  color: var(--mid);
  font-weight: 500;
}
.blogs-view-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.blogs-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--mid);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 8px;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.blogs-view-btn:hover { color: var(--dark-blue); }
.blogs-view-btn.is-active {
  background: var(--dark-blue);
  color: var(--yellow);
  box-shadow: 0 2px 6px rgba(0,62,116,0.16);
}
.blogs-view-btn svg { display: block; }

/* Grid view: 3-4 per row, always stretches to fill the row regardless of
   how many posts there are (so a single-post category doesn't leave an
   empty track on the right). */
.blogs-grid.is-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* List view: one full-width card per row */
.blogs-grid.is-view-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}
.blogs-grid.is-view-list .blog-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: stretch;
  background: var(--white);
}
.blogs-grid.is-view-list .blog-card-img {
  height: 100%;
  min-height: 160px;
}
.blogs-grid.is-view-list .blog-card-body { padding: 22px 26px; }
.blogs-grid.is-view-list .blog-card-excerpt { -webkit-line-clamp: 3; }

@media (max-width: 768px) {
  .blogs-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "sidebar" "main";
  }
  .blogs-sidebar {
    position: static;
    min-width: 0;
    width: 100%;
  }
}
@media (max-width: 600px) {
  .blogs-grid.is-view-list .blog-card { grid-template-columns: 1fr; }
  .blogs-grid.is-view-list .blog-card-img { min-height: 160px; }
}

/* Card image: support real photo via <img> alongside emoji fallback */
.blog-card-img {
  position: relative;
  overflow: hidden;
}
.blog-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.2s;
}

.blog-back:hover {
  color: var(--dark-blue);
}

.blog-article .blog-hero {
  margin-bottom: 32px;
}

.blog-article .blog-meta {
  font-size: 13px;
  color: var(--mid);
  margin-bottom: 12px;
}

.blog-article .blog-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--dark);
  margin-bottom: 20px;
}

.blog-article .blog-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--dark);
}

.blog-article .blog-content p {
  margin-bottom: 1.25em;
}

.blog-article .blog-content h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.blog-article .blog-content h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin-top: 1.25em;
  margin-bottom: 0.4em;
}

.blog-article .blog-content ul,
.blog-article .blog-content ol {
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.blog-article .blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* List page */
.blogs-list-header {
  margin-bottom: 32px;
}

.blogs-list-header h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.blogs-list-header p {
  font-size: 15px;
  color: var(--mid);
}

.blogs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.blog-card {
  border-radius: 4px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--light-gray);
  transition: transform 0.25s, box-shadow 0.25s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.blog-card-img {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.blog-card-body {
  padding: 20px;
  flex: 1;
}

.blog-card-meta {
  font-size: 12px;
  color: var(--mid);
  margin-bottom: 8px;
}

.blog-card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--dark);
  margin-bottom: 8px;
  transition: color 0.2s;
}

.blog-card:hover .blog-card-title {
  color: var(--blue);
}

.blog-card-excerpt {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blogs-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--mid);
  font-size: 16px;
}

.img-bg-1 { background: linear-gradient(145deg, #f0e8d4, #d8c8a8); }
.img-bg-2 { background: linear-gradient(145deg, #d4e4f0, #a8c4d8); }
.img-bg-3 { background: linear-gradient(145deg, #e4f0d4, #b8d4a0); }
.img-bg-4 { background: linear-gradient(145deg, #f0d4e4, #d8a8c0); }
.img-bg-5 { background: linear-gradient(145deg, #d4e8d4, #a0c8a8); }
.img-bg-6 { background: linear-gradient(145deg, #e8d4f0, #c0a8d8); }
.img-bg-7 { background: linear-gradient(145deg, #f0eed4, #d4cfa0); }
.img-bg-8 { background: linear-gradient(145deg, #d4f0ee, #a0d4d0); }
.img-bg-9 { background: linear-gradient(145deg, #f0d4d4, #d8a8a8); }
.img-bg-10 { background: linear-gradient(145deg, #d4d4f0, #a8a8d8); }

/* ── Responsive: blog list & single post ── */
/* Breadcrumbs — very thin yellow strip below the site nav. */
.blogs-breadcrumbs-bar {
  background: transparent;
  padding-top: 12px;
  padding-bottom: 0;
}
.blogs-breadcrumbs-bar.is-hidden {
  display: none !important;
}
.blogs-breadcrumbs-strip {
  background: #FFDB00; /* exact same yellow as the header */
  padding: 2px 12px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--dark-blue);
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
  filter: none;
}
.blogs-breadcrumbs-strip:empty {
  display: none;
}
html.mbs-embedded .blogs-page > .blogs-breadcrumbs-bar {
  display: none !important;
}
.blogs-bc {
  display: block;
  position: static;
  background: transparent;
  box-shadow: none;
}
.blogs-bc a {
  color: var(--dark-blue);
  text-decoration: none;
  font-weight: 500;
}
.blogs-bc a:hover {
  color: var(--blue);
  text-decoration: underline;
}
.blogs-bc-sep {
  color: var(--dark-blue);
  opacity: 0.55;
  margin: 0 6px;
  font-weight: 400;
}
.blogs-bc-current {
  color: var(--dark-blue);
  font-weight: 500;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 48px;
  padding-top: 32px;
  padding-bottom: 64px;
  align-items: start;
  width: 100%;
}
.blog-sidebar {
  display: block;
  min-width: 260px;
  position: sticky;
  top: 130px;
  z-index: 1;
}
html.mbs-embedded .blog-sidebar {
  top: 20px;
}
.blog-main-column {
  min-width: 0;
  width: 100%;
  max-width: none;
}
.blog-main-column .blog-article {
  max-width: 820px;
}
/* In-article breadcrumb on single blog post — matches the yellow strip used on list.
   When embedded in the SPA iframe, the parent page already shows it, so hide this one. */
.blog-breadcrumb {
  display: block;
  position: static;
  background: #FFDB00;
  box-shadow: none;
  font-size: 11.5px;
  color: var(--dark-blue);
  margin: 0 0 20px;
  padding: 2px 12px;
  line-height: 1.35;
  border-radius: 0;
  opacity: 1;
  filter: none;
}
html.mbs-embedded .blog-breadcrumb {
  display: none !important;
}
.blog-breadcrumb a {
  color: var(--dark-blue);
  text-decoration: none;
  font-weight: 500;
}
.blog-breadcrumb a:hover {
  color: var(--blue);
  text-decoration: underline;
}
.bc-sep {
  margin: 0 6px;
  color: var(--dark-blue);
  opacity: 0.55;
}
.bc-current {
  color: var(--dark-blue);
  font-weight: 600;
}

.blog-article-header { margin-bottom: 24px; }
.blog-category-line { font-size: 14px; margin-bottom: 8px; }
.blog-category-line a { color: var(--blue); font-weight: 600; text-decoration: none; }
.blog-main-column .blog-title {
  font-family: var(--serif);
  font-size: clamp(26px, 3.5vw, 40px);
  line-height: 1.15;
  margin-bottom: 12px;
}
.blog-byline { font-size: 14px; color: var(--mid); }

.blog-hero-figure { margin: 0 0 28px; }
.blog-hero-figure img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.blog-hero-figure figcaption {
  font-size: 14px;
  color: var(--mid);
  margin-top: 10px;
  font-style: italic;
}

.blog-main-column .blog-content {
  font-size: 17px;
  line-height: 1.8;
}
.blog-main-column .blog-content p { margin-bottom: 1.2em; }
.blog-content .blog-figure,
.blog-content figure { margin: 1.5em 0; }
.blog-content figure img { max-width: 100%; height: auto; border-radius: 6px; }
.blog-content figcaption { font-size: 14px; color: var(--mid); margin-top: 8px; }

.blog-share {
  margin: 40px 0;
  padding: 26px 24px 28px;
  border-radius: 18px;
  background: linear-gradient(145deg, #fdfcfa 0%, var(--off-white) 45%, #f3f1ea 100%);
  border: 1px solid rgba(0, 62, 116, 0.12);
  box-shadow: 0 6px 28px rgba(0, 62, 116, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  font-size: 14px;
}

.blog-share-label {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  font-style: italic;
  color: var(--dark-blue);
  margin: 0 0 18px 0;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.blog-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  min-height: 44px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--sans);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1.2;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  filter: brightness(1.04);
}

.share-btn:focus {
  outline: none;
}

.share-btn:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

.share-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.share-btn-svg {
  flex-shrink: 0;
  display: block;
}

.share-btn-text {
  position: relative;
  top: 0.5px;
}

/* X (Twitter) */
.share-btn--twitter {
  background: #0f1419;
  color: #fff;
  border-color: #0f1419;
}

.share-btn--twitter:hover {
  filter: brightness(1.15);
}

/* Facebook */
.share-btn--facebook {
  background: #0866ff;
  color: #fff;
  border-color: #0866ff;
}

/* Pinterest */
.share-btn--pinterest {
  background: #e60023;
  color: #fff;
  border-color: #e60023;
}

/* Copy link — matches site chrome */
.share-btn--copy {
  background: var(--white);
  color: var(--dark-blue);
  border-color: rgba(0, 62, 116, 0.28);
  box-shadow: 0 2px 8px rgba(0, 62, 116, 0.06);
}

.share-btn--copy:hover {
  background: rgba(255, 219, 0, 0.35);
  border-color: var(--dark-blue);
  color: var(--dark-blue);
}

@media (max-width: 520px) {
  .blog-share {
    padding: 22px 18px 24px;
  }

  .share-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 138px;
  }

  .share-btn--copy {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-btn {
    transition: none;
  }

  .share-btn:hover {
    transform: none;
  }
}

.blog-helpful {
  margin-bottom: 40px;
  padding: 20px;
  background: var(--off-white);
  border-radius: 12px;
}
.blog-helpful p { margin-bottom: 12px; font-weight: 600; }
.btn-helpful {
  padding: 10px 18px;
  margin-right: 10px;
  border-radius: 8px;
  border: 2px solid var(--dark-blue);
  background: var(--yellow);
  font-weight: 600;
  cursor: pointer;
}
.btn-helpful.btn-muted { background: white; }

.blog-comments { margin-bottom: 48px; }
.blog-comments h2 { font-family: var(--serif); font-size: 22px; margin-bottom: 16px; }
.comment-item { padding: 16px 0; border-bottom: 1px solid var(--light-gray); }
.comment-date { display: block; font-size: 12px; color: var(--mid); margin: 4px 0 8px; }
.comment-form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; margin-top: 20px; }
.comment-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.comment-form input, .comment-form textarea {
  padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font: inherit;
}
.comment-form button {
  align-self: flex-start;
  padding: 12px 24px;
  background: var(--dark-blue);
  color: var(--yellow);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.blog-related { margin-top: 48px; }
.blog-related h2 { font-family: var(--serif); font-size: 22px; margin-bottom: 16px; }
.related-grid { display: grid; gap: 12px; }
.related-card {
  display: block;
  padding: 16px;
  background: var(--off-white);
  border-radius: 8px;
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  transition: box-shadow 0.2s;
}
.related-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

.sidebar-block {
  background: var(--off-white);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.sidebar-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dark-blue);
  margin-bottom: 12px;
}
.sidebar-links { list-style: none; font-size: 14px; }
.sidebar-links li { margin-bottom: 8px; }
.sidebar-links a { color: var(--blue); text-decoration: none; word-break: break-word; }
.sidebar-links a:hover { text-decoration: underline; }
.sidebar-muted { font-size: 13px; color: var(--mid); }

/* Nested categories in single-blog sidebar */
.sidebar-links--nested { display: flex; flex-direction: column; gap: 2px; }
.sidebar-links--nested li { margin: 0; }
.sidebar-links--nested .cat-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-links--nested .cat-row > a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  font-weight: 600;
  color: var(--dark);
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.sidebar-links--nested .sidebar-cat-count {
  font-size: 11px;
  color: var(--mid);
  font-weight: 500;
  background: var(--off-white);
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.sidebar-links--nested .sidebar-cat-count--sub {
  font-size: 10.5px;
  padding: 1px 6px;
  background: transparent;
}
.sidebar-links--nested .cat-row > a:hover {
  background: var(--white);
  color: var(--blue);
  text-decoration: none;
}
.sidebar-links--nested .subcat-toggle {
  background: transparent;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--mid);
  font-size: 11px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.2s;
}
.sidebar-links--nested .subcat-toggle:hover { background: var(--white); }
.sidebar-links--nested .subcat-toggle.is-open { transform: rotate(90deg); }
.sidebar-links--nested .subcats {
  margin-left: 14px;
  border-left: 2px solid var(--light-gray);
  padding-left: 8px;
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.sidebar-links--nested .subcats.is-open { max-height: 600px; }
.sidebar-links--nested .subcats a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--blue);
  border-radius: 6px;
}
.sidebar-links--nested .subcats a:hover {
  background: var(--white);
  text-decoration: none;
}

/* Popular posts with thumbnails */
.sidebar-popular {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar-popular li { margin: 0; }
.sidebar-popular-link {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--dark);
  padding: 6px;
  margin: -6px;
  border-radius: 10px;
  transition: background 0.15s;
}
.sidebar-popular-link:hover {
  background: var(--white);
  text-decoration: none;
}
.sidebar-popular-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  position: relative;
}
.sidebar-popular-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-popular-text {
  min-width: 0;
}
.sidebar-popular-title {
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-popular-link:hover .sidebar-popular-title { color: var(--blue); }
.sidebar-popular-meta {
  font-size: 11px;
  color: var(--mid);
}
.sidebar-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  font-size: 12px;
  padding: 4px 10px;
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: 20px;
  color: var(--dark-blue);
  text-decoration: none;
}
.sidebar-newsletter .sidebar-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--dark-blue);
  color: var(--yellow);
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
  font-size: 13px;
}
.blog-page-footer {
  text-align: center;
  padding: 32px 16px;
  font-size: 13px;
  color: var(--mid);
  border-top: 1px solid var(--light-gray);
}
.blog-page-footer a { color: var(--blue); margin: 0 6px; }

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
  .blog-sidebar {
    position: static;
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .blog-sidebar .sidebar-block { margin-bottom: 0; }
}

@media (max-width: 768px) {
  .blog-page-wrap { padding: 32px 20px 48px; }
  .blogs-list-header h1 { font-size: 26px; }
  .blogs-list-header p { font-size: 14px; }
  .blogs-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
  .blog-article .blog-title { font-size: 26px; }
  .blog-article .blog-content { font-size: 16px; }
  .blog-article .blog-content h2 { font-size: 20px; }
  .blog-article .blog-content h3 { font-size: 18px; }
}

@media (max-width: 600px) {
  .blog-page-wrap { padding: 24px 16px 40px; }
  .blog-back { font-size: 12px; margin-bottom: 20px; }
  .blogs-list-header { margin-bottom: 24px; }
  .blogs-list-header h1 { font-size: 22px; }
  .blogs-grid { grid-template-columns: 1fr; gap: 20px; }
  .blog-card-img { height: 160px; font-size: 56px; }
  .blog-card-body { padding: 16px; }
  .blog-card-title { font-size: 16px; }
  .blog-article .blog-title { font-size: 22px; margin-bottom: 16px; }
  .blog-article .blog-content { font-size: 15px; }
  .blog-article .blog-content h2 { font-size: 18px; margin-top: 1.25em; }
  .blog-article .blog-content h3 { font-size: 16px; margin-top: 1em; }
  .blogs-empty { padding: 32px 16px; font-size: 15px; }
}

@media (max-width: 480px) {
  .blog-page-wrap { padding: 20px 12px 32px; }
  .blog-card-img { height: 140px; font-size: 48px; }
}
