/* ============================================================
   BLOG ARTICLE — the template every article page uses.
   1. Split top: topic colour with the title on the left, the
      article's picture (or a plain panel) on the right.
   2. Contents list beside the article: stays in view and marks the
      section you are on (js/article.js). A box above the article
      on phones.
   3. One reading column, the audit box, the author box.
   4. Keep reading: three cards (css/blog.css).
   The final banner comes from css/closing.css.
   (Prefix ar-; the old .article- rules in style.css are not used.)
   ============================================================ */

/* --- 1. Split top --- */
.ar-hero {
  --ar-bg: var(--navy);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  padding-top: var(--nav-height);
  background: var(--ar-bg);
  color: var(--white);
}
.ar-hero--advertise { --ar-bg: var(--blue); }
.ar-hero--rank { --ar-bg: var(--navy); }
.ar-hero--build { --ar-bg: var(--dark); }

.ar-hero-copy { padding: 72px 4rem 76px max(5vw, calc((100vw - 1200px) / 2)); }
.ar-crumbs { display: flex; gap: 0.55rem; margin-bottom: 1.4rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
.ar-crumbs a { color: rgba(255, 255, 255, 0.85); border-bottom: 1px solid transparent; transition: color var(--transition), border-color var(--transition); }
.ar-crumbs a:hover,
.ar-crumbs a:focus-visible { color: var(--white); border-color: var(--white); }
.ar-hero h1 { margin: 0 0 1.25rem; font-size: clamp(2rem, 3.8vw, 3.2rem); line-height: 1.1; letter-spacing: -0.025em; color: var(--white); }
.ar-hero-intro { max-width: 36rem; margin: 0 0 1.75rem; font-size: 1.1rem; line-height: 1.65; color: rgba(255, 255, 255, 0.88); }
.ar-hero-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; margin: 0; padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, 0.25); font-size: 0.9rem; color: rgba(255, 255, 255, 0.85); }
.ar-hero-meta a { font-weight: 700; color: var(--white); border-bottom: 1px solid rgba(255, 255, 255, 0.6); }
.ar-hero-meta a:hover,
.ar-hero-meta a:focus-visible { border-color: var(--white); }

.ar-hero-pic { position: relative; min-height: 380px; overflow: hidden; background: rgba(13, 31, 66, 0.35); }
.ar-hero-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* no picture yet: the logo peaks */
.ar-hero-blank { position: absolute; inset: 0; background: url("../images/mountains-mark.svg") right -8% bottom -1px / 82% auto no-repeat; }

/* --- 2 + 3. Contents list and reading column --- */
.ar-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 4.5rem; align-items: start; padding-top: 72px; padding-bottom: 96px; }

.ar-side { position: sticky; top: calc(var(--nav-height) + 2rem); display: grid; gap: 2rem; }
.ar-side h2 { margin: 0 0 0.9rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.ar-toc ol { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--border); }
.ar-toc a {
  display: block;
  margin-left: -2px;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 2px solid transparent;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
}
.ar-toc a:hover,
.ar-toc a:focus-visible { color: var(--navy); }
.ar-toc a.is-current { border-left-color: var(--blue); font-weight: 700; color: var(--navy); }
.ar-related ul { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.ar-related a { display: block; padding: 0.45rem 0.95rem; border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; font-weight: 700; color: var(--navy); transition: background var(--transition), color var(--transition), border-color var(--transition); }
.ar-related a:hover,
.ar-related a:focus-visible { background: var(--navy); border-color: var(--navy); color: var(--white); }

.ar-main { min-width: 0; max-width: 44rem; }
.ar-body { font-size: 1.08rem; }
.ar-body > p:first-child { font-size: 1.25rem; line-height: 1.65; color: var(--text); }
.ar-body p { margin: 0 0 1.3rem; line-height: 1.8; color: var(--text); }
.ar-body h2 { margin: 3rem 0 1rem; font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: 1.2; letter-spacing: -0.02em; scroll-margin-top: calc(var(--nav-height) + 1.5rem); }
.ar-body h3 { margin: 2.2rem 0 0.8rem; font-size: 1.25rem; scroll-margin-top: calc(var(--nav-height) + 1.5rem); }
.ar-body h4 { margin: 1.8rem 0 0.6rem; font-size: 1.08rem; }
.ar-body strong { font-weight: 700; color: var(--navy); }
.ar-body a { font-weight: 600; color: var(--blue); border-bottom: 1px solid var(--light-blue); transition: color var(--transition), border-color var(--transition); }
.ar-body a:hover,
.ar-body a:focus-visible { color: var(--navy); border-color: var(--navy); }
.ar-body ul,
.ar-body ol { margin: 0 0 1.4rem; padding-left: 1.4rem; color: var(--text); }
.ar-body ul { list-style: disc; }
.ar-body ol { list-style: decimal; }
.ar-body li { margin-bottom: 0.55rem; padding-left: 0.3rem; line-height: 1.75; }
.ar-body li::marker { font-weight: 700; color: var(--blue); }
.ar-body hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--border); }
.ar-body pre { margin: 1.5rem 0; padding: 1.25rem; border-radius: var(--radius); background: var(--dark); font-size: 0.85rem; line-height: 1.55; color: var(--off-white); overflow-x: auto; }
.ar-body :not(pre) > code { padding: 0.1rem 0.35rem; border-radius: 4px; background: var(--off-white); font-size: 0.92em; color: var(--navy); }

/* the article's own audit box */
.ar-audit { margin-top: 3rem; padding: 2.25rem 2.5rem; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 140%); color: var(--white); }
.ar-audit h2 { margin: 0 0 0.75rem; font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.25; color: var(--white); }
.ar-audit p { margin: 0 0 1.5rem; color: rgba(255, 255, 255, 0.88); }
.ar-audit-btn { background: var(--white); border: 1px solid var(--white); color: var(--navy); }
.ar-audit-btn:hover,
.ar-audit-btn:focus-visible { background: var(--light-blue); border-color: var(--light-blue); color: var(--dark); }

/* who wrote it */
.ar-author { display: flex; gap: 1.25rem; align-items: flex-start; margin-top: 2rem; padding: 1.75rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--off-white); }
.ar-author-avatar { display: flex; align-items: center; justify-content: center; flex: none; width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--navy); font-size: 1rem; font-weight: 800; letter-spacing: 0.04em; color: var(--white); }
.ar-author p { margin: 0; font-size: 0.95rem; line-height: 1.65; }
.ar-author .ar-author-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.ar-author .ar-author-name { margin-bottom: 0.35rem; font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.ar-author a { font-weight: 700; color: var(--blue); border-bottom: 1px solid var(--light-blue); }
.ar-author a:hover,
.ar-author a:focus-visible { color: var(--navy); border-color: var(--navy); }

/* --- 4. Keep reading --- */
.ar-more { padding: 80px 0 96px; background: var(--off-white); }
.ar-more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 2rem; }
.ar-more-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.02em; }
.ar-more-all { padding-bottom: 0.2rem; border-bottom: 2px solid var(--light-blue); font-weight: 700; color: var(--blue); transition: color var(--transition), border-color var(--transition); }
.ar-more-all:hover,
.ar-more-all:focus-visible { border-color: var(--navy); color: var(--navy); }

/* ============ Smaller screens ============ */
@media (max-width: 1000px) {
  .ar-hero { grid-template-columns: minmax(0, 1fr); }
  .ar-hero-copy { padding: 48px 5vw 52px; }
  .ar-hero-pic { min-height: 0; aspect-ratio: 16 / 9; }
  .ar-layout { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-top: 40px; padding-bottom: 64px; }
  /* contents become a box above the article */
  .ar-side { position: static; gap: 1.5rem; padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--off-white); }
  .ar-main { max-width: none; }
  .ar-more { padding: 56px 0 68px; }
}
@media (max-width: 620px) {
  .ar-body { font-size: 1.02rem; }
  .ar-body > p:first-child { font-size: 1.12rem; }
  .ar-audit { padding: 1.75rem 1.5rem; }
  .ar-author { padding: 1.4rem; gap: 1rem; }
}
