/*---------------------------------
  Phase 3b: article page
  Title area, byline with share, figure, reading column, related,
  comments, latest. The ad rail (rightside.php) keeps its column.
-----------------------------------*/
.imv-article-page { padding: var(--space-2) 0 var(--space-7); }

/* The whole story sits in one white card that fills the column up to the ad rail */
.imv-article-card {
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 32, 28, .04), 0 10px 30px rgba(20, 32, 28, .06);
}

/* ---- Title area ---- */

.imv-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-3);
  font-size: 13px;
  color: var(--muted);
}
.imv-crumbs a { color: var(--muted); }
.imv-crumbs a:hover { color: var(--green-700); }
.imv-crumbs .imv-crumbs-cat {
  font-family: var(--secondaryFont);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green-700);
}
.imv-article-cat {
  display: inline-block;
  margin-bottom: var(--space-3);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--green-50);
  color: var(--green-800);
  font-family: var(--secondaryFont);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.imv-article-cat:hover { background: var(--green-700); color: #fff; }
.imv-article-title,
.news-details-wrap .imv-article-title {
  margin: 0 0 var(--space-3);
  font-family: var(--secondaryFont);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--ink);
}

/* ---- Byline ---- */
.imv-byline {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.imv-byline-avatar { flex: none; line-height: 0; }
.imv-byline-avatar img { width: 40px !important; height: 40px !important; max-width: none; margin: 0 !important; border-radius: 50%; display: block; }
.imv-byline-text { display: flex; flex-direction: column; gap: 0; min-width: 0; line-height: 1.35; }
.imv-byline-author {
  font-family: var(--secondaryFont);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink);
}
.imv-byline-meta { font-size: 13px; color: var(--muted); }
.imv-byline-meta span[aria-hidden] { margin: 0 4px; }
.imv-byline-share { margin-left: auto; }

/* ---- Share buttons ---- */
.imv-share { display: flex; flex-wrap: wrap; gap: 6px; }
.imv-share a,
.imv-share button {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
}
.imv-share svg { width: 16px; height: 16px; }
/* Brand colours always on; lift and deepen on hover */
.imv-share a, .imv-share button { border-color: transparent; color: #fff; }
.imv-share-whatsapp { background: #25D366 !important; }
.imv-share-facebook { background: #1877F2 !important; }
.imv-share-x        { background: #111111 !important; }
.imv-share-telegram { background: #229ED9 !important; }
.imv-share-linkedin { background: #0A66C2 !important; }
.imv-share-email    { background: #EA4335 !important; }
.imv-share-copy     { background: var(--green-700) !important; }
.imv-share a:hover, .imv-share button:hover {
  transform: translateY(-2px);
  color: #fff;
  filter: brightness(.9);
  box-shadow: 0 6px 14px rgba(20, 32, 28, .18);
}
.imv-share-copied {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.imv-share-copy.is-copied .imv-share-copied { opacity: 1; }

/* ---- Lead photo ---- */
.imv-article-figure { margin: var(--space-4) 0 var(--space-5); }
.imv-article-figure img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  border-radius: var(--radius);
}
.imv-article-figure figcaption {
  margin-top: var(--space-2);
  padding-left: var(--space-3);
  border-left: 3px solid var(--green-600);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---- Reading column ---- */
/* stylev2 floats .news-para; floated, a long unbroken line made the body wider than the screen */
.news-details-wrap .imv-article-body,
.imv-article-body { max-width: none; float: none; width: auto; overflow-wrap: break-word; }
.imv-article-body,
.imv-article-body p {
  font-family: var(--bodyFont);
  font-size: 18px;
  line-height: 1.75;
  color: #26312D;
}
.imv-article-body p { margin: 0 0 1.25em; }
.imv-article-body > p:first-of-type { font-size: 20px; line-height: 1.65; color: var(--ink); }
.imv-article-body h2, .imv-article-body h3, .imv-article-body h4 {
  margin: 1.6em 0 .6em;
  font-family: var(--secondaryFont);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.imv-article-body h2 { font-size: 26px; }
.imv-article-body h3 { font-size: 22px; }
.imv-article-body a { color: var(--green-700); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.imv-article-body a:hover { color: var(--green-800); text-decoration-thickness: 2px; }
.imv-article-body blockquote {
  margin: 1.8em 0;
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--green-600);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--green-50);
  font-family: var(--secondaryFont);
  font-size: 20px;
  font-style: normal;
  line-height: 1.55;
  color: var(--ink);
}
.imv-article-body blockquote p { margin: 0; font-size: inherit; color: inherit; }
.imv-article-body img,
.imv-article-body figure img,
.imv-article-body .wp-block-image img { max-width: 100%; height: auto; border-radius: var(--radius); }
.imv-article-body figure,
.imv-article-body .wp-caption { max-width: 100%; margin: 1.6em 0; }
.imv-article-body figcaption,
.imv-article-body .wp-caption-text,
.imv-article-body .wp-element-caption { margin-top: var(--space-2); font-size: 13px; font-style: normal; color: var(--muted); text-align: left; }
.imv-article-body ul, .imv-article-body ol { margin: 0 0 1.25em; padding-left: 1.4em; }
.imv-article-body li { margin-bottom: .4em; }
.imv-article-body iframe { max-width: 100%; border-radius: var(--radius); }

/* ---- End of article ---- */
.imv-article-foot { margin-top: var(--space-5); }
.imv-article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-5); }
.imv-article-tags a {
  padding: 5px 12px;
  border-radius: 999px;
  background: #F1F4F2;
  color: var(--text);
  font-size: 13px;
}
.imv-article-tags a:hover { background: var(--green-50); color: var(--green-800); }
.imv-share-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: 12px;
  background: var(--green-50);
}
.imv-share-box-label { font-family: var(--secondaryFont); font-size: 15px; font-weight: 700; color: var(--ink); }

/* ---- Related ---- */
.imv-related { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.imv-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.imv-related-card .news-card-img img { aspect-ratio: 16 / 10; }
.imv-related-card { margin: 0; }
.imv-related-card .news-card-img { display: block; position: relative; }
.imv-related-card .news-card-info h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 16px;
}
/* No photo (tenders, auctions): a bordered text card instead of a broken image */
.imv-related-card--text {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-top: 3px solid var(--green-700);
  border-radius: var(--radius);
  background: var(--green-50);
}
.imv-related-card--text .news-card-info { margin-top: var(--space-2); display: flex; flex-direction: column; flex: 1; }
.imv-related-card--text .news-card-info h3 { -webkit-line-clamp: 5; }
.imv-related-card--text .news-metainfo { margin-top: auto; }
.imv-related-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--secondaryFont);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green-700);
}

/* ---- Comments ---- */
.imv-comments { margin-top: var(--space-6); }
.imv-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--green-600);
  color: #fff;
  font-size: 12px;
  vertical-align: 2px;
}
.imv-comments-empty { color: var(--muted); font-size: 15px; }
/* Comment thread: avatar + name/date, text, reply link; hairlines between top-level comments, replies indented */
.imv-comments .comment-item-wrap { margin-top: var(--space-2); }
.imv-cmt { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.imv-cmt:first-child { padding-top: var(--space-2); }
.imv-cmt .imv-cmt { margin: 0 0 0 19px; padding: var(--space-3) 0 0 var(--space-4); border-bottom: 0; border-left: 2px solid var(--green-100); } /* padding, not margin, so the guide line runs unbroken */
.imv-cmt-row { display: flex; gap: 12px; align-items: flex-start; }
.imv-cmt-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green-800);
  font-family: var(--secondaryFont);
  font-size: 16px;
  font-weight: 700;
}
.imv-cmt .imv-cmt .imv-cmt-avatar { width: 32px; height: 32px; font-size: 14px; }
.imv-cmt-main { flex: 1; min-width: 0; }
.imv-cmt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.imv-cmt-name { font-family: var(--secondaryFont); font-size: 15px; font-weight: 700; color: var(--ink); }
.imv-cmt-date { font-size: 12px; color: var(--muted); }
.imv-cmt-edit a { font-size: 12px; color: var(--green-700); }
.imv-cmt-text { margin-top: 4px; overflow-wrap: anywhere; }
.imv-cmt-answers { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--green-700); }
.imv-cmt-answers:hover { color: var(--green-800); text-decoration: underline; }
.imv-cmt:target > .imv-cmt-row { animation: imv-flash 1.6s ease-out; border-radius: var(--radius); }
@keyframes imv-flash { from { background: var(--green-50); } to { background: transparent; } }
.imv-cmt-text p { margin: 0 0 var(--space-2); font-size: 15px; line-height: 1.65; color: var(--text); }
.imv-cmt-text p:last-child { margin-bottom: 0; }
.imv-cmt-reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0 -8px;
  padding: 4px 10px 4px 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--green-700);
  font-family: var(--secondaryFont);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s;
}
.imv-cmt-reply:hover, .imv-cmt-reply:focus-visible { background: var(--green-50); color: var(--green-800); }
.imv-replying {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-3);
  padding: 8px 8px 8px 12px;
  border-left: 3px solid var(--green-700);
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px;
  color: var(--ink);
}
.imv-replying[hidden] { display: none; }
.imv-comments-list.is-collapsed .comment-item-wrap > .imv-cmt:nth-child(n+6) { display: none; }
.imv-cmt-more {
  display: block;
  width: 100%;
  margin-top: var(--space-4);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--green-700);
  font-family: var(--secondaryFont);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.imv-cmt-more:hover { border-color: var(--green-700); background: var(--green-50); }
.imv-replying svg { flex: none; color: var(--green-700); }
.imv-replying span { flex: 1; min-width: 0; }
.imv-replying button { flex: none; padding: 4px 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.imv-replying button:hover { background: #F2F4F3; color: var(--ink); }

.imv-comment-form-card { scroll-margin-top: 100px; /* clear the pinned menu bar */ margin-top: var(--space-5); padding: var(--space-5); border-radius: 12px; background: #F6F8F7; }
.imv-comment-form-title { margin: 0 0 var(--space-1); font-family: var(--secondaryFont); font-size: 18px; font-weight: 700; color: var(--ink); }
.imv-comment-rules { margin: 0 0 var(--space-4); font-size: 12px; letter-spacing: .03em; color: var(--muted); }
.imv-comment-status:empty { display: none; }
.imv-comment-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: var(--space-4);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}
.imv-comment-status:before { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; content: ""; }
.imv-comment-status.is-wait:before { border: 2px solid var(--green-100); border-top-color: var(--green-700); animation: imv-spin .8s linear infinite; }
.imv-comment-status.is-ok { border-color: #A6DCC6; background: var(--green-50); color: var(--green-800); font-weight: 600; }
.imv-comment-status.is-ok:before { background: var(--green-700) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat; }
.imv-comment-status.is-error { border-color: #F4C7C0; background: #FEF3F2; color: #B42318; font-weight: 600; }
.imv-comment-status.is-error:before { background: #B42318 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' d='M12 7v6M12 17h.01'/%3E%3C/svg%3E") center / 12px no-repeat; }
@keyframes imv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .imv-comment-status.is-wait:before { animation: none; } }

/* Inline field errors (replace the old alert() pop-ups) */
.imv-comment-form-card .is-invalid { border-color: #B42318 !important; background: #FFFBFA !important; }
.imv-comment-form-card .is-invalid:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, .12) !important; }
.imv-field-error:empty { display: none; }
.imv-field-error { margin: calc(var(--space-3) * -1 + 6px) 0 var(--space-3); font-size: 13px; font-weight: 500; color: #B42318; }
.imv-field-error:before { content: "! "; font-weight: 700; }
.imv-comment-form-card input[type="text"],
.imv-comment-form-card input[type="email"],
.imv-comment-form-card textarea {
  width: 100%;
  margin-bottom: var(--space-3);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 15px;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.imv-comment-form-card input:focus,
.imv-comment-form-card textarea:focus { outline: 0; border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(21, 171, 123, .12); }
.imv-comment-form-card textarea { min-height: 140px; resize: vertical; }
.imv-comment-form-card .imv-comment-send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--green-700);
  color: #fff;
  font-family: var(--secondaryFont);
  font-size: 14px;
  font-weight: 700;
}
.imv-comment-form-card .imv-comment-send:before,
.imv-comment-form-card .imv-comment-send:after { display: none; } /* old two-tone hover fill */
.imv-comment-form-card .imv-comment-send:disabled { background: var(--green-700); opacity: .55; cursor: default; }
.imv-comment-form-card input:disabled,
.imv-comment-form-card textarea:disabled { color: var(--muted); cursor: default; }
.imv-comment-form-card .imv-comment-send:hover { background: var(--green-800); }
.imv-comment-form-card .imv-comment-send i { position: static; font-size: 14px; }

/* ---- Latest ---- */
.imv-latest { margin-top: var(--space-6); }
.imv-latest-list { margin: 0; padding: 0; list-style: none; counter-reset: latest; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-6); }
.imv-latest-list li { counter-increment: latest; border-bottom: 1px solid var(--line); }
.imv-latest-list a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; }
.imv-latest-list a:before {
  content: counter(latest);
  flex: none;
  width: 24px;
  font-family: var(--secondaryFont);
  font-size: 24px;
  font-weight: 800;
  color: var(--green-600);
}
.imv-latest-thumb { flex: none; }
.imv-latest-thumb img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; display: block; }
.imv-latest-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imv-latest-title { font-family: var(--secondaryFont); font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.imv-latest-list a:hover .imv-latest-title { color: var(--green-700); }
.imv-latest-time { font-size: 12px; color: var(--muted); }


/* ---- Tablet ---- */
@media (max-width: 991px) {
  .imv-article-card { padding: var(--space-5) var(--space-4); }
  .imv-byline { flex-wrap: wrap; }
  .imv-byline-share { margin-left: 0; width: 100%; }
  .imv-related-grid { grid-template-columns: 1fr 1fr; }
  .imv-latest-list { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .imv-article-body, .imv-article-body p { font-size: 17px; }
  .imv-related-grid { grid-template-columns: 1fr; }
}

/* ---- Dark mode ---- */
.theme-dark .imv-article-title, .theme-dark .imv-byline-author, .theme-dark .imv-article-body,
.theme-dark .imv-article-body p, .theme-dark .imv-latest-title, .theme-dark .imv-share-box-label { color: #fff; }

.theme-dark .imv-share-box, .theme-dark .imv-comment-form-card { background: rgba(255, 255, 255, .05); }
.theme-dark .imv-article-card { background: #16201D; border-color: rgba(255, 255, 255, .1); }


/* ===== Reading polish: stronger headline, reading progress ===== */
/* Headline, text and photo all share the card's full width, starting on the same left edge */
.imv-article-card .imv-article-body, .imv-article-card .imv-article-foot { max-width: none; margin-left: 0; margin-right: 0; }
.imv-article-title { font-size: 42px !important; line-height: 1.16 !important; font-weight: 800 !important; letter-spacing: -.02em; }
.imv-article-body > p:first-of-type { font-size: 21px; line-height: 1.6; }
.imv-article-figure { margin-bottom: var(--space-6); }

.imv-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1100; pointer-events: none; }
.imv-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-600), var(--green-800)); transform: scaleX(0); transform-origin: 0 50%; }

@media (max-width: 767px) { .imv-article-title { font-size: 30px !important; } }
.imv-byline-author { text-transform: none; font-size: 15px; letter-spacing: 0; }   /* names in normal case */
.imv-byline-initial {
  width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-600), var(--green-800)); color: #fff; font: 700 16px/1 var(--secondaryFont);
}
/* Head rhythm: breadcrumb › headline › byline › photo, evenly spaced */
.imv-article-card .imv-crumbs { margin-bottom: 14px; }
.imv-article-card .imv-article-title { margin: 0 0 24px !important; }
.imv-article-card .imv-byline { padding: 14px 0; }
.imv-article-card .imv-article-head { margin-bottom: 28px; }
.imv-article-card .imv-article-figure { margin-top: 0; }

/* Byline: "written by" label, name, then date / time ago / reading time with icons */
.imv-byline-text { display: flex; flex-direction: column; gap: 2px; }
.imv-byline-by { font: 700 10.5px/1.2 var(--secondaryFont); letter-spacing: .12em; text-transform: uppercase; color: var(--green-700); }
.imv-byline-author { font: 700 16px/1.3 var(--secondaryFont) !important; color: var(--ink); }
.imv-byline-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.imv-meta-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.imv-meta-item svg { color: var(--green-600); flex: 0 0 auto; }
.imv-byline-initial { width: 48px; height: 48px; flex-basis: 48px; font-size: 19px; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }
