
/* Casper-flavored theme with tags, author block, cover hero + instant search */
:root {
  --bg: #ffffff;
  --fg: #15171a;
  --muted: #738a94;
  --accent: #2b7fff;
  --card: #ffffffcc;
  --ring: rgba(43,127,255,.28);

  --outer-w: 1040px;
  --inner-pad: 24px;
  --radius: 16px;
  --shadow: 0 12px 36px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.site {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--fg);
  background: var(--bg);
  line-height: 1.65;
  position: relative;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}

/* base background (posts + general pages): balanced visibility */
.bg-overlay {
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to bottom, rgba(255,255,255,0.68), rgba(255,255,255,0.84)),
    url('bg.jpg');
  background-size: cover; background-position: center;
  background-attachment: fixed;
  opacity: .45;
  z-index: 0;
}

/* homepage boost: make the image more visible under the hero */
body.home .bg-overlay {
  opacity: .68;
  background-image:
    linear-gradient(to bottom, rgba(255,255,255,0.56), rgba(255,255,255,0.74)),
    url('bg.jpg');
}

/* wrappers */
.outer { position: relative; z-index: 1; }
.inner.container { max-width: var(--outer-w); margin: 0 auto; padding: 0 var(--inner-pad); }

/* header + hero */
.site-header { padding: 28px 0 10px; }
.site-header--home { padding-bottom: 0; }
.header-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: .2px; text-decoration: none; color: var(--fg); border-bottom: 2px solid transparent; }
.brand:hover { border-bottom-color: var(--fg); }
.nav .nav-link { color: var(--muted); text-decoration: none; margin-left: 1rem; }
.nav .nav-link:hover { color: var(--fg); }

.hero { padding: 36px 0 10px; text-align: left; }
.hero--home { padding: 56px 0 8px; }
.hero-title { font-size: clamp(2.1rem, 5vw, 3.1rem); line-height: 1.15; margin: 0 0 .25rem; font-weight: 800; }
.hero-subtitle { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* search */
.search-wrap { position: sticky; top: 0.5rem; z-index: 5; margin: 1rem 0 1.25rem; }
#search { width: 100%; padding: 0.85rem 1rem; border-radius: 12px; border: 1px solid rgba(0,0,0,.08); background: rgba(255,255,255,.88); outline: none; font-size: 1rem; box-shadow: 0 8px 26px rgba(0,0,0,.05); }
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.result-count { margin: 0.4rem 0 0; font-size: .92rem; color: var(--muted); }

/* grid + cards */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 18px; padding: 8px 0 40px; }
@media (min-width: 760px) { .post-grid { grid-template-columns: 1fr 1fr; gap: 22px; } }
@media (min-width: 1040px) { .post-grid { gap: 26px; } }

.card-cover {
  width: 100%; height: 160px; border-radius: var(--radius); margin-bottom: 10px;
  background-size: cover; background-position: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

.post-card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 14px 44px rgba(0,0,0,.11); }
.post-card[hidden] { display: none !important; }
.post-card-link { text-decoration: none; color: inherit; display: block; }
.post-title { margin: 0 0 .35rem; font-size: 1.25rem; font-weight: 800; letter-spacing: .2px; }
.post-excerpt { margin: 0 0 .55rem; color: var(--muted); }
.post-meta { font-size: .94rem; color: var(--muted); }

/* tags */
.tag-list { margin: 0 0 .4rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { display: inline-block; padding: .14rem .5rem; border-radius: 999px; background: #eef4ff; color: #2b63d9; font-size: .8rem; }

/* post page */
.post-cover { width: 100%; height: 36vh; min-height: 220px; max-height: 420px; border-radius: 22px; margin: 12px 0 18px; background-size: cover; background-position: center; position: relative; overflow: hidden; box-shadow: 0 16px 44px rgba(0,0,0,.12); }
.post-cover-veil { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.10), rgba(0,0,0,.18)); }
.post { padding: 18px 0 56px; }
.post-header { margin: 0 0 12px; }
.post .post-title { font-size: clamp(1.9rem, 3.5vw, 2.5rem); margin: 0 0 .2rem; font-weight: 800; letter-spacing: .2px; }
.post .post-meta { color: var(--muted); margin-bottom: 1.1rem; }
.post-content h1, .post-content h2, .post-content h3 { margin: 1.35rem 0 .6rem; line-height: 1.25; }
.post-content h2 { font-size: 1.45rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content p { margin: .7rem 0; }
.post-content a { color: var(--accent); text-decoration: none; }
.post-content a:hover { text-decoration: underline; }
.post-content code { background: #f5f7fa; padding: .16rem .38rem; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace; font-size: .95em; }
.post-content ul { padding-left: 1.2rem; }
.post-content li { margin: .28rem 0; }

/* author block */
.author-block { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: center; margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid rgba(0,0,0,.06); }
.author-avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 22px rgba(0,0,0,.12); }
.author-name { font-weight: 800; }
.author-bio { color: var(--muted); }

/* footer */
.site-footer { padding: 22px 0 52px; color: var(--muted); font-size: .95rem; }
