/* ============================================
   AWT Blog — Public Blog Styles
   Extends the main style.css
   ============================================ */

/* ── BLOG LAYOUT ── */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}
.blog-main { min-width: 0; }
.blog-sidebar { position: sticky; top: 80px; }

@media(max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
}

/* ── SEARCH BAR ── */
.blog-search-bar {
  background: var(--off-white);
  border-bottom: 1px solid var(--light-grey);
  padding: 16px 0;
}
.blog-search-form {
  display: flex;
  gap: 10px;
  max-width: 500px;
}
.blog-search-form input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--light-grey);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .93rem;
  outline: none;
  transition: border-color .2s;
}
.blog-search-form input:focus { border-color: var(--blue); }

/* ── BLOG POSTS GRID ── */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
@media(max-width: 640px) { .blog-posts-grid { grid-template-columns: 1fr; } }

/* ── BLOG CARD ── */
.blog-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .3s, box-shadow .3s;
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.blog-card-img-link { display: block; height: 200px; overflow: hidden; }
.blog-card-img-link img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.blog-card:hover .blog-card-img-link img { transform: scale(1.05); }
.blog-card-img-placeholder {
  height: 200px;
  background: linear-gradient(135deg, var(--red), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}

.blog-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.blog-card-body h2 { font-size: 1rem; margin: 8px 0 8px; }
.blog-card-body h2 a { color: var(--dark); }
.blog-card-body h2 a:hover { color: var(--red); }
.blog-excerpt { font-size: .87rem; color: #666; flex: 1; }

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .78rem;
  color: #999;
  margin-top: 10px;
}

.blog-cat-pill {
  display: inline-block;
  color: white;
  font-size: .72rem;
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 10px;
  border-radius: 3px;
  text-decoration: none;
}
.blog-cat-pill:hover { opacity: .85; color: white; }

.blog-filter-notice {
  margin-bottom: 20px;
  padding: 10px 16px;
  background: var(--off-white);
  border-radius: var(--radius);
  font-size: .88rem;
}
.blog-filter-notice a { margin-left: 12px; color: var(--red); font-weight: 600; }

.blog-empty { text-align: center; padding: 60px 20px; color: #999; }
.blog-empty p { margin-bottom: 20px; font-size: 1.1rem; }

/* ── PAGINATION ── */
.blog-pagination {
  display: flex;
  gap: 8px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.blog-pagination a {
  padding: 8px 14px;
  border: 2px solid var(--light-grey);
  border-radius: 5px;
  font-family: var(--font-head);
  font-size: .82rem;
  font-weight: 600;
  color: var(--blue);
  transition: all .2s;
}
.blog-pagination a:hover { background: var(--blue); color: white; border-color: var(--blue); }
.blog-pagination a.current { background: var(--red); color: white; border-color: var(--red); }

/* ── SIDEBAR WIDGETS ── */
.blog-widget {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}
.widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--light-grey);
  position: relative;
}
.widget-title::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 32px; height: 2px;
  background: var(--red);
}

/* Cat list */
.cat-list { list-style: none; }
.cat-list li { border-bottom: 1px solid var(--light-grey); }
.cat-list li:last-child { border-bottom: none; }
.cat-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  font-size: .87rem;
  color: var(--text);
  transition: color .2s;
}
.cat-list a:hover, .cat-list a.active { color: var(--red); font-weight: 600; }
.cat-list a span:last-child { margin-left: auto; color: #999; font-size: .78rem; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Popular posts */
.popular-post {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}
.popular-post img { width: 56px; height: 44px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.popular-post a { font-size: .85rem; color: var(--text); font-weight: 600; }
.popular-post a:hover { color: var(--red); }

/* About widget */
.about-widget { text-align: center; }
.about-widget img { max-width: 160px; margin: 0 auto 12px; }
.about-widget p { font-size: .87rem; color: #666; margin-bottom: 14px; }

/* ── SINGLE POST ── */
.post-hero-img {
  position: relative;
  max-height: 420px;
  overflow: hidden;
}
.post-hero-img img { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.post-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 60%, rgba(0,0,0,.3));
}

.post-breadcrumb {
  font-size: .82rem;
  color: #999;
  margin-bottom: 14px;
}
.post-breadcrumb a { color: #999; }
.post-breadcrumb a:hover { color: var(--red); }

.post-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 14px 0 16px;
  line-height: 1.2;
  color: var(--dark);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: .83rem;
  color: #999;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--light-grey);
}

/* Post body typography */
.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
}
.post-content h2 { font-size: 1.5rem; margin: 36px 0 14px; color: var(--dark); }
.post-content h3 { font-size: 1.2rem; margin: 28px 0 12px; color: var(--dark); }
.post-content p  { margin-bottom: 18px; }
.post-content ul, .post-content ol { margin: 0 0 18px 24px; }
.post-content li { margin-bottom: 7px; }
.post-content blockquote {
  border-left: 4px solid var(--red);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--off-white);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: #555;
}
.post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 20px 0;
  box-shadow: var(--shadow);
}
.post-content a { color: var(--blue); text-decoration: underline; }
.post-content a:hover { color: var(--red); }
.post-content table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.post-content table th, .post-content table td {
  padding: 10px 14px;
  border: 1px solid var(--light-grey);
  text-align: left;
}
.post-content table th { background: var(--off-white); font-weight: 700; }

/* Tags */
.post-tags {
  margin: 28px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: .87rem;
}
.tag-link {
  background: var(--off-white);
  border: 1px solid var(--light-grey);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .8rem;
  transition: all .2s;
}
.tag-link:hover { background: var(--red); color: white; border-color: var(--red); }

/* Share */
.post-share {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0 32px;
  padding: 16px;
  background: var(--off-white);
  border-radius: var(--radius);
  font-size: .88rem;
}
.share-btn {
  padding: 7px 16px;
  border-radius: 5px;
  font-size: .82rem;
  font-weight: 700;
  font-family: var(--font-head);
  color: white;
  text-decoration: none;
  transition: opacity .2s;
}
.share-btn:hover { opacity: .85; color: white; }
.share-btn.twitter  { background: #000; }
.share-btn.facebook { background: #1877f2; }

/* ── COMMENTS ── */
.comments-section { margin-top: 40px; padding-top: 32px; border-top: 2px solid var(--light-grey); }
.comments-section h2 { font-size: 1.3rem; margin-bottom: 24px; color: var(--dark); }

.comment {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}
.comment-avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--red);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
}
.comment-body { flex: 1; }
.comment-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; font-size: .83rem; color: #999; }
.comment-meta strong { color: var(--dark); font-size: .95rem; }
.comment-text { font-size: .9rem; color: #444; line-height: 1.6; }

.comment-notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .9rem;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.comment-notice.error { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

.comment-form-wrap { margin-top: 32px; padding: 24px; background: var(--off-white); border-radius: var(--radius); }
.comment-form-wrap h3 { margin-bottom: 18px; font-size: 1.1rem; }
.comment-form .form-group { margin-bottom: 16px; }
.comment-form label { display: block; font-weight: 600; font-size: .87rem; margin-bottom: 6px; color: var(--dark); }
.comment-form input, .comment-form textarea {
  width: 100%;
  padding: 10px 13px;
  border: 2px solid var(--light-grey);
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: .93rem;
  outline: none;
  transition: border-color .2s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--blue); }
.comment-form textarea { min-height: 100px; resize: vertical; }

.blog-post-article { min-width: 0; }
