/**
 * DSTME blog design (post page, listing cards, related articles, CTA).
 * Loaded on all blog pages by Magefan_Blog::blog_css.xml. Everything is scoped under .dstme-blog.
 */
.dstme-blog {
    --b-primary: #0088cc;
    --b-primary-dark: #006da3;
    --b-dark: #222529;
    --b-text: #222;
    --b-muted: #6b7280;
    --b-line: #e5e7eb;
    --b-soft: #f4f6f9;
    color: var(--b-text);
    font-size: 16px;
    line-height: 1.7;
}
.dstme-blog *, .dstme-blog *::before, .dstme-blog *::after { box-sizing: border-box; }
.dstme-blog a { color: var(--b-primary); }
.dstme-blog-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Meta line: CATEGORY · date · N min read */
.dstme-blog-meta {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--b-muted);
}
.dstme-blog-cat { color: var(--b-primary); text-decoration: none; }

/* Buttons */
.dstme-blog .dstme-blog-btn {
    display: inline-block; padding: 10px 20px; border: 1px solid var(--b-primary); border-radius: 6px;
    background: var(--b-primary); color: #fff; font-weight: 600; font-size: 14px; line-height: 1.4;
    text-align: center; text-decoration: none; cursor: pointer;
}
.dstme-blog .dstme-blog-btn:hover { background: var(--b-primary-dark); border-color: var(--b-primary-dark); color: #fff; }
.dstme-blog .dstme-blog-btn-ghost { background: #fff; color: var(--b-primary); }
.dstme-blog .dstme-blog-btn-ghost:hover { background: var(--b-soft); color: var(--b-primary-dark); }

/* ---------- Post hero ---------- */
.dstme-blog-hero {
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: center;
    margin: 0 0 40px; padding: 40px; border-radius: 10px; background: var(--b-soft);
}
.dstme-blog-hero.no-image { grid-template-columns: 1fr; }
.dstme-blog .dstme-blog-title {
    margin: 0 0 14px; font-size: 38px; line-height: 1.2; font-weight: 700; color: var(--b-text);
}
.dstme-blog-summary { margin: 0; font-size: 18px; line-height: 1.6; color: var(--b-muted); }
.dstme-blog-hero-image {
    padding: 16px; border: 1px solid var(--b-line); border-radius: 10px; background: #fff; text-align: center;
}
.dstme-blog-hero-image img { display: block; max-width: 100%; max-height: 320px; height: auto; margin: 0 auto; }

/* ---------- Post body + aside ---------- */
.dstme-blog-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start;
}
.dstme-blog-body { max-width: 780px; }
.dstme-blog-content { font-size: 16px; line-height: 1.75; overflow-wrap: break-word; }
.dstme-blog-content p, .dstme-blog-content ul, .dstme-blog-content ol { margin: 0 0 18px; }
.dstme-blog .dstme-blog-content h2 {
    margin: 40px 0 14px; font-size: 26px; line-height: 1.3; font-weight: 700; color: var(--b-text);
    scroll-margin-top: 90px;
}
.dstme-blog .dstme-blog-content h3 { margin: 28px 0 10px; font-size: 20px; line-height: 1.35; font-weight: 700; color: var(--b-text); }
.dstme-blog .dstme-blog-content h4 { margin: 22px 0 8px; font-size: 17px; font-weight: 700; }
.dstme-blog-content > :first-child { margin-top: 0; }
.dstme-blog-content ul, .dstme-blog-content ol { padding-left: 22px; }
.dstme-blog-content li { margin: 0 0 6px; }
.dstme-blog-content img { max-width: 100%; height: auto; border-radius: 8px; }
.dstme-blog-content blockquote {
    margin: 24px 0; padding: 14px 20px; border-left: 4px solid var(--b-primary); background: var(--b-soft);
    font-style: normal;
}
.dstme-blog-content table {
    width: 100% !important; margin: 0 0 24px; border: 0; border-collapse: collapse; font-size: 15px;
}
.dstme-blog-content th, .dstme-blog-content td {
    padding: 10px 14px; border: 1px solid var(--b-line); text-align: left; vertical-align: top;
}
.dstme-blog-content th p, .dstme-blog-content td p { margin: 0; }
.dstme-blog-content th, .dstme-blog-content thead td { background: var(--b-soft); font-weight: 700; }
.dstme-blog-content tbody tr:nth-child(even) td { background: #fafbfc; }

/* Tags + share */
.dstme-blog-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; padding: 0; list-style: none; }
.dstme-blog-tags li { margin: 0; }
.dstme-blog-tags a {
    display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--b-soft);
    font-size: 13px; color: var(--b-text); text-decoration: none;
}
.dstme-blog-tags a:hover { background: var(--b-line); }
.dstme-blog-share {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin: 24px 0 0; padding: 16px 0; border-top: 1px solid var(--b-line); border-bottom: 1px solid var(--b-line);
    font-size: 14px;
}
.dstme-blog-share span { font-weight: 600; margin-right: 4px; }
.dstme-blog-share a {
    padding: 5px 12px; border: 1px solid var(--b-line); border-radius: 6px; color: var(--b-text); text-decoration: none;
}
.dstme-blog-share a:hover { border-color: var(--b-primary); color: var(--b-primary); }

/* Aside: On this page + help box.
   Porto puts overflow-x:hidden on body, which stops position:sticky; clip hides overflow the same way
   without making body a scroll container (only on blog post pages). */
body.blog-post-view { overflow-x: clip; }
.dstme-blog-aside { position: sticky; top: 90px; display: grid; gap: 20px; }
.dstme-blog-toc, .dstme-blog-help { padding: 20px; border: 1px solid var(--b-line); border-radius: 10px; background: #fff; }
.dstme-blog-toc[hidden] { display: none; }
.dstme-blog .dstme-blog-aside-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--b-text); }
.dstme-blog-toc ol { margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.45; }
.dstme-blog-toc li { margin: 0; padding: 6px 0; border-top: 1px solid var(--b-soft); }
.dstme-blog-toc li:first-child { border-top: 0; }
.dstme-blog-toc a { color: var(--b-muted); text-decoration: none; }
.dstme-blog-toc a:hover { color: var(--b-primary); }
.dstme-blog-help { background: var(--b-soft); }
.dstme-blog-help p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--b-muted); }
.dstme-blog-help .dstme-blog-btn { display: block; width: 100%; margin-top: 8px; }

/* ---------- Cards (listing + related) ---------- */
.dstme-blog-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 0 0 32px; padding: 0; list-style: none;
}
.dstme-blog-card {
    display: flex; flex-direction: column; margin: 0; border: 1px solid var(--b-line); border-radius: 10px;
    background: #fff; overflow: hidden; transition: box-shadow .2s, transform .2s;
}
.dstme-blog-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.dstme-blog-card-image {
    display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10;
    background: var(--b-soft); overflow: hidden;
}
.dstme-blog-card-image img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.dstme-blog-card-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.dstme-blog-card-body .dstme-blog-meta { margin-bottom: 8px; font-size: 11px; }
.dstme-blog .dstme-blog-card-title { margin: 0 0 8px; font-size: 18px; line-height: 1.35; font-weight: 700; }
.dstme-blog .dstme-blog-card-title a { color: var(--b-text); text-decoration: none; }
.dstme-blog .dstme-blog-card-title a:hover { color: var(--b-primary); }
.dstme-blog-card-excerpt { flex: 1; margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: var(--b-muted); }
.dstme-blog-card-more { font-size: 14px; font-weight: 600; text-decoration: none; }

/* Listing intro (subtitle + search) */
.dstme-blog-intro {
    display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; margin: 0 0 28px;
}
.dstme-blog-intro p { margin: 0; font-size: 16px; color: var(--b-muted); }
.dstme-blog-search { display: flex; gap: 8px; width: 100%; max-width: 380px; }
.dstme-blog .dstme-blog-search input {
    flex: 1; height: 42px; padding: 0 14px; border: 1px solid var(--b-line); border-radius: 6px; font-size: 14px;
}

/* Related articles + CTA band */
.dstme-blog-related { margin: 56px 0 0; }
.dstme-blog .dstme-blog-related > h2 { margin: 0 0 20px; font-size: 26px; font-weight: 700; color: var(--b-text); }
.dstme-blog-cta {
    display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between;
    margin: 40px 0; padding: 36px 40px; border-radius: 12px; background: var(--b-dark); color: #fff;
}
.dstme-blog .dstme-blog-cta h2 { margin: 0 0 8px; font-size: 26px; line-height: 1.3; font-weight: 700; color: #fff; }
.dstme-blog-cta p { margin: 0; max-width: 620px; color: #c9ccd1; }
.dstme-blog-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dstme-blog-cta .dstme-blog-btn-ghost { background: transparent; border-color: #6b7280; color: #fff; }
.dstme-blog-cta .dstme-blog-btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* Magefan blocks kept below the post (related products) */
.blog-post-view .post-bottom .block.related { margin-top: 40px; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
    .dstme-blog-layout { grid-template-columns: 1fr; gap: 32px; }
    .dstme-blog-aside { position: static; }
    .dstme-blog-body { max-width: none; }
    .dstme-blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .dstme-blog-hero { grid-template-columns: 1fr; gap: 24px; padding: 24px 20px; margin-bottom: 28px; }
    .dstme-blog .dstme-blog-title { font-size: 28px; }
    .dstme-blog-summary { font-size: 16px; }
    .dstme-blog .dstme-blog-content h2 { font-size: 22px; margin-top: 32px; }
    .dstme-blog .dstme-blog-content h3 { font-size: 18px; }
    .dstme-blog-grid { grid-template-columns: 1fr; gap: 20px; }
    .dstme-blog-content table { display: block; overflow-x: auto; }
    .dstme-blog-cta { padding: 28px 20px; }
    .dstme-blog .dstme-blog-cta h2, .dstme-blog .dstme-blog-related > h2 { font-size: 22px; }
    .dstme-blog-search { max-width: none; }
}
