/* Modern Typography & Design System */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;700&display=swap");

:root {
  --primary-color: #0d1117;
  --secondary-color: #6e7681;
  --accent-color: #2f81f7;
  --bg-color: #ffffff;
  --card-bg: #f6f8fa;
  --text-main: #1f2328;
  --text-muted: #636c76;
  --border-color: #d0d7de;
  --max-width: 1400px;
  --reading-width: 860px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Navbar variables from index */
  --primary-blue: #3a6ea5;
  --accent-cyan: #5ec3e6;
  --navbar-height: 70px;
  --border-radius-pill: 50px;
  --border-divider: #d9e2ec;
  --shadow-color: rgba(16, 42, 67, 0.08);
  --btn-primary: #3a6ea5;
  --btn-primary-hover: #2c5e8a;
  --text-heading: #102a43;
  --bg-card: #ffffff;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-color);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: "Outfit", sans-serif;
  color: var(--primary-color);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

/* Layout Containers */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header {
  text-align: center;
  padding: 4rem 0 2rem;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

header p {
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

/* Blog Card Styles */
.blog-card {
  background: var(--bg-color);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-color);
}

.blog-card .card-image {
  width: 100%;
  height: 140px; /* Reduced from 220px (~40% decrease) */
  object-fit: cover;
  transition: var(--transition);
}

.blog-card:hover .card-image {
  filter: brightness(0.9);
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.card-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-footer {
  margin-top: auto;
  font-weight: 500;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Post Page Styles (Medium-like) */
.post-container {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-weight: 500;
}

.back-link:hover {
  color: var(--accent-color);
}

.post-header {
  margin-bottom: 3rem;
}

.post-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.post-author-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.author-info h4 {
  font-size: 1.1rem;
}

.author-info span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.featured-image-full {
  width: 60%; /* Reduced from 100% (40% decrease) */
  max-width: 100%;
  margin: 0 auto 3rem;
  border-radius: 12px;
  display: block;
}

.post-body {
  font-size: 1.25rem;
  line-height: 1.8;
}

.post-body p {
  margin-bottom: 2rem;
}

.post-body h2 {
  font-size: 2rem;
  margin: 3rem 0 1.5rem;
}

.post-body h3 {
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
}

.post-body blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 2rem;
  margin: 3rem 0;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.post-body ul {
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}

.post-body li {
  margin-bottom: 0.75rem;
}

/* Error State */
.error-container {
  text-align: center;
  padding: 5rem 1.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  header h1 {
    font-size: 2.2rem;
  }
  .post-title {
    font-size: 2.5rem;
  }
  .post-body {
    font-size: 1.15rem;
  }
}

@media (max-width: 480px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .container {
    padding: 1rem;
  }
}

/* --- Navbar (Dynamic Island Style) --- */
.navbar-container {
  position: fixed;
  top: 20px;
  left: 0;
  width: 100%;
  z-index: 1002;
  display: flex;
  justify-content: center;
  padding: 0 10px;
  pointer-events: none;
}

.navbar {
  background: var(--bg-card);
  width: 100%;
  max-width: 900px;
  height: var(--navbar-height);
  border-radius: var(--border-radius-pill);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  box-shadow: 0 10px 40px -10px var(--shadow-color), 0 0 0 1px var(--border-divider);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  pointer-events: auto;
}

.nav-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  color: var(--text-main);
  font-size: 0.95rem;
  position: relative;
}

.nav-link:hover {
  color: var(--primary-blue);
}

.nav-cta {
  background-color: var(--btn-primary);
  color: white !important;
  padding: 10px 24px;
  border-radius: var(--border-radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
}

.burger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  z-index: 1002;
}

.burger-line {
  height: 2px;
  width: 100%;
  background-color: var(--text-heading);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1001;
}

.mobile-nav-overlay.active {
  transform: translateY(0);
}

.mobile-link {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-heading);
}

.spacer {
  height: 100px;
}

/* Burger Animation */
.burger-menu.active .burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background-color: var(--primary-blue);
}
.burger-menu.active .burger-line:nth-child(2) {
  opacity: 0;
}
.burger-menu.active .burger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background-color: var(--primary-blue);
}

@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .burger-menu { display: flex; }
  .navbar { padding: 0 20px; }
  .post-title { font-size: 2.2rem; }
}
