/* ============================================================
   if you're in a place — Ghost Theme CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --bg: #f8d7e3;
  --text: #2a2a2a;
  --text-mid: #4a4a4a;
  --text-light: #aaa;
  --accent: #c0355a;
  --accent-soft: #e8a0b4;
  --border: #e4b8ca;
  --link: #b02e50;
  --sidebar-w: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Masthead ── */
.masthead {
  display: none;
}

.site-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: block;
  line-height: 1.2;
  margin-bottom: 6px;
  transition: color 0.2s;
}

.site-name:hover { color: var(--accent); }

.site-tagline {
  font-size: 0.66rem;
  color: var(--text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.5;
  margin-bottom: 32px;
}

/* ── Body layout ── */
.body {
  display: flex;
  align-items: flex-start;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 48px 0;
  text-align: right;
}

.sidebar-byline {
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 36px;
  line-height: 1.6;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

nav a {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 0;
  display: block;
  transition: color 0.2s;
}

nav a:hover,
nav a.nav-current { color: var(--accent); }

.rss-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-size: 0.65rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.08em;
  font-weight: 500;
  text-transform: uppercase;
  border: 1px solid var(--accent-soft);
  padding: 4px 10px;
  border-radius: 99px;
  margin-top: 24px;
  transition: background 0.2s, color 0.2s;
}

.rss-link:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── Main content ── */
.main-content {
  flex: 1;
  padding: 48px 0 80px 52px;
  min-width: 0;
}

/* ── Posts ── */
.post {
  padding: 28px 0;
  animation: fadeUp 0.5s ease both;
}

.post:first-child { padding-top: 0; }

.post:nth-child(1) { animation-delay: 0.05s; }
.post:nth-child(2) { animation-delay: 0.12s; }
.post:nth-child(3) { animation-delay: 0.19s; }
.post:nth-child(4) { animation-delay: 0.26s; }
.post:nth-child(5) { animation-delay: 0.33s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.post-date {
  font-size: 0.65rem;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-tag {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  background: rgba(192, 53, 90, 0.08);
  padding: 2px 7px;
  border-radius: 2px;
  text-decoration: none;
}

.post-title.is-linked::after {
  content: ' →';
  color: var(--accent-soft);
}

.post-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.post-title a:hover { color: var(--accent); }

.post-excerpt {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.75;
}

.post-footer {
  margin-top: 10px;
  font-size: 0.68rem;
  color: var(--text-light);
}

.post-footer a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.post-footer a:hover { color: var(--accent); }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: space-between;
  padding: 28px 0 0;
  font-size: 0.75rem;
  color: var(--text-light);
}

.pagination a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.pagination a:hover { opacity: 0.7; }

/* ── Individual post ── */
.post-full-header {
  padding: 32px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.post-full-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.post-full-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

.post-full-image {
  width: 100%;
  height: auto;
  border-radius: 3px;
  margin-top: 16px;
}

.post-full-content {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.8;
}

.post-full-content p { margin-bottom: 1.2em; }

.post-full-content a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.post-full-content a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.post-full-content h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  font-weight: 400;
  margin: 1.8em 0 0.6em;
  color: var(--text);
}

.post-full-content h3 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 1.6em 0 0.5em;
  color: var(--text);
}

.post-full-content blockquote {
  border-left: 2px solid var(--accent-soft);
  padding-left: 16px;
  margin: 1.4em 0;
  font-style: italic;
  color: var(--text-mid);
}

.post-full-content ul,
.post-full-content ol {
  padding-left: 1.4em;
  margin-bottom: 1.2em;
}

.post-full-content li { margin-bottom: 0.3em; }

.post-full-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.post-full-content pre {
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.8rem;
  margin-bottom: 1.2em;
}

.post-full-content code {
  font-size: 0.82em;
  background: rgba(0,0,0,0.04);
  padding: 2px 5px;
  border-radius: 3px;
}

.post-full-content img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  margin: 1em 0;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 0;
  margin-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
}

.post-nav a {
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.2s;
  max-width: 45%;
}

.post-nav a:hover { color: var(--accent); }

.post-nav-label {
  display: block;
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 4px;
}

/* ── Error page ── */
.error-page { padding-top: 40px; }

.error-code {
  font-family: 'DM Serif Display', serif;
  font-size: 4rem;
  color: var(--accent-soft);
  line-height: 1;
  margin-bottom: 12px;
}

.error-message {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 20px;
}

.error-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

/* ── Koenig card width classes (required by Ghost) ── */
.kg-width-wide {
  margin-left: -60px;
  margin-right: -60px;
}

.kg-width-full {
  margin-left: calc(50% - 50vw + var(--sidebar-w) / 2);
  margin-right: calc(50% - 50vw + var(--sidebar-w) / 2);
}

.kg-width-wide img,
.kg-width-full img { width: 100%; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .page { padding: 0 20px; }
  .site-name { font-size: 2rem; }
  .body { flex-direction: column; }

  .sidebar {
    width: 100%;
    text-align: left;
    padding: 24px 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  nav { flex-direction: row; flex-wrap: wrap; gap: 0 18px; }
  nav a { text-align: left; }
  .sidebar-byline { margin-bottom: 16px; }

  .main-content { padding: 28px 0 60px; }

  .kg-width-wide,
  .kg-width-full {
    margin-left: -20px;
    margin-right: -20px;
  }
}
