/* ==========================================================================
   BLOG STYLES - BEM Structure
   Modern Vietnamese Blog Design
   ========================================================================== */

/* ==========================================================================
   BREADCRUMB - Minimal Style
   ========================================================================== */

.ta_breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.ta_breadcrumb__link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.ta_breadcrumb__link:hover {
  color: var(--primary);
}

.ta_breadcrumb__sep {
  color: var(--gray-300);
  user-select: none;
}

.ta_breadcrumb__current {
  color: var(--text-muted);
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   BLOG ARCHIVE PAGE
   ========================================================================== */

.ta_blog {
  background: var(--bg-body);
  min-height: 100vh;
}

/* Hero Section - Centered with Background */
.ta_blog-hero {
  position: relative;
  padding: var(--space-16) 0;
  background-color: var(--primary);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  text-align: center;
}

.ta_blog-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgb(0 0 0 / 90%) 0%,
    rgba(10, 42, 75, 0.65) 100%
  );
  z-index: 1;
}

.ta_blog-hero .container {
  position: relative;
  z-index: 2;
}

.ta_blog-hero__inner {
  max-width: 700px;
  margin: 0 auto;
}

.ta_blog-hero .ta_breadcrumb {
  justify-content: center;
  margin-bottom: var(--space-5);
}

.ta_blog-hero .ta_breadcrumb__link {
  color: rgba(255, 255, 255, 0.7);
}

.ta_blog-hero .ta_breadcrumb__link:hover {
  color: white;
}

.ta_blog-hero .ta_breadcrumb__sep {
  color: rgba(255, 255, 255, 0.4);
}

.ta_blog-hero .ta_breadcrumb__current {
  color: rgba(255, 255, 255, 0.9);
}

.ta_blog-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: var(--font-bold);
  color: white;
  margin: 0 0 var(--space-4);
  line-height: var(--leading-tight);
}

.ta_blog-hero__desc {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.85);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.ta_blog-hero__desc p {
  margin: 0;
}

.ta_blog-hero__count {
  display: inline-block;
  font-size: var(--text-sm);
  color: var(--secondary);
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin: 0;
}

/* Main Content */
.ta_blog__main {
  padding: var(--space-6) 0;
}

/* Layout */
.ta_blog__layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-6);
  align-items: start;
}

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

  .ta_blog__sidebar {
    order: 2;
  }
}

/* Posts Grid */
.ta_posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

/* 4 columns grid variant */
.ta_posts-grid--4cols {
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

@media (max-width: 1199px) {
  .ta_posts-grid--4cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 991px) {
  .ta_posts-grid--4cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575px) {
  .ta_posts-grid,
  .ta_posts-grid--4cols {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   POST CARD
   ========================================================================== */

.ta_post-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

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

.ta_post-card__image {
  display: block;
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.ta_post-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.ta_post-card:hover .ta_post-card__img {
  transform: scale(1.05);
}

.ta_post-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.ta_post-card:hover .ta_post-card__overlay {
  opacity: 1;
}

.ta_post-card__content {
  padding: var(--space-4);
}

/* Compact content for 4-col grid */
.ta_posts-grid--4cols .ta_post-card__content {
  padding: var(--space-3);
}

.ta_posts-grid--4cols .ta_post-card__excerpt {
  display: none;
}

.ta_posts-grid--4cols .ta_post-card__image {
  aspect-ratio: 4/3;
}

.ta_post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.ta_post-card__cat {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.ta_post-card__cat:hover {
  color: var(--secondary);
}

.ta_post-card__date {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.ta_post-card__title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Larger title for 2-col layout */
.ta_blog__layout .ta_post-card__title {
  font-size: var(--text-lg);
}

.ta_post-card__title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.ta_post-card__title a:hover {
  color: var(--primary);
}

.ta_post-card__excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.ta_post-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ta_post-card__link:hover {
  color: var(--secondary);
  gap: var(--space-2);
}

/* ==========================================================================
   BLOG SIDEBAR
   ========================================================================== */

.ta_blog-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.ta_blog-sidebar__widget {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.ta_blog-sidebar__title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--secondary);
}

/* Categories */
.ta_blog-categories {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ta_blog-categories__item {
  border-bottom: 1px solid var(--border-subtle);
}

.ta_blog-categories__item:last-child {
  border-bottom: none;
}

.ta_blog-categories__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.ta_blog-categories__link:hover {
  color: var(--primary);
  padding-left: var(--space-2);
}

.ta_blog-categories__count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Recent Posts */
.ta_recent-posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ta_recent-posts__item {
  display: flex;
  gap: var(--space-3);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ta_recent-posts__item:hover {
  transform: translateX(4px);
}

.ta_recent-posts__image {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ta_recent-posts__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ta_recent-posts__content {
  flex: 1;
  min-width: 0;
}

.ta_recent-posts__title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ta_recent-posts__item:hover .ta_recent-posts__title {
  color: var(--primary);
}

.ta_recent-posts__date {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Pagination */
.ta_blog__pagination {
  margin-top: var(--space-8);
}

.ta_blog__pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.ta_blog__pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ta_blog__pagination .page-numbers:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ta_blog__pagination .page-numbers.current {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Empty */
.ta_blog__empty {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
}

.ta_blog__empty svg {
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.ta_blog__empty h3 {
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
}

.ta_blog__empty p {
  color: var(--text-secondary);
  margin: 0 0 var(--space-6);
}

/* ==========================================================================
   SINGLE ARTICLE PAGE
   ========================================================================== */

.ta_article {
  background: var(--bg-body);
}

/* Hero - Centered with Background */
.ta_article-hero {
  position: relative;
  padding: var(--space-16) 0;
  background-color: var(--primary);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  text-align: center;
}

.ta_article-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgb(0 0 0 / 90%) 0%,
    rgba(10, 42, 75, 0.65) 100%
  );
  z-index: 1;
}

.ta_article-hero .container {
  position: relative;
  z-index: 2;
}

.ta_article-hero__inner {
  max-width: 800px;
  margin: 0 auto;
}

.ta_article-hero .ta_breadcrumb {
  justify-content: center;
  margin-bottom: var(--space-5);
}

.ta_article-hero .ta_breadcrumb__link {
  color: rgba(255, 255, 255, 0.7);
}

.ta_article-hero .ta_breadcrumb__link:hover {
  color: white;
}

.ta_article-hero .ta_breadcrumb__sep {
  color: rgba(255, 255, 255, 0.4);
}

.ta_article-hero .ta_breadcrumb__current {
  color: rgba(255, 255, 255, 0.9);
}

.ta_article-hero__cat {
  margin-bottom: var(--space-3);
}

.ta_article-hero__cat a {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ta_article-hero__cat a:hover {
  background: var(--secondary);
  color: var(--primary);
}

.ta_article-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: white;
  margin: 0 0 var(--space-4);
}

.ta_article-hero__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
}

.ta_article-hero__date,
.ta_article-hero__reading {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.85);
}

.ta_article-hero__date svg,
.ta_article-hero__reading svg {
  opacity: 0.7;
}

/* Main Layout */
.ta_article__main {
  padding: var(--space-6) 0;
}

.ta_article__layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-6);
  align-items: start;
}

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

/* Content */
.ta_article__content {
  min-width: 0;
}

.ta_article-content {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
}

.ta_article-content h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  color: var(--primary);
}

.ta_article-content h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.ta_article-content h4 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

.ta_article-content p {
  margin-bottom: var(--space-4);
}

.ta_article-content ul,
.ta_article-content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.ta_article-content li {
  margin-bottom: var(--space-2);
}

.ta_article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: var(--space-4) 0;
}

.ta_article-content blockquote {
  border-left: 4px solid var(--secondary);
  padding-left: var(--space-4);
  margin: var(--space-5) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.ta_article-content a {
  color: var(--primary);
  text-decoration: underline;
}

.ta_article-content a:hover {
  color: var(--secondary);
}

/* Tags */
.ta_article__tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-default);
}

.ta_article__tags-label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
}

.ta_article__tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ta_article__tag {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: var(--gray-100);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ta_article__tag:hover {
  background: var(--primary);
  color: white;
}

/* Share */
.ta_article__share {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-default);
}

.ta_article__share-label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
}

.ta_article__share-buttons {
  display: flex;
  gap: var(--space-2);
}

.ta_article__share-btn {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: white;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
}

.ta_article__share-btn:hover {
  transform: translateY(-2px);
  color: white;
}

.ta_article__share-btn--facebook {
  background: #1877f2;
}

.ta_article__share-btn--twitter {
  background: #1da1f2;
}

.ta_article__share-btn--linkedin {
  background: #0a66c2;
}

.ta_article__share-btn--copy {
  background: var(--gray-600);
}

.ta_article__share-btn--copy.is-copied {
  background: var(--success);
}

/* Article Sidebar */
.ta_article__sidebar {
  align-self: start;
  height: 100%;
}

.ta_article-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.ta_article-sidebar__widget {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.ta_article-sidebar__title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--secondary);
}

/* Related Posts */
.ta_related-posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ta_related-post {
  display: flex;
  gap: var(--space-3);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ta_related-post:hover {
  transform: translateX(4px);
}

.ta_related-post__image {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ta_related-post__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ta_related-post__content {
  flex: 1;
  min-width: 0;
}

.ta_related-post__title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ta_related-post:hover .ta_related-post__title {
  color: var(--primary);
}

.ta_related-post__date {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.ta_related-posts__empty {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-4);
}
