:root {
  --bg: #111;
  --text: #eee;
  --muted: #aaa;
  --card: #1f1f1f;
  --border: #333;
  --accent: #00ffcc;
  --accent-hover: #00e6b3;
  --transition: all .3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font: 16px/1.6 Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

.blog-hero {
  position: relative;
  background: url('/assets/images/blog-hero.jpg') center/cover no-repeat;
  text-align: center;
  padding: 60px 20px;
  color: var(--accent);
}

.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.blog-hero h1,
.blog-hero p {
  position: relative;
  z-index: 1;
}

.blog-hero h1 {
  font-size: 3rem;
  margin-bottom: .5rem;
}

.blog-hero p {
  font-size: 1.125rem;
  color: var(--muted);
}

.container {
  display: flex;
  max-width: 1200px;
  margin: 40px auto;
  gap: 20px;
  padding: 0 20px;
}

.main-col {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition);
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
}

.thumbnail {
  position: relative;
  overflow: hidden;
}

.thumbnail img,
.thumbnail .no-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--border);
  display: block;
}

.thumbnail .date {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: var(--bg);
  padding: 4px 8px;
  font-size: .85rem;
  font-weight: bold;
  border-radius: 4px;
  z-index: 2;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-body {
  padding: 15px;
}

.card-body h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.card-body p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: .95rem;
}

.read-more {
  font-weight: bold;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 30px 0;
}

.pagination a {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

.pagination .active a {
  background: linear-gradient(135deg,#7f00ff,#e100ff);
  color: #fff;
  border: none;
}

.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.widget h4 {
  margin-bottom: 15px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}

.search-form {
  display: flex;
  gap: 6px;
}

.search-form input {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px 0 0 4px;
  background: var(--bg);
  color: var(--text);
}

.search-form button {
  padding: 0 12px;
  border: none;
  background: var(--accent);
  color: var(--bg);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: var(--transition);
}

.search-form button:hover {
  background: var(--accent-hover);
}

.popular-posts li,
.categories li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.popular-posts img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.categories a {
  flex: 1;
  color: var(--text);
}

.categories span {
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags a {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .85rem;
  background: var(--bg);
  color: var(--text);
}

.up-to-top {
  position: fixed;
  right: 20px;
  bottom: 40px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 100;
}

.up-to-top:hover {
  background: var(--accent-hover);
}

.widget.subscribe-widget {
}

.subscribe-description {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.4;
}

.subscribe-form {
  display: flex;
  width: 100%;
  gap: 6px;
}

.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px 0 0 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  box-sizing: border-box;
}

.subscribe-form button {
  flex: 0 0 auto;
  padding: 0 12px;
  border: none;
  background: var(--accent);
  color: var(--bg);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

.subscribe-form button:hover {
  background: var(--accent-hover);
}

.flash {
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-weight: bold;
}

.flash-success {
  background: rgba(46,204,113,.15);
  border: 1px solid #2ecc71;
  color: #2ecc71;
}

.flash-error {
  background: rgba(231,76,60,.15);
  border: 1px solid #e74c3c;
  color: #e74c3c;
}

@media (max-width: 768px) {
  .blog-hero {
    padding: 45px 15px;
  }
  .blog-hero h1 {
    font-size: 2.5rem;
  }
  .blog-hero p {
    font-size: 1rem;
  }

  .container {
    flex-direction: column;
    margin: 20px auto;
    padding: 0 15px;
    gap: 15px;
  }
  .sidebar {
    width: 100%;
    margin-top: 20px;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .thumbnail img,
  .thumbnail .no-thumb {
    height: 120px;
  }

  .card-body {
    padding: 12px;
  }
  .card-body h3 {
    font-size: 1.1rem;
  }
  .card-body p {
    font-size: .9rem;
  }

  .pagination {
    margin: 20px 0;
    gap: 8px;
  }
  .pagination a {
    padding: 5px 10px;
    font-size: .9rem;
  }

  .widget {
    padding: 15px;
    margin-bottom: 15px;
  }
  .widget h4 {
    font-size: 1rem;
  }

  .search-form input {
    padding: 6px;
    font-size: .9rem;
  }
  .search-form button {
    padding: 0 10px;
    font-size: .9rem;
  }

  .popular-posts img {
    width: 40px;
    height: 40px;
  }
  .popular-posts li,
  .categories li {
    margin-bottom: 10px;
  }

  .tags {
    gap: 6px;
  }
  .tags a {
    padding: 5px 8px;
    font-size: .8rem;
  }

  .up-to-top {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    right: 15px;
    bottom: 30px;
  }

  .subscribe-description {
    font-size: .9rem;
    margin-bottom: 10px;
  }
  .subscribe-form input[type="email"] {
    padding: 6px;
    font-size: .9rem;
  }
  .subscribe-form button {
    padding: 0 10px;
    font-size: .9rem;
  }

  .flash {
    padding: 8px;
    margin-bottom: 12px;
    font-size: .9rem;
  }
}

@media (max-width: 767px) {
  .blog-hero {
    padding: 30px 10px;
  }
  .blog-hero h1 {
    font-size: 2rem;
  }
  .blog-hero p {
    font-size: .9rem;
  }

  .card-body h3 {
    font-size: 1rem;
  }
}
