/* Jim Writes — Short stories about stuff. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Source+Code+Pro:wght@400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --text: #2c2c2a;
  --muted: #888780;
  --border: #d3d1c7;
  --accent: #185fa5;
  --accent-hover: #0c447c;
  --bg: #faf9f7;
}

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
}

/* ---- HEADER ---- */

.site-header {
  background: #042c53;
  border-bottom: 1px solid #185fa5;
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand { flex-shrink: 0; }

.header-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #e6f1fb;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: block;
  line-height: 1.1;
}

.header-title:hover { color: #ffffff; }

.header-search {
  flex: 1;
  max-width: 480px;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.85rem;
  background: #0c447c;
  border: 1px solid #185fa5;
  border-radius: 4px;
  color: #e6f1fb;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: #378add; }
.search-input:focus { border-color: #85b7eb; }

.search-cta {
  font-size: 0.62rem;
  color: #ffffff;
  margin-top: 0.3rem;
  font-style: italic;
}

/* ---- HOMEPAGE LIST ---- */

.main {
  max-width: 600px;
  padding: 3rem 2.5rem;
  margin: 0 auto;
  flex: 1;
}

.site-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 2rem;
  font-style: italic;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.post-list li { border-bottom: 1px solid var(--border); }
.post-list li:last-child { border-bottom: none; }

.post-list a {
  display: block;
  padding: 0.65rem 0;
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.15s, padding-left 0.15s;
}

.post-list a:hover {
  color: var(--accent-hover);
  padding-left: 0.4rem;
}

/* ---- PAGINATION ---- */

.pagination {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-family: 'Source Code Pro', monospace;
}

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

.pagination a:hover { color: var(--accent-hover); text-decoration: underline; }
.pagination .page-number { color: var(--muted); }

/* ---- SINGLE POST ---- */

.post-full {
  max-width: 620px;
  padding: 3rem 2.5rem;
  margin: 0 auto;
}

.post-full-title {
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 2rem;
}

.post-full-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
}

.post-full-content p { margin-bottom: 1.4rem; }
.post-full-content p:last-child { margin-bottom: 0; }

.post-full-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

/* ---- BFF CALLOUT ---- */

.bff-callout {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  background: #e6f1fb;
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.bff-callout a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.bff-callout a:hover { color: var(--accent-hover); }

/* ---- BACK LINK ---- */

.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  font-family: 'Source Code Pro', monospace;
}

.back-link:hover { color: var(--accent); }

/* ---- STATIC PAGES ---- */

.page-full {
  max-width: 620px;
  padding: 3rem 2.5rem;
  margin: 0 auto;
}

.page-full-title {
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.page-full-content {
  font-size: 1.05rem;
  line-height: 1.85;
}

.page-full-content p { margin-bottom: 1.4rem; }

.page-full-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- FOOTER ---- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.footer-disclosure {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ---- KOENIG CARD WIDTHS (required by Ghost theme validator) ---- */

.kg-width-wide {
  margin-left: calc(50% - 50vw + 2.5rem);
  margin-right: calc(50% - 50vw + 2.5rem);
}

.kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* ---- RESPONSIVE ---- */

@media (max-width: 600px) {
  .site-header { flex-wrap: wrap; padding: 1rem 1.25rem; gap: 1rem; }
  .header-search { max-width: 100%; width: 100%; }
  .main { padding: 1.5rem 1.25rem; }
  .post-full { padding: 1.5rem 1.25rem; }
  .page-full { padding: 1.5rem 1.25rem; }
  .site-footer { padding: 1.25rem; }
}
