/* ══ SKELETON ══ */
@keyframes ndPulse { 0%,100%{opacity:.45} 50%{opacity:.9} }
.nd-skeleton-wrap { max-width: 1140px; margin: 0 auto; padding: 2rem 2rem 4rem; }
.nd-sk-header { max-width: 720px; margin: 0 auto 2rem; display: flex; flex-direction: column; gap: 12px; }
.nd-sk-body { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }
.nd-sk-main { display: flex; flex-direction: column; gap: 12px; }
.nd-sk-side { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.nd-sk-img {
  height: 340px; border-radius: var(--radius-lg);
  background: var(--bg-secondary); margin-bottom: 8px;
  animation: ndPulse 1.4s ease-in-out infinite;
}
.nd-sk-line {
  height: 14px; border-radius: 4px; width: 100%;
  background: var(--bg-secondary); animation: ndPulse 1.4s ease-in-out infinite;
}
.nd-sk-line.w30 { width: 30%; }
.nd-sk-line.w50 { width: 50%; }
.nd-sk-line.w60 { width: 60%; }
.nd-sk-line.w70 { width: 70%; }
.nd-sk-line.w80 { width: 80%; }
.nd-sk-line.w85 { width: 85%; }
.nd-sk-line.w90 { width: 90%; }
.nd-sk-line.tall { height: 28px; }

/* ══ NOT FOUND ══ */
.nd-notfound {
  max-width: 480px; margin: 5rem auto; text-align: center; padding: 2rem;
}
.nd-nf-back {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 1.25rem;
  font-size: 13.5px; color: var(--primary); font-weight: 500; text-decoration: none;
}
.nd-nf-back:hover { text-decoration: underline; }

/* ══ ARTICLE HEADER ══ */
.nd-article-head {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  padding: 2.5rem 2rem 2rem;
}
.nd-article-head-inner { max-width: 760px; margin: 0 auto; }

.nd-type-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.nd-type-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-light); color: var(--primary);
  border: 1px solid var(--primary-border);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.nd-type-tag i { font-size: 11px; }

.nd-title {
  font-size: 28px; font-weight: 800; color: var(--text-primary);
  line-height: 1.35; letter-spacing: -0.5px; margin: 0 0 1.25rem;
}

.nd-meta {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.nd-meta-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--text-muted);
}
.nd-meta-item i { font-size: 14px; }
.nd-meta-item strong { color: var(--text-secondary); font-weight: 500; }

/* ══ BODY LAYOUT ══ */
.nd-wrap { }
.nd-body {
  max-width: 1140px; margin: 0 auto;
  padding: 2rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem; align-items: start;
}

/* ══ MAIN ══ */
.nd-main { min-width: 0; }

.nd-featured-img {
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 1.75rem;
  background: linear-gradient(135deg, #E6F1FB, #c8dff5);
}
.nd-featured-img img {
  width: 100%; display: block;
  max-height: 440px; object-fit: cover;
}
.nd-featured-img:empty { display: none; }

.nd-intro {
  font-size: 16px; color: var(--text-secondary);
  line-height: 1.8; border-left: 3px solid var(--primary);
  padding: 0.75rem 1.25rem; margin-bottom: 1.75rem;
  background: var(--primary-light); border-radius: 0 var(--radius) var(--radius) 0;
}
.nd-intro:empty { display: none; }

/* ── Article content (TinyMCE HTML) ── */
.nd-content {
  font-size: 15px; color: var(--text-primary);
  line-height: 1.85; word-break: break-word;
}
/* TinyMCE inline background-color (#ffffff) дарна */
.nd-content p,
.nd-content h1,.nd-content h2,.nd-content h3,
.nd-content h4,.nd-content h5,.nd-content h6,
.nd-content ul,.nd-content ol,.nd-content li,
.nd-content span,.nd-content td,.nd-content th {
  background-color: transparent !important;
}
.nd-content h1,.nd-content h2,.nd-content h3,
.nd-content h4,.nd-content h5,.nd-content h6 {
  color: var(--text-primary); font-weight: 700;
  margin: 1.75rem 0 0.75rem; line-height: 1.3;
  letter-spacing: -0.3px;
}
.nd-content h1 { font-size: 24px; }
.nd-content h2 { font-size: 21px; }
.nd-content h3 { font-size: 18px; }
.nd-content h4 { font-size: 16px; }
.nd-content p  { margin: 0 0 1rem; }
.nd-content a  { color: var(--primary); text-decoration: underline; }
.nd-content a:hover { color: var(--primary-dark); }
.nd-content ul, .nd-content ol {
  margin: 0.5rem 0 1rem 1.5rem; display: flex; flex-direction: column; gap: 4px;
}
.nd-content li { padding-left: 4px; }
.nd-content blockquote {
  margin: 1.25rem 0; padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--primary);
  background: var(--bg-secondary); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary); font-style: italic;
}
.nd-content img {
  max-width: 100%; height: auto; border-radius: var(--radius); display: block;
  margin: 1rem auto;
}
.nd-content table {
  width: 100%; border-collapse: collapse; margin: 1rem 0;
  font-size: 13.5px;
}
.nd-content table th, .nd-content table td {
  border: 1px solid var(--border); padding: 8px 12px; text-align: left;
}
.nd-content table th {
  background: var(--bg-secondary); font-weight: 600; color: var(--text-primary);
}
.nd-content table tr:hover td { background: var(--bg-secondary); }
.nd-content pre, .nd-content code {
  font-family: 'Courier New', monospace; font-size: 13px;
  background: #1e293b; color: #e2e8f0; border-radius: var(--radius);
  padding: 0.15em 0.4em;
}
.nd-content pre { padding: 1rem 1.25rem; overflow-x: auto; margin: 1rem 0; }
.nd-content pre code { background: none; padding: 0; }
.nd-content hr { border: none; border-top: 1px solid var(--border-light); margin: 1.75rem 0; }

/* Article footer tags */
.nd-article-foot {
  margin-top: 2rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.nd-article-foot:empty { display: none; }
.nd-foot-label { font-size: 12px; color: var(--text-muted); margin-right: 4px; }
.nd-foot-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-secondary); color: var(--text-secondary);
  border: 1px solid var(--border-light); cursor: pointer;
  text-decoration: none; transition: background 0.12s, color 0.12s;
}
.nd-foot-tag:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-border); }

/* ══ COMMENTS ══ */
.nd-comments { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border-light); }

.nd-comments-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 1.5rem;
}
.nd-comments-head i { font-size: 20px; color: var(--primary); }
.nd-cmt-count {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  background: var(--bg-secondary); padding: 2px 8px; border-radius: 100px;
}

/* Comment item */
.nd-cmt-item {
  display: flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.nd-cmt-item:last-of-type { border-bottom: none; }
.nd-cmt-av {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #1a6eb5);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}
.nd-cmt-av.guest { background: linear-gradient(135deg, #64748b, #94a3b8); }
.nd-cmt-body { flex: 1; min-width: 0; }
.nd-cmt-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.nd-cmt-author { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.nd-cmt-date   { font-size: 11.5px; color: var(--text-muted); }
.nd-cmt-text   { font-size: 14px; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* Empty comments */
.nd-cmt-empty { text-align: center; padding: 1.5rem 0; color: var(--text-muted); font-size: 13.5px; }

/* Comment form */
.nd-cmt-form { margin-top: 1.75rem; background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 1.5rem; }
.nd-cmt-form-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem; }
.nd-cmt-user-label {
  font-size: 13px; color: var(--primary); background: var(--primary-light);
  border: 1px solid var(--primary-border); border-radius: var(--radius);
  padding: 7px 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.nd-cmt-input {
  width: 100%; padding: 9px 12px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13.5px; background: var(--bg-white); color: var(--text-primary);
  outline: none; font-family: inherit; transition: border 0.15s; box-sizing: border-box;
}
.nd-cmt-input:focus { border-color: var(--primary); }
.nd-cmt-textarea {
  width: 100%; padding: 9px 12px; margin-bottom: 4px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13.5px; background: var(--bg-white); color: var(--text-primary);
  outline: none; font-family: inherit; resize: vertical; min-height: 100px;
  transition: border 0.15s; box-sizing: border-box;
}
.nd-cmt-textarea:focus { border-color: var(--primary); }
.nd-cmt-char { font-size: 11px; color: var(--text-muted); text-align: right; margin-bottom: 8px; }
.nd-cmt-err { font-size: 13px; color: #ef4444; margin-bottom: 8px; }
.nd-cmt-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; border: none;
  padding: 9px 20px; border-radius: var(--radius); font-size: 13.5px;
  font-weight: 500; cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.nd-cmt-btn:hover { background: var(--primary-dark); }
.nd-cmt-btn:disabled { opacity: 0.6; cursor: default; }

/* ══ SIDEBAR ══ */
.nd-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }

.nd-sb-card {
  background: var(--bg-white); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.nd-sb-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 1rem; display: flex; align-items: center; gap: 7px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border-light);
}
.nd-sb-title i { font-size: 15px; color: var(--primary); }

/* Popular list */
.nd-pop-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0; border-bottom: 1px solid var(--border-light);
  text-decoration: none; color: inherit;
}
.nd-pop-item:last-child { border-bottom: none; padding-bottom: 0; }
.nd-pop-item:first-child { padding-top: 0; }
.nd-pop-thumb {
  width: 54px; height: 54px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #E6F1FB, #c8dff5);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.nd-pop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nd-pop-thumb i { font-size: 20px; opacity: 0.25; color: var(--primary); }
.nd-pop-title {
  font-size: 12.5px; font-weight: 500; color: var(--text-primary);
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nd-pop-item:hover .nd-pop-title { color: var(--primary); }
.nd-pop-views { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 3px; }


/* ══ RESPONSIVE ══ */
@media (max-width: 960px) {
  .nd-body { grid-template-columns: 1fr; }
  .nd-sidebar { position: static; }
  .nd-sk-body { grid-template-columns: 1fr; }
  .nd-sk-side { display: none; }
}
@media (max-width: 700px) {
  .nd-article-head { padding: 1.5rem 1rem 1.25rem; }
  .nd-body { padding: 1.5rem 1rem 3rem; gap: 1.5rem; }
  .nd-title { font-size: 22px; }
  .nd-skeleton-wrap { padding: 1.5rem 1rem 3rem; }
}
