/**
 * if(塾) WordPress Theme - Blog Styles
 *
 * Covers: single post typography, code blocks, image gallery,
 * related posts, comments, table of contents, archive grid,
 * reading progress, lightbox, and share buttons.
 *
 * @package if-juku
 * @since 1.0.0
 */

/* ==========================================================================
   CSS Custom Properties (inherited from main style.css)
   ========================================================================== */

:root {
  --blog-max-width: 800px;
  --blog-wide-width: 1100px;
  --blog-font-size: 1.05rem;
  --blog-line-height: 1.9;
  --code-bg: #1e1e2e;
  --code-border: rgba(0, 255, 204, 0.2);
  --code-text: #cdd6f4;
  --toc-bg: rgba(26, 26, 46, 0.8);
  --toc-border: rgba(0, 255, 204, 0.3);
}

/* ==========================================================================
   1. Blog Archive Grid
   ========================================================================== */

.blog-archive {
  max-width: var(--blog-wide-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid rgba(0, 255, 204, 0.15);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 255, 204, 0.15);
  border-color: var(--primary-color, #00ffcc);
}

.post-card.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.post-card__thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-dark, #0a0a0a);
}

.post-card__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.post-card__category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary-color, #00ffcc);
  color: var(--bg-dark, #0a0a0a);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.post-card__body {
  padding: 1.25rem;
}

.post-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__title a {
  color: var(--text-light, #ffffff);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card__title a:hover {
  color: var(--primary-color, #00ffcc);
}

.post-card__excerpt {
  font-size: 0.9rem;
  color: var(--text-gray, #b0b0b0);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-gray, #b0b0b0);
}

.post-card__date::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Category filter bar */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.category-filter {
  padding: 8px 20px;
  border: 1px solid rgba(0, 255, 204, 0.3);
  border-radius: 30px;
  background: transparent;
  color: var(--text-light, #ffffff);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.category-filter:hover,
.category-filter.active {
  background: var(--primary-color, #00ffcc);
  color: var(--bg-dark, #0a0a0a);
  border-color: var(--primary-color, #00ffcc);
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.3);
}

.category-filter:focus-visible {
  outline: 2px solid var(--primary-color, #00ffcc);
  outline-offset: 2px;
}

/* Blog search */
.blog-search {
  max-width: 500px;
  margin: 0 auto 2rem;
  position: relative;
}

.blog-search-input {
  width: 100%;
  padding: 12px 20px 12px 44px;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid rgba(0, 255, 204, 0.2);
  border-radius: 30px;
  color: var(--text-light, #ffffff);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.blog-search-input:focus {
  border-color: var(--primary-color, #00ffcc);
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.2);
}

.blog-search-input::placeholder {
  color: var(--text-gray, #b0b0b0);
}

/* ==========================================================================
   2. Single Post Typography
   ========================================================================== */

.single-content,
.entry-content {
  max-width: var(--blog-max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  font-size: var(--blog-font-size);
  line-height: var(--blog-line-height);
  color: var(--text-light, #ffffff);
}

.entry-content > * + * {
  margin-top: 1.5rem;
}

.entry-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color, #00ffcc);
  background: linear-gradient(45deg, var(--primary-color, #00ffcc), var(--secondary-color, #ff00ff));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.entry-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  border-left: 4px solid var(--primary-color, #00ffcc);
  color: var(--text-light, #ffffff);
}

.entry-content h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color, #00ffcc);
}

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

.entry-content a {
  color: var(--primary-color, #00ffcc);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.entry-content a:hover {
  color: var(--secondary-color, #ff00ff);
}

.entry-content ul,
.entry-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.entry-content li {
  margin-bottom: 0.5rem;
}

.entry-content blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--secondary-color, #ff00ff);
  background: rgba(255, 0, 255, 0.05);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-gray, #b0b0b0);
}

.entry-content blockquote p:last-child {
  margin-bottom: 0;
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.entry-content figure {
  margin: 2rem 0;
}

.entry-content figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-gray, #b0b0b0);
  margin-top: 0.5rem;
}

.entry-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-color, #00ffcc), transparent);
  margin: 3rem 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 255, 204, 0.2);
  text-align: left;
}

.entry-content th {
  background: rgba(0, 255, 204, 0.1);
  font-weight: 700;
  color: var(--primary-color, #00ffcc);
}

.entry-content td {
  background: rgba(26, 26, 46, 0.5);
}

/* ==========================================================================
   3. Code Block Styling
   ========================================================================== */

.entry-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--code-border);
}

.entry-content pre {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
}

.entry-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  color: var(--code-text);
  white-space: pre;
  word-wrap: normal;
}

/* Copy code button (injected by blog.js) */
.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  background: rgba(0, 255, 204, 0.15);
  border: 1px solid rgba(0, 255, 204, 0.3);
  color: var(--primary-color, #00ffcc);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 1;
}

pre:hover .copy-code-btn {
  opacity: 1;
}

.copy-code-btn:hover {
  background: rgba(0, 255, 204, 0.3);
}

.copy-code-btn:focus-visible {
  opacity: 1;
  outline: 2px solid var(--primary-color, #00ffcc);
  outline-offset: 2px;
}

/* WordPress code block (Gutenberg) */
.wp-block-code {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 1.25rem;
}

/* ==========================================================================
   4. Image Gallery Styles
   ========================================================================== */

.wp-block-gallery,
.gallery {
  display: grid;
  gap: 0.75rem;
  margin: 2rem 0;
}

.wp-block-gallery.columns-2,
.gallery-columns-2 {
  grid-template-columns: repeat(2, 1fr);
}

.wp-block-gallery.columns-3,
.gallery-columns-3 {
  grid-template-columns: repeat(3, 1fr);
}

.wp-block-gallery.columns-4,
.gallery-columns-4 {
  grid-template-columns: repeat(4, 1fr);
}

.wp-block-gallery figure,
.gallery-item {
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 204, 0.15);
}

.wp-block-gallery figure img,
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.wp-block-gallery figure:hover img,
.gallery-item:hover img {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .wp-block-gallery.columns-3,
  .gallery-columns-3,
  .wp-block-gallery.columns-4,
  .gallery-columns-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   5. Related Posts Grid
   ========================================================================== */

.related-posts {
  max-width: var(--blog-wide-width);
  margin: 3rem auto;
  padding: 2rem 1rem;
}

.related-posts__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  background: linear-gradient(45deg, var(--primary-color, #00ffcc), var(--secondary-color, #ff00ff));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.related-post {
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid rgba(0, 255, 204, 0.15);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-post:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 255, 204, 0.1);
}

.related-post__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-dark, #0a0a0a);
}

.related-post__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-post__body {
  padding: 1rem;
}

.related-post__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post__title a {
  color: var(--text-light, #ffffff);
  text-decoration: none;
}

.related-post__title a:hover {
  color: var(--primary-color, #00ffcc);
}

/* ==========================================================================
   6. Comment Section Styling
   ========================================================================== */

.comments-area {
  max-width: var(--blog-max-width);
  margin: 3rem auto;
  padding: 2rem 1rem;
}

.comments-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--primary-color, #00ffcc);
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid rgba(0, 255, 204, 0.1);
  border-radius: 10px;
}

.comment .children {
  list-style: none;
  padding-left: 2rem;
  margin-top: 1.5rem;
  border-left: 2px solid rgba(0, 255, 204, 0.2);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.comment-author .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 204, 0.3);
}

.comment-author .fn {
  font-weight: 700;
  color: var(--primary-color, #00ffcc);
}

.comment-metadata {
  font-size: 0.8rem;
  color: var(--text-gray, #b0b0b0);
}

.comment-content {
  line-height: 1.8;
  color: var(--text-light, #ffffff);
}

.comment-content p {
  margin-bottom: 0.75rem;
}

.comment-reply-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--primary-color, #00ffcc);
  text-decoration: none;
  border: 1px solid rgba(0, 255, 204, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.comment-reply-link:hover {
  background: var(--primary-color, #00ffcc);
  color: var(--bg-dark, #0a0a0a);
}

/* Comment form */
.comment-respond {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid rgba(0, 255, 204, 0.15);
  border-radius: 12px;
}

.comment-respond .comment-reply-title {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color, #00ffcc);
}

.comment-form label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: var(--text-gray, #b0b0b0);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 1rem;
  background: var(--bg-dark, #0a0a0a);
  border: 1px solid rgba(0, 255, 204, 0.2);
  border-radius: 8px;
  color: var(--text-light, #ffffff);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--primary-color, #00ffcc);
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.15);
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-form .submit {
  background: linear-gradient(135deg, var(--primary-color, #00ffcc), var(--secondary-color, #ff00ff));
  color: var(--bg-dark, #0a0a0a);
  border: none;
  padding: 12px 32px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comment-form .submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 255, 204, 0.3);
}

/* ==========================================================================
   7. Table of Contents Styling
   ========================================================================== */

.toc,
#tableOfContents,
[data-toc] {
  max-width: var(--blog-max-width);
  margin: 2rem auto;
  padding: 0 1rem;
}

.toc-nav {
  background: var(--toc-bg);
  border: 1px solid var(--toc-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(10px);
}

.toc-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary-color, #00ffcc);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-title::after {
  content: '\25BC'; /* down arrow */
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.toc-title.is-collapsed::after {
  transform: rotate(-90deg);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: 0.4rem;
}

.toc-link {
  color: var(--text-gray, #b0b0b0);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.6;
  display: block;
  padding: 2px 0;
  transition: color 0.2s ease, padding-left 0.2s ease;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
}

.toc-link:hover {
  color: var(--primary-color, #00ffcc);
}

.toc-link.is-active {
  color: var(--primary-color, #00ffcc);
  border-left-color: var(--primary-color, #00ffcc);
  font-weight: 600;
}

.toc-item--h3 .toc-link {
  font-size: 0.85rem;
  padding-left: 2rem;
}

/* ==========================================================================
   8. Reading Progress Bar
   ========================================================================== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color, #00ffcc), var(--secondary-color, #ff00ff));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ==========================================================================
   9. Social Share Buttons
   ========================================================================== */

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 2rem 0;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
  transform: translateY(-2px);
}

.share-btn:focus-visible {
  outline: 2px solid var(--primary-color, #00ffcc);
  outline-offset: 2px;
}

.share-btn--twitter {
  background: #1da1f2;
  color: #ffffff;
}

.share-btn--facebook {
  background: #1877f2;
  color: #ffffff;
}

.share-btn--line {
  background: #06c755;
  color: #ffffff;
}

.share-btn--hatena {
  background: #00a4de;
  color: #ffffff;
}

.share-btn--pocket {
  background: #ef4056;
  color: #ffffff;
}

.share-btn--copy {
  background: rgba(0, 255, 204, 0.15);
  color: var(--primary-color, #00ffcc);
  border: 1px solid rgba(0, 255, 204, 0.3);
}

/* ==========================================================================
   10. Lightbox / Image Modal
   ========================================================================== */

.if-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  align-items: center;
  justify-content: center;
}

.if-lightbox__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
}

.if-lightbox__content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.if-lightbox__close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: var(--primary-color, #00ffcc);
  font-size: 2rem;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.2s ease;
}

.if-lightbox__close:hover {
  color: var(--secondary-color, #ff00ff);
}

.if-lightbox__close:focus-visible {
  outline: 2px solid var(--primary-color, #00ffcc);
  outline-offset: 2px;
}

.if-lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.if-lightbox__caption {
  color: var(--text-gray, #b0b0b0);
  margin-top: 12px;
  text-align: center;
  font-size: 0.9rem;
  max-width: 90vw;
}

/* ==========================================================================
   11. Toast Notification
   ========================================================================== */

.if-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color, #00ffcc);
  color: var(--bg-dark, #0a0a0a);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 100001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   12. Post Navigation (prev/next)
   ========================================================================== */

.post-navigation {
  max-width: var(--blog-max-width);
  margin: 2rem auto;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.post-navigation a {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid rgba(0, 255, 204, 0.15);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-light, #ffffff);
  flex: 1;
  transition: border-color 0.3s ease, transform 0.2s ease;
}

.post-navigation a:hover {
  border-color: var(--primary-color, #00ffcc);
  transform: translateY(-2px);
}

.post-navigation .nav-label {
  font-size: 0.8rem;
  color: var(--primary-color, #00ffcc);
  margin-bottom: 0.3rem;
}

.post-navigation .nav-title {
  font-size: 0.95rem;
  font-weight: 600;
}

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

/* ==========================================================================
   13. Reading Time & Post Meta
   ========================================================================== */

.reading-time {
  font-size: 0.85rem;
  color: var(--text-gray, #b0b0b0);
  margin-bottom: 1rem;
}

.post-hero {
  position: relative;
  max-width: var(--blog-wide-width);
  margin: 0 auto;
}

.post-hero__image {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: 0 0 12px 12px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-gray, #b0b0b0);
  margin-bottom: 2rem;
  max-width: var(--blog-max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.post-meta__category {
  background: rgba(0, 255, 204, 0.15);
  color: var(--primary-color, #00ffcc);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
}

/* ==========================================================================
   14. Pagination
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 3rem 0;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid rgba(0, 255, 204, 0.2);
  border-radius: 8px;
  color: var(--text-light, #ffffff);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--primary-color, #00ffcc);
  color: var(--bg-dark, #0a0a0a);
  border-color: var(--primary-color, #00ffcc);
}

/* ==========================================================================
   15. Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .related-posts__grid {
    grid-template-columns: 1fr;
  }

  .entry-content h2 {
    font-size: 1.35rem;
  }

  .entry-content h3 {
    font-size: 1.15rem;
  }

  .post-navigation {
    flex-direction: column;
  }

  .share-buttons {
    gap: 0.5rem;
  }

  .share-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .toc-nav {
    padding: 1rem;
  }

  .comments-area {
    padding: 1rem;
  }

  .comment {
    padding: 1rem;
  }

  .comment .children {
    padding-left: 1rem;
  }
}

@media (max-width: 480px) {
  .category-filters {
    gap: 0.5rem;
  }

  .category-filter {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}
