/* ============================================================================
   Blog — shared stylesheet.

   Loaded in TWO places, and that is the whole point:
     1. The public blog template (/blog/) via head.php's $extra_css.
     2. TinyMCE's editing iframe, via `content_css` in portal/views/blog-edit.php.

   The iframe does not load style.css, so the tokens and @font-face it needs are
   redeclared here rather than inherited. Any rule under `.blog-post-body`
   therefore renders identically while typing and once published — that contract
   is what keeps the editor honest, so keep post-body rules in that block.
   ========================================================================== */

@font-face{
  font-family:'Manrope';font-style:normal;font-weight:300 800;font-display:swap;
  src:url(../fonts/manrope-latin.woff2) format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face{
  font-family:'Manrope';font-style:normal;font-weight:300 800;font-display:swap;
  src:url(../fonts/manrope-latin-ext.woff2) format('woff2');
  unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* Mirrors style.css :root. Duplicated so the editor iframe resolves them. */
.blog-scope,.blog-post-body{
  --gold:#dfa949; --gold-dk:#b8882e; --gold-lt:#f5e4b8;
  --violet:#8582c3; --violet-dk:#3919ba; --violet-deep:#2a1290; --violet-lt:#e8e8f7;
  --dark:#1a1535; --body:#3d3860; --white:#ffffff;
  --paper:#ffffff; --rule:#e8e8f7;
}

/* ─────────────────────── Post body (SHARED WITH EDITOR) ───────────────────
   Everything below is what an author sees while typing. Widths and margins
   live on the article sheet, not here, so the editor can supply its own frame.
   ------------------------------------------------------------------------ */
.blog-post-body{
  font-family:'Manrope',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  font-size:18px; line-height:1.78; color:var(--body);
  overflow-wrap:break-word;
}
.blog-post-body > :first-child{margin-top:0;}
.blog-post-body > :last-child{margin-bottom:0;}

.blog-post-body h2{font-size:30px;line-height:1.25;font-weight:800;margin:44px 0 16px;color:var(--dark);letter-spacing:-.4px;}
.blog-post-body h3{font-size:23px;line-height:1.3;font-weight:800;margin:34px 0 12px;color:var(--dark);letter-spacing:-.2px;}
.blog-post-body h4{font-size:19px;line-height:1.35;font-weight:800;margin:28px 0 10px;color:var(--dark);}
.blog-post-body p{margin:0 0 20px;}
.blog-post-body a{color:var(--violet-dk);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1.5px;font-weight:600;}
.blog-post-body a:hover{color:var(--violet-deep);}
.blog-post-body strong,.blog-post-body b{color:var(--dark);font-weight:800;}
.blog-post-body mark{background:var(--gold-lt);color:var(--dark);padding:1px 4px;border-radius:3px;}
.blog-post-body ul,.blog-post-body ol{margin:0 0 20px;padding-left:24px;}
.blog-post-body li{margin-bottom:9px;}
.blog-post-body li::marker{color:var(--violet-dk);font-weight:700;}
.blog-post-body hr,.blog-post-body .blog-delimiter{border:none;border-top:2px solid var(--rule);width:70px;margin:40px auto;}

.blog-post-body blockquote{
  position:relative;margin:30px 0;padding:20px 24px 20px 26px;
  border-left:4px solid var(--gold);
  background:linear-gradient(90deg,rgba(223,169,73,.09),rgba(223,169,73,0));
  border-radius:0 12px 12px 0;
  font-size:19px;font-style:italic;color:var(--dark);
}
.blog-post-body blockquote p:last-child{margin-bottom:0;}
.blog-post-body blockquote cite{display:block;margin-top:10px;font-style:normal;font-size:13px;font-weight:700;
  text-transform:uppercase;letter-spacing:.6px;color:var(--violet-dk);}

.blog-post-body img{max-width:100%;height:auto;border-radius:12px;}
.blog-post-body figure{margin:32px 0;}
.blog-post-body figure img{width:100%;display:block;}
.blog-post-body figcaption{text-align:center;font-size:13.5px;color:var(--violet-dk);margin-top:10px;font-weight:600;}
.blog-post-body .blog-img-border img{border:1px solid var(--rule);}
.blog-post-body .blog-img-bg{background:var(--violet-lt);padding:20px;border-radius:14px;}

.blog-post-body table,.blog-post-body .blog-table{
  width:100%;border-collapse:collapse;margin:28px 0;font-size:15.5px;
  border:1px solid var(--rule);border-radius:10px;overflow:hidden;
}
.blog-post-body th,.blog-post-body td{border:1px solid var(--rule);padding:11px 14px;text-align:left;}
.blog-post-body th{background:var(--violet-lt);color:var(--dark);font-weight:800;}
.blog-post-body tbody tr:nth-child(even) td{background:#fafaff;}

.blog-post-body pre{background:var(--dark);color:#e9e7ff;padding:18px 20px;border-radius:12px;overflow-x:auto;margin:26px 0;font-size:14px;line-height:1.6;}
.blog-post-body code{background:var(--violet-lt);color:var(--violet-deep);padding:2px 6px;border-radius:4px;font-size:.9em;}
.blog-post-body pre code{background:none;color:inherit;padding:0;}

/* Legacy Editor.js column blocks — retained so posts authored before the
   TinyMCE migration keep their layout. */
.blog-post-body .blog-columns{display:flex;gap:26px;margin:26px 0;}
.blog-post-body .blog-col{flex:1;min-width:0;}

/* Editor-iframe-only frame: a white sheet at the same measure as the live
   article, so line length while typing matches line length when published. */
.blog-editor-body{
  background:var(--paper);
  max-width:820px;margin:0 auto;padding:34px 38px 60px;
  -webkit-font-smoothing:antialiased;
}

/* ───────────────────────────── Page chrome (public only) ───────────────── */
.blog-main{max-width:1180px;margin:0 auto;padding:56px 24px 110px;}

.blog-hero{text-align:center;max-width:760px;margin:0 auto 44px;}
.blog-eyebrow{display:inline-flex;align-items:center;gap:8px;padding:7px 16px;border-radius:999px;
  background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.28);backdrop-filter:blur(10px);
  color:var(--gold);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:1.4px;margin-bottom:18px;}
.blog-hero h1{font-size:52px;line-height:1.1;font-weight:800;color:#fff;letter-spacing:-1.2px;margin-bottom:16px;}
.blog-hero h1 em{font-style:normal;color:var(--gold);}
.blog-hero p{color:rgba(255,255,255,.76);font-size:18px;line-height:1.6;}

.blog-cat-filter{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-bottom:44px;}
.blog-cat-filter a{padding:9px 18px;border-radius:999px;font-weight:700;font-size:13.5px;text-decoration:none;
  background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.22);color:rgba(255,255,255,.85);
  backdrop-filter:blur(10px);transition:background .18s ease,color .18s ease,border-color .18s ease,transform .18s ease;}
.blog-cat-filter a:hover{background:rgba(255,255,255,.18);color:#fff;transform:translateY(-1px);}
.blog-cat-filter a.is-active{background:var(--gold);border-color:var(--gold);color:var(--dark);}

/* Lead story — first post on page 1 gets a wide editorial treatment. */
.blog-feature{display:grid;grid-template-columns:1.05fr .95fr;gap:0;margin-bottom:40px;border-radius:22px;overflow:hidden;
  background:var(--paper);box-shadow:0 26px 60px rgba(10,6,40,.34);text-decoration:none;color:inherit;
  transition:transform .22s ease,box-shadow .22s ease;}
.blog-feature:hover{transform:translateY(-4px);box-shadow:0 34px 74px rgba(10,6,40,.44);}
.blog-feature-img{width:100%;height:100%;min-height:340px;object-fit:cover;display:block;}
.blog-feature-img-ph{background:linear-gradient(135deg,var(--violet-deep),var(--violet-dk));min-height:340px;}
.blog-feature-body{padding:44px 46px;display:flex;flex-direction:column;justify-content:center;}
.blog-feature-body h2{font-size:32px;line-height:1.2;font-weight:800;color:var(--dark);letter-spacing:-.6px;margin:14px 0 12px;}
.blog-feature-body p{color:var(--body);font-size:16px;line-height:1.65;margin-bottom:20px;}

.blog-chip{display:inline-block;padding:6px 13px;border-radius:999px;background:var(--violet-lt);color:var(--violet-dk);
  font-size:11.5px;font-weight:800;text-transform:uppercase;letter-spacing:.7px;}
.blog-chip-gold{background:var(--gold-lt);color:var(--gold-dk);}

.blog-meta{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--violet-dk);font-weight:600;}
.blog-meta .dot{width:3px;height:3px;border-radius:50%;background:currentColor;opacity:.55;}
.blog-readmore{margin-top:auto;padding-top:18px;color:var(--violet-dk);font-weight:800;font-size:14.5px;
  display:inline-flex;align-items:center;gap:8px;}
.blog-feature:hover .blog-readmore i,.blog-card:hover .blog-readmore i{transform:translateX(4px);}
.blog-readmore i{transition:transform .18s ease;}

.blog-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:26px;}
.blog-card{display:flex;flex-direction:column;border-radius:18px;overflow:hidden;background:var(--paper);
  text-decoration:none;color:inherit;box-shadow:0 14px 34px rgba(10,6,40,.24);
  transition:transform .22s ease,box-shadow .22s ease;}
.blog-card:hover{transform:translateY(-6px);box-shadow:0 26px 54px rgba(10,6,40,.36);}
.blog-card-img{width:100%;aspect-ratio:16/10;object-fit:cover;display:block;}
.blog-card-img-ph{width:100%;aspect-ratio:16/10;background:linear-gradient(135deg,var(--violet-deep),var(--violet-dk));
  display:flex;align-items:center;justify-content:center;}
.blog-card-img-ph i{font-size:34px;color:rgba(255,255,255,.32);}
.blog-card-body{padding:22px 24px 24px;display:flex;flex-direction:column;flex:1;}
.blog-card-body h2{font-size:20px;line-height:1.32;font-weight:800;color:var(--dark);margin:12px 0 10px;letter-spacing:-.2px;}
.blog-card-body p{font-size:14.5px;line-height:1.6;color:var(--body);margin-bottom:16px;}

.blog-pager{display:flex;justify-content:center;gap:9px;margin-top:52px;}
.blog-pager a{min-width:40px;height:40px;padding:0 12px;display:flex;align-items:center;justify-content:center;border-radius:999px;
  background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.22);color:rgba(255,255,255,.85);
  font-weight:700;text-decoration:none;transition:background .18s ease,color .18s ease;}
.blog-pager a:hover{background:rgba(255,255,255,.18);color:#fff;}
.blog-pager a.is-active{background:var(--gold);border-color:var(--gold);color:var(--dark);}

.blog-empty{text-align:center;padding:80px 20px;color:rgba(255,255,255,.75);}
.blog-empty h1{color:#fff;font-size:32px;margin-bottom:12px;}
.blog-empty a{color:var(--gold);font-weight:700;}

/* ───────────────────────────── Single post ─────────────────────────────── */
.blog-post{max-width:900px;margin:0 auto;}
.blog-post-head{text-align:center;margin-bottom:32px;}
.blog-cats{display:flex;justify-content:center;gap:8px;margin-bottom:18px;flex-wrap:wrap;}
.blog-cats a{text-decoration:none;}
.blog-cats a .blog-chip{background:rgba(255,255,255,.12);color:var(--gold);border:1px solid rgba(255,255,255,.25);}
.blog-post-head h1{font-size:46px;line-height:1.12;font-weight:800;color:#fff;letter-spacing:-1.1px;margin-bottom:18px;}
.blog-post-meta{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;
  color:rgba(255,255,255,.66);font-size:14px;font-weight:600;}
.blog-post-meta .dot{width:3px;height:3px;border-radius:50%;background:currentColor;opacity:.6;}

.blog-post-hero{width:100%;max-width:1000px;aspect-ratio:16/8;object-fit:cover;border-radius:20px;display:block;
  margin:0 auto 0;box-shadow:0 30px 70px rgba(10,6,40,.42);position:relative;z-index:1;}

/* The article sheet: white paper floating on the site's dark gradient. When a
   hero image is present it tucks under it via the negative margin. */
.blog-sheet{background:var(--paper);border-radius:22px;padding:56px 62px 60px;
  box-shadow:0 26px 64px rgba(10,6,40,.32);}
.blog-sheet.has-hero{margin-top:-46px;padding-top:74px;position:relative;z-index:0;}
.blog-post-body{max-width:720px;margin:0 auto;}

.blog-tags{max-width:720px;margin:44px auto 0;padding-top:26px;border-top:1px solid var(--rule);
  display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.blog-tags .lbl{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.8px;color:var(--violet);margin-right:4px;}

.blog-back{display:inline-flex;align-items:center;gap:9px;margin-bottom:28px;color:rgba(255,255,255,.72);
  text-decoration:none;font-weight:700;font-size:14px;transition:color .18s ease,gap .18s ease;}
.blog-back:hover{color:#fff;gap:13px;}

/* Post-article CTA back into the funnel. */
.blog-cta{max-width:900px;margin:48px auto 0;padding:44px 46px;border-radius:22px;text-align:center;
  background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.28);backdrop-filter:blur(18px);}
.blog-cta h2{font-size:30px;font-weight:800;color:#fff;letter-spacing:-.5px;margin-bottom:12px;}
.blog-cta p{color:rgba(255,255,255,.76);font-size:16.5px;line-height:1.6;margin-bottom:24px;}
.blog-cta .btn-primary{display:inline-flex;align-items:center;gap:10px;padding:15px 30px;border-radius:999px;
  background:var(--gold);color:var(--dark);font-weight:800;text-decoration:none;font-size:15.5px;
  transition:transform .18s ease,box-shadow .18s ease;}
.blog-cta .btn-primary:hover{transform:translateY(-2px);box-shadow:0 14px 30px rgba(223,169,73,.4);}

/* Preview banner — only rendered by the portal's preview route. */
.blog-preview-bar{position:sticky;top:0;z-index:99;display:flex;align-items:center;justify-content:center;gap:12px;
  padding:11px 18px;background:var(--gold);color:var(--dark);font-weight:800;font-size:13.5px;letter-spacing:.3px;}
.blog-preview-bar button{background:var(--dark);color:#fff;border:none;padding:7px 15px;border-radius:999px;
  font-weight:700;font-size:12.5px;cursor:pointer;font-family:inherit;}

@media (max-width:1280px){
  .blog-grid{grid-template-columns:repeat(2,1fr);}
  .blog-sheet{padding:44px 40px 48px;}
  .blog-feature-body{padding:34px 34px;}
}
@media (max-width:768px){
  .blog-main{padding:36px 16px 72px;}
  .blog-grid{grid-template-columns:1fr;}
  .blog-hero h1{font-size:32px;letter-spacing:-.6px;}
  .blog-hero p{font-size:16px;}
  .blog-post-head h1{font-size:29px;letter-spacing:-.5px;}
  .blog-feature{grid-template-columns:1fr;}
  .blog-feature-img,.blog-feature-img-ph{min-height:210px;aspect-ratio:16/10;}
  .blog-feature-body{padding:26px 24px 30px;}
  .blog-feature-body h2{font-size:24px;}
  .blog-post-hero{aspect-ratio:16/10;border-radius:14px;}
  .blog-sheet{padding:30px 20px 36px;border-radius:16px;}
  .blog-sheet.has-hero{margin-top:-24px;padding-top:40px;}
  .blog-post-body{font-size:16.5px;}
  .blog-post-body h2{font-size:24px;margin:32px 0 12px;}
  .blog-post-body h3{font-size:20px;}
  .blog-post-body .blog-columns{flex-direction:column;gap:0;}
  .blog-cta{padding:32px 22px;margin-top:34px;}
  .blog-cta h2{font-size:23px;}
  .blog-editor-body{padding:20px 18px 40px;}
}
