/* DevHouse Ghost theme — matching devhouse.team */

:root {
  --ink: #0e1116;
  --ink-2: #151a21;
  --ink-3: #1c232c;
  --fjord: #6ea8c9;
  --gold: #d4a94e;
  --teal: #2fa3a0;
  --vermilion: #c8102e;
  --paper: #ece7dd;
  --paper-dim: #a8a396;
  --line: rgba(236, 231, 221, 0.07);
  --serif: "EB Garamond", "Pridi", "Noto Serif SC", "Iowan Old Style", Georgia, serif;
  --sans: "Sarabun", "Inter", "Avenir Next", "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--ink); }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 28px; }
.site-header .wrap, .site-footer .wrap { max-width: 1080px; }

.topline {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg,
    var(--fjord) 0%, var(--fjord) 30%,
    var(--gold) 38%, var(--gold) 62%,
    var(--teal) 70%, var(--teal) 86%,
    var(--vermilion) 94%, var(--vermilion) 100%);
  z-index: 200;
}

/* ---------- header ---------- */
.site-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
  nav.links { margin-left: auto; }

.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--paper); }
.logo-text { line-height: 1.15; }
.logo-seal {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--vermilion);
  border-radius: 8px;
  font-family: var(--serif);
  font-size: 26px;
  color: #f5efe4;
  box-shadow: 0 4px 18px rgba(200, 16, 46, 0.35);
}
.logo-text b { font-size: 17px; letter-spacing: 0.14em; display: block; font-weight: 600; }
.logo-text span { font-size: 11px; color: var(--paper-dim); letter-spacing: 0.22em; }

nav.links { display: flex; gap: 30px; align-items: center; }
nav.links a {
  color: var(--paper-dim);
  text-decoration: none;
  font-size: 13.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}
nav.links a:hover, nav.links a.current { color: var(--paper); }



/* ---------- hero ---------- */
.blog-hero { padding: 100px 0 60px; text-align: center; }
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.blog-hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.25;
}

/* ---------- post grid ---------- */
.post-grid-section { padding: 20px 0 110px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 950px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease;
}
.post-card:hover { transform: translateY(-5px); border-color: rgba(212, 169, 78, 0.35); }

.card-link { text-decoration: none; color: inherit; display: block; }

.card-image {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: var(--ink-3);
}
.card-placeholder {
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 44px;
  color: rgba(236, 231, 221, 0.08);
}

.card-body { padding: 22px 22px 26px; }
.card-body time {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-dim);
}
.card-body h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.3;
  margin: 10px 0 8px;
}
.card-body p { font-size: 14.5px; color: var(--paper-dim); line-height: 1.6; }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 24px; margin-top: 50px; font-size: 14px; }
.pagination a, .pagination span {
  color: var(--paper-dim);
  text-decoration: none;
  font-family: var(--mono);
  letter-spacing: 0.1em;
}
.pagination a:hover { color: var(--gold); }

/* ---------- post page ---------- */
.post-full { padding: 80px 0 60px; }
.post-header { text-align: center; padding-bottom: 40px; }
.post-header h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.2;
}
.post-meta {
  margin-top: 18px;
  color: var(--paper-dim);
  font-size: 14px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
}
.meta-sep { margin: 0 8px; color: var(--gold); }

.post-hero-image {
  max-width: 1000px;
  margin: 0 auto 50px;
  aspect-ratio: 16 / 8;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
}

.post-content { font-size: 18px; }
.post-content > p { margin-bottom: 28px; }
.post-content h2, .post-content h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 44px 0 16px;
  line-height: 1.3;
}
.post-content h2 { font-size: 30px; }
.post-content h3 { font-size: 23px; }
.post-content a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(212, 169, 78, 0.4); }
.post-content a:hover { color: var(--paper); border-color: var(--paper); }
.post-content img { max-width: 100%; border-radius: 10px; margin: 10px 0; }
.post-content blockquote {
  border-left: 2px solid var(--gold);
  padding: 4px 0 4px 24px;
  margin: 32px 0;
  font-family: var(--serif);
  font-size: 21px;
  font-style: italic;
  color: var(--paper-dim);
}
.post-content hr { border: none; border-top: 1px solid var(--line); margin: 44px 0; }
.post-content code { font-family: var(--mono); font-size: 0.88em; background: var(--ink-3); padding: 2px 7px; border-radius: 4px; }
.post-content pre {
  font-family: var(--mono);
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  overflow-x: auto;
  font-size: 14.5px;
  margin: 32px 0;
}

/* Ghost editor wide/full image classes */
.kg-width-wide { max-width: 1100px; margin-left: 50% !important; transform: translateX(-50%); }
.kg-width-full { max-width: 100vw; width: 100vw; margin-left: calc(50% - 50vw) !important; border-radius: 0; }
.kg-width-wide img, .kg-width-full img { width: 100%; border-radius: 10px; }
.kg-width-full img { border-radius: 0; }

/* bookmark & gallery cards */
.kg-bookmark-card { margin: 34px 0; }
.kg-bookmark-container {
  display: flex; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit;
  transition: border-color 0.3s ease;
}
.kg-bookmark-container:hover { border-color: rgba(212, 169, 78, 0.35); }
.kg-bookmark-content { padding: 18px 20px; flex: 1; min-width: 0; }
.kg-bookmark-title { font-family: var(--serif); font-size: 18px; margin-bottom: 4px; }
.kg-bookmark-description { font-size: 14px; color: var(--paper-dim); line-height: 1.5; }
.kg-bookmark-metadata { font-size: 12px; color: var(--paper-dim); margin-top: 10px; }
.kg-bookmark-thumbnail { flex: 0 0 180px; background-size: cover; background-position: center; }
.kg-bookmark-author img, .kg-bookmark-publisher img { border-radius: 3px; margin-right: 4px; vertical-align: -2px; }
@media (max-width: 600px) { .kg-bookmark-thumbnail { display: none; } }

/* embedded videos (YouTube etc.) fill nicely */
.post-content .kg-card-embed,
.post-content iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: none;
  margin: 34px 0;
}
.post-content .kg-gallery-container { margin: 34px 0; }
.post-content .kg-gallery-row { display: flex; gap: 10px; margin-bottom: 10px; }
.post-content .kg-gallery-row img { flex: 1; object-fit: cover; }

/* ---------- post footer ---------- */
.post-footer { margin-top: 30px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 50px; }
.tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--paper-dim);
  letter-spacing: 0.08em;
}

.subscribe-box {
  text-align: center;
  border: 1px solid var(--line);
  background: var(--ink-2);
  border-radius: 10px;
  padding: 44px 30px;
}
.subscribe-box h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin-bottom: 8px; }
.subscribe-box p { color: var(--paper-dim); margin-bottom: 22px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 15px 34px;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.btn-primary {
  background: linear-gradient(180deg, #dcb558, var(--gold));
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(212, 169, 78, 0.15);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(212, 169, 78, 0.25);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  font-size: 13px;
  color: var(--paper-dim);
}
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.site-footer .glyphs a {
  font-family: var(--serif);
  font-size: 20px;
  text-decoration: none;
}
@media (max-width: 600px) {
  .site-footer .wrap { flex-direction: column; }
}

/* page feature image caption */
.post-hero { max-width: 1000px; margin: 0 auto 50px; }
.post-hero figcaption {
  text-align: center; font-size: 13px; color: var(--paper-dim);
  margin-top: 10px; font-family: var(--mono); letter-spacing: 0.05em;
}

/* YouTube / oEmbed video cards inside posts */
.post-content .kg-embed-card,
.post-content .kg-card-embed {
  margin: 38px 0;
}
.post-content .kg-embed-card iframe,
.post-content .kg-card-embed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: none;
  border-radius: 10px;
}

/* ---------- theme switcher (matches devhouse.team) ---------- */
nav.links button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  color: var(--paper-dim);
  transition: color 0.3s ease, transform 0.4s ease;
}
nav.links button:hover { color: var(--teal); transform: rotate(180deg); }

/* light theme — same palette as devhouse.team light mode */
html[data-theme="light"] {
  --ink: #efeadd;
  --ink-2: #f7f3e9;
  --ink-3: #e9e2d2;
  --fjord: #2f6488;
  --gold: #9a7623;
  --teal: #1d7371;
  --paper: #2a2620;
  --paper-dim: #6f6a5e;
  --line: rgba(42, 38, 34, 0.08);
}
html[data-theme="light"] .card-placeholder { color: rgba(42, 38, 34, 0.08); }
html[data-theme="light"] .btn-primary {
  background: #cfa84e;
  box-shadow: 0 1px 4px rgba(154, 118, 35, 0.15);
}
html[data-theme="light"] ::selection { background: var(--gold); color: #f7f3e9; }
