/* ========================================
   ARTICLE PAGE — NEXT Online Cinema
   ======================================== */

/* ============================================
   ARTICLE HERO
   ============================================ */

.article-hero {
  padding: calc(var(--header-height) + var(--space-4xl)) 0 0;
  background: var(--bg-primary);
}

.article-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.article-hero__date {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.article-hero__title {
  font-size: clamp(1.75rem, 3.5vw, var(--font-size-4xl));
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: var(--space-xl);
  max-width: 900px;
}

.article-hero__image {
  width: 100%;
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
  margin-bottom: var(--space-lg);
}

.article-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-hero__caption {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-3xl);
}

/* ============================================
   ARTICLE LAYOUT
   ============================================ */

.article-layout {
  padding: 0 0 var(--space-4xl);
  background: var(--bg-primary);
}

.article-layout__inner {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-3xl);
  align-items: start;
}

/* Main content area */
.article-layout__main {
  min-width: 0;
}

/* Sidebar */
.article-layout__sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-xl));
}

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

.article-sidebar__title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.article-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.article-sidebar__item {
  display: flex;
  gap: var(--space-md);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.article-sidebar__item:hover {
  opacity: 0.7;
}

.article-sidebar__item-image {
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card);
}

.article-sidebar__item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-sidebar__item-info {
  flex: 1;
  min-width: 0;
}

.article-sidebar__item-title {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
}

.article-sidebar__item-date {
  font-size: 10px;
  color: var(--text-muted);
}

/* ============================================
   ARTICLE CONTENT — CMS Styles
   ALL styles MUST be scoped to .article-content
   ============================================ */

.article-content {
  max-width: 720px;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: var(--font-size-base);
}

/* --- Paragraphs --- */
.article-content p {
  margin-bottom: var(--space-lg);
  line-height: 1.8;
}

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

/* --- Links --- */
.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.article-content a:hover {
  color: var(--accent-hover);
}

/* --- Inline text --- */
.article-content strong,
.article-content b {
  color: var(--text-primary);
  font-weight: 700;
}

.article-content em,
.article-content i {
  font-style: italic;
}

.article-content small {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* --- Headings --- */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-lg);
}

.article-content h1 { font-size: var(--font-size-3xl); }
.article-content h2 { font-size: var(--font-size-2xl); }
.article-content h3 { font-size: var(--font-size-xl); }
.article-content h4 { font-size: var(--font-size-lg); }
.article-content h5 { font-size: var(--font-size-base); }
.article-content h6 { font-size: var(--font-size-sm); }

.article-content h1:first-child,
.article-content h2:first-child,
.article-content h3:first-child {
  margin-top: 0;
}

/* --- Images --- */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius-lg);
  margin: var(--space-xl) 0;
  display: block;
  background: var(--bg-card);
}

.article-content figure {
  margin: var(--space-xl) 0;
}

.article-content figure img {
  margin: 0;
}

.article-content figcaption {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-sm);
  line-height: 1.5;
}

/* --- Lists --- */
.article-content ul,
.article-content ol {
  margin: 0 0 var(--space-lg);
  padding-left: var(--space-xl);
}

.article-content ul {
  list-style: disc;
}

.article-content ol {
  list-style: decimal;
}

.article-content li {
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

.article-content li:last-child {
  margin-bottom: 0;
}

.article-content li::marker {
  color: var(--accent);
}

/* --- Blockquote --- */
.article-content blockquote {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl) var(--space-2xl);
  border-left: 3px solid var(--accent);
  background: rgba(229, 62, 62, 0.04);
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.7;
}

.article-content blockquote p {
  margin-bottom: var(--space-sm);
}

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

.article-content blockquote footer {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--space-md);
  font-style: normal;
}

/* --- Tables --- */
.article-content .table-wrapper {
  overflow-x: auto;
  margin: var(--space-2xl) 0;
  -webkit-overflow-scrolling: touch;
}

.article-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-size-sm);
  line-height: 1.6;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-content thead {
  background: var(--bg-elevated);
}

.article-content th {
  padding: var(--space-md) var(--space-lg);
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.article-content td {
  padding: var(--space-md) var(--space-lg);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.article-content tbody tr:last-child td {
  border-bottom: none;
}

.article-content tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.article-content tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* --- Code / Pre --- */
.article-content pre {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: var(--font-size-sm);
  line-height: 1.7;
  color: var(--text-secondary);
  -webkit-overflow-scrolling: touch;
}

.article-content pre::-webkit-scrollbar {
  height: 4px;
}

.article-content pre::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.article-content code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border-radius: 4px;
  color: var(--accent);
}

.article-content pre code {
  padding: 0;
  background: none;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

/* --- Horizontal rule --- */
.article-content hr {
  margin: var(--space-3xl) 0;
  border: none;
  height: 1px;
  background: var(--border);
}

/* --- Wrapper for responsive content --- */
.article-content .responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================
   ARTICLE FOOTER / SHARE
   ============================================ */

.article-footer {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.article-footer__tags {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.article-footer__share {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.article-footer__share-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.article-footer__share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.article-footer__share-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.article-footer__share-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   RELATED ARTICLES — Editorial Block
   ============================================ */

.article-related {
  padding: var(--space-5xl) 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: var(--space-2xl);
}

.article-related .news-list-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Override first-child featured card for related section */
.article-related .news-list-grid .news-card:first-child {
  grid-column: auto;
  display: flex;
  flex-direction: column;
}

.article-related .news-list-grid .news-card:first-child .news-card__image {
  aspect-ratio: 16 / 9;
  height: auto;
}

.article-related .news-list-grid .news-card:first-child .news-card__body {
  padding: var(--space-lg);
}

.article-related .news-list-grid .news-card:first-child .news-card__title {
  font-size: var(--font-size-base);
  -webkit-line-clamp: 2;
}

.article-related .news-list-grid .news-card:first-child .news-card__excerpt {
  -webkit-line-clamp: 2;
  font-size: var(--font-size-sm);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .article-layout__inner {
    grid-template-columns: 1fr;
  }

  .article-layout__sidebar {
    display: none;
  }

  .article-hero__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
  }

  .article-related .news-list-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .article-related {
    padding: var(--space-3xl) 0;
  }

  .article-related .news-list-grid {
    grid-template-columns: 1fr;
  }

  .article-hero {
    padding: calc(var(--header-height) + var(--space-2xl)) 0 0;
  }

  .article-hero__title {
    font-size: 1.5rem;
  }

  .article-hero__image {
    border-radius: var(--border-radius-lg);
    aspect-ratio: 16 / 10;
  }

  .article-content {
    font-size: var(--font-size-sm);
  }

  .article-content blockquote {
    padding: var(--space-lg) var(--space-xl);
    margin: var(--space-xl) 0;
  }

  .article-content pre {
    padding: var(--space-lg) var(--space-md);
    font-size: var(--font-size-xs);
  }

  .article-content th,
  .article-content td {
    padding: var(--space-sm) var(--space-md);
  }

  .article-content h2 { font-size: var(--font-size-xl); }
  .article-content h3 { font-size: var(--font-size-lg); }

  .article-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .article-hero {
    padding: calc(var(--header-height) + var(--space-xl)) 0 0;
  }

  .article-hero__title {
    font-size: 1.25rem;
  }

  .article-content ul,
  .article-content ol {
    padding-left: var(--space-lg);
  }

  .article-content blockquote {
    padding: var(--space-md) var(--space-lg);
  }

  .article-content table {
    font-size: var(--font-size-xs);
  }
}
