/* THOFTLY Ghost theme */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Lora:ital,wght@1,400;1,500&display=swap');

:root {
  --bg: #e8e4dc;
  --card: #faf8f4;
  --border: #d4cfc7;
  --text: #2a2825;
  --muted: #8f8b85;
  --soft: #b5b1aa;
  --accent: #4a5c3f;
  --accent-h: #3d4f34;
  --accent-pale: #eef0eb;
  --mint: #E9EEE9;
  --tag: #e6e3dc;
  --red: #b85c4a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }

/* TOP STRIP */
/* COMPACT TOP BAR */
.t-bar {
  background: var(--mint);
  color: var(--accent);
  border-bottom: 1px solid rgba(74, 92, 63, 0.1);
  padding: 8px 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.t-bar-row1 {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.02em;
}
.t-bar-title {
  color: var(--accent);
  text-decoration: none;
}
.t-bar-title:hover { opacity: 0.8; }

.t-bar-row2 {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--accent);
  opacity: 0.85;
  letter-spacing: 0.02em;
}

.t-bar-form {
  display: flex;
  align-items: stretch;
  gap: 6px;
  background: rgba(250, 248, 244, 0.95);
  border: 1px solid var(--accent);
  border-radius: 24px;
  padding: 3px 3px 3px 0;
  max-width: 360px;
  width: 100%;
}

.t-bar-form input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 5px 14px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  min-width: 0;
}
.t-bar-form input::placeholder { color: var(--soft); }

.t-bar-form button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 5px 16px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  gap: 1px;
  flex-shrink: 0;
}
.t-bar-btn-main { font-size: 12px; pointer-events: none; }
.t-bar-btn-sub { font-size: 8px; opacity: 0.85; font-style: italic; pointer-events: none; }
.t-bar-form button:hover { background: var(--accent-h); }

.t-bar-msg {
  font-size: 11px;
  color: var(--accent);
  font-style: italic;
  text-align: center;
  margin-top: 2px;
  min-height: 14px;
}

/* APP IFRAME WRAP */
.app-wrap {
  width: 100%;
  background: var(--bg);
}

.app-iframe {
  display: block;
  width: 100%;
  height: 90vh;            /* initial fallback; JS resizes to content height */
  min-height: 720px;
  border: none;
  background: var(--bg);
  transition: height 0.25s ease;
}

/* POSTS / EXPLORE */
.posts-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 20px 40px;
}

.posts-section-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--accent);
  margin: 0 0 24px;
  text-align: center;
}

.post-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.post-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}

.post-card-excerpt {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.6;
}

.post-card-meta {
  font-size: 11px;
  color: var(--soft);
}

/* SINGLE POST */
.post {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 20px 40px;
}

.post-header { text-align: center; margin-bottom: 40px; }
.post-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 32px;
  color: var(--accent);
  margin: 0 0 12px;
}
.post-meta { font-size: 12px; color: var(--soft); }

.post-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}

.post-content h1, .post-content h2, .post-content h3 {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--accent);
  margin-top: 1.5em;
}

.post-content a { text-decoration: underline; }

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  font-style: italic;
  color: var(--muted);
  margin: 1.5em 0;
}

.post-content img {
  max-width: 100%;
  border-radius: 10px;
  margin: 1.5em 0;
}

/* Koenig editor card width classes */
.kg-width-wide {
  position: relative;
  width: 85vw;
  max-width: 1040px;
  left: 50%;
  transform: translateX(-50%);
  margin: 1.5em auto;
}

.kg-width-full {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  margin: 1.5em 0;
}

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

/* Other Koenig classes */
.kg-image { max-width: 100%; height: auto; }
.kg-image-card { margin: 1.5em 0; }
.kg-card { margin: 1.5em 0; }
.kg-bookmark-card,
.kg-embed-card,
.kg-gallery-card,
.kg-button-card,
.kg-callout-card,
.kg-toggle-card { margin: 1.5em 0; }

.kg-bookmark-container {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
}

.kg-bookmark-content { padding: 16px; flex: 1; }
.kg-bookmark-title { font-weight: 600; margin-bottom: 6px; }
.kg-bookmark-description { font-size: 13px; color: var(--muted); }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--muted);
}

/* FOOTER */
.t-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 20px;
  font-size: 11px;
  color: var(--soft);
  background: var(--bg);
}

.t-footer a { color: var(--muted); margin: 0 8px; }

/* RESPONSIVE */
@media (max-width: 600px) {
  .t-bar-row1 { font-size: 14px; }
  .t-bar-row2 { font-size: 11px; }
  .t-bar-form input { padding: 5px 10px; font-size: 13px; }
  .t-bar-form button { padding: 4px 12px; }
  .t-bar-btn-main { font-size: 13px; }
  .t-bar-btn-sub { font-size: 9px; }
  .app-iframe { height: 100vh; min-height: 600px; }
  .posts-section { padding: 40px 16px 30px; }
  .post { padding: 40px 16px 30px; }
  .post-title { font-size: 24px; }
}
