/**
 * @file article.css
 * Full node page: header, meta, body, taxonomy box, stats bar, comments.
 */

/* ── Node article ─────────────────────────────────────────────────────────── */
.node--view-mode-full {
  max-width: 820px;
}

/* ── Node header ──────────────────────────────────────────────────────────── */
.node--view-mode-full .node__header {
  margin-bottom: var(--mp-space-6);
  padding-bottom: var(--mp-space-4);
  border-bottom: 1px solid var(--mp-border);
}

.node--view-mode-full .node__title {
  font-size: var(--mp-text-3xl);
  font-weight: 700;
  color: var(--mp-secondary);
  line-height: var(--mp-leading-tight);
  margin-bottom: var(--mp-space-4);
}

/* ── Node meta row (author · date · type) ─────────────────────────────────── */
.node__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mp-space-2) var(--mp-space-3);
  font-size: var(--mp-text-sm);
  color: var(--mp-text-muted);
}

.node__author-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--mp-space-1);
}

.mp-icon-user,
.mp-icon-cal {
  flex-shrink: 0;
  color: var(--mp-text-muted);
}

/* Author link — active, styled */
.node__author-link {
  color: var(--mp-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--mp-transition-fast);
}

.node__author-link:hover {
  color: var(--mp-primary-hover);
  text-decoration: underline;
}

.node__author-name {
  color: var(--mp-text-secondary);
  font-weight: 600;
}

.node__meta-sep {
  color: var(--mp-border);
  font-weight: 300;
}

.node__date {
  display: inline-flex;
  align-items: center;
  gap: var(--mp-space-1);
}

/* Content type badge */
.mp-type-badge {
  display: inline-block;
  padding: 2px var(--mp-space-3);
  background: var(--mp-primary-50);
  color: var(--mp-primary);
  border: 1px solid var(--mp-primary-100);
  border-radius: var(--mp-radius-full);
  font-size: var(--mp-text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ── Node body ────────────────────────────────────────────────────────────── */
.mp-node-full {
  font-size: var(--mp-text-lg);
  line-height: var(--mp-leading-relaxed);
  color: var(--mp-text);
  margin-bottom: var(--mp-space-8);
}

.mp-node-full p {
  margin-bottom: var(--mp-space-5);
}

/* ── Taxonomy box ─────────────────────────────────────────────────────────── */
.mp-node-taxonomy {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--mp-space-3);
  padding: var(--mp-space-4) var(--mp-space-5);
  background: var(--mp-bg-alt);
  border: 1px solid var(--mp-border);
  border-left: 3px solid var(--mp-primary);
  border-radius: var(--mp-radius-lg);
  margin-bottom: var(--mp-space-6);
}

.mp-taxonomy-label {
  display: inline-flex;
  align-items: center;
  gap: var(--mp-space-1);
  font-size: var(--mp-text-sm);
  font-weight: 700;
  color: var(--mp-secondary);
  white-space: nowrap;
  padding-top: 2px;
}

.mp-taxonomy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mp-space-2);
  flex: 1;
}

/* Individual taxonomy field (each can have multiple terms) */
.mp-taxonomy-field {
  display: contents; /* let inner items flow naturally */
}

/* Drupal renders taxonomy term links inside .field--type-entity-reference */
.mp-node-taxonomy .field--type-entity-reference .field__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mp-space-2);
}

.mp-node-taxonomy .field--type-entity-reference .field__item a,
.mp-node-taxonomy .field--type-entity-reference .field__item {
  display: inline-block;
  padding: 3px var(--mp-space-3);
  background: var(--mp-bg-card);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-full);
  font-size: var(--mp-text-xs);
  font-weight: 600;
  color: var(--mp-secondary);
  text-decoration: none;
  transition: background var(--mp-transition-fast), border-color var(--mp-transition-fast), color var(--mp-transition-fast);
}

.mp-node-taxonomy .field--type-entity-reference .field__item a:hover {
  background: var(--mp-primary-50);
  border-color: var(--mp-primary);
  color: var(--mp-primary);
}

/* ── Node divider ─────────────────────────────────────────────────────────── */
.mp-node-divider {
  border: none;
  border-top: 1px solid var(--mp-border);
  margin: var(--mp-space-6) 0;
}

/* ── Stats bar ────────────────────────────────────────────────────────────── */
.mp-node-stats {
  display: flex;
  align-items: stretch;
  gap: var(--mp-space-3);
  flex-wrap: wrap;
  margin-bottom: var(--mp-space-8);
  padding: var(--mp-space-4) var(--mp-space-5);
  background: var(--mp-bg-alt);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-xl);
}

/* Each stat is a self-contained card tile */
.mp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--mp-space-1);
  padding: var(--mp-space-3) var(--mp-space-6);
  background: var(--mp-bg-card);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  min-width: 90px;
  text-decoration: none;
  transition: border-color var(--mp-transition-fast),
              box-shadow var(--mp-transition-fast),
              background var(--mp-transition-fast);
  position: relative;
}

/* Icon row */
.mp-stat svg {
  color: var(--mp-text-muted);
  flex-shrink: 0;
  transition: color var(--mp-transition-fast);
}

/* Big number */
.mp-stat > span:not(.mp-stat-label) {
  font-size: var(--mp-text-2xl);
  font-weight: 700;
  color: var(--mp-secondary);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Label below number */
.mp-stat-label {
  font-size: var(--mp-text-xs);
  font-weight: 600;
  color: var(--mp-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Hover state */
a.mp-stat:hover,
.mp-stat:hover {
  border-color: var(--mp-primary);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.12);
  background: var(--mp-primary-50);
}

a.mp-stat:hover svg,
.mp-stat:hover svg {
  color: var(--mp-primary);
}

a.mp-stat:hover > span:not(.mp-stat-label) {
  color: var(--mp-primary);
}

/* Comment stat — accent strip on top */
.mp-stat--comments::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--mp-primary);
  border-radius: var(--mp-radius-lg) var(--mp-radius-lg) 0 0;
}

/* Views stat — accent strip */
.mp-stat--views::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--mp-accent);
  border-radius: var(--mp-radius-lg) var(--mp-radius-lg) 0 0;
}

/* Bookmark stat — normalise Flag module output */
.mp-stat--bookmark {
  cursor: default;
}

.mp-stat--bookmark .flag-action,
.mp-stat--bookmark a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mp-space-1);
  color: inherit;
  text-decoration: none;
  font-size: inherit;
  width: 100%;
}

.mp-stat--bookmark .flag-action .flag-throbber { display: none; }

.mp-stat--bookmark::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--mp-secondary);
  border-radius: var(--mp-radius-lg) var(--mp-radius-lg) 0 0;
}

.mp-stat--bookmark:hover {
  border-color: var(--mp-secondary);
  box-shadow: 0 4px 12px rgba(92, 51, 23, 0.12);
  background: var(--mp-bg-alt);
}

/* Bookmark label text — override Flag module default */
.mp-stat--bookmark .flag-action,
.mp-stat--bookmark a {
  font-size: var(--mp-text-xs);
  font-weight: 600;
  color: var(--mp-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Bookmark icon (before text) */
.mp-stat--bookmark svg {
  width: 22px;
  height: 22px;
  color: var(--mp-text-muted);
}

/* Make the bookmark number-like part big */
.mp-stat--bookmark .flag-action::before {
  content: '🔖';
  font-size: var(--mp-text-2xl);
  line-height: 1;
  display: block;
  margin-bottom: 2px;
}

/* ── Comments section ─────────────────────────────────────────────────────── */
.mp-comments-section {
  margin-top: var(--mp-space-10);
  padding-top: var(--mp-space-8);
  border-top: 2px solid var(--mp-secondary);
}

.mp-comments {
  /* field--comment wrapper */
}

.mp-comments-heading {
  display: flex;
  align-items: center;
  gap: var(--mp-space-3);
  font-size: var(--mp-text-xl);
  font-weight: 700;
  color: var(--mp-secondary);
  margin-bottom: var(--mp-space-6);
}

.mp-comment-list {
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-4);
}

/* ── Single comment card ──────────────────────────────────────────────────── */
.mp-comment-card {
  background: var(--mp-bg-card);
  border: 2px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  padding: var(--mp-space-4) var(--mp-space-5);
  transition: border-color var(--mp-transition-fast), box-shadow var(--mp-transition-fast);
}

.mp-comment-card:hover {
  border-color: #c8b09a;
  box-shadow: var(--mp-shadow-sm);
}

/* Highlight new comments */
.mp-comment-card.new {
  border-color: var(--mp-primary);
  border-left-width: 4px;
  background: var(--mp-primary-50);
}

/* ── Comment header ───────────────────────────────────────────────────────── */
.mp-comment-header {
  margin-bottom: var(--mp-space-3);
}

.mp-comment-author-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--mp-space-1) var(--mp-space-2);
}

.mp-comment-author a,
.mp-comment-author {
  font-weight: 700;
  color: var(--mp-primary);
  text-decoration: none;
  font-size: var(--mp-text-sm);
}

.mp-comment-author a:hover {
  color: var(--mp-primary-hover);
  text-decoration: underline;
}

.mp-comment-sep {
  color: var(--mp-border);
}

.mp-comment-date {
  font-size: var(--mp-text-xs);
  color: var(--mp-text-muted);
}

/* ── "नवीन" badge ─────────────────────────────────────────────────────────── */
/* Hidden by default; shown by Drupal JS when comment is new */
.mp-comment-new-badge {
  display: none;
}

.mp-comment-card.new .mp-comment-new-badge {
  display: inline-block;
  padding: 1px 8px;
  background: var(--mp-primary);
  color: var(--mp-white);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--mp-radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Also style the <mark> element that Drupal JS reveals */
mark[data-comment-timestamp]:not(.hidden) {
  display: inline-block;
  padding: 1px 8px;
  background: var(--mp-primary);
  color: var(--mp-white);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--mp-radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  font-style: normal;
}

/* ── Comment body ─────────────────────────────────────────────────────────── */
.mp-comment-body {
  font-size: var(--mp-text-base);
  line-height: var(--mp-leading-normal);
  color: var(--mp-text);
}

.mp-comment-body p { margin-bottom: var(--mp-space-3); }
.mp-comment-body p:last-child { margin-bottom: 0; }

.mp-comment-title {
  font-size: var(--mp-text-base);
  font-weight: 700;
  color: var(--mp-secondary);
  margin-bottom: var(--mp-space-2);
}

/* ── Comment divider + footer links ──────────────────────────────────────── */
.mp-comment-divider {
  border: none;
  border-top: 1px solid var(--mp-border);
  margin: var(--mp-space-3) 0 var(--mp-space-3);
}

.mp-comment-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--mp-space-1) var(--mp-space-4);
  font-size: var(--mp-text-sm);
}

/* Drupal comment links — reply, edit, delete */
.mp-comment-footer .links,
.mp-comment-footer ul.links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mp-space-1) var(--mp-space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.mp-comment-footer .links li a,
.mp-comment-footer a {
  color: var(--mp-text-muted);
  text-decoration: none;
  font-size: var(--mp-text-sm);
  font-weight: 500;
  transition: color var(--mp-transition-fast);
}

.mp-comment-footer .links li a:hover,
.mp-comment-footer a:hover {
  color: var(--mp-primary);
}

/* Permalink in footer */
.mp-comment-footer .permalink {
  color: var(--mp-text-muted);
  font-size: var(--mp-text-xs);
  text-decoration: none;
  margin-left: auto;
}

.mp-comment-footer .permalink:hover {
  color: var(--mp-primary);
}

/* ── Nested comments (threaded) ──────────────────────────────────────────── */
.indented {
  margin-left: var(--mp-space-8);
  padding-left: var(--mp-space-4);
  border-left: 2px solid var(--mp-border);
  margin-top: var(--mp-space-3);
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-3);
}

/* Deeper nesting gets lighter border */
.indented .indented {
  border-left-color: var(--mp-border-light);
  margin-left: var(--mp-space-6);
}

.indented .indented .indented {
  border-left-color: transparent;
  margin-left: var(--mp-space-4);
}

/* ── New comment form ─────────────────────────────────────────────────────── */
.mp-comment-form-wrap {
  margin-top: var(--mp-space-10);
  padding: var(--mp-space-6);
  background: var(--mp-bg-alt);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-xl);
}

.mp-comment-form-heading {
  display: flex;
  align-items: center;
  gap: var(--mp-space-3);
  font-size: var(--mp-text-lg);
  font-weight: 700;
  color: var(--mp-secondary);
  margin-bottom: var(--mp-space-5);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .node--view-mode-full .node__title {
    font-size: var(--mp-text-2xl);
  }

  .mp-node-taxonomy {
    flex-direction: column;
    gap: var(--mp-space-2);
  }

  .indented {
    margin-left: var(--mp-space-4);
    padding-left: var(--mp-space-3);
  }

  .mp-comment-form-wrap {
    padding: var(--mp-space-4);
  }
}
