/* ============================================================
   TUAN'S BLOG — Ghost Theme CSS
   tuanng.com | April 2026
   ============================================================ */

/* Google Fonts loaded in default.hbs */

/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  --bg:             #F7F6F2;
  --bg-dark:        #1A2744;
  --text:           #1C1C1C;
  --accent:         #4A7C59;
  --accent-hover:   #3a6347;
  --midnight:       #1A2744;
  --muted:          #6B6B6B;
  --border-light:   #D8D6CF;

  --font-mono:  'Space Mono', 'Courier New', monospace;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;
  --font-code:  'JetBrains Mono', 'Courier New', monospace;

  --max-width:        1200px;
  --max-width-narrow: 740px;
  --nav-height:       60px;
  --radius:           0px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
::selection { background: var(--accent); color: #F7F6F2; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.section-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   DUOTONE IMAGE TREATMENT
   ============================================================ */
.duotone {
  position: relative;
  display: block;
  overflow: hidden;
}

.duotone::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #4A7C59;
  mix-blend-mode: multiply;
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 120ms linear;
}

.duotone:hover::after { opacity: 0.55; }

.duotone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(15%);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--midnight);
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-header__logo-img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.site-header__logo-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #F7F6F2;
}

.site-nav__list {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
}

.site-nav__link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #F7F6F2;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 120ms linear;
}

.site-nav__link:hover,
.site-nav__link--active {
  color: #F7F6F2;
  border-bottom-color: var(--accent);
  text-decoration: none;
}

@media (max-width: 768px) {
  .site-header__inner { padding: 0 20px; }
  .site-header__logo-text { display: none; }
  .site-nav__list { gap: 16px; }
  .site-nav__link { font-size: 10px; }
}

/* ============================================================
   HERO BANNER
   ============================================================ */
.hero {
  background: var(--midnight);
  border-bottom: 2px dashed var(--accent);
  padding: 52px 0;
}

.hero__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 48px;
  align-items: center;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero__headline {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.15;
  color: #F7F6F2;
  margin-bottom: 18px;
}

.hero__bio {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: rgba(247, 246, 242, 0.72);
  max-width: 500px;
  margin-bottom: 24px;
}

.hero__tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__tag {
  font-family: var(--font-code);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms linear;
}

.hero__tag:hover {
  color: #F7F6F2;
  text-decoration: none;
}

.hero__image {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .hero__inner {
    grid-template-columns: 1fr;
    padding: 0 20px;
    gap: 24px;
  }
  .hero__image { width: 100%; height: 200px; }
}

/* ============================================================
   MAIN & FEED
   ============================================================ */
.site-main {
  min-height: 60vh;
}

.feed-header {
  padding: 40px 0 0;
  border-bottom: 2px dashed var(--accent);
  padding-bottom: 20px;
  margin-bottom: 0;
}

/* ============================================================
   POST ROW
   ============================================================ */
.post-row {
  display: grid;
  grid-template-columns: 148px 1fr 120px;
  gap: 24px;
  padding: 28px 0;
  border-top: 2px dashed var(--accent);
  align-items: start;
}

.post-row__image-link {
  display: block;
  text-decoration: none;
}

.post-row__image {
  width: 148px;
  height: 148px;
}

.post-row__image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--midnight);
}

.post-row__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-row__tags--top {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.post-row__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: 22px;
  line-height: 1.25;
  color: var(--midnight);
}

.post-row__title a {
  color: inherit;
  text-decoration: none;
  transition: color 120ms linear;
}

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

.post-row__excerpt {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
}

.post-row__meta {
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-row__read-more {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
  display: inline-block;
  transition: color 120ms linear;
}

.post-row__read-more:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.post-row__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.post-row__date-top {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.post-row__date-year {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: right;
}

.post-row__tags--aside {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .post-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .post-row__image { width: 100%; height: 220px; }
  .post-row__aside { align-items: flex-start; }
  .post-row__date-top, .post-row__date-year { text-align: left; }
  .post-row__tags--aside { justify-content: flex-start; }
}

/* ============================================================
   TAG BADGES
   ============================================================ */
.tag {
  display: inline-block;
  font-family: var(--font-code);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--text);
  color: var(--bg);
  padding: 2px 7px;
  border-radius: 0;
  text-decoration: none;
  transition: background 120ms linear, color 120ms linear;
}

.tag:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-view .container--narrow {
  padding-top: 52px;
  padding-bottom: 0;
}

.post-view .post--body {
  padding-bottom: 0;
}

.post__back {
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 36px;
  transition: color 120ms linear;
}

.post__back:hover { color: var(--accent-hover); text-decoration: none; }

.post__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.post__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.15;
  color: var(--midnight);
  margin-bottom: 18px;
  text-wrap: pretty;
}

/* Meta row */
.post__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 0;
  padding-bottom: 36px;
}

.post__meta-date,
.post__meta-read,
.post__meta-name {
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.post__meta-sep {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.post__meta-author {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

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

.post__meta-avatar {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.post__meta-avatar img {
  width: 26px;
  height: 26px;
  object-fit: cover;
}

/* Hero image — full viewport width */
.post__hero {
  width: 100%;
  margin: 0 0 0;
}

.post__hero-inner {
  width: 100%;
  max-height: 480px;
  overflow: hidden;
}

.post__hero-inner img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  display: block;
}

.post__hero-caption {
  font-family: var(--font-code);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
  padding: 0 40px;
}

.post__divider {
  border-top: 2px dashed var(--accent);
  margin: 32px 0;
}

/* Ghost content styles — updated body sizing */
.gh-content {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
}

.gh-content p { margin-bottom: 1.6em; text-wrap: pretty; }

.gh-content h2 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: 26px;
  color: var(--midnight);
  margin: 2em 0 0.75em;
  line-height: 1.2;
}

.gh-content h3 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
  color: var(--midnight);
  margin: 1.5em 0 0.5em;
}

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

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

.gh-content pre,
.gh-content code {
  font-family: var(--font-code);
  font-size: 13px;
  background: var(--midnight);
  color: #F7F6F2;
}

.gh-content code {
  padding: 2px 6px;
}

.gh-content pre {
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.gh-content pre code {
  background: none;
  padding: 0;
}

.gh-content hr {
  border: none;
  border-top: 2px dashed var(--accent);
  margin: 2.5em 0;
}

.gh-content ul, .gh-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.gh-content li { margin-bottom: 0.4em; }

.gh-content img {
  width: 100%;
  height: auto;
  margin: 1.5em 0;
}

.gh-content figure { margin: 1.5em 0; }
.gh-content figcaption {
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.post__footer {
  border-top: 2px dashed var(--accent);
  margin-top: 48px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.post__footer-back {
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.post__footer-tags { display: flex; gap: 4px; flex-wrap: wrap; }

/* ============================================================
   POST NAVIGATION
   ============================================================ */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  border-top: 1px solid var(--border-light);
  margin-top: 0;
  padding-bottom: 80px;
}

.post-nav__item {
  padding: 24px 20px;
  background: var(--bg);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 120ms linear;
}

.post-nav__item:hover { background: #eeecea; text-decoration: none; }

.post-nav__item--next { text-align: right; }

.post-nav__empty { background: var(--bg); }

.post-nav__label {
  font-family: var(--font-code);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-nav__title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--midnight);
  line-height: 1.3;
}

@media (max-width: 768px) {
  .post-nav { grid-template-columns: 1fr; padding-bottom: 60px; }
  .post-nav__item--next { text-align: left; }
}

/* ============================================================
   TAG ARCHIVE
   ============================================================ */
.tag-header {
  padding: 48px 0 32px;
  border-bottom: 2px dashed var(--accent);
}

.tag-header__name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: 36px;
  color: var(--midnight);
  margin: 8px 0 6px;
}

.tag-header__desc {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 500px;
  margin-bottom: 8px;
}

.tag-header__count {
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   PAGE VIEW
   ============================================================ */
.page-view .container--narrow {
  padding-top: 64px;
  padding-bottom: 80px;
}

.page__eyebrow {
  margin-bottom: 16px;
}

.page__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  color: var(--midnight);
  margin-bottom: 28px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0 64px;
  border-top: 2px dashed var(--accent);
  margin-top: 0;
}

.pagination__older,
.pagination__newer {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms linear;
}

.pagination__older:hover,
.pagination__newer:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.pagination__info {
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ============================================================
   ERROR PAGE
   ============================================================ */
.error-view .container--narrow {
  padding: 80px 40px;
}

.error-content { max-width: 500px; }

.error-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: 36px;
  color: var(--midnight);
  margin: 12px 0 16px;
  line-height: 1.15;
}

.error-message {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 9px 20px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms linear, color 120ms linear;
  border-radius: 0;
}

.btn--primary {
  background: var(--text);
  color: var(--bg);
}

.btn--primary:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--midnight);
  padding: 48px 40px 28px;
  margin-top: 64px;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 32px;
  border-bottom: 2px dashed var(--accent);
  flex-wrap: wrap;
  gap: 24px;
}

.site-footer__logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #F7F6F2;
  margin-bottom: 6px;
}

.site-footer__tagline,
.site-footer__location {
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.site-footer__nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.site-footer__nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 246, 242, 0.65);
  text-decoration: none;
  transition: color 120ms linear;
}

.site-footer__nav-link:hover {
  color: #F7F6F2;
  text-decoration: none;
}

.site-footer__bottom {
  max-width: var(--max-width);
  margin: 20px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer__copy {
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.site-footer__tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer__tag {
  font-family: var(--font-code);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms linear;
}

.site-footer__tag:hover {
  color: #F7F6F2;
  text-decoration: none;
}

@media (max-width: 768px) {
  .site-footer { padding: 40px 20px 24px; }
  .site-footer__inner { flex-direction: column; }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   GHOST CARD ASSETS
   ============================================================ */
.kg-width-wide  { margin: 1.5em -80px; }
.kg-width-full  { margin: 1.5em calc(50% - 50vw); width: 100vw; }

@media (max-width: 900px) {
  .kg-width-wide { margin: 1.5em 0; }
}

.kg-image-card img { width: 100%; }

.kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 1.5em 0;
}

.kg-gallery-row {
  display: flex;
  gap: 2px;
}

.kg-gallery-image { flex: 1; }
.kg-gallery-image img { width: 100%; height: 200px; object-fit: cover; display: block; }

.kg-bookmark-card {
  border: 1px solid var(--border-light, #D8D6CF);
  padding: 16px;
  margin: 1.5em 0;
  display: flex;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 120ms linear;
}

.kg-bookmark-card:hover { border-color: var(--accent); text-decoration: none; }

.kg-bookmark-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.kg-bookmark-description {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.kg-bookmark-url {
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.kg-callout-card {
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  margin: 1.5em 0;
  background: rgba(74, 124, 89, 0.06);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.kg-toggle-card {
  border: 1px solid var(--border-light, #D8D6CF);
  margin: 1.5em 0;
}

.kg-toggle-heading {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kg-toggle-content { padding: 0 16px 14px; }
