/* ============================================================
   MASJID AL-LAYL — Islamic Dark Theme for Obsidian Publish
   motasem-notes.net
   ============================================================

   Concept: The interior of a mosque at night.
   Dark carved stone, candlelight gold, emerald glass,
   and the quiet geometry of sacred mathematics.

   COLOR SYSTEM
   ─────────────────────────────────────────────────────────────
   --stone-void      Deepest background (night stone)
   --stone-dark      Panels and sidebars
   --stone-mid       Content surface
   --stone-card      Raised surfaces / cards
   --gold            Primary accent (candlelight)
   --emerald         Secondary accent (sacred green)
   --teal            Tertiary accent (turquoise tilework)
   --crimson         Warning / danger accent
   --text-*          Text hierarchy
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Amiri:ital,wght@0,400;0,700;1,400&family=Courier+Prime:ital,wght@0,400;0,700;1,400&display=swap');

/* ─── CUSTOM PROPERTIES ──────────────────────────────────── */
:root {
  --stone-void:       #080a0e;
  --stone-dark:       #0d1018;
  --stone-mid:        #101420;
  --stone-card:       #141926;
  --stone-raised:     #18202e;
  --stone-hover:      #1c2536;

  --gold:             #c9a052;
  --gold-light:       #e2ba70;
  --gold-pale:        #f0d89a;
  --gold-dim:         rgba(201, 160, 82, 0.12);
  --gold-glow:        0 0 12px rgba(201, 160, 82, 0.35), 0 0 30px rgba(201, 160, 82, 0.15);
  --gold-border:      rgba(201, 160, 82, 0.3);

  --emerald:          #2e8c5e;
  --emerald-light:    #3daa74;
  --emerald-dim:      rgba(46, 140, 94, 0.12);
  --emerald-glow:     0 0 12px rgba(46, 140, 94, 0.4), 0 0 28px rgba(46, 140, 94, 0.15);

  --teal:             #1e7a8a;
  --teal-light:       #2a9aad;
  --teal-dim:         rgba(30, 122, 138, 0.12);

  --crimson:          #8b2635;
  --crimson-light:    #b03344;
  --crimson-dim:      rgba(139, 38, 53, 0.15);

  --sand:             #d4b896;
  --sand-dim:         rgba(212, 184, 150, 0.08);

  --text-primary:     #d4c4a8;
  --text-secondary:   #8a7d68;
  --text-muted:       #4a4438;
  --text-heading:     #e8d9bc;
  --text-bright:      #f5ead4;

  --border-faint:     rgba(201, 160, 82, 0.06);
  --border-dim:       rgba(201, 160, 82, 0.14);
  --border-mid:       rgba(201, 160, 82, 0.28);
  --border-strong:    rgba(201, 160, 82, 0.55);

  --font-display:     'Cinzel', serif;
  --font-body:        'Cormorant Garamond', serif;
  --font-alt:         'Amiri', serif;
  --font-mono:        'Courier Prime', monospace;

  --radius-sm:        2px;
  --radius-md:        4px;
  --radius-lg:        6px;

  --transition-fast:  0.18s ease;
  --transition-mid:   0.32s ease;
}

/* ─── GEOMETRIC BACKGROUND PATTERN ──────────────────────── */
/*
   Islamic 8-pointed star tessellation via layered CSS gradients.
   Subtle — like the shadow of carved stone.
*/
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  /* Fine grain texture overlay */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='none'/%3E%3Ccircle cx='1' cy='1' r='0.4' fill='rgba(201,160,82,0.04)'/%3E%3C/svg%3E");
  background-size: 4px 4px;
}

/* Geometric star grid */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background-image:
    /* Horizontal fine lines */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 47px,
      rgba(201, 160, 82, 0.04) 47px,
      rgba(201, 160, 82, 0.04) 48px
    ),
    /* Vertical fine lines */
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 47px,
      rgba(201, 160, 82, 0.04) 47px,
      rgba(201, 160, 82, 0.04) 48px
    ),
    /* Diagonal 45° lines */
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 33px,
      rgba(201, 160, 82, 0.025) 33px,
      rgba(201, 160, 82, 0.025) 34px
    ),
    /* Diagonal 135° lines */
    repeating-linear-gradient(
      135deg,
      transparent,
      transparent 33px,
      rgba(201, 160, 82, 0.025) 33px,
      rgba(201, 160, 82, 0.025) 34px
    );
}

/* ─── BASE ───────────────────────────────────────────────── */
body {
  background-color: var(--stone-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.85;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(201, 160, 82, 0.22);
  color: var(--text-bright);
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--stone-void);
}
::-webkit-scrollbar-thumb {
  background: rgba(201, 160, 82, 0.2);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ─── SITE LAYOUT ────────────────────────────────────────── */
.site-body {
  background: var(--stone-void);
}

.site-body-left-column {
  background: var(--stone-dark);
  border-right: 1px solid var(--border-faint);
}

.site-body-right-column {
  background: var(--stone-dark);
  border-left: 1px solid var(--border-faint);
}

.site-body-center {
  background: var(--stone-mid);
  flex: 1 1 0%;
  min-width: 0;
}

/* ─── SITE HEADER ────────────────────────────────────────── */
.site-header {
  background: var(--stone-dark);
  border-bottom: 1px solid var(--border-dim);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Muqarnas-inspired decorative arch line */
.site-header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold) 15%,
    var(--gold-pale) 50%,
    var(--gold) 85%,
    transparent 100%
  );
  opacity: 0.6;
}

/* Radial light bloom from center — like a lantern */
.site-header::after {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 80px;
  background: radial-gradient(ellipse at center top,
    rgba(201, 160, 82, 0.07) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.site-header-text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: var(--gold-glow);
}

.site-header-text a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-header-text a:hover {
  color: var(--gold-pale);
}

/* ─── NAVIGATION / SIDEBAR ───────────────────────────────── */
.nav-view-outer {
  padding: 20px 0;
}

.nav-folder-title,
.tree-item-self {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 7px 22px;
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
  cursor: pointer;
}

.nav-folder-title:hover,
.tree-item-self:hover {
  background: var(--gold-dim);
  color: var(--gold);
  border-left-color: var(--gold);
}

.tree-item-self.is-active,
.nav-file-title.is-active {
  background: var(--gold-dim);
  color: var(--gold-light);
  border-left-color: var(--gold);
  text-shadow: 0 0 16px rgba(201, 160, 82, 0.4);
}

.nav-file-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 5px 22px 5px 36px;
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  line-height: 1.5;
}

.nav-file-title:hover {
  background: var(--gold-dim);
  color: var(--gold-light);
  border-left-color: rgba(201, 160, 82, 0.35);
}

/* ─── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb-container {
  border-bottom: 1px solid var(--border-faint);
  padding: 10px 36px;
  background: var(--stone-dark);
}

.breadcrumb-container span,
.breadcrumb-container a {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-container a:hover {
  color: var(--gold);
}

/* ─── PAGE + CONTENT ─────────────────────────────────────── */
.page-header {
  padding: 44px 48px 0;
}

.markdown-rendered,
.publish-article {
  padding: 36px 48px 90px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.page-content {
  max-width: 100%;
  width: 100%;
}

.mod-page {
  max-width: 100% !important;
  width: 100% !important;
}

/* ─── HEADINGS ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3,
.markdown-rendered h4,
.markdown-rendered h5,
.markdown-rendered h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-heading);
  line-height: 1.25;
  margin: 2.2em 0 0.8em;
  position: relative;
}

h1, .markdown-rendered h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.22em;
  padding: 0 0 24px;
  margin-bottom: 1.8em;
}

/* Ornamental frame under H1 — like a mosque arch */
h1::before, .markdown-rendered h1::before {
  content: '◆';
  display: block;
  font-size: 14px;
  letter-spacing: 0.6em;
  color: var(--gold);
  opacity: 0.45;
  margin-bottom: 10px;
  text-shadow: none;
}

h1::after, .markdown-rendered h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold) 20%,
    var(--gold-pale) 50%,
    var(--gold) 80%,
    transparent 100%
  );
  box-shadow: 0 0 10px rgba(201, 160, 82, 0.3);
}

h2, .markdown-rendered h2 {
  font-size: 1.25rem;
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(201, 160, 82, 0.25);
  padding-bottom: 10px;
}

h2::after, .markdown-rendered h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
    var(--gold) 0%,
    transparent 70%
  );
  opacity: 0.4;
}

h3, .markdown-rendered h3 {
  font-size: 1.05rem;
  color: var(--emerald-light);
  text-shadow: 0 0 16px rgba(61, 170, 116, 0.3);
  padding-left: 14px;
}

h3::before, .markdown-rendered h3::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  color: var(--emerald-light);
  opacity: 0.7;
}

h4, .markdown-rendered h4 {
  font-size: 0.9rem;
  color: var(--teal-light);
  letter-spacing: 0.14em;
}

h5, h6,
.markdown-rendered h5,
.markdown-rendered h6 {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ─── BODY TEXT ──────────────────────────────────────────── */
p, .markdown-rendered p {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.9;
  color: var(--text-primary);
  margin: 0 0 1.3em;
}

/* ─── LINKS ──────────────────────────────────────────────── */
a,
.markdown-rendered a {
  color: var(--gold-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 160, 82, 0.28);
  transition: all var(--transition-fast);
}

a:hover,
.markdown-rendered a:hover {
  color: var(--gold-pale);
  border-bottom-color: var(--gold);
  text-shadow: 0 0 10px rgba(201, 160, 82, 0.4);
}

.internal-link {
  color: var(--gold-light);
  border-bottom: 1px dashed rgba(201, 160, 82, 0.3);
}

.internal-link:hover {
  color: var(--gold-pale);
  border-bottom-style: solid;
}

.external-link {
  color: var(--emerald-light);
  border-bottom: 1px solid rgba(61, 170, 116, 0.28);
}

.external-link:hover {
  color: #5fcc90;
  border-bottom-color: var(--emerald-light);
  text-shadow: 0 0 10px rgba(61, 170, 116, 0.35);
}

/* ─── INLINE CODE ────────────────────────────────────────── */
code,
.markdown-rendered code {
  font-family: var(--font-mono);
  font-size: 0.83em;
  color: var(--emerald-light);
  background: var(--emerald-dim);
  border: 1px solid rgba(46, 140, 94, 0.22);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  letter-spacing: 0;
}

/* ─── CODE BLOCKS ────────────────────────────────────────── */
pre,
.markdown-rendered pre {
  background: var(--stone-card) !important;
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--emerald);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin: 1.6em 0;
  overflow-x: auto;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(201, 160, 82, 0.04),
    0 6px 28px rgba(0, 0, 0, 0.55);
}

/* Ornamental label */
pre::before {
  content: attr(class);
  position: absolute;
  top: 8px;
  right: 14px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--emerald);
  opacity: 0.4;
}

pre code,
.markdown-rendered pre code {
  background: transparent !important;
  border: none;
  padding: 0;
  font-size: 13.5px;
  color: #b8dcc4;
  letter-spacing: 0;
}

/* ─── BLOCKQUOTE ─────────────────────────────────────────── */
blockquote,
.markdown-rendered blockquote {
  margin: 1.8em 0;
  padding: 22px 28px 22px 32px;
  background: var(--gold-dim);
  border-left: none;
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  position: relative;
  font-style: italic;
  box-shadow:
    inset 0 0 40px rgba(201, 160, 82, 0.03),
    0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Decorative bismillah-style ornament */
blockquote::before {
  content: '❝';
  position: absolute;
  top: 14px;
  left: 10px;
  font-family: var(--font-alt);
  font-size: 22px;
  color: var(--gold);
  opacity: 0.45;
  line-height: 1;
}

blockquote p {
  font-family: var(--font-alt);
  font-size: 17px;
  color: rgba(212, 196, 168, 0.9);
  font-style: italic;
  margin: 0;
  line-height: 1.85;
}

/* ─── HORIZONTAL RULE — Arabesque Divider ────────────────── */
hr, .markdown-rendered hr {
  border: none;
  margin: 3em 0;
  text-align: center;
  position: relative;
  height: 18px;
  overflow: visible;
}

hr::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold) 15%,
    var(--gold-pale) 50%,
    var(--gold) 85%,
    transparent 100%
  );
  opacity: 0.35;
}

hr::after {
  content: '✦ ◆ ✦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  letter-spacing: 0.6em;
  color: var(--gold);
  background: var(--stone-mid);
  padding: 0 16px;
  opacity: 0.6;
}

/* ─── LISTS ──────────────────────────────────────────────── */
ul, ol,
.markdown-rendered ul,
.markdown-rendered ol {
  padding-left: 1.6em;
  margin: 0.8em 0 1.4em;
}

li, .markdown-rendered li {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 0.45em;
  line-height: 1.8;
}

ul > li::marker {
  color: var(--gold);
  content: '◆  ';
  font-size: 0.6em;
}

ol > li::marker {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 0.8em;
  letter-spacing: 0.06em;
}

/* ─── TABLES ─────────────────────────────────────────────── */
table,
.markdown-rendered table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: 15px;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  overflow: hidden;
}

thead tr {
  background: var(--stone-card);
  border-bottom: 2px solid var(--gold);
}

thead th {
  padding: 13px 18px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(201, 160, 82, 0.3);
}

tbody tr {
  border-bottom: 1px solid var(--border-faint);
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--gold-dim);
}

tbody tr:nth-child(odd) {
  background: rgba(201, 160, 82, 0.025);
}

tbody tr:nth-child(odd):hover {
  background: var(--gold-dim);
}

td, .markdown-rendered td {
  padding: 11px 18px;
  color: var(--text-primary);
  vertical-align: top;
  font-family: var(--font-body);
}

/* ─── TAGS ───────────────────────────────────────────────── */
.tag,
a.tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold) !important;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 3px 12px;
  text-decoration: none !important;
  border-bottom: 1px solid var(--gold-border) !important;
  transition: all var(--transition-fast);
}

.tag:hover,
a.tag:hover {
  background: rgba(201, 160, 82, 0.2);
  border-color: var(--gold);
  color: var(--gold-pale) !important;
  box-shadow: var(--gold-glow);
}

/* ─── TASK LISTS ─────────────────────────────────────────── */
.task-list-item-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(201, 160, 82, 0.35);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  margin-right: 8px;
  top: 2px;
  transition: all var(--transition-fast);
}

.task-list-item-checkbox:checked {
  background: var(--gold-dim);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(201, 160, 82, 0.3);
}

.task-list-item-checkbox:checked::after {
  content: '✦';
  position: absolute;
  top: -3px;
  left: 1px;
  font-size: 12px;
  color: var(--gold);
  text-shadow: 0 0 6px rgba(201, 160, 82, 0.5);
}

/* ─── CALLOUTS ───────────────────────────────────────────── */
.callout {
  margin: 1.8em 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dim);
  overflow: hidden;
}

.callout[data-callout="info"],
.callout[data-callout="note"] {
  border-color: rgba(30, 122, 138, 0.3);
  background: var(--teal-dim);
}

.callout[data-callout="warning"],
.callout[data-callout="caution"] {
  border-color: var(--gold-border);
  background: var(--gold-dim);
}

.callout[data-callout="danger"],
.callout[data-callout="bug"] {
  border-color: rgba(139, 38, 53, 0.3);
  background: var(--crimson-dim);
}

.callout[data-callout="tip"],
.callout[data-callout="success"] {
  border-color: rgba(46, 140, 94, 0.3);
  background: var(--emerald-dim);
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-faint);
}

.callout[data-callout="info"] .callout-title,
.callout[data-callout="note"] .callout-title    { color: var(--teal-light); }
.callout[data-callout="warning"] .callout-title,
.callout[data-callout="caution"] .callout-title { color: var(--gold-light); }
.callout[data-callout="danger"] .callout-title,
.callout[data-callout="bug"] .callout-title     { color: var(--crimson-light); }
.callout[data-callout="tip"] .callout-title,
.callout[data-callout="success"] .callout-title { color: var(--emerald-light); }

.callout-content {
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--text-primary);
  line-height: 1.8;
}

/* ─── SEARCH ─────────────────────────────────────────────── */
.search-view-outer {
  padding: 14px;
}

.search-input-container input,
.search-input-wrapper input {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  background: var(--stone-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input-container input:focus,
.search-input-wrapper input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(201, 160, 82, 0.12);
}

.search-input-container input::placeholder,
.search-input-wrapper input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 9px;
}

.search-result-file-title {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 10px 14px 4px;
}

.search-result-file-match {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 14px;
  transition: background var(--transition-fast);
}

.search-result-file-match:hover {
  background: var(--gold-dim);
  color: var(--text-primary);
}

/* ─── TOC / OUTLINE ──────────────────────────────────────── */
.outline-view-outer {
  padding: 16px 0;
}

.tree-item-self .tree-item-inner {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.tree-item-self:hover .tree-item-inner {
  color: var(--gold);
}

/* ─── IMAGES ─────────────────────────────────────────────── */
img, .markdown-rendered img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  display: block;
  margin: 1.8em auto;
  box-shadow:
    0 0 0 4px var(--stone-mid),
    0 0 0 5px var(--border-dim),
    0 10px 40px rgba(0, 0, 0, 0.65);
  transition: box-shadow var(--transition-mid);
}

img:hover, .markdown-rendered img:hover {
  box-shadow:
    0 0 0 4px var(--stone-mid),
    0 0 0 5px var(--gold-border),
    0 12px 48px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(201, 160, 82, 0.1);
}

/* ─── INLINE FORMATTING ──────────────────────────────────── */
strong, b,
.markdown-rendered strong,
.markdown-rendered b {
  color: var(--text-bright);
  font-weight: 600;
}

em, i,
.markdown-rendered em,
.markdown-rendered i {
  font-family: var(--font-alt);
  color: rgba(212, 196, 168, 0.85);
  font-style: italic;
}

mark, .markdown-rendered mark {
  background: rgba(201, 160, 82, 0.18);
  color: var(--gold-pale);
  border-bottom: 1px solid rgba(201, 160, 82, 0.4);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

/* ─── SITE FOOTER ────────────────────────────────────────── */
.site-footer {
  background: var(--stone-dark);
  border-top: 1px solid var(--border-faint);
  padding: 22px 36px;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.site-footer::before {
  content: '✦ ◆ ✦';
  display: block;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.6em;
  margin-bottom: 10px;
  opacity: 0.4;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
  border: none;
  transition: color var(--transition-fast);
}

.site-footer a:hover {
  color: var(--gold-pale);
  text-shadow: var(--gold-glow);
}

.published-with-obsidian {
  opacity: 0.3;
  transition: opacity var(--transition-fast);
}

.published-with-obsidian:hover {
  opacity: 0.65;
}

/* ─── SIDEBAR TOGGLE ─────────────────────────────────────── */
.sidebar-toggle-button {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.sidebar-toggle-button:hover {
  color: var(--gold);
}

/* ─── GRAPH VIEW ─────────────────────────────────────────── */
.graph-view-outer {
  background: var(--stone-void);
}

/* ─── FOOTNOTES ──────────────────────────────────────────── */
.footnote-ref a {
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--gold);
  border: none;
  vertical-align: super;
}

.footnotes {
  border-top: 1px solid var(--border-faint);
  margin-top: 3em;
  padding-top: 1.5em;
}

.footnotes li {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ─── DEFINITION LISTS ───────────────────────────────────── */
dt {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 1em;
}

dd {
  font-family: var(--font-body);
  color: var(--text-primary);
  padding-left: 1.5em;
  margin: 0.3em 0 0.8em;
}

/* ─── MOBILE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .markdown-rendered,
  .publish-article {
    padding: 24px 22px 60px;
  }

  h1, .markdown-rendered h1 {
    font-size: 1.55rem;
    letter-spacing: 0.14em;
  }

  h2, .markdown-rendered h2 {
    font-size: 1.1rem;
  }

  p, .markdown-rendered p,
  li, .markdown-rendered li {
    font-size: 16px;
  }

  .site-header {
    padding: 0 18px;
  }
}

/* ─── UTILITY CLASS: ORNAMENT ────────────────────────────── */
/*
   Add class="ornament" to any div or p to render
   a centered geometric ornament divider, e.g.:
   <div class="ornament"></div>
*/
.ornament {
  text-align: center;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.8em;
  opacity: 0.5;
  margin: 2em 0;
}

.ornament::before {
  content: '◆ ✦ ◈ ✦ ◆';
}

/* ─── EOF ─────────────────────────────────────────────────── */