/* ─── FONTS ──────────────────────────────────────────────── */
/* Cinzel       → headings / labels (sacred inscriptions)     */
/* Cormorant    → hero title (editorial, regal)               */
/* Crimson Pro  → body text (book-like, warm reading)         */

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --saffron:       #FF6B00;
  --saffron-light: #FFA040;
  --maroon:        #7B1A00;
  --maroon-deep:   #4A0E00;
  --gold:          #B45309;
  --gold-light:    #F59E0B;
  --cream:         #FFF8F0;
  --cream-mid:     #FFF0DC;
  --cream-dark:    #F5E6CC;
  --ink:           #2C1A0E;
  --ink-mid:       #5C3D1E;
  --ink-light:     #8B6543;
  --border:        rgba(180,83,9,0.18);
  --border-mid:    rgba(180,83,9,0.30);
}

/* ─── BASE ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--cream);
  color: var(--ink);
}

/* ─── READING PROGRESS ───────────────────────────────────── */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--maroon), var(--saffron), var(--gold-light));
  z-index: 999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ─── WRAPPER ─────────────────────────────────────────────── */
.blog-detail {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ─── BACK LINK ───────────────────────────────────────────── */
.blog-back {
  margin-bottom: 1.5rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s, gap 0.2s;
}
.back-link:hover { color: var(--maroon); gap: 10px; }
.back-link svg { transition: transform 0.2s; }
.back-link:hover svg { transform: translateX(-3px); }

/* ─── HERO ────────────────────────────────────────────────── */
.blog-hero {
  position: relative;
  margin-bottom: 2.5rem;
}
.blog-hero__frame {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16/6;
  border: 1px solid var(--border-mid);
}
.blog-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 8s ease;
}
.blog-hero:hover .blog-hero__img { transform: scale(1.03); }
.blog-hero__vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(44,26,14,0.35) 100%);
  pointer-events: none;
}

/* Decorative corner brackets */
.blog-hero__corner {
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--gold);
  border-style: solid;
  z-index: 2;
}
.blog-hero__corner--tl { top: -4px; left: -4px; border-width: 2px 0 0 2px; }
.blog-hero__corner--tr { top: -4px; right: -4px; border-width: 2px 2px 0 0; }
.blog-hero__corner--bl { bottom: -4px; left: -4px; border-width: 0 0 2px 2px; }
.blog-hero__corner--br { bottom: -4px; right: -4px; border-width: 0 2px 2px 0; }

/* ─── HEADER ─────────────────────────────────────────────── */
.blog-header {
  text-align: center;
  padding: 0 1rem 2rem;
}
.blog-header__mantra {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  color: var(--saffron);
  opacity: 0.5;
  line-height: 1;
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}
.blog-header__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.label-gem { color: var(--saffron); font-size: 8px; }

.blog-header__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 500;
  color: var(--maroon-deep);
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 820px;
  margin: 0 auto 1.25rem;
}

.blog-header__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  color: var(--ink-light);
}
.meta-dot { color: var(--border-mid); }
.meta-badge {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 1px solid var(--border-mid);
  border-radius: 2px;
  color: var(--gold);
  background: rgba(180,83,9,0.05);
}

/* ─── SACRED DIVIDER ─────────────────────────────────────── */
.sacred-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0.5rem 0 2.5rem;
  padding: 0 1rem;
}
.sacred-divider__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-mid), transparent);
}
.sacred-divider__symbol {
  display: flex;
  align-items: center;
  opacity: 0.85;
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
.blog-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}

/* ─── SIDEBAR TOC ─────────────────────────────────────────── */
.blog-sidebar {
  position: sticky;
  top: 6rem;
}
.sidebar-scroll {
  background: rgba(255,240,220,0.5);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
}
.sidebar-title {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc-link {
  font-family: 'Crimson Pro', serif;
  font-size: 0.88rem;
  color: var(--ink-mid);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 2px;
  border-left: 2px solid transparent;
  line-height: 1.4;
  transition: all 0.2s;
}
.toc-link--sub {
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--ink-light);
}
.toc-link:hover {
  color: var(--maroon);
  background: rgba(180,83,9,0.06);
  border-left-color: var(--gold-light);
}
.toc-link.active {
  color: var(--maroon);
  background: rgba(180,83,9,0.08);
  border-left-color: var(--saffron);
  font-weight: 500;
}

/* ─── ARTICLE BODY ────────────────────────────────────────── */
.blog-body {
  min-width: 0;
  font-family: 'Crimson Pro', serif;
  font-size: 1.2rem;
  line-height: 1.85;
  color: var(--ink);
}

/* ─────────────────────────────────────────────────────────── */
/* CKEditor Content Styles                                     */
/* These target the HTML that CKEditor generates              */
/* ─────────────────────────────────────────────────────────── */

/* Headings */
.ck-content h1,
.ck-content h2,
.ck-content h3,
.ck-content h4 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--maroon-deep);
  margin: 2.5rem 0 1rem;
  line-height: 1.25;
  font-weight: 500;
}
.ck-content h1 { font-size: 2.2rem; }
.ck-content h2 {
  font-size: 1.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.ck-content h2::before {
  content: '✦';
  position: absolute;
  left: -1.4rem;
  font-size: 0.7rem;
  color: var(--saffron);
  top: 0.6rem;
}
.ck-content h3 { font-size: 1.5rem; color: var(--maroon); }
.ck-content h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Paragraphs */
.ck-content p {
  margin-bottom: 1.4rem;
}
.ck-content p:first-of-type::first-letter {
  font-family: 'Cormorant Garamond', serif;
  font-size: 4rem;
  font-weight: 600;
  color: var(--maroon);
  float: left;
  line-height: 0.8;
  margin: 0.1rem 0.15rem 0 0;
  padding: 0.1rem 0.1rem 0 0;
}

/* Links */
.ck-content a {
  color: var(--maroon);
  text-decoration: underline;
  text-decoration-color: rgba(123,26,0,0.3);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.ck-content a:hover {
  color: var(--saffron);
  text-decoration-color: var(--saffron);
}

/* Bold & Italic */
.ck-content strong {
  font-weight: 600;
  color: var(--maroon-deep);
}
.ck-content em {
  font-style: italic;
  color: var(--ink-mid);
}

/* Blockquote */
.ck-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.75rem;
  background: rgba(255,240,220,0.6);
  border-left: 3px solid var(--saffron);
  border-radius: 0 4px 4px 0;
  position: relative;
}
.ck-content blockquote::before {
  content: '\201C';
  font-family: 'Cormorant Garamond', serif;
  font-size: 5rem;
  color: var(--saffron);
  opacity: 0.25;
  position: absolute;
  top: -1rem;
  left: 1rem;
  line-height: 1;
  pointer-events: none;
}
.ck-content blockquote p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-style: italic;
  color: var(--maroon-deep);
  margin: 0;
  line-height: 1.6;
}

/* Lists */
.ck-content ul,
.ck-content ol {
  margin: 1rem 0 1.4rem 0;
  padding-left: 1.5rem;
}
.ck-content ul { list-style: none; padding-left: 0; }
.ck-content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}
.ck-content ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--saffron);
  font-size: 0.6rem;
  top: 0.55rem;
}
.ck-content ol {
  counter-reset: sacred-counter;
  list-style: none;
  padding-left: 0;
}
.ck-content ol li {
  counter-increment: sacred-counter;
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 0.6rem;
}
.ck-content ol li::before {
  content: counter(sacred-counter);
  position: absolute;
  left: 0;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--maroon);
  color: var(--cream);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0.2rem;
}

/* Images from CKEditor */
.ck-content figure.image {
  margin: 2rem 0;
  text-align: center;
}
.ck-content figure.image img {
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border-mid);
}
.ck-content figure.image figcaption {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: var(--ink-light);
  font-style: italic;
  margin-top: 0.5rem;
}

/* Tables from CKEditor */
.ck-content figure.table {
  margin: 2rem 0;
  overflow-x: auto;
}
.ck-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.ck-content table th {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--maroon-deep);
  color: var(--cream);
  padding: 0.75rem 1rem;
  text-align: left;
}
.ck-content table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: top;
}
.ck-content table tr:nth-child(even) td {
  background: rgba(255,240,220,0.35);
}
.ck-content table tr:hover td {
  background: rgba(255,107,0,0.05);
}

/* Code blocks */
.ck-content pre {
  background: var(--maroon-deep);
  color: var(--cream-mid);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.9rem;
  margin: 1.5rem 0;
  border: 1px solid rgba(255,107,0,0.15);
}
.ck-content code {
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
  background: rgba(123,26,0,0.08);
  color: var(--maroon);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.ck-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

/* Horizontal rule */
.ck-content hr {
  border: none;
  margin: 2.5rem 0;
  display: flex;
  align-items: center;
  text-align: center;
}
.ck-content hr::before {
  content: '✦  ✦  ✦';
  display: block;
  width: 100%;
  color: var(--gold);
  font-size: 0.75rem;
  letter-spacing: 0.5em;
  opacity: 0.6;
}

/* CKEditor media embed */
.ck-content .media {
  margin: 2rem 0;
}
.ck-content .media > div {
  aspect-ratio: 16/9;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-mid);
}

/* ─── BLOG END ORNAMENT ───────────────────────────────────── */
.blog-end {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 3rem 0 2rem;
}
.blog-end__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-mid), transparent);
}
.blog-end__symbol {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  white-space: nowrap;
}

/* ─── CTA ─────────────────────────────────────────────────── */
.blog-cta {
  text-align: center;
  padding: 1rem 0 2rem;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--maroon);
  text-decoration: none;
  border: 1px solid var(--border-mid);
  padding: 10px 24px;
  border-radius: 2px;
  background: transparent;
  transition: all 0.25s;
}
.cta-btn:hover {
  background: var(--maroon-deep);
  color: var(--cream);
  border-color: var(--maroon-deep);
  gap: 12px;
}
.cta-btn svg { transition: transform 0.2s; }
.cta-btn:hover svg { transform: translateX(-3px); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
  .blog-sidebar {
    display: none;
  }
  .blog-hero__frame {
    aspect-ratio: 16/7;
  }
  .ck-content h2::before {
    display: none;
  }
}
@media (max-width: 600px) {
  .blog-detail { padding: 1rem 1rem 3rem; }
  .blog-header__title { font-size: 1.9rem; }
  .blog-hero__frame { aspect-ratio: 4/3; }
  .ck-content { font-size: 1.1rem; }
  .ck-content p:first-of-type::first-letter {
    font-size: 3rem;
  }
}