/* ============================================================
   NEWS DETAIL — article layout, VERDE WIRE skin
   Depends on design tokens / base components defined in
   assets/css/styles.css (import it BEFORE this file).
   ============================================================ */

/* ---- Breadcrumb ---- */
.nd-crumb { padding: var(--s-4) 0; font-size: var(--fs-sm); color: var(--ink-500); border-bottom: 1px solid var(--line); }
.nd-crumb a { color: var(--ink-600); }
.nd-crumb a:hover { color: var(--brand-strong); }
.nd-crumb .sep { margin: 0 0.55rem; color: var(--ink-300); }
.nd-crumb [aria-current] { color: var(--ink-800); font-weight: 600; }

/* ---- Hero ---- */
.nd-hero { padding-block: var(--s-5) var(--s-2); max-width: 820px; }
.nd-tag { display: inline-block; font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-strong); background: var(--brand-soft); padding: 0.3rem 0.7rem; border-radius: var(--r-pill); font-weight: 600; }
.nd-title { margin: var(--s-4) 0 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.16; color: var(--ink-900); }
.nd-excerpt { margin-top: var(--s-4); font-size: var(--fs-lg); color: var(--ink-600); line-height: 1.6; }

/* ---- Meta row ---- */
.nd-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-5); padding-bottom: var(--s-5); border-bottom: 1px solid var(--line); }
.nd-author { display: flex; align-items: center; gap: var(--s-3); }
.nd-author__ava { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(145deg, var(--red-500), var(--red-700)); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; flex: none; }
.nd-author__name { font-weight: 700; color: var(--ink-900); font-size: var(--fs-sm); }
.nd-author__role { font-size: var(--fs-xs); color: var(--ink-500); }
.nd-metaitem { display: flex; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); color: var(--ink-500); }
.nd-metaitem svg { width: 16px; height: 16px; color: var(--brand); }
.nd-metaitem .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); margin: 0 0.2rem; }
.nd-share { margin-left: auto; display: flex; gap: 0.5rem; }
.nd-share button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-600); display: grid; place-items: center; transition: .2s; }
.nd-share button:hover { border-color: var(--brand); color: var(--brand-strong); }
.nd-share svg { width: 17px; height: 17px; }

/* ---- Layout ---- */
.nd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(2rem, 5vw, 4rem); align-items: start; padding-block: var(--s-6) var(--s-8); }
.nd-content { min-width: 0; }

/* ---- Image placeholder ---- */
.nd-img { width: 100%; height: 100%; display: grid; place-items: center; gap: 0.5rem; padding: 1rem; text-align: center; background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); color: var(--ink-400); }
.nd-img svg { width: 26%; max-width: 96px; height: auto; color: var(--brand); opacity: 0.55; }
.nd-img span { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase; }

/* ---- Figure (main + inline) ---- */
.nd-figure { margin: var(--s-6) 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.nd-figure .nd-img { aspect-ratio: 16 / 9; }
.nd-figure figcaption { padding: var(--s-3) var(--s-4); font-size: var(--fs-xs); color: var(--ink-500); border-top: 1px solid var(--line); background: var(--surface); }
.nd-inline { margin: var(--s-5) 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.nd-inline .nd-img { aspect-ratio: 4 / 3; }

/* ---- Article typography ---- */
.nd-content p { color: var(--ink-700); line-height: 1.85; font-size: var(--fs-base); margin: 0 0 var(--s-4); }
.nd-content h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xl); color: var(--ink-900); margin: var(--s-7) 0 var(--s-3); }
.nd-content h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lg); color: var(--ink-900); margin: var(--s-6) 0 var(--s-2); }
.nd-content a { color: var(--brand-strong); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--brand-soft); }
.nd-content a:hover { border-bottom-color: var(--brand); }
.nd-content blockquote { margin: var(--s-5) 0; padding: var(--s-4) var(--s-5); border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--ink-800); font-size: var(--fs-md); line-height: 1.7; font-style: italic; }
.nd-content blockquote cite { display: block; margin-top: var(--s-3); font-size: var(--fs-sm); font-style: normal; color: var(--ink-500); }
.nd-content ul, .nd-content ol { margin: 0 0 var(--s-4); padding-inline-start: 1.3rem; color: var(--ink-700); line-height: 1.8; }
.nd-content li { margin-bottom: 0.5rem; }
.nd-content li::marker { color: var(--brand); }

/* ---- Aside ---- */
.nd-aside { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: var(--s-5); }
.nd-widget { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); background: var(--surface); box-shadow: var(--shadow-1); }
.nd-widget__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); color: var(--ink-900); margin: 0 0 var(--s-4); display: flex; align-items: center; gap: 0.5rem; }
.nd-widget__title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--brand); display: inline-block; }

/* Author card */
.nd-authorcard__top { display: flex; align-items: center; gap: var(--s-3); }
.nd-authorcard__ava { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(145deg, var(--red-500), var(--red-700)); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; flex: none; }
.nd-authorcard__name { font-family: var(--font-display); font-weight: 700; color: var(--ink-900); font-size: var(--fs-base); }
.nd-authorcard__role { font-size: var(--fs-xs); color: var(--ink-500); margin-top: 2px; }
.nd-authorcard__bio { margin: var(--s-4) 0 0; font-size: var(--fs-sm); color: var(--ink-600); line-height: 1.7; }
.nd-authorcard__social { display: flex; gap: 0.5rem; margin-top: var(--s-4); }
.nd-authorcard__social a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--ink-600); transition: .2s; }
.nd-authorcard__social a:hover { border-color: var(--brand); color: var(--brand-strong); }
.nd-authorcard__social svg { width: 16px; height: 16px; }

/* Related list */
.nd-rellist { display: grid; gap: var(--s-4); }
.nd-relitem { display: flex; gap: var(--s-3); align-items: flex-start; }
.nd-relitem__thumb { width: 76px; height: 56px; flex: none; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.nd-relitem__thumb .nd-img { aspect-ratio: auto; padding: 0.4rem; }
.nd-relitem__title { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-800); line-height: 1.45; text-decoration: none; }
.nd-relitem__title:hover { color: var(--brand-strong); }
.nd-relitem__date { font-size: var(--fs-xs); color: var(--ink-400); font-family: var(--font-mono); margin-top: 3px; }

/* Tags */
.nd-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.nd-tagchip { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-600); background: var(--surface-2); border: 1px solid var(--line); padding: 0.35rem 0.7rem; border-radius: var(--r-pill); text-decoration: none; transition: .2s; }
.nd-tagchip:hover { border-color: var(--brand); color: var(--brand-strong); }

/* ---- Related news section ---- */
.nd-section { border-top: 1px solid var(--line); padding-block: var(--s-7); }
.nd-section > .wrap > h2 { font-size: var(--fs-xl); margin-bottom: var(--s-5); }
.nd-news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
.nd-newscard { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); transition: box-shadow var(--ease) 0.25s, transform var(--ease) 0.25s; }
.nd-newscard:hover { box-shadow: var(--shadow-2); transform: translateY(-3px); }
.nd-newscard__img { aspect-ratio: 16 / 9; border-bottom: 1px solid var(--line); }
.nd-newscard__body { padding: var(--s-4) var(--s-5) var(--s-5); }
.nd-newscard__cat { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-strong); }
.nd-newscard__title { margin: var(--s-2) 0 var(--s-3); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); color: var(--ink-900); line-height: 1.35; }
.nd-newscard__meta { font-size: var(--fs-xs); color: var(--ink-400); font-family: var(--font-mono); }

/* ---- Toast (share feedback) ---- */
.nd-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink-900); color: #fff; padding: 0.7rem 1.2rem; border-radius: var(--r-pill); font-size: var(--fs-sm); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 60; }
.nd-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 1023px) {
  .nd-layout { grid-template-columns: 1fr; }
  .nd-aside { position: static; grid-template-columns: 1fr 1fr; }
  .nd-aside .nd-widget:last-child { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .nd-news-grid { grid-template-columns: 1fr; }
  .nd-aside { grid-template-columns: 1fr; }
  .nd-share { margin-left: 0; width: 100%; justify-content: flex-start; }
  .nd-meta { gap: var(--s-3); }
}

/* ============================================================
   VERDE additions — real images, states, RTL
   ============================================================ */
.nd-figure img,
.nd-inline img { display:block; width:100%; height:100%; object-fit:cover; }
.nd-figure .nd-imgwrap { aspect-ratio:16/9; overflow:hidden; }
.nd-newscard__img img { display:block; width:100%; height:100%; object-fit:cover; }
.nd-relitem__thumb img { display:block; width:100%; height:100%; object-fit:cover; }
.nd-relitem { text-decoration:none; }
.nd-newscard a { text-decoration:none; color:inherit; display:block; }

/* Article body coming from CMS may contain raw <img> / tables */
.nd-content img { max-width:100%; height:auto; border-radius:var(--r-md); margin:var(--s-4) 0; }
.nd-content table { width:100%; border-collapse:collapse; margin:var(--s-5) 0; font-size:var(--fs-sm); }
.nd-content th, .nd-content td { border:1px solid var(--line); padding:.6rem .8rem; text-align:start; }
.nd-content th { background:var(--surface-2); font-weight:700; color:var(--ink-900); }
.nd-content pre { overflow-x:auto; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-md); padding:var(--s-4); font-family:var(--font-mono); font-size:var(--fs-sm); }
.nd-content > *:first-child { margin-top:0; }

/* Loading / empty states */
.nd-skeleton { background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 37%,var(--surface-2) 63%); background-size:400% 100%; animation:ndShimmer 1.3s ease infinite; border-radius:var(--r-md); }
@keyframes ndShimmer { 0%{background-position:100% 50%} 100%{background-position:0 50%} }
.nd-empty { padding:var(--s-8) 0; text-align:center; color:var(--ink-500); }
.nd-empty h2 { font-family:var(--font-display); color:var(--ink-900); margin-bottom:var(--s-3); }

/* RTL */
[dir="rtl"] .nd-share { margin-left:0; margin-right:auto; }
[dir="rtl"] .nd-content blockquote { border-left:0; border-right:4px solid var(--brand); border-radius:var(--r-md) 0 0 var(--r-md); }
[dir="rtl"] .nd-widget__title::before { order:2; }
