/* Apologetizam — original design. Tokens + light/dark (system pref + toggle). */

:root {
  --bg: #faf7f2;
  --bg-raised: #ffffff;
  --ink: #26221c;
  --ink-soft: #5c554a;
  --accent: #8a3b2c;
  --accent-soft: #b9573f;
  --rule: #e4ddd1;
  --verse-bg: #f3ede1;
  --verse-border: #c9a227;
  --quote-border: #b9b0a1;
  --tag-bg: #efe8db;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: system-ui, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1916;
    --bg-raised: #262220;
    --ink: #e8e2d7;
    --ink-soft: #a89f8f;
    --accent: #d98a6a;
    --accent-soft: #e0a288;
    --rule: #3a342e;
    --verse-bg: #2a2620;
    --verse-border: #a8862a;
    --quote-border: #5c554a;
    --tag-bg: #322d28;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1916;
  --bg-raised: #262220;
  --ink: #e8e2d7;
  --ink-soft: #a89f8f;
  --accent: #d98a6a;
  --accent-soft: #e0a288;
  --rule: #3a342e;
  --verse-bg: #2a2620;
  --verse-border: #a8862a;
  --quote-border: #5c554a;
  --tag-bg: #322d28;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-soft); }
img { max-width: 100%; height: auto; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--bg-raised); }
.header-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.masthead { font-weight: 700; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.site-nav { display: flex; gap: 1rem; align-items: center; font-family: var(--sans); font-size: .95rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
#tema-dugme { background: none; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-soft); cursor: pointer; font-size: 1rem; line-height: 1; padding: .3rem .55rem; }
#tema-dugme:hover { color: var(--accent); border-color: var(--accent); }

/* Hero */
.hero { padding: 2.5rem 0 1.5rem; border-bottom: 1px solid var(--rule); }
.hero h1 { font-size: 2.2rem; margin: 0 0 .5rem; line-height: 1.2; }
.hero-sub { color: var(--ink-soft); font-size: 1.15rem; margin: 0 0 1.25rem; }
.search { font-family: var(--sans); }

.section-title { font-size: 1.4rem; border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: .15rem; margin-top: 2.5rem; }

/* Cards */
.card { padding: 1.4rem 0; border-bottom: 1px solid var(--rule); }
.card-title { margin: 0 0 .25rem; font-size: 1.35rem; line-height: 1.3; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-meta { margin: 0 0 .5rem; font-family: var(--sans); font-size: .85rem; color: var(--ink-soft); }
.card-desc { margin: 0 0 .6rem; color: var(--ink-soft); }
.card-tags { margin: 0 0 .4rem; }
.card-more { margin: 0; font-family: var(--sans); font-size: .9rem; }
.card-more a { text-decoration: none; font-weight: 600; }

/* Tags */
.tag {
  display: inline-block; margin: 0 .35rem .35rem 0; padding: .12rem .6rem;
  background: var(--tag-bg); border-radius: 999px;
  font-family: var(--sans); font-size: .82rem; color: var(--ink-soft);
  text-decoration: none;
}
.tag:hover { color: var(--accent); }
.tag-count { opacity: .65; font-size: .9em; }
.tag-cloud { line-height: 2; }

/* Post */
.post-header h1 { font-size: 2rem; line-height: 1.25; margin: 2rem 0 .5rem; }
.post-meta { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); }
.post-body { margin-top: 1.5rem; }
.post-body h2, .post-body h3, .post-body h4 { line-height: 1.3; margin-top: 2.2rem; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem auto; width: 40%; }

/* Patristic / general quotes */
.post-body blockquote {
  margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem;
  border-left: 3px solid var(--quote-border);
  color: var(--ink-soft); font-style: italic;
}

/* Scripture quotes — distinct treatment */
blockquote.verse {
  margin: 1.75rem 0; padding: 1rem 1.25rem;
  background: var(--verse-bg);
  border-left: 4px solid var(--verse-border);
  border-radius: 0 .4rem .4rem 0;
  font-style: normal; color: var(--ink);
}
blockquote.verse p { margin: 0 0 .4rem; }
blockquote.verse cite {
  display: block; font-style: normal; font-family: var(--sans);
  font-size: .82rem; color: var(--ink-soft); text-align: right;
}

.post-footer { margin: 2.5rem 0; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: .9rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.post-body table { border-collapse: collapse; width: 100%; font-size: .95em; }
.post-body th, .post-body td { border: 1px solid var(--rule); padding: .5rem .75rem; text-align: left; vertical-align: top; }
.post-body th { background: var(--tag-bg); font-family: var(--sans); font-size: .85em; }

/* RTL script fragments (Hebrew, Arabic, Syriac) */
[dir="rtl"] { unicode-bidi: isolate; }

/* Embeds */
.embed { position: relative; aspect-ratio: 16 / 9; margin: 1.5rem 0; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: .4rem; }

/* Pager */
.pager { display: flex; justify-content: space-between; margin: 2rem 0; font-family: var(--sans); }
.pager-next { margin-left: auto; }

.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600; font-size: .95rem;
  padding: .45rem 1rem; border: 1.5px solid var(--accent); border-radius: .4rem;
  text-decoration: none;
}
.muted { color: var(--ink-soft); font-family: var(--sans); font-size: .9rem; }

/* Footer */
.site-footer { margin-top: 3.5rem; border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; font-family: var(--sans); font-size: .85rem; color: var(--ink-soft); }
.site-footer p { margin: .25rem 0; }

/* Pagefind theming */
.search { --pagefind-ui-primary: var(--accent); --pagefind-ui-text: var(--ink); --pagefind-ui-background: var(--bg-raised); --pagefind-ui-border: var(--rule); --pagefind-ui-font: var(--sans); }

@media (max-width: 600px) {
  body { font-size: 1.05rem; }
  .hero h1 { font-size: 1.7rem; }
  .post-header h1 { font-size: 1.55rem; }
}
