/* ==========================================================================
   Public Articles: Executive Engineering Editorial Cards, Listing & Reader
   Uses design tokens from style.css
   ========================================================================== */

/* ---------- Article Cards Grid ---------- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.45rem;
}

@media (max-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.article-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  border-color: rgba(5, 150, 105, 0.45);
}

.ac-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 8.8;
  overflow: hidden;
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
}

.ac-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover .ac-cover img {
  transform: scale(1.045);
}

.ac-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  color: var(--primary);
  opacity: 0.5;
}

.ac-cat {
  position: absolute;
  bottom: 0.65rem;
  inset-inline-end: 0.65rem;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.45);
  font-size: 0.71rem;
  font-weight: 700;
  padding: 0.2rem 0.72rem;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.ac-body {
  padding: 1.25rem 1.3rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.ac-meta {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 600;
}

.ac-meta i,
.ac-stats i {
  margin-inline-end: 0.32rem;
  font-size: 0.75rem;
  color: var(--primary);
}

.ac-title {
  font-size: 1.1rem;
  line-height: 1.5;
  font-weight: 800;
  color: #0f172a;
}

.ac-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.ac-title a:hover {
  color: var(--primary);
}

.ac-excerpt {
  font-size: 0.87rem;
  color: #475569;
  line-height: 1.68;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ac-tags {
  display: flex;
  gap: 0.38rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.ac-tags span {
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  padding: 0.14rem 0.55rem;
  border-radius: 6px;
  font-family: var(--font-latin);
}

.ac-foot {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ac-stats {
  display: flex;
  gap: 0.85rem;
  font-size: 0.77rem;
  color: #64748b;
  font-weight: 600;
}

.ac-read {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  background: var(--primary-soft);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(5, 150, 105, 0.2);
  transition: all 0.2s;
}

.ac-read:hover {
  background: var(--primary);
  color: #ffffff;
}

.ac-read i {
  transition: transform 0.2s;
  font-size: 0.72rem;
}

.ac-read:hover i {
  transform: translateX(-3px);
}

html[dir="ltr"] .ac-read:hover i {
  transform: translateX(3px);
}

/* ---------- Featured Card: Wide Hero Banner ---------- */
.article-card.is-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid rgba(5, 150, 105, 0.3);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
}

.article-card.is-featured .ac-cover {
  aspect-ratio: 16 / 9;
  min-height: 100%;
  border-bottom: none;
}

.article-card.is-featured .ac-body {
  padding: 1.85rem 2rem;
  justify-content: center;
  gap: 0.85rem;
}

.article-card.is-featured .ac-title {
  font-size: 1.42rem;
  line-height: 1.45;
}

.article-card.is-featured .ac-excerpt {
  -webkit-line-clamp: 4;
  font-size: 0.94rem;
}

/* ---------- Articles Listing Page ---------- */
.page-hero {
  padding: 2.75rem 0 1.25rem;
  text-align: center;
}

.page-hero h1 {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.45rem 0;
  color: #0f172a;
}

.page-hero p {
  color: #475569;
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.98rem;
  line-height: 1.65;
}

.list-toolbar {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin: 1.35rem 0 1.6rem;
  background: #ffffff;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.list-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.list-search i {
  position: absolute;
  inset-inline-start: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
}

.list-search input {
  width: 100%;
  padding: 0.58rem 0.9rem;
  padding-inline-start: 2.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 0.88rem;
  transition: var(--transition);
}

.list-search input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.chip-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 0.81rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #ffffff;
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.25);
}

.sort-select {
  padding: 0.5rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-sub);
  grid-column: 1 / -1;
}

.empty-state i {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 0.6rem;
  opacity: 0.5;
}

.skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: sk 1.4s ease infinite;
  border-radius: 16px;
  height: 340px;
}

@keyframes sk {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.section-footer {
  text-align: center;
  margin-top: 1.85rem;
}

/* ==========================================================================
   Article Reader Page (Executive Publication Dossier Layout)
   ========================================================================== */
.read-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3.5px;
  z-index: 250;
  background: transparent;
}

.read-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #10b981, #0284c7);
  transition: width 0.1s;
}

html[dir="rtl"] .read-progress span {
  margin-inline-start: auto;
}

.article-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
  position: relative;
  z-index: 1;
}

.crumbs {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 1.15rem;
  background: #ffffff;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

.crumbs a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

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

/* Dark Slate Executive Article Hero Banner */
.article-hero-card {
  background: linear-gradient(145deg, #0f172a 0%, #111827 60%, #0d2824 100%);
  color: #f8fafc;
  border-radius: 20px;
  padding: 2.1rem 2.3rem 1.75rem;
  border: 1px solid rgba(52, 211, 153, 0.3);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  margin-bottom: 1.65rem;
  position: relative;
  overflow: hidden;
}

.article-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.article-hero-card .cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.45);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
}

.article-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.81rem;
  color: #cbd5e1;
  font-weight: 600;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.22rem 0.65rem;
  border-radius: 8px;
}

.article-meta i {
  color: #34d399;
  font-size: 0.78rem;
}

.article-hero-card h1 {
  font-size: 1.88rem;
  line-height: 1.42;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.85rem;
}

.article-hero-card .lead {
  font-size: 1rem;
  color: #cbd5e1;
  line-height: 1.78;
  margin-bottom: 1.35rem;
  padding-inline-start: 0.95rem;
  border-inline-start: 3px solid #34d399;
}

.article-author-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.author-mini-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-mini-avatar {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  object-fit: cover;
  border: 1.5px solid #34d399;
  background: #0f172a;
}

.author-mini-text strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
}

.author-mini-text span {
  display: block;
  font-size: 0.76rem;
  color: #94a3b8;
}

.hero-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.hero-quick-tags span {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.18rem 0.58rem;
  border-radius: 6px;
}

/* Blueprint Cover Showcase Frame */
.article-cover {
  margin: 0 auto 1.75rem;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
  border: 1.5px solid #1e293b;
  background: #0b1120;
  cursor: zoom-in;
}

.article-cover img {
  width: 100%;
  height: auto;
  display: block;
}

/* Main Editorial Content Paper Card */
.article-paper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 2.2rem 2.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  margin-bottom: 1.85rem;
}

/* Structured Narrative Paragraphs: Problem -> Architectural Solution -> Impact */
.prose {
  font-size: 1.06rem;
  line-height: 2.02;
  color: #1e293b;
  min-width: 0;
}

.prose p {
  margin: 0 0 1.35rem;
  text-align: justify;
  padding: 1.25rem 1.45rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-inline-start: 4px solid #0284c7;
  position: relative;
}

.prose p:first-of-type {
  background: #fffbeb;
  border-color: #fde68a;
  border-inline-start: 4px solid #d97706;
}

.prose p:nth-of-type(2) {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-inline-start: 4px solid #059669;
}

.prose p:nth-of-type(3) {
  background: #f0f9ff;
  border-color: #bae6fd;
  border-inline-start: 4px solid #0284c7;
  margin-bottom: 0;
}

.narrative-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.narrative-badge.problem {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.narrative-badge.solution {
  background: rgba(5, 150, 105, 0.14);
  color: #047857;
}

.narrative-badge.impact {
  background: rgba(2, 132, 199, 0.14);
  color: #0369a1;
}

/* Article Footer Bar: Tags + Reactions + Share */
.article-action-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1.35rem;
  border-top: 1.5px dashed #cbd5e1;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.article-tags span {
  direction: ltr;
  unicode-bidi: isolate;
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-latin);
}

.article-interact-btns {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.btn-article-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.95rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-article-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-article-action.liked {
  background: #fff1f2;
  border-color: #fda4af;
  color: #e11d48;
}

/* Prev / Next Article Navigation */
.article-nav-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.art-nav-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: #0f172a;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.art-nav-item:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transform: translateY(-2px);
}

.art-nav-item small {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.art-nav-item strong {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.45;
  color: #0f172a;
}

/* Comments Box */
.comments-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.65rem 1.85rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.comments-box h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comments-box h3 em {
  font-style: normal;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
}

.comment-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.68rem 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #f8fafc;
  transition: var(--transition);
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.comment-form textarea {
  min-height: 92px;
  resize: vertical;
}

.comment-form button {
  justify-self: start;
}

.comment {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 0;
  border-top: 1px solid #e2e8f0;
}

.c-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, #10b981, #0284c7);
}

.c-body {
  min-width: 0;
  flex: 1;
}

.c-head {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.c-head strong {
  font-size: 0.92rem;
}

.c-head small {
  color: #64748b;
  font-size: 0.76rem;
}

.c-text {
  margin-top: 0.25rem;
  font-size: 0.92rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.no-comments {
  text-align: center;
  color: #64748b;
  padding: 1rem 0 0.3rem;
  font-size: 0.9rem;
}

.related {
  margin: 2.5rem auto 0;
}

.related h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1.15rem;
  color: #0f172a;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: zoom-out;
  backdrop-filter: blur(5px);
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.lightbox button {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
}

@media (max-width: 860px) {
  .article-card.is-featured {
    grid-template-columns: 1fr;
  }
  .article-hero-card {
    padding: 1.45rem 1.35rem;
  }
  .article-hero-card h1 {
    font-size: 1.42rem;
  }
  .article-paper {
    padding: 1.35rem 1.15rem;
  }
  .prose p {
    padding: 1rem 1.1rem;
    font-size: 0.97rem;
  }
  .article-nav-cards {
    grid-template-columns: 1fr;
  }
}
