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

:root {
  --bg: #0f0f0f;
  --bg2: #161616;
  --bg3: #1e1e1e;
  --border: #252525;
  --text: #e8e8e8;
  --text-muted: #888;
  --text-dim: #555;
  --accent: #c9963a;
  --accent-hover: #e0aa44;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 6px;
  --max-w: 1100px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* =====================
   HEADER
   ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,15,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.5px;
  transition: color 0.2s;
}
.logo:hover { color: var(--accent); }

.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.2s;
  letter-spacing: 0.3px;
}
.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

/* =====================
   HERO
   ===================== */
.hero {
  border-bottom: 0.5px solid var(--border);
  padding: 48px 0 40px;
}

.hero-inner {
  text-align: center;
}

.hero-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--accent);
}

.hero-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}

.hero-desc {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 300;
}

/* =====================
   HOME LAYOUT
   ===================== */
.home-container {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 56px;
  padding-top: 40px;
  padding-bottom: 60px;
  align-items: start;
}

/* =====================
   POST CARDS
   ===================== */
.posts-list { display: flex; flex-direction: column; }

.post-card {
  padding: 32px 0;
  border-bottom: 0.5px solid var(--border);
}

.post-card-img {
  display: block;
  width: 100%;
  height: 220px;
  background: var(--bg2);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
  transition: opacity 0.2s;
}
.post-card-img:hover { opacity: 0.85; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; }

.post-card-img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
  font-size: 36px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.read-time, .post-date {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
}

.dot { color: var(--border); font-size: 8px; }

.post-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 12px;
}

.post-card-title a {
  color: var(--text);
  transition: color 0.2s;
}
.post-card-title a:hover { color: var(--accent); }

.post-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 16px;
  font-weight: 300;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =====================
   AUTHOR
   ===================== */
.post-author { display: flex; align-items: center; gap: 10px; }

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}
.author-avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.author-name { font-size: 13px; color: var(--text-muted); font-weight: 400; }

/* =====================
   TAGS
   ===================== */
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg2);
  border: 0.5px solid var(--border);
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 400;
  transition: all 0.2s;
  cursor: pointer;
}
.tag:hover { color: var(--accent); border-color: var(--accent); }

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 80px;
}

.sidebar-section {
  border-bottom: 0.5px solid var(--border);
  padding-bottom: 28px;
}

.sidebar-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
  margin-bottom: 18px;
}

.recent-post {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
  transition: opacity 0.2s;
}
.recent-post:hover { opacity: 0.75; }
.recent-post:last-child { margin-bottom: 0; }

.rp-img {
  width: 60px;
  height: 60px;
  background: var(--bg3);
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
}
.rp-img img { width: 100%; height: 100%; object-fit: cover; }

.rp-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 5px;
  font-weight: 400;
}

.rp-date { font-size: 11px; color: var(--text-dim); }

.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* =====================
   NEWSLETTER
   ===================== */
.newsletter-box {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 22px;
}

.newsletter-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.newsletter-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
  font-weight: 300;
}

.newsletter-input {
  width: 100%;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 4px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  margin-bottom: 8px;
  outline: none;
  transition: border-color 0.2s;
}
.newsletter-input:focus { border-color: var(--accent); }

.newsletter-btn {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  padding: 10px;
  color: #111;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.newsletter-btn:hover { background: var(--accent-hover); }

/* =====================
   POST PAGE
   ===================== */
.post-container {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 56px;
  padding-top: 48px;
  padding-bottom: 60px;
  align-items: start;
}

.post-header { margin-bottom: 32px; }

.post-meta-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.post-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 14px;
}

.post-description {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
  font-weight: 300;
}

.post-author-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 28px;
}

.post-cover {
  width: 100%;
  height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 36px;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

.post-content {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.85;
  color: #d0d0d0;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  font-family: var(--font-display);
  color: var(--text);
  margin: 36px 0 16px;
  font-weight: 500;
}

.post-content h1 { font-size: 28px; }
.post-content h2 { font-size: 22px; }
.post-content h3 { font-size: 18px; }

.post-content p { margin-bottom: 22px; }

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

.post-content img {
  width: 100%;
  border-radius: var(--radius);
  margin: 24px 0;
}

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 20px;
  margin: 28px 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-content code {
  background: var(--bg2);
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 14px;
  color: var(--accent);
}

.post-content pre {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}

.post-content ul, .post-content ol {
  padding-left: 24px;
  margin-bottom: 22px;
}

.post-content li { margin-bottom: 6px; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 0.5px solid var(--border);
}

.prev-post, .next-post {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 48%;
  transition: opacity 0.2s;
}
.prev-post:hover, .next-post:hover { opacity: 0.7; }
.next-post { text-align: right; margin-left: auto; }

.nav-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.nav-title { font-size: 14px; color: var(--text); font-family: var(--font-display); line-height: 1.4; }

/* =====================
   FOOTER
   ===================== */
.site-footer {
  border-top: 0.5px solid var(--border);
  padding: 28px 0;
  text-align: center;
}

.site-footer p {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 300;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .home-container,
  .post-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .sidebar { position: static; }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 0.5px solid var(--border);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .post-title { font-size: 26px; }
  .post-cover { height: 240px; }
  .hero-name { font-size: 22px; }
}
.post-content img {
  width: 100% !important;
  height: 180px !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  margin: 0 !important;
  display: block !important;
}

.post-content .img-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  margin: 24px 0 !important;
}

.post-content .img-grid img {
  width: 100% !important;
  height: 180px !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  margin: 0 !important;
  display: block !important;
}
