:root {
  --primary: hsl(24, 95%, 53%);
  --primary-dark: hsl(24, 95%, 43%);
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-gray: #f9fafb;
  --border: #e5e7eb;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-style: normal;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
header {
  overflow: visible;
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.625rem 0;
}

@supports (backdrop-filter: blur(8px)) {
  header {
    background: rgba(255, 255, 255, 0.6);
  }
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.logo-image {
  height: 22px;
  width: 22px;
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  position: relative;
}

nav > ul > li {
  position: relative;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--primary);
}

/* Dropdown menu */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown-toggle::after {
  content: '▾';
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.dropdown:hover .dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 50;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.dropdown-menu a:hover {
  background: var(--bg-gray);
  color: var(--primary);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 4rem 0;
  text-align: center;
  overflow: hidden;
  background: white;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 70%, rgba(255, 255, 255, 1) 100%),
    linear-gradient(to right, rgba(229, 231, 235, 0.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(229, 231, 235, 0.3) 1px, transparent 1px);
  background-size: 100% 100%, 60px 60px, 60px 60px;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 800;
  color: var(--text);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

/* Blog Cards Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 3rem 0;
}

.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-gray);
}

.post-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.post-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  flex: 1;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 1rem;
}

.post-category {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  margin-right: 0.5rem;
}

/* Search & Filter */
.search-bar {
  margin: 2rem 0;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-bar input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Section Headers */
.section-header {
  padding: 2rem 0 1rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
}

.section-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-light);
  font-size: 1.1rem;
}

/* Single Post */
.post-single {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.875rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.back-button:hover {
  color: var(--primary);
}

.post-header {
  padding-top: 0.5rem;
  position: relative;
  z-index: 1;
}

.post-single h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .post-single h1 {
    font-size: 1.5rem;
  }

  .post-content h2 {
    font-size: 1.25rem;
  }

  .post-content h3 {
    font-size: 1.1rem;
  }
}

.post-single .post-meta {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.post-content {
  font-size: 1rem;
  line-height: 1.7;
}

.post-content h2 {
  margin: 2rem 0 1rem;
  font-size: 1.5rem;
}

.post-content h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.25rem;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content ul, .post-content ol {
  margin: 1rem 0 1rem 2rem;
}

.post-content code {
  background: var(--bg-gray);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: var(--bg-gray);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

.post-content a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--primary);
  transition: opacity 0.2s;
}

.post-content a:hover {
  opacity: 0.8;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0;
}

.pagination a, .pagination span {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
}

.pagination a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination .active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Post Navigation */
.post-navigation {
  display: flex;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  background: var(--bg);
  flex: 0 1 auto;
  max-width: 50%;
}

.post-nav-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-nav-prev {
  text-align: left;
}

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

.post-nav-label {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
}

.post-nav-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-nav-description {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .post-navigation {
    flex-direction: column;
  }

  .post-nav-item {
    max-width: 100%;
  }

  .post-nav-next {
    text-align: left;
  }
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

/* Footer */
footer {
  background: var(--bg-gray);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  nav ul {
    flex-wrap: wrap;
    gap: 1rem;
  }
}
