/* ═══════════════════════════════════════════════════
   Blog Pages — Listing + Detail
   Glamour Cascade
═══════════════════════════════════════════════════ */

/* ── Preview-mode banner (draft/pending_review/archived posts
   opened via an admin ?preview=1 link) ── */
.gc-preview-banner {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #FFF4D6;
  border-bottom: 2px solid #E8B84B;
  color: #6B4E00;
  font-size: .88rem;
  font-weight: 600;
  padding: 12px 20px;
  text-align: center;
}
.gc-preview-banner i { color: #C98A00; }
.gc-preview-banner strong { text-transform: capitalize; }

/* ── Blog Listing: Category Tabs ──────────────────── */
.blog-cat-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

/* ── Active tag-filter banner (shown for /blogs?tag=...) ── */
.blog-filter-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--g1);
  border: 1px solid var(--g3);
  border-radius: 12px;
  padding: 14px 20px;
  margin: -24px 0 36px;
  font-size: .9rem;
  color: var(--brown);
}
.blog-filter-banner strong { color: var(--g7); }
.blog-filter-banner a {
  margin-left: auto;
  font-size: .84rem;
  font-weight: 600;
  color: var(--g5);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.blog-filter-banner a:hover { color: var(--g7); }

/* ── Blog Grid ────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* ── Blog Card ────────────────────────────────────── */
.bc {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 18px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  transition: transform .25s, box-shadow .25s;
  text-decoration: none;
}
.bc:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 36px rgba(0,0,0,.13);
}
.bc-img {
  overflow: hidden;
  height: 220px;
  flex-shrink: 0;
}
.bc-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s;
}
.bc:hover .bc-img img { transform: scale(1.06); }

.bc-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.bc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--g1);
  color: var(--g5);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 11px;
  border-radius: 20px;
  margin-bottom: 11px;
  width: fit-content;
}
.bc-meta {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.bc-meta i { color: var(--g5); margin-right: 4px; font-size: 10px; }
.bc-title {
  font-family: var(--ff-h);
  font-size: 1.07rem;
  color: var(--brown);
  margin-bottom: 10px;
  line-height: 1.4;
  flex: 1;
}
.bc-title a { color: inherit; text-decoration: none; }
.bc-title a:hover { color: var(--g5); }
.bc-excerpt {
  font-size: .85rem;
  color: var(--gray);
  line-height: 1.75;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bc-read {
  font-size: .84rem;
  font-weight: 700;
  color: var(--g5);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .2s;
}
.bc-read:hover { gap: 10px; }

/* hidden cards (filtered out) */
.bc.hidden { display: none; }

/* no results */
.blog-no-results {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 0;
  color: var(--gray);
  font-size: 1rem;
}

/* ────────────────────────────────────────────────────
   Blog Detail — Two-Column Layout
──────────────────────────────────────────────────── */
.blog-detail-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 52px;
  align-items: start;
}

/* ── Article Column ──
   min-width: 0 lets this grid item shrink below its content's
   intrinsic width instead of forcing the sidebar off the edge of
   the page (the classic CSS Grid "1fr won't shrink" overflow bug —
   triggered by any oversized child: a wide table, a code block, a
   long unbroken URL, or an authored image with an inline width). */
.blog-article {
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.blog-feat-img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  margin-bottom: 28px;
}

.bd-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--g1);
  color: var(--g5);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-decoration: none;
}
.bd-badge:hover { background: var(--g3); }

.bd-title {
  font-family: var(--ff-h);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  color: var(--brown);
  line-height: 1.3;
  margin-bottom: 16px;
}

.bd-meta {
  font-size: 13px;
  color: var(--gray);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--g2);
}
.bd-meta i { color: var(--g5); margin-right: 5px; }

/* Rich article content
   ── Reading-optimised measure: caps line length for comfortable
      reading regardless of how wide the column grid renders. ── */
.art-content {
  max-width: 74ch;
  font-size: 1rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.art-content > *:first-child { margin-top: 0; }
/* Guard against admin-authored HTML with inline width/height attributes
   (common from WYSIWYG editors) — !important is required here because
   an inline style="width:..." on the element otherwise always wins
   over an external stylesheet rule, which was overflowing the column. */
.art-content img,
.art-content iframe,
.art-content video,
.art-content embed,
.art-content object {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
}
.art-content table,
.art-content pre {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}
.art-content pre code { white-space: pre-wrap; word-break: break-word; }

.art-content h2 {
  font-family: var(--ff-h);
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  font-weight: 700;
  color: var(--brown);
  margin: 46px 0 16px;
  line-height: 1.32;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g2);
}
.art-content h2:first-child { margin-top: 0; }
.art-content h3 {
  font-family: var(--ff-h);
  font-size: clamp(1.1rem, 1.8vw, 1.24rem);
  font-weight: 700;
  color: var(--brown);
  margin: 34px 0 12px;
  line-height: 1.35;
}
.art-content h4 {
  font-family: var(--ff-b);
  font-size: 1rem;
  font-weight: 700;
  color: var(--g7);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 26px 0 10px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}
.art-content h4::before {
  content: "";
  width: 16px;
  height: 2px;
  background: var(--g5);
  flex-shrink: 0;
  display: inline-block;
}
.art-content p {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: .1px;
}
.art-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 28px 0;
  display: block;
}
.art-content ul,
.art-content ol {
  margin: 0 0 22px;
  padding-left: 4px;
  list-style: none;
}
.art-content ol { counter-reset: art-ol; }
.art-content li {
  position: relative;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 12px;
  padding-left: 30px;
}
.art-content li:last-child { margin-bottom: 0; }
.art-content ul > li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 3px;
  font-size: .72rem;
  color: var(--g5);
  background: var(--g1);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-content ol > li {
  counter-increment: art-ol;
  padding-left: 34px;
}
.art-content ol > li::before {
  content: counter(art-ol);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--g5);
  color: #fff;
  font-size: .74rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-content ul ul,
.art-content ul ol,
.art-content ol ul,
.art-content ol ol { margin: 10px 0 10px; }
.art-content strong { color: var(--brown); font-weight: 700; }
.art-content em { color: var(--g7); }
.art-content a { color: var(--g5); text-decoration: underline; text-underline-offset: 2px; transition: color .2s; }
.art-content a:hover { color: var(--g7); }
.art-content hr { border: none; border-top: 1px solid var(--g2); margin: 40px 0; }
.art-content blockquote {
  border-left: 4px solid var(--g4);
  padding: 18px 24px;
  background: var(--g1);
  border-radius: 0 10px 10px 0;
  margin: 30px 0;
  font-style: italic;
  color: var(--brown);
  font-size: 1.02rem;
  line-height: 1.8;
}
.art-content blockquote p:last-child { margin-bottom: 0; }
.art-content .tip-box {
  background: var(--g1);
  border: 1px solid var(--g3);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 26px 0;
}
.art-content .tip-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--g5);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.art-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 26px 0;
  font-size: .92rem;
}
.art-content th,
.art-content td {
  padding: 12px 16px;
  border: 1px solid var(--g2);
  text-align: left;
}
.art-content th {
  background: var(--g1);
  color: var(--brown);
  font-weight: 700;
}
@media (max-width: 620px) {
  .art-content { max-width: none; }
  .art-content h2 { font-size: 1.25rem; margin: 36px 0 14px; }
  .art-content h3 { font-size: 1.08rem; margin: 28px 0 10px; }
  .art-content p, .art-content li { font-size: .95rem; }
}

/* Tags */
.bd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--g2);
}
.bd-tag {
  background: var(--g1);
  color: var(--brown);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.bd-tag:hover { background: var(--g3); color: var(--g5); }

/* Author Box */
.bd-author-box {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--g1);
  border: 1px solid var(--g2);
  border-radius: 14px;
  padding: 24px;
  margin-top: 38px;
}
.bd-author-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--g3);
}
.bd-author-name {
  font-family: var(--ff-h);
  font-size: 1.05rem;
  color: var(--brown);
  margin-bottom: 2px;
}
.bd-author-role { font-size: 12px; color: var(--g5); font-weight: 600; margin-bottom: 8px; }
.bd-author-bio { font-size: .84rem; line-height: 1.75; color: var(--gray); }

/* Related Posts */
.bd-related { margin-top: 56px; }
.bd-related-title {
  font-family: var(--ff-h);
  font-size: 1.3rem;
  color: var(--brown);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g2);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

/* ── Article FAQ ── */
.bd-faq { margin-top: 56px; }
.bd-faq-title {
  font-family: var(--ff-h);
  font-size: 1.3rem;
  color: var(--brown);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g2);
}
.bd-faq .faq-list { max-width: none; margin: 0; }
.bd-faq .faq-group-title {
  font-family: var(--ff-h);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--brown);
  margin: 22px 0 2px;
}
.bd-faq .faq-group-title:first-child { margin-top: 0; }

/* ── Comments ── */
.bd-comments { margin-top: 56px; }
.bd-comments-title {
  font-family: var(--ff-h);
  font-size: 1.3rem;
  color: var(--brown);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g2);
}
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}
.comment-item { display: flex; gap: 14px; }
.comment-item.is-reply { margin-left: 60px; }
.comment-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--g2);
  color: var(--g7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--ff-h);
  font-size: 1rem;
  flex-shrink: 0;
}
.comment-body {
  flex: 1;
  background: #fff;
  border: 1px solid var(--g2);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.comment-name { font-family: var(--ff-h); color: var(--brown); font-size: .95rem; }
.comment-date { font-size: .76rem; color: var(--gray); }
.comment-text { font-size: .9rem; line-height: 1.75; color: var(--text); }
.comment-empty {
  padding: 26px 20px;
  text-align: center;
  color: var(--gray);
  font-size: .9rem;
  background: var(--g1);
  border-radius: 12px;
  margin-bottom: 40px;
}
.comment-count {
  font-size: .95rem;
  font-weight: 400;
  color: var(--gray);
}
.comment-form-wrap {
  background: #fff;
  border: 1px solid var(--g2);
  border-radius: 14px;
  padding: 28px 30px;
}
.comment-form-title {
  font-family: var(--ff-h);
  font-size: 1.05rem;
  color: var(--brown);
  margin-bottom: 4px;
}
.comment-form-sub { font-size: .84rem; color: var(--gray); margin-bottom: 20px; }

@media (max-width: 620px) {
  .comment-item.is-reply { margin-left: 24px; }
  .comment-form-wrap { padding: 22px 20px; }
}
.rel-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform .22s;
}
.rel-card:hover { transform: translateY(-3px); }
.rel-card-img { height: 140px; overflow: hidden; }
.rel-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.rel-card:hover .rel-card-img img { transform: scale(1.05); }
.rel-card-body { padding: 14px 16px 18px; flex: 1; }
.rel-card-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--g5); margin-bottom: 6px; }
.rel-card-title { font-family: var(--ff-h); font-size: .88rem; color: var(--brown); line-height: 1.4; margin-bottom: 6px; }
.rel-card-date { font-size: 11px; color: var(--gray); }

/* ── Sidebar ── */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 100px;
}

.sw {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
}
.sw-title {
  font-family: var(--ff-h);
  font-size: 1rem;
  color: var(--brown);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g2);
}

/* Category list in sidebar */
.sw-cat-list { list-style: none; padding: 0; margin: 0; }
.sw-cat-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--g1);
}
.sw-cat-list li:last-child { border-bottom: none; }
.sw-cat-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: .88rem;
  transition: color .2s;
}
.sw-cat-list a i { color: var(--g5); font-size: 11px; }
.sw-cat-list a:hover { color: var(--g5); }
.sw-cat-count {
  background: var(--g2);
  color: var(--brown);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
}

/* Popular posts in sidebar */
.pop-post {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--g1);
  text-decoration: none;
}
.pop-post:last-child { border-bottom: none; }
.pop-post-img {
  width: 66px;
  height: 58px;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
}
.pop-post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pop-post-title {
  font-family: var(--ff-h);
  font-size: .82rem;
  color: var(--brown);
  line-height: 1.45;
  margin-bottom: 4px;
}
.pop-post:hover .pop-post-title { color: var(--g5); }
.pop-post-date { font-size: 11px; color: var(--gray); }

/* Tag cloud in sidebar */
.sw-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.sw-tag {
  font-size: 12px;
  background: var(--g1);
  color: var(--brown);
  padding: 5px 14px;
  border-radius: 20px;
  text-decoration: none;
  transition: background .2s, color .2s;
  cursor: pointer;
}
.sw-tag:hover { background: var(--g3); color: var(--g5); }

/* Blog detail back link */
.bd-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--g5);
  text-decoration: none;
  margin-bottom: 28px;
  font-weight: 600;
}
.bd-back:hover { gap: 12px; }

/* ── Responsive ──────────────────────── */
@media (max-width: 1024px) {
  .blog-detail-wrap { grid-template-columns: minmax(0, 1fr) 260px; gap: 36px; }
  .related-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2,1fr); }
  .blog-detail-wrap { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; display: grid; grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 620px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-sidebar { grid-template-columns: 1fr; }
  .blog-feat-img { height: 240px; }
  .related-grid { grid-template-columns: 1fr; }
  .bd-author-box { flex-direction: column; }
}
