/* =====================================================================
   BLOG CMS — EMBEDDABLE MODULE STYLESHEET
   ---------------------------------------------------------------------
   Everything in this file is scoped under the ".bcms-scope" wrapper and
   every custom class is prefixed "bcms-" so this can be dropped into ANY
   third-party website without colliding with (or being overridden by)
   that site's own CSS — no Bootstrap, no global element selectors like
   body/a/ul outside of .bcms-scope.
   ===================================================================== */

.bcms-scope {
    --bcms-brand: #4f46e5;
    --bcms-brand-dark: #3730a3;
    --bcms-ink: #1e1b2e;
    --bcms-muted: #6b7280;
    --bcms-bg-soft: #f6f6fb;
    --bcms-border: #e7e6f2;
    --bcms-radius: 16px;

    display: block;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--bcms-ink);
    text-align: left;

    /* Make this module a CSS "container" so every breakpoint below reacts
       to the ACTUAL width it's been given by the host page (e.g. a
       col-md-9 column, a sidebar, a narrow theme content area) instead of
       the browser's viewport width. This is what makes it genuinely
       "drop into any site" responsive: on a wide desktop screen the host
       column can still be narrow, and viewport-based @media queries would
       never fire in that case — which is exactly what was happening here. */
    container-type: inline-size;
    container-name: bcms;
}
.bcms-scope, .bcms-scope *, .bcms-scope *::before, .bcms-scope *::after { box-sizing: border-box; }
.bcms-scope a { text-decoration: none; color: inherit; cursor: pointer; }
.bcms-scope img { max-width: 100%; height: auto; display: block; }
.bcms-scope button { font-family: inherit; cursor: pointer; }
.bcms-scope input, .bcms-scope select, .bcms-scope textarea { font-family: inherit; font-size: 1rem; }

/* ---------- Layout helpers ---------- */
.bcms-container { max-width:1400px; margin: 0 auto; padding: 0 16px; }
.bcms-grid-2col { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; align-items: start; }
.bcms-cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.bcms-cards-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@container bcms (max-width: 860px) {
    .bcms-grid-2col { grid-template-columns: 1fr; }
    .bcms-cards-grid, .bcms-cards-grid-3 { grid-template-columns: 1fr; }
}
@container bcms (min-width: 861px) and (max-width: 1000px) {
    .bcms-cards-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Buttons / inputs (scoped, no Bootstrap) ---------- */
.bcms-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--bcms-brand); color: #fff; border: 1px solid var(--bcms-brand);
    font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 10px;
    transition: all .15s ease;
}
.bcms-btn:hover { background: var(--bcms-brand-dark); border-color: var(--bcms-brand-dark); }
.bcms-btn-outline { background: transparent; color: var(--bcms-ink); border: 1px solid var(--bcms-border); }
.bcms-btn-outline:hover { border-color: var(--bcms-brand); color: var(--bcms-brand); }
.bcms-btn-sm { padding: 6px 12px; font-size: .78rem; }
.bcms-btn-group { display: inline-flex; max-width: 100%; border-radius: 10px; overflow: hidden; }
.bcms-btn-group .bcms-btn { border-radius: 0; min-width: 0; }

.bcms-input {
    width: 100%; min-width: 0; padding: 9px 12px; border: 1px solid var(--bcms-border); border-radius: 10px;
    background: #fff; color: var(--bcms-ink); font-size: .92rem;
}
.bcms-input:focus { outline: none; border-color: var(--bcms-brand); }
.bcms-search-form { display: flex; gap: 8px; }
.bcms-search-form .bcms-btn { flex-shrink: 0; }

/* ---------- Icons (inline SVG, no external icon-font dependency) ---------- */
.bcms-icon { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- Hero ---------- */
.bcms-hero { background: linear-gradient(135deg, var(--bcms-bg-soft), #eef0ff); padding: 56px 0 40px; text-align: center; }
.bcms-hero h1 { font-weight: 800; font-size: 2.2rem; margin: 0 0 8px; }
.bcms-hero p { color: var(--bcms-muted); margin: 0; }

/* ---------- Blog Cards (listing / related) ---------- */
.bcms-card-link { display: block; color: inherit; }
.bcms-card {
    background: #fff; border: 1px solid var(--bcms-border); border-radius: var(--bcms-radius);
    overflow: hidden; height: 100%; transition: transform .2s ease, box-shadow .2s ease;
}
.bcms-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(31,29,63,.10); }
.bcms-card-img { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--bcms-bg-soft); }
.bcms-card-img img { width: 100%; height: 100%; object-fit: cover; }
.bcms-card-cat {
    position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); color: var(--bcms-brand);
    font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
}
.bcms-card-body { padding: 20px; }
.bcms-card-meta { font-size: .78rem; color: var(--bcms-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bcms-card-title { font-size: 16px; font-weight: 600; line-height: 1.35; margin: 0 0 8px; color: var(--bcms-ink); }
.bcms-card-title.bcms-title-sm { font-size: .96rem; }
.bcms-card-excerpt { font-size: 14px; color: var(--bcms-muted); margin: 0 0 10px; }
.bcms-card-readmore { font-size: 13px; font-weight: 600; color: var(--bcms-brand); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Sidebar widgets ---------- */
.bcms-widget { background: var(--bcms-bg-soft); border-radius: var(--bcms-radius); padding: 20px; margin-bottom: 20px; }
.bcms-widget h6 { font-weight: 700; margin: 0 0 14px; font-size: 16px;; }
.bcms-widget-list { list-style: none; margin: 0; padding: 0; }
.bcms-widget-list li { padding: 6px 0; }
.bcms-widget-list a { color: var(--bcms-ink); font-weight: 500; font-size: 13px; }
.bcms-widget-list a.bcms-active, .bcms-widget-list a:hover { color: var(--bcms-brand); }
.bcms-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.bcms-pill-tag {
    display: inline-block; background: #fff; border: 1px solid var(--bcms-border); color: var(--bcms-ink);
    font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 999px; transition: all .15s ease;
}
.bcms-pill-tag:hover, .bcms-pill-tag.bcms-active { background: var(--bcms-brand); color: #fff; border-color: var(--bcms-brand); }

.bcms-pill-cat {
    display: inline-block; background: #eef0ff; color: var(--bcms-brand); font-size: .76rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; padding: 6px 14px; border-radius: 999px;
}
.bcms-pill-cat-light { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Pagination ---------- */
.bcms-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 40px; flex-wrap: wrap; }
.bcms-pagination a {
    display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px;
    border: 1px solid var(--bcms-border); border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--bcms-ink);
}
.bcms-pagination a.bcms-active { background: var(--bcms-brand); border-color: var(--bcms-brand); color: #fff; }
.bcms-pagination a:hover:not(.bcms-active) { border-color: var(--bcms-brand); color: var(--bcms-brand); }

/* ---------- Empty / not-found states ---------- */
.bcms-empty-state { text-align: center; padding: 56px 16px; color: var(--bcms-muted); }
.bcms-empty-state svg { margin-bottom: 12px; opacity: .5; width: 40px; height: 40px; }

/* ---------- Article (single blog detail) shared styles ---------- */
.bcms-article-title { font-weight: 800; font-size: 2.05rem; line-height: 1.25; margin: 0; }
.bcms-article-meta { color: var(--bcms-muted); font-size: .86rem; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.bcms-article-featured-img { max-height: 440px; width: 100%; object-fit: cover; border-radius: 16px; margin-bottom: 28px; }

/* Rich-text content coming from the TinyMCE editor — explicit typographic
   rules for every element it can output, since .bcms-scope has no blanket
   margin/list resets that would otherwise strip these. */
.bcms-article-content { font-size: 1.04rem; line-height: 1.85; color: #33313f; }
.bcms-article-content p { margin: 0 0 1.1em; }
.bcms-article-content h1, .bcms-article-content h2, .bcms-article-content h3,
.bcms-article-content h4, .bcms-article-content h5, .bcms-article-content h6 {
    font-weight: 700; line-height: 1.3; margin: 1.6em 0 .6em; color: var(--bcms-ink);
}
.bcms-article-content h2 { font-size: 1.5rem; }
.bcms-article-content h3 { font-size: 1.25rem; }
.bcms-article-content ul, .bcms-article-content ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.bcms-article-content li { margin-bottom: .4em; }
.bcms-article-content a { color: var(--bcms-brand); text-decoration: underline; }
.bcms-article-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 1em 0; }
.bcms-article-content blockquote {
    border-left: 4px solid var(--bcms-brand); padding: 8px 20px; color: var(--bcms-muted);
    font-style: italic; margin: 1.5em 0;
}
.bcms-article-content pre {
    background: #1e1b2e; color: #f4f4f7; padding: 16px; border-radius: 10px; overflow-x: auto; margin: 1.2em 0;
}
.bcms-article-content code { background: #f1f0fa; padding: 2px 6px; border-radius: 4px; font-size: .92em; }
.bcms-article-content pre code { background: none; padding: 0; }
.bcms-article-content table { width: 100%; border-collapse: collapse; margin: 1.2em 0; }
.bcms-article-content th, .bcms-article-content td { border: 1px solid var(--bcms-border); padding: 8px 12px; text-align: left; }
.bcms-article-content hr { border: none; border-top: 1px solid var(--bcms-border); margin: 2em 0; }

.bcms-article-tags { padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Gallery images (multiple images per blog) ---------- */
.bcms-gallery { margin: 2rem 0; }
.bcms-gallery h4 { font-weight: 700; font-size: 1.1rem; margin: 0 0 14px; }
.bcms-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.bcms-gallery-grid img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px;
    border: 1px solid var(--bcms-border); transition: opacity .15s;
}
.bcms-gallery-grid a:hover img { opacity: .85; }

/* ---------- Related posts ---------- */
.bcms-related { background: var(--bcms-bg-soft); padding: 48px 0; margin-top: 48px; border-radius: var(--bcms-radius); }
.bcms-related h3 { font-weight: 800; margin: 0 0 24px; font-size: 1.3rem; }

/* ---------- Admin preview notice (shown to logged-in admin on unpublished posts) ---------- */
.bcms-preview-alert {
    background: #fff8e6; border: 1px solid #f5deac; color: #8a6d1e;
    padding: 10px 16px; border-radius: 10px; font-size: .85rem; margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
}

/* =====================================================================
   LAYOUT: Classic
   ===================================================================== */
.bcms-layout-classic { padding: 40px 0; }
.bcms-layout-classic .bcms-article-inner { max-width: 90%; margin: 0 auto;box-shadow: 0 16px 32px rgba(31,29,63,.10);
  padding: 20px; }
.bcms-layout-classic .bcms-article-head { text-align: center; margin-bottom: 24px; }

/* =====================================================================
   LAYOUT: Modern
   ===================================================================== */
.bcms-layout-modern .bcms-modern-hero {
    height: 420px; background-size: cover; background-position: center; position: relative;
    display: flex; align-items: center; margin-bottom: -70px;
}
.bcms-layout-modern .bcms-modern-hero-overlay {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, rgba(20,18,40,.35), rgba(20,18,40,.78)); text-align: center; padding: 0 16px;
}
.bcms-modern-title { font-weight: 800; font-size: 2.2rem; max-width: 800px; margin: 12px auto 0; color: #fff; }
.bcms-modern-meta { color: rgba(255,255,255,.88); font-size: .88rem; margin-top: 10px; }
.bcms-modern-card {
    background: #fff; max-width: 820px; margin: 0 auto 48px; border-radius: 22px;
    box-shadow: 0 24px 48px rgba(31,29,63,.14); padding: 44px; position: relative; z-index: 2;
}
@container bcms (max-width: 767px) { .bcms-modern-card { padding: 22px; } .bcms-layout-modern .bcms-modern-hero { height: 300px; } }

/* =====================================================================
   LAYOUT: Magazine
   ===================================================================== */
.bcms-layout-magazine { padding: 40px 0; }
.bcms-magazine-content:first-letter {
    float: left; font-family: 'Merriweather', Georgia, serif; font-weight: 700;
    font-size: 3.4rem; line-height: 1; padding: 6px 10px 0 0; color: var(--bcms-brand);
}
.bcms-magazine-sidebar { position: sticky; top: 20px; }

/* =====================================================================
   LAYOUT: Minimal
   ===================================================================== */
.bcms-layout-minimal { padding: 48px 0 32px; }
.bcms-layout-minimal .bcms-article-inner { max-width: 680px; margin: 0 auto; }
.bcms-minimal-title { font-family: 'Merriweather', Georgia, serif; font-weight: 700; font-size: 1.9rem; line-height: 1.35; margin: 8px 0 0; }
.bcms-minimal-meta { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; color: var(--bcms-muted); font-weight: 600; }
.bcms-minimal-content { font-family: 'Merriweather', Georgia, serif; font-size: 1rem; }
.bcms-minimal-divider { border: none; border-top: 1px solid var(--bcms-border); margin: 2.5rem 0 1.2rem; }

/* =====================================================================
   LAYOUT: Full Width
   ===================================================================== */
.bcms-fullwidth-banner { height: 42vh; min-height: 260px; background-size: cover; background-position: center; }
.bcms-fullwidth-content { max-width: 960px; margin: 0 auto; }
.bcms-layout-fullwidth .bcms-article-title { max-width: 960px; margin-left: auto; margin-right: auto; }
.bcms-layout-fullwidth .bcms-fw-container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- Site header/footer (only used in standalone mode, harmless if unused) ---------- */
.bcms-site-header { border-bottom: 1px solid var(--bcms-border); background: #fff; position: sticky; top: 0; z-index: 1000; }
.bcms-site-header .bcms-container { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; gap: 16px; flex-wrap: wrap; }
.bcms-brand-link { font-weight: 800; font-size: 1.3rem; color: var(--bcms-ink); display: flex; align-items: center; gap: 8px; }
.bcms-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.bcms-nav a { font-weight: 500; font-size: .92rem; }
.bcms-nav a:hover { color: var(--bcms-brand); }

.bcms-site-footer { background: var(--bcms-ink); color: #d6d4e6; padding: 48px 0 24px; margin-top: 40px; border-radius: var(--bcms-radius) var(--bcms-radius) 0 0; }
.bcms-site-footer h5, .bcms-site-footer h6 { color: #fff; font-weight: 700; }
.bcms-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
@container bcms (max-width: 700px) { .bcms-footer-grid { grid-template-columns: 1fr; } }
.bcms-footer-links { list-style: none; margin: 0; padding: 0; }
.bcms-footer-links a { color: #b9b7cc; font-size: .88rem; }
.bcms-footer-links a:hover { color: #fff; }
.bcms-footer-bottom { text-align: center; font-size: .82rem; color: #9694ab; margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); }

@container bcms (max-width: 767px) {
    .bcms-article-title, .bcms-hero h1 { font-size: 1.5rem; }
    .bcms-modern-title { font-size: 1.6rem; }
}
