/* PLACEHOLDER PALETTE: swap these with the hex codes from theologiamoralis.com */
:root {
  --bg: #F4F3F1;
  --sidebar: #EBEAE7;
  --card: #FFFFFF;
  --text: #2b2929;
  --muted: #2b2929;
  --blue: #6D8BC6;   /* links and quotes */
  --accent: #6D8BC6;
  --line: #DCD9D4;
  --field: #E2E1DD;
  --thumb: #DCD9D4;
  --sidebar-width: 300px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* Layout */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
aside {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar);
  padding: 28px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.3s ease, padding 0.3s ease;
  color: var(--text);
}

/* Collapsed: icons only */
body.collapsed { --sidebar-width: 76px; }
body.collapsed aside { padding: 28px 12px; }
body.collapsed .lbl,
body.collapsed .label,
body.collapsed .count,
body.collapsed aside .arrow,
body.collapsed .profile-text { display: none; }
body.collapsed .profile { justify-content: center; margin-bottom: 28px; }
body.collapsed .nav a,
body.collapsed .link-list a { justify-content: center; padding: 11px 0; gap: 0; }
body.collapsed .avatar { width: 44px; height: 44px; border-radius: 50%; }

.toggle {
  position: fixed;
  top: 24px;
  left: calc(var(--sidebar-width) - 13px);
  z-index: 10;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: left 0.3s ease, background 0.2s ease, color 0.2s ease;
  padding: 0;
  box-shadow: inset 0 0 0 1px var(--blue);
}
.toggle:hover {
  background: var(--bg);
  color: var(--blue);
}

.profile { display: flex; gap: 14px; align-items: center; margin-bottom: 36px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--line);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-name { font-size: 20px; font-weight: 600; margin: 0; line-height: 1.2; color: var(--text); }
.profile-role { font-size: 15px; margin: 2px 0 0; color: var(--text); }

.nav a, .link-list a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 16px;
  color: var(--blue);
  white-space: nowrap;
}
.nav a:hover, .link-list a:hover { background: rgba(109, 139, 198, 0.12); }
.nav a.active { background: rgba(109, 139, 198, 0.18); }
.nav svg, .link-list svg { width: 20px; height: 20px; flex-shrink: 0; stroke: var(--text); fill: none; stroke-width: 1.6; }

.nav a .count { margin-left: auto; font-size: 13px; background: rgba(109,139,198,0.15); border-radius: 999px; padding: 2px 9px; }
.link-list a .arrow { margin-left: auto; font-size: 13px; display: inline-block; transition: transform 0.2s ease; }
.link-list a:hover .arrow { transform: translateY(-3px); }
body.collapsed .link-list a .arrow,
body.collapsed .nav a .count { display: none; }

.label {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text); margin: 32px 14px 10px;
}

/* Main */
main {
  flex: 1;
  padding: 48px 56px 80px;
  min-width: 0;
}

/* Home */
.hero {
  min-height: calc(100vh - 128px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.hero-emblem {
  width: 300px;
  height: auto;
  margin-bottom: 32px;
}
.pill {
  display: inline-block;
  background: var(--sidebar);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 15px;
  margin-bottom: 28px;
}
.hero h1 {
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 auto;
  max-width: 16ch;
}
.hero h1 em { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.hero p { font-size: 17px; color: var(--muted); max-width: 52ch; margin: 28px auto 0; }

/* Recent posts on home */
.recent { margin-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.section-head h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.view-all { color: var(--accent); font-size: 15px; }
.view-all .arrow { display: inline-block; transition: transform 0.2s ease; }
.view-all:hover .arrow { transform: translateX(3px); }

/* Inner pages */
.page-title {
  font-size: clamp(36px, 4.5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 40px;
}

.page-intro { font-size: 17px; max-width: 60ch; margin: -24px 0 36px; }
.crumb { font-size: 14px; margin: 0 0 12px; }
.crumb a { color: var(--accent); }
.card .d { font-size: 15px; line-height: 1.5; }

/* Controls */
.controls { display: flex; gap: 16px; align-items: center; margin-bottom: 28px; }
.search, .filter {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
}
.search { flex: 1; outline: none; background: var(--sidebar); }
.search::placeholder { color: #A19D98; }
.filter { min-width: 160px; }

/* Post cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  overflow: hidden;
}
.card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.06); }
.card .thumb {
  transition: transform 0.5s ease;
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(135deg, var(--thumb) 0 10px, #E8E6E2 10px 20px);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted);
}
.card .thumb.has-img { background-size: cover; background-repeat: no-repeat; }
.card:hover .thumb { transform: scale(1.08); }
.card .t { font-size: 18px; font-weight: 600; line-height: 1.3; }
.card .m { font-size: 14px; color: var(--muted); }
.card.hidden { display: none; }

/* Reading list */
.reading-list { list-style: none; padding: 0; margin: 0; }
.reading-list li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.reading-list li:first-child { border-top: 1px solid var(--line); }
.reading-list .t { font-size: 15px; }
.reading-list .m { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Post page */
article.post { max-width: 680px; margin: 0 auto; }
.post h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 16px; }
.post .deck { font-size: 20px; line-height: 1.45; margin: 0 0 18px; }
.post .meta { color: #4857A4; font-size: 14px; margin: 0 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.post figure { margin: 0 0 36px; }
.post .cover-img { aspect-ratio: 16 / 9; border-radius: 12px; background-size: cover; background-repeat: no-repeat; }
.post p { font-size: 18px; line-height: 1.75; margin: 0 0 22px; }
.post p a { text-decoration: none; }
.post h2 { color: #4857A4; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 44px 0 14px; }
.post h3 { color: #4857A4; font-size: 21px; font-weight: 600; margin: 32px 0 12px; }
.post blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-style: italic;
  line-height: 1.5;
}
.post blockquote cite { display: block; margin-top: 12px; font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif; font-size: 14px; font-style: normal; color: var(--text); }
.post ul { font-size: 18px; line-height: 1.75; padding-left: 22px; margin: 0 0 22px; }
.post .crumb a { text-decoration: none; }
.post-back { margin-top: 48px; }
.post p.post-back a { text-decoration: none; }
.crumb a, .post-back a { transition: color 0.2s ease; }
.crumb a:hover, .post p.post-back a:hover { color: #A19D98; }
.post-back .arrow { display: inline-block; transition: transform 0.2s ease; }
.post-back a:hover .arrow { transform: translateX(-4px); }

/* Quotes and inline links */
blockquote, q { color: var(--accent); }
main p a, main li a { color: var(--accent); }

footer { margin-top: 80px; font-size: 14px; color: var(--muted); text-align: center; }
footer a, footer a:link, footer a:visited { color: var(--accent); }
footer a .arrow {
  display: inline-block;
  font-size: 12px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
footer a:hover .arrow { opacity: 1; transform: translateY(-2px); }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  aside { width: 100%; height: auto; position: static; }
  body.collapsed { --sidebar-width: 100%; }
  .toggle { display: none; }
  main { padding: 32px 24px 60px; }
  .hero { min-height: auto; padding: 48px 0; }
  .hero-emblem { width: 220px; }
}

/* Inside post text */
.post blockquote p { font-size: inherit; line-height: inherit; margin: 0; }
.post img { max-width: 100%; height: auto; border-radius: 12px; display: block; margin: 32px 0; }
.hero p a { color: var(--accent); }
