/* ============================================================
   Blog article template — shared by every /blog/<slug>/ page.
   Reuses tokens/components already defined in ../../styles.css:
   --red / --black / --white / --grey-light / --grey-soft / --grey-border / --text-secondary,
   --font-display / --font-text, --ease, --header-h, .container, .reveal, .btn / .btn--primary.
   ============================================================ */

.article-page .container{ max-width: var(--container-narrow); margin-left: auto; }

/* ---------- Breadcrumb ---------- */
.article-breadcrumb{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-text);
  font-size: 0.86rem;
  color: var(--text-secondary);
}
.article-breadcrumb a{ color: var(--text-secondary); transition: color 0.2s var(--ease); }
.article-breadcrumb a:hover{ color: var(--red); }
.article-breadcrumb span[aria-hidden]{ color: var(--grey-border); }
.article-breadcrumb .is-current{ color: var(--black); }

/* ---------- Header ---------- */
.article-header{
  padding-top: 48px;
}
.article-h1{
  margin-top: 18px;
  max-width: 800px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 4vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--black);
}
.article-subtitle{
  margin-top: 20px;
  max-width: 700px;
  font-family: var(--font-text);
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ---------- Two-column layout ---------- */
.article-layout{
  margin-top: 48px;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

/* ---------- Sidebar ---------- */
.article-sidebar{
  position: sticky;
  top: calc(var(--header-h) + 28px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-panel{
  background: var(--white);
  border: 1px solid var(--grey-soft);
  border-radius: 16px;
  padding: 18px 20px;
}

/* meta panel */
.sidebar-meta-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 10px;
  font-family: var(--font-text);
  font-size: 0.88rem;
  color: var(--black);
  border-top: 1px solid var(--grey-soft);
}
.sidebar-meta-row:first-child{ border-top: none; padding-top: 0; }
.sidebar-meta-row svg{ flex: none; color: var(--black); }

.sidebar-share{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  line-height: normal;
}
.sidebar-share span{ transition: color 0.2s var(--ease); }
.sidebar-share:hover span:last-child{ color: var(--red); }
.sidebar-share.is-copied span:last-child{ color: var(--red); }

.sidebar-social{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--grey-soft);
}
.sidebar-social__link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--grey-soft);
  color: var(--black);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.sidebar-social__link:hover{ border-color: var(--red); color: var(--red); }

/* table of contents panel */
.sidebar-panel--toc{ padding: 18px 20px; }
.sidebar-panel--toc summary{
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  font-family: var(--font-text);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--black);
}
.sidebar-panel--toc summary::-webkit-details-marker{ display: none; }
.sidebar-panel--toc summary::marker{ content: ""; }
.toc-chevron{ flex: none; color: var(--text-secondary); transition: transform 0.2s var(--ease); }
.sidebar-panel--toc[open] .toc-chevron{ transform: rotate(180deg); }

.toc-list{
  margin-top: 6px;
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
}
.toc-link{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-block: 8px;
  font-family: var(--font-text);
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease);
}
.toc-link:hover{ color: var(--black); }
.toc-link.is-active{ color: var(--red); }
.toc-num{
  flex: none;
  width: 16px;
  color: #B5B5B2;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s var(--ease);
}
.toc-link.is-active .toc-num{ color: var(--red); }

.toc-link--related{
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--grey-soft);
  font-weight: 600;
  color: var(--black);
}
.toc-link--related:hover{ color: var(--red); }

/* ---------- Main column ---------- */
.article-main{ min-width: 0; }

.article-hero{
  border-radius: 16px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--grey-light);
}
.article-hero img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Body ---------- */
.article-body{
  max-width: 760px;
  margin-top: 40px;
  font-family: var(--font-text);
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--black);
}
.article-body h2{
  margin-top: 48px;
  scroll-margin-top: calc(var(--header-h) + 24px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--black);
}
.article-body h2:first-child{ margin-top: 0; }
.article-body h3{
  margin-top: 32px;
  scroll-margin-top: calc(var(--header-h) + 24px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--black);
}
.article-body p{ margin-top: 18px; color: var(--text-secondary); }
.article-body h2 + p, .article-body h3 + p{ margin-top: 14px; }
.article-body ul, .article-body ol{
  margin-top: 18px;
  padding-left: 22px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-body li{ line-height: 1.6; }
.article-body strong{ color: var(--black); }
.article-body p a, .article-body li a{ color: var(--red); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Pro Tip ---------- */
.pro-tip{
  margin-top: 40px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 26px;
  border-left: 3px solid var(--red);
  background: var(--grey-light);
  border-radius: 12px;
}
.pro-tip__icon{ flex: none; color: var(--red); margin-top: 1px; }
.pro-tip__label{
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--black);
}
.pro-tip__text{
  margin-top: 4px;
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.pro-tip__text strong{ display: block; margin-bottom: 4px; color: var(--black); }

/* ---------- Related articles ---------- */
.article-related{
  border-top: 1px solid var(--grey-soft);
  padding: 70px 0 90px;
}
.article-related__heading{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--black);
}
.article-related__grid{
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 40px;
  row-gap: 40px;
}
.article-related__card{ display: block; }
.article-related__visual{
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: var(--grey-light);
}
.article-related__visual img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.article-related__card:hover .article-related__visual img{ transform: scale(1.04); }
.article-related__category{
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-text);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}
.article-related__title{
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--black);
  transition: color 0.2s var(--ease);
}
.article-related__card:hover .article-related__title{ color: var(--red); }
.article-related__meta{
  display: block;
  margin-top: 8px;
  font-family: var(--font-text);
  font-size: 0.82rem;
  color: #9C9C99;
}

/* ---------- Final CTA banner ---------- */
.article-final-cta{ padding: 20px 0 100px; }
.article-final-cta__card{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 48px 56px;
  border-radius: 22px;
  background: var(--black);
}
.article-final-cta__copy{ max-width: 520px; }
.article-final-cta__heading{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  color: var(--white);
}
.article-final-cta__text{
  margin-top: 10px;
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.65);
}
.btn--on-dark{
  flex: none;
  background: var(--red);
  color: var(--white);
  padding: 16px 28px;
  border-radius: 9999px;
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn--on-dark .btn__arrow{ color: var(--white); transition: transform 0.25s var(--ease); }
.btn--on-dark:hover{ background: var(--red-dark); transform: translateY(-1px); }
.btn--on-dark:hover .btn__arrow{ transform: translateX(3px); }
.btn--on-dark:active{ transform: translateY(0); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1000px){
  .article-layout{ grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 900px){
  .article-layout{ grid-template-columns: 1fr; margin-top: 32px; }
  .article-sidebar{ position: static; top: auto; }
  .article-related__grid{ grid-template-columns: repeat(2, 1fr); }
  .article-final-cta__card{ padding: 40px; }
}

@media (max-width: 700px){
  .article-header{ padding-top: 32px; }
  .article-body{ margin-top: 32px; padding-bottom: 0; }
  .pro-tip{ flex-direction: column; gap: 10px; padding: 20px; }
  .article-related{ padding: 50px 0 60px; }
  .article-related__grid{ grid-template-columns: 1fr; }
  .article-final-cta{ padding: 8px 0 64px; }
  .article-final-cta__card{
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
    border-radius: 18px;
  }
  .btn--on-dark{ width: 100%; justify-content: center; }
}
