/* ============================================
   ANDREW TORHILE UCHI — Official Website
   Blog Post & Blog Listing Styles
   ============================================ */

/* ---- Loading Spinner ---- */
.blog-loading,
.blog-post-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.blog-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0ddd6;
  border-top-color: #C8A961;
  border-radius: 50%;
  animation: blogSpin 0.8s linear infinite;
  margin-bottom: 16px;
}

.sidebar-spinner {
  width: 24px;
  height: 24px;
  margin: 20px auto;
}

@keyframes blogSpin {
  to { transform: rotate(360deg); }
}

.blog-loading p,
.blog-post-loading p {
  color: #6B6B6B;
  font-size: 0.9rem;
}

/* ---- Empty / Error States ---- */
.blog-empty,
.blog-post-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.blog-empty i,
.blog-post-error i {
  font-size: 3rem;
  color: #C8A961;
  margin-bottom: 20px;
}

.blog-empty h3,
.blog-post-error h2 {
  font-family: 'Playfair Display', serif;
  color: #1B2A4A;
  margin-bottom: 10px;
}

.blog-empty p,
.blog-post-error p {
  color: #6B6B6B;
  margin-bottom: 24px;
  max-width: 400px;
}

/* ---- Blog Listing Page ---- */
.blog-listing-page {
  padding-top: 80px; /* offset for fixed navbar */
}

.blog-listing-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* ---- Blog Pagination ---- */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 50px;
  padding-top: 30px;
}

.pagination-info {
  font-size: 0.9rem;
  color: #6B6B6B;
  font-weight: 500;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 2px solid #1B2A4A;
  background: transparent;
  color: #1B2A4A;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: #1B2A4A;
  color: #FFFFFF;
}

.btn-outline:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-outline:disabled:hover {
  background: transparent;
  color: #1B2A4A;
}

/* ---- Blog Post Page ---- */
.blog-post-page {
  padding-top: 80px; /* offset for fixed navbar */
  min-height: 60vh;
}

/* ---- Breadcrumb ---- */
.blog-breadcrumb {
  padding: 24px 0;
  font-size: 0.85rem;
  color: #6B6B6B;
}

.blog-breadcrumb a {
  color: #6B6B6B;
  text-decoration: none;
  transition: color 0.3s ease;
}

.blog-breadcrumb a:hover {
  color: #C8A961;
}

.breadcrumb-sep {
  margin: 0 8px;
  font-size: 0.65rem;
  color: #ccc;
}

/* ---- Post Layout (Article + Sidebar) ---- */
.blog-post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 50px;
  padding-bottom: 80px;
}

/* ---- Post Header ---- */
.blog-post-header {
  margin-bottom: 32px;
}

.blog-post-category {
  display: inline-block;
  background: #C8A961;
  color: #1B2A4A;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 3px;
  margin-bottom: 16px;
}

.blog-post-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #1B2A4A;
  line-height: 1.3;
  margin-bottom: 16px;
}

.blog-post-meta {
  display: flex;
  gap: 24px;
  color: #6B6B6B;
  font-size: 0.9rem;
}

.blog-post-meta i {
  margin-right: 6px;
  color: #C8A961;
}

/* ---- Featured Image ---- */
.blog-post-featured-image {
  margin-bottom: 36px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

/* ---- Post Body (WordPress Content) ---- */
.blog-post-body {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  color: #2C2C2C;
}

.blog-post-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #1B2A4A;
  margin-top: 40px;
  margin-bottom: 16px;
}

.blog-post-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #1B2A4A;
  margin-top: 32px;
  margin-bottom: 12px;
}

.blog-post-body h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1B2A4A;
  margin-top: 28px;
  margin-bottom: 10px;
}

.blog-post-body p {
  margin-bottom: 20px;
}

.blog-post-body a {
  color: #C8A961;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.blog-post-body a:hover {
  color: #1B2A4A;
}

.blog-post-body ul,
.blog-post-body ol {
  margin-bottom: 20px;
  padding-left: 28px;
}

.blog-post-body li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.blog-post-body blockquote {
  border-left: 4px solid #C8A961;
  background: rgba(27, 42, 74, 0.04);
  margin: 28px 0;
  padding: 20px 24px;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #1B2A4A;
}

.blog-post-body blockquote p {
  margin-bottom: 0;
}

.blog-post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  margin: 24px 0;
}

.blog-post-body figure {
  margin: 28px 0;
}

.blog-post-body figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: #6B6B6B;
  margin-top: 8px;
  font-style: italic;
}

.blog-post-body pre,
.blog-post-body code {
  background: #F8F6F1;
  border-radius: 4px;
  font-size: 0.9rem;
}

.blog-post-body pre {
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.blog-post-body code {
  padding: 2px 6px;
}

.blog-post-body pre code {
  padding: 0;
  background: none;
}

.blog-post-body hr {
  border: none;
  border-top: 1px solid #e0ddd6;
  margin: 36px 0;
}

/* ---- Sidebar ---- */
.blog-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
}

.sidebar-section {
  background: #F8F6F1;
  border-radius: 8px;
  padding: 24px;
}

.sidebar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: #1B2A4A;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #C8A961;
}

.sidebar-post {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e0ddd6;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.sidebar-post:last-child {
  border-bottom: none;
}

.sidebar-post:hover {
  opacity: 0.8;
}

.sidebar-post-image {
  width: 70px;
  height: 55px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-post-info h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1B2A4A;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-post-date {
  font-size: 0.75rem;
  color: #6B6B6B;
}

.sidebar-empty {
  color: #6B6B6B;
  font-size: 0.9rem;
  font-style: italic;
}

/* ---- Blog Card Link Styles ---- */
.blog-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* ---- View All Posts Button ---- */
.blog-view-all {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.blog-view-all a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border: 2px solid #1B2A4A;
  color: #1B2A4A;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.blog-view-all a:hover {
  background: #1B2A4A;
  color: #FFFFFF;
}

.blog-view-all a i {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.blog-view-all a:hover i {
  transform: translateX(4px);
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
  .blog-listing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-post-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .blog-sidebar {
    position: static;
  }

  .blog-post-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .blog-listing-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .blog-post-title {
    font-size: 1.7rem;
  }

  .blog-post-meta {
    flex-direction: column;
    gap: 8px;
  }

  .blog-pagination {
    gap: 12px;
  }

  .btn-outline {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .blog-post-title {
    font-size: 1.5rem;
  }

  .blog-post-body {
    font-size: 0.95rem;
  }

  .blog-post-body h2 {
    font-size: 1.5rem;
  }

  .blog-post-body h3 {
    font-size: 1.2rem;
  }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  .blog-spinner {
    animation: none;
    border-top-color: #C8A961;
  }
}
