/* ============================================
   SORA JAPAN – News/Blog Styles
   ============================================ */

/* ─── Hero Section ─── */
.news-hero {
  background: linear-gradient(135deg, #0C4A6E 0%, #0284C7 100%);
  color: white;
  padding: 140px 20px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.news-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/hero-bg.png') center/cover;
  opacity: 0.15;
}

/* Gradient overlay at top — makes fixed header text readable */
.news-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 130px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
  z-index: 0;
  pointer-events: none;
}

.news-hero > * {
  position: relative;
  z-index: 1;
}

.news-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--color-primary-light);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  margin-bottom: 12px;
}

.news-hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding: 20px 0;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--color-text-muted);
}

/* ─── Detail Hero Bar ─── */
.news-detail-hero {
  background: linear-gradient(135deg, #0C4A6E 0%, #0369A1 60%, #0284C7 100%);
  padding: 120px 20px 30px;
  position: relative;
  overflow: hidden;
}

.news-detail-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/hero-bg.png') center/cover;
  opacity: 0.1;
}

.news-detail-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 130px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
  pointer-events: none;
}

.news-detail-hero > * {
  position: relative;
  z-index: 1;
}

.breadcrumb-light {
  color: rgba(255, 255, 255, 0.7);
}

.breadcrumb-light a {
  color: rgba(255, 255, 255, 0.85);
}

.breadcrumb-light a:hover {
  color: #fff;
}

.breadcrumb-light span {
  color: rgba(255, 255, 255, 0.5);
}

/* ─── Featured Post ─── */
.featured-post {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 50px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.featured-post:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.featured-post-img {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

.featured-post-body {
  padding: 30px 30px 30px 0;
}

.featured-post-body .category-badge {
  margin-bottom: 12px;
}

.featured-post-body h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--color-text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.featured-post-body h2 a {
  color: inherit;
  text-decoration: none;
}

.featured-post-body h2 a:hover {
  color: var(--color-primary);
}

.featured-post-body .excerpt {
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: 16px;
}

.featured-post-body .post-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ─── Category Filter ─── */
.category-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.category-filter button {
  padding: 8px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: white;
  color: var(--color-text-light);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.category-filter button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.category-filter button.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* ─── Category Badge ─── */
.category-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  background: var(--color-primary);
}

/* ─── Posts Grid ─── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 50px;
}

.post-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

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

.post-card-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-card-body .category-badge {
  align-self: flex-start;
  margin-bottom: 10px;
}

.post-card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.post-card-body h3 a {
  color: inherit;
  text-decoration: none;
}

.post-card-body h3 a:hover {
  color: var(--color-primary);
}

.post-card-body .excerpt {
  color: var(--color-text-light);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 14px;
  flex-grow: 1;
}

.post-card-body .post-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-meta-views {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 40px 0 60px;
}

.pagination button {
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.pagination button:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

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

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Detail Page ─── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 50px;
  padding: 40px 0 60px;
}

.article-main .category-badge {
  margin-bottom: 16px;
}

.article-main h1 {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  gap: 20px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-thumbnail {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
}

/* Article content styling */
.article-content {
  color: var(--color-text-light);
  font-size: 1.05rem;
  line-height: 1.85;
}

.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-text);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary-light);
}

.article-content h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-text);
  margin: 28px 0 12px;
}

.article-content p {
  margin-bottom: 18px;
}

.article-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

.article-content ul, .article-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 16px 20px;
  margin: 20px 0;
  background: var(--color-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

/* Tags */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.article-tags .tag {
  padding: 4px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--color-primary);
  text-decoration: none;
}

.article-tags .tag:hover {
  background: var(--color-primary);
  color: white;
}

/* Share buttons */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 30px;
}

.share-buttons span {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9rem;
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  font-size: 1rem;
  transition: transform var(--transition);
}

.share-btn:hover {
  transform: scale(1.1);
}

.share-btn.fb { background: #1877F2; }
.share-btn.zalo { background: #0068FF; }
.share-btn.copy { background: var(--color-text-muted); cursor: pointer; border: none; }

/* ─── Sidebar ─── */
.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.sidebar-block {
  background: white;
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.sidebar-block h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
}

.sidebar-post {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
}

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

.sidebar-post-img {
  width: 70px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-bg-section);
}

.sidebar-post-info h4 {
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 4px;
}

.sidebar-post-info h4:hover {
  color: var(--color-primary);
}

.sidebar-post-info .date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Sidebar categories */
.sidebar-categories {
  list-style: none;
  padding: 0;
}

.sidebar-categories li {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

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

.sidebar-categories a {
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  transition: color var(--transition);
}

.sidebar-categories a:hover {
  color: var(--color-primary);
}

.sidebar-categories .count {
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ─── Related Posts ─── */
.related-section {
  padding: 60px 0;
  background: var(--color-bg-section);
}

.related-section h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--color-text);
  margin-bottom: 30px;
  text-align: center;
}

/* ─── Loading & Empty States ─── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 350px;
  border-radius: var(--radius-md);
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--color-text-muted);
}

.empty-state svg {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.3rem;
  color: var(--color-text);
  margin-bottom: 8px;
}

.news-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.news-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .featured-post {
    grid-template-columns: 1fr;
  }

  .featured-post-img {
    height: 240px;
  }

  .featured-post-body {
    padding: 24px;
  }

  .article-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .sidebar {
    position: static;
  }

  .article-main h1 {
    font-size: 1.8rem;
  }

  .news-hero h1 {
    font-size: 2rem;
  }
}

@media (max-width: 600px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .category-filter {
    gap: 6px;
  }

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

  .featured-post-body h2 {
    font-size: 1.3rem;
  }

  .article-main h1 {
    font-size: 1.5rem;
  }

  .article-content {
    font-size: 1rem;
  }

  .share-buttons {
    flex-wrap: wrap;
  }
}
