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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #ffffff;
  color: #1a1a2e;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ===== Hero Section ===== */
.hero {
  position: relative;
  width: 100%;
  background: #f8f9fa;
  overflow: hidden;
}

.hero-cover {
  width: 100%;
  height: 400px;
  overflow: hidden;
  position: relative;
}

.hero-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.4));
}

.hero-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  position: relative;
  max-width: 800px;
  margin: -80px auto 0;
  padding: 0 24px 48px;
  text-align: center;
  z-index: 10;
}

.hero-profile {
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid #ffffff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  background: #fff;
}

.hero-profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-name {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-title {
  font-size: 1.2rem;
  color: #555;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-tagline {
  font-size: 1.05rem;
  color: #666;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto 16px;
  line-height: 1.6;
}

.hero-personal {
  font-size: 0.95rem;
  color: #888;
  margin-bottom: 24px;
}

.hero-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
}

.hero-link.linkedin {
  background: #0077b5;
  color: white;
}

.hero-link.linkedin:hover {
  background: #005885;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,119,181,0.3);
}

.hero-link.github {
  background: #010409;
  color: white;
}

.hero-link.github:hover {
  background: #0d1117;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(1,4,9,0.4);
}

.hero-link.about {
  background: #f0f0f0;
  color: #1a1a2e;
}

.hero-link.about:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

/* Responsive Hero */
@media (max-width: 768px) {
  .hero-cover {
    height: 300px;
  }

  .hero-content {
    margin-top: -60px;
  }

  .hero-profile {
    width: 120px;
    height: 120px;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 1rem;
  }

  .hero-tagline {
    font-size: 0.95rem;
  }
}

/* ===== Container ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Archive Section ===== */
.archive {
  padding: 48px 0;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: #1a1a2e;
}

/* ===== Post Grid ===== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
  .post-grid { grid-template-columns: 1fr; }
}

/* ===== Search Bar ===== */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto 32px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  font-size: 0.95rem;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.search-input:focus {
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.search-input::placeholder {
  color: #999;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
}

.no-results {
  display: none;
  text-align: center;
  padding: 48px 24px;
  color: #666;
  font-size: 1rem;
}

/* ===== Post Card - Vertical Tile Style ===== */
.post-card {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  border-color: #d0d0d0;
}

.card-link-vertical {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* Card Header - Date and Heart Counter */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.card-date {
  font-size: 0.8rem;
  color: #666;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.card-likes {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #999;
  font-size: 0.8rem;
}

.card-likes svg {
  width: 16px;
  height: 16px;
}

/* Card Image */
.card-image-vertical {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #f5f5f5;
}

.card-image-vertical img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .card-image-vertical img {
  transform: scale(1.05);
}

/* Card Content */
.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card-title-vertical {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: #1a1a2e;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}

.card-link-vertical:hover .card-title-vertical {
  color: #0066cc;
}

.card-tags-vertical {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.tag {
  font-size: 0.7rem;
  background: #f0f0f0;
  color: #555;
  padding: 4px 10px;
  border-radius: 14px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.tag:hover {
  background: #e0e0e0;
  color: #333;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .card-image-vertical {
    height: 160px;
  }

  .card-title-vertical {
    font-size: 0.95rem;
  }
}

/* ===== Post Page ===== */
.post-header-bar {
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

.back-link {
  font-size: 0.9rem;
  color: #666;
  transition: color 0.2s;
}

.back-link:hover { color: #1a1a2e; }

.post-container {
  padding-top: 48px;
  padding-bottom: 80px;
  max-width: 740px;
}

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

.post-meta time {
  font-size: 0.85rem;
  color: #888;
}

.post-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  color: #1a1a2e;
}

.post-subtitle {
  font-size: 1.15rem;
  color: #666;
  margin-bottom: 32px;
  line-height: 1.6;
}

.featured-image {
  margin: 32px 0;
  border-radius: 8px;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.post-hero {
  margin-bottom: 36px;
  border-radius: 12px;
  overflow: hidden;
}

.post-hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.post-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #2d2d2d;
}

.post-body h2 { font-size: 1.5rem; font-weight: 700; margin: 2em 0 0.75em; color: #1a1a2e; }
.post-body h3 { font-size: 1.2rem; font-weight: 600; margin: 1.75em 0 0.6em; }
.post-body p  { margin-bottom: 1.4em; }
.post-body ul, .post-body ol { margin: 1em 0 1.4em 1.5em; }
.post-body li { margin-bottom: 0.4em; }
.post-body code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Fira Code', monospace;
}
.post-body pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.9em;
}
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body blockquote {
  border-left: 3px solid #0066cc;
  padding-left: 20px;
  color: #555;
  font-style: italic;
  margin: 1.5em 0;
}
.post-body a { color: #0066cc; text-decoration: underline; }
.post-body img { max-width: 100%; border-radius: 8px; margin: 1.5em 0; }

.bottom-back {
  display: inline-block;
  margin-top: 48px;
  color: #666;
  font-size: 0.9rem;
}
.bottom-back:hover { color: #1a1a2e; }

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 32px;
  border-top: 1px solid #f0f0f0;
  color: #999;
  font-size: 0.85rem;
}
