/* ============================================================
   Sastena — News & Insights ARTICLE pages (v3)
   Faithful Fairatmos blog-post layout, Sastena green/dark theme.
   Flow: cream page -> title block -> branded-cover hero -> prose
         -> 3-card CTA -> "Article Recommendations" grid -> footer.
   Prefix: .article-*   (shared tokens/utilities come from styles.css;
   .n-* recommendation cards reuse news.css)
   ============================================================ */

/* ---------- Light-section tokens (so reused .n-* cards work) ---------- */
[data-article-page] {
  /* mirror news.css:12-18 so .n-card / .n-tag / .n-readmore render identically */
  --n-heading: #14241a;
  --n-body: #43564c;
  --n-muted: #6b7d73;
  --n-btn: #2f5740;          /* dark forest-green CTA (Fairatmos-style, on light bg) */
  --n-btn-2: #3a6b50;        /* hover */
  --n-chip-border: rgba(20, 36, 26, 0.22);
  --n-card-shadow: 0 18px 44px rgba(18, 38, 24, 0.10);

  /* article-specific */
  --art-bg: #f4efe3;         /* warm cream page background */
  --art-text: #2b3a31;       /* body prose text (dark slate-green) */
  --art-rule: rgba(20, 36, 26, 0.14);
  --art-recs-bg: #efe8d9;    /* subtle band under recommendations */
}

/* ---------- Page shell ---------- */
/* base body styles in styles.css are scoped to `.s-home`, so set them here */
body[data-article-page] {
  font-family: var(--font);
  background: var(--art-bg);
  color: var(--art-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.article-main {
  padding-top: clamp(120px, 13vh, 156px);   /* clear the fixed floating navbar */
  padding-bottom: 0;
}

/* Solid green nav pill over the cream article background (matches Fairatmos;
   the default 45%-opacity shell would leave white nav text low-contrast on cream) */
body[data-article-page] .s-nav-shell {
  background: rgba(13, 23, 16, 0.9);
  border-color: rgba(255, 255, 255, 0.16);
}

/* Active "News & Insights" item inside the Explore nav dropdown */
.s-pop-item.is-current .s-pop-title { color: var(--leaf); }

/* ============================================================
   1. ARTICLE HEAD  (title, tags, author + date, share)
   ============================================================ */
.article-head { padding-bottom: 30px; }

.article-title {
  font-size: clamp(2.05rem, 4.4vw, 3.35rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.022em;
  color: var(--n-heading);
  max-width: 24ch;
  margin: 0 0 26px;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}
/* reuses .n-tag from news.css */

.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}
.article-avatar {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #2f5740;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.article-avatar img { width: 26px; height: auto; display: block; }
.article-meta-text { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.article-meta-author {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--n-heading);
}
.article-meta-date {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--n-muted);
}

.article-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-btn);
  background: var(--n-btn);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.18s ease, transform 0.18s ease;
}
.article-share-btn:hover { background: var(--n-btn-2); transform: translateY(-2px); }
.article-share-btn svg { width: 18px; height: 18px; }

/* ============================================================
   2. BRANDED-COVER HERO  (photo + green title overlay + logo)
   ============================================================ */
.article-hero-cover {
  position: relative;
  margin: 8px 0 50px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(10, 28, 18, 0.22);
}
/* direct child only — must NOT match the logo <img> nested in the overlay */
.article-hero-cover > img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.article-hero-cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;   /* anchor title + logo to the bottom, like Fairatmos */
  text-align: center;
  padding: 30px 30px clamp(34px, 6vh, 60px);
  background: linear-gradient(180deg, rgba(8, 20, 14, 0.22) 0%, rgba(8, 20, 14, 0.42) 48%, rgba(8, 20, 14, 0.72) 100%);
}
.article-hero-cover-title {
  margin: 0;
  max-width: 20ch;
  color: var(--leaf-2);
  font-size: clamp(1.5rem, 3.2vw, 2.7rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.55);
}
.article-hero-cover-logo {
  height: clamp(22px, 2.4vw, 30px);
  width: auto;
  margin-top: clamp(18px, 2.4vw, 28px);
  opacity: 0.95;
}

/* ============================================================
   3. ARTICLE BODY  (prose)
   ============================================================ */
.article-body {
  font-size: clamp(1rem, 1.04vw, 1.12rem);
  line-height: 1.78;
  color: var(--art-text);
  max-width: 1080px;          /* keep line length readable within the wide container */
}
.article-body > :first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.3em; }
.article-body a { color: var(--n-btn); text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover { color: var(--leaf-dark); }
.article-body strong { font-weight: 700; color: var(--n-heading); }

.article-lede {
  font-size: clamp(1.12rem, 1.35vw, 1.3rem);
  line-height: 1.66;
  font-weight: 500;
  color: var(--n-heading);
  margin-bottom: 1.4em !important;
}

.article-body h2 {
  font-size: clamp(1.45rem, 2.1vw, 1.95rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.012em;
  color: var(--n-heading);
  margin: 2.3em 0 0.7em;
}
.article-body h3 {
  font-size: clamp(1.12rem, 1.45vw, 1.32rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--n-heading);
  margin: 1.7em 0 0.45em;
}

.article-body ul,
.article-body ol { margin: 0 0 1.3em; padding-left: 1.35em; }
.article-body li { margin-bottom: 0.7em; line-height: 1.7; }
.article-body li::marker { color: var(--leaf-dark); }

.article-body hr {
  border: 0;
  border-top: 1px solid var(--art-rule);
  margin: 2.6em 0;
}

/* figures */
.article-figure { margin: 2.1em 0; }
.article-figure img {
  display: block;
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(10, 28, 18, 0.12);
}
.article-figure-sm { max-width: 640px; margin-left: auto; margin-right: auto; }
.article-figcaption {
  margin-top: 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--n-muted);
}

/* fact box (Berjaya) */
.article-factbox {
  margin: 1.8em 0;
  padding: 22px 26px;
  border-radius: 14px;
  border: 1px solid rgba(93, 204, 93, 0.22);
  border-left: 4px solid var(--leaf);
  background: rgba(93, 204, 93, 0.07);
}
.article-factbox-loc {
  margin: 0 0 12px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--n-heading);
}
.article-factbox dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
}
.article-factbox dt {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--n-muted);
  align-self: center;
}
.article-factbox dd { margin: 0; font-weight: 600; color: var(--n-heading); }

/* gallery (Berjaya) */
.article-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 2.2em 0 0.4em;
}
.article-gallery figure { margin: 0; }
.article-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(10, 28, 18, 0.12);
}

/* ============================================================
   4. CTA BLOCK  (Fairatmos 3-card layout, Sastena green buttons)
   ============================================================ */
.article-cta-section { padding: 50px 0 8px; }
.article-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}
.article-cta-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 46px 40px;
  min-height: 196px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  background-color: #123029;
  background-image:
    linear-gradient(180deg, rgba(8, 26, 21, 0.74), rgba(8, 26, 21, 0.8)),
    var(--cta-img, none);
  background-size: cover;
  background-position: center;
}
.article-cta-card h3 {
  margin: 0;
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.2rem, 1.6vw, 1.5rem);
  line-height: 1.25;
}
.article-cta-card p {
  margin: 0;
  max-width: 48ch;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.97rem;
  line-height: 1.55;
}
.article-cta-card .s-btn { margin-top: 6px; }
.article-cta-card-wide { min-height: 168px; }

/* ============================================================
   5. ARTICLE RECOMMENDATIONS  (reuses .n-grid / .n-card)
   ============================================================ */
.article-recs {
  margin-top: 50px;
  padding: 46px 0 72px;
  background: var(--art-recs-bg);
}
.article-recs-title {
  margin: 0 0 30px;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #46564c;
}
/* 2 sibling cards sit left-aligned in the shared 3-col grid */

/* ============================================================
   6. SHARE MODAL  (matches screenshot 9)
   ============================================================ */
.article-share-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 30, 24, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.article-share-modal[hidden] { display: none; }
.article-share-modal.is-open { opacity: 1; }

.article-share-dialog {
  position: relative;
  width: min(100%, 440px);
  background: #fff;
  border-radius: 14px;
  padding: 34px 36px 36px;
  box-shadow: 0 40px 90px rgba(6, 16, 11, 0.4);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;
  outline: none;
}
.article-share-modal.is-open .article-share-dialog { transform: none; }

.article-share-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #5a6b61;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.16s ease, color 0.16s ease;
}
.article-share-x:hover { background: #f0ece2; color: #14241a; }
.article-share-x svg { width: 18px; height: 18px; }

.article-share-title {
  margin: 0 0 18px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #14241a;
  padding-bottom: 18px;
  border-bottom: 1px solid #e7e2d6;
}
.article-share-via,
.article-share-or {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: #43564c;
}
.article-share-or { margin-top: 24px; }

.article-share-icons { display: flex; gap: 14px; }
.article-share-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eeeae1;
  color: #14241a;
  transition: background 0.16s ease, transform 0.16s ease;
}
.article-share-icon:hover { background: #e2ddd0; transform: translateY(-2px); }
.article-share-icon svg { width: 24px; height: 24px; }

.article-share-copy {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-btn);
  background: var(--n-btn);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.16s ease;
}
.article-share-copy:hover { background: var(--n-btn-2); }
.article-share-copy.is-copied { background: var(--leaf-dark); }
.article-share-copy svg { width: 17px; height: 17px; }

/* ============================================================
   7. RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .article-cta-grid { grid-template-columns: 1fr; }
  .article-body { max-width: none; }
}
@media (max-width: 720px) {
  .article-main { padding-top: 104px; }
  .article-hero-cover > img { aspect-ratio: 4 / 3; }
  .article-gallery { grid-template-columns: 1fr; }
  .article-cta-card { padding: 38px 26px; }
  .article-share-dialog { padding: 28px 24px 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .article-share-btn:hover,
  .article-share-icon:hover { transform: none; }
  .article-share-modal,
  .article-share-dialog { transition: none; }
}
