/* ==========================================================================
   News Detail Phase 2 - Persian RTL Editorial Article Experience
   ========================================================================== */

:root {
  --emerald-dark: #08241a;
  --emerald-main: #0e3d2e;
  --emerald-subtle: #144d3b;
  --emerald-light: #e8f0ec;
  --gold-primary: #c49826;
  --gold-accent: #d4af37;
  --gold-soft: #f4e8c1;
  --gold-bg: #fffbf0;
  --ivory-bg: #FAF8F5;
  --surface-card: #ffffff;
  --surface-warm: #FAF7F2;
  --text-primary: #122232;
  --text-body: #243648;
  --text-muted: #576b7c;
  --border-light: #E6E0D4;
  --border-emerald: #b8d1c6;
  --border-gold: rgba(196, 152, 38, 0.35);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(14, 61, 46, 0.04);
  --shadow-md: 0 8px 24px rgba(14, 61, 46, 0.08);
  --shadow-lg: 0 16px 40px rgba(14, 61, 46, 0.12);
}

body {
  background: var(--ivory-bg) !important;
  color: var(--text-body) !important;
  font-family: 'Vazirmatn', Tahoma, sans-serif !important;
  margin: 0;
  direction: rtl;
}

/* Container Shell */
.news-detail-shell {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.news-detail-padding {
  padding: 36px 0 64px;
}

/* ==========================================================================
   1. Compact Full-Width Article Hero Header
   ========================================================================== */
.article-hero {
  position: relative;
  min-height: 230px;
  padding: 36px 0 40px;
  display: flex;
  align-items: center;
  background-image: 
    linear-gradient(270deg, 
      #08241a 0%, 
      #0e3d2e 35%, 
      rgba(14, 61, 46, 0.95) 60%, 
      rgba(7, 26, 54, 0.92) 100%
    ),
    url('/static/images/karbala-hussain-shrine.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  color: #FFFFFF;
  border-bottom: 3px solid var(--gold-primary);
  box-shadow: inset 0 -12px 28px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.article-hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 880px;
}

.article-hero__breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #D3E4DC;
  flex-wrap: wrap;
}

.article-hero__breadcrumb a {
  color: var(--gold-soft);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.article-hero__breadcrumb a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.article-hero__sep {
  color: rgba(212, 175, 55, 0.6);
  font-size: 0.75rem;
}

.article-hero__title {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.35;
  word-break: break-word;
}

.article-hero__meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.88rem;
  color: var(--gold-soft);
  font-weight: 600;
  flex-wrap: wrap;
}

.article-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-hero__meta-item svg {
  width: 15px;
  height: 15px;
  stroke: var(--gold-accent);
  fill: none;
  stroke-width: 2;
}

.article-hero__divider {
  width: 60px;
  height: 3px;
  background: var(--gold-primary);
  border-radius: 2px;
  margin-top: 2px;
}

/* ==========================================================================
   2. Main Article Editorial Canvas
   ========================================================================== */
/* Prevent horizontal overflow on article containers */
.article-canvas,
.article-reading-column,
.news-detail-shell {
  overflow-x: hidden;
}

.article-canvas {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  box-shadow: 0 10px 32px rgba(14, 61, 46, 0.06);
}

.article-reading-column {
  max-width: 860px;
  margin: 0 auto;
}

/* Main Featured Image Container */
.article-featured-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 32px;
  background: #FAF6F0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.article-featured-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  margin: 0 auto;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.article-featured-image:hover {
  opacity: 0.95;
}

.article-featured-hint {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(8, 36, 26, 0.75);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

/* Editorial badge tag */
.article-editorial-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--emerald-main);
  background: var(--emerald-light);
  border: 1px solid var(--border-emerald);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.article-editorial-badge__icon {
  color: var(--gold-primary);
}

/* Article Body Typography */
.article-body-content {
  font-size: 1.1rem;
  line-height: 2.15;
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  margin-bottom: 40px;
}

.article-body-content p {
  margin: 0 0 24px 0;
}

.article-body-content p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   3. Additional Images / News Gallery Section
   ========================================================================== */
.article-gallery-section {
  margin-top: 44px;
  padding-top: 36px;
  border-top: 2px dashed #EFE7DA;
}

.article-gallery-header {
  margin-bottom: 24px;
}

.article-gallery-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.article-gallery-title svg {
  width: 20px;
  height: 20px;
  stroke: var(--emerald-main);
  fill: none;
  stroke-width: 2;
}

.article-gallery-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.article-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.article-gallery-grid--single {
  display: flex;
  justify-content: center;
}

.article-gallery-grid--single .article-gallery-card {
  max-width: 480px;
  width: 100%;
}

.article-gallery-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #FAF6F0;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.article-gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-emerald);
}

.article-gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  object-position: center;
  background: #F4ECE1;
  display: block;
  transition: transform 0.35s ease;
}

.article-gallery-card:hover img {
  transform: scale(1.02);
}

.article-gallery-caption {
  padding: 12px 14px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-body);
  background: var(--surface-card);
  border-top: 1px solid var(--border-light);
  line-height: 1.45;
  text-align: right;
}

/* ==========================================================================
   4. Lightbox Modal
   ========================================================================== */
.news-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.news-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.news-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 18, 12, 0.88);
  backdrop-filter: blur(4px);
}

.news-lightbox__container {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.news-lightbox__close {
  position: absolute;
  top: -42px;
  left: 0;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.news-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.news-lightbox__image {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.news-lightbox__caption {
  margin-top: 14px;
  color: var(--gold-soft);
  font-size: 0.94rem;
  font-weight: 600;
  text-align: center;
  max-width: 650px;
}

/* ==========================================================================
   5. Article Footer & Action Area
   ========================================================================== */
.article-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #EFE7DA;
  flex-wrap: wrap;
}

.article-end-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-news-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: var(--surface-card);
  color: var(--emerald-main);
  border: 1.5px solid var(--emerald-main);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
  min-height: 44px;
}

.btn-news-back:hover {
  background: var(--emerald-main);
  color: #FFFFFF;
  transform: translateX(3px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   6. Closing Pilgrimage Strip
   ========================================================================== */
.news-closing-strip {
  margin-top: 56px;
  background: linear-gradient(90deg, #08241a 0%, #0e3d2e 50%, #08241a 100%);
  border-top: 2px solid var(--gold-primary);
  border-bottom: 1px solid rgba(196, 152, 38, 0.2);
  padding: 22px 16px;
  text-align: center;
  color: #FFFFFF;
}

.news-closing-strip__content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  font-weight: 700;
  color: var(--gold-soft);
}

.news-closing-strip__icon {
  color: var(--gold-accent);
}

/* ==========================================================================
   7. Responsive Overrides
   ========================================================================== */
@media (max-width: 980px) {
  .article-hero {
    min-height: 220px;
    padding: 32px 0 36px;
  }
  .article-canvas {
    padding: 36px 28px;
  }
  .article-featured-image {
    max-height: 480px;
  }
  .article-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .article-hero {
    min-height: 190px;
    padding: 28px 0 32px;
  }
  .article-hero__title {
    font-size: 1.45rem;
  }
  .news-detail-padding {
    padding: 20px 0 44px;
  }
  .article-canvas {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }
  .article-featured-container {
    margin-bottom: 24px;
    border-radius: 12px;
  }
  .article-featured-image {
    max-height: 360px;
  }
  .article-body-content {
    font-size: 1.02rem;
    line-height: 1.9;
    text-align: right;
  }
  .article-gallery-grid {
    grid-template-columns: 1fr;
  }
  .article-footer-actions {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .btn-news-back {
    justify-content: center;
    width: 100%;
  }
}
