/* Article list + detail — complements webflow.css (do not override blog-body flex) */

/* Keep in-page TOC / heading anchors below the fixed navbar */
html {
  scroll-padding-top: 7.5rem;
}

#article-content h2[id],
#article-content h3[id],
#article-content h4[id] {
  scroll-margin-top: 7.5rem;
}

.article-migration-note {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid #c9a227;
  background: #fff8e1;
  color: #5c4b00;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.article-list-lead {
  margin: 0.75rem 0 0;
  color: #333;
}

.article-card-grid {
  gap: 2rem 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 991px) {
  .article-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .article-card-grid {
    grid-template-columns: 1fr;
  }
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.article-card a {
  color: inherit;
  text-decoration: none;
}

.article-card-image {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 16 / 10;
  background: #eef2f5;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
}

.article-card-meta {
  font-size: 0.85rem;
  color: #667;
}

.article-card-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #e8f1f6;
  color: #1b4b63;
  margin-right: 0.35rem;
}

.article-card-badge.is-external {
  background: #f3f3f3;
  color: #555;
}

.blog3_category-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 1.75rem;
}

.blog3_category-menu a {
  color: #1b4b63;
  text-decoration: none;
  font-size: 0.95rem;
}

/* TOC + richtext (from live article page) */
#toc {
  background-color: #ececec;
  border-radius: 8px;
  display: inline-block;
  margin-top: 1rem;
  margin-bottom: 3rem;
  min-width: 80%;
  padding: 1rem 2rem;
  width: 100%;
}

#toc p.toc-title {
  padding-left: 0.5rem;
  margin-bottom: 0;
}

#toc ul {
  list-style-type: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

#toc li {
  font-weight: bold;
  margin-bottom: 10px;
}

#toc a:hover {
  color: var(--border-color--border-secondary, #165e83);
}

.text-rich-text h2 {
  font-size: 1.7rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding-top: 0.5rem;
}

.text-rich-text h2:first-of-type {
  margin-top: 0;
}

.text-rich-text h2:after {
  content: "";
  display: block;
  height: 7px;
  background: linear-gradient(to right, rgb(22, 94, 131), transparent);
}

.text-rich-text h3 {
  font-size: 1.5rem;
  line-height: 1.7;
  padding: 0.25em 0;
  position: relative;
}

.text-rich-text h4 {
  font-size: 1.2rem;
  padding-left: 0.3em;
  line-height: 1.4;
}

.text-rich-text h4:before {
  content: "✓";
  margin-right: 7px;
  color: #223a70;
  font-weight: 700;
}

/* Keep Webflow figure display:table; only add spacing */
#article-content figure {
  margin: 1.5rem auto;
}

#article-content a {
  text-decoration: underline;
}

#article-content a:hover {
  color: var(--border-color--border-secondary, #165e83);
}

.text-rich-text a {
  word-wrap: break-word;
  word-break: break-all;
  overflow-wrap: break-word;
}

/* Ensure body images paint even when figure wrappers use font-size:0 */
#article-content img,
#article-content figure img {
  box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  max-width: 100%;
  height: auto;
  display: block;
}

#article-content iframe {
  max-width: 100%;
}

.blog3_image {
  aspect-ratio: 2 / 1;
  width: 100%;
  object-fit: cover;
}

figcaption {
  color: #515151;
}

blockquote {
  font-size: 1rem;
}

/* Article-end breadcrumb: match live wrap.
   Do not flex-grow the title into the first line's leftover space —
   let flex-wrap move the whole title to the next row, then wrap CJK. */
.breadcrumb_component .same-as-h1 {
  flex: 0 1 auto;
  max-width: 100%;
  line-height: 1.5;
}

/* In-article same-site link cards (live uses Embedly; we render statically) */
.article-link-card {
  margin: 1.25rem auto 1.75rem; /* centered like live Embedly card-hug */
  width: 100%;
  max-width: 600px; /* match live Embedly card-hug width */
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  box-shadow: none;
}

.article-link-card__anchor {
  display: block;
  color: inherit;
  text-decoration: none !important;
}

.article-link-card__anchor:hover {
  text-decoration: none !important;
}

.article-link-card__provider {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem 0.4rem;
  color: #777;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.article-link-card__author {
  color: #999;
  font-weight: 500;
}

#article-content .article-link-card__favicon,
.article-link-card__favicon {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: none !important;
  display: inline-block;
}

.article-link-card__media {
  margin: 0 0.85rem;
  overflow: hidden;
  border-radius: 2px;
  background: #f3f3f3;
}

#article-content .article-link-card__media img,
.article-link-card__media img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.article-link-card__body {
  padding: 0.75rem 0.85rem 0.95rem;
}

.article-link-card__title {
  margin: 0 0 0.45rem;
  color: #222;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.article-link-card__desc {
  margin: 0 0 0.65rem;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-decoration: none;
}

.article-link-card__cta {
  margin: 0;
  color: #1a73e8;
  font-size: 0.9rem;
  line-height: 1.4;
}

.article-link-card__anchor:hover .article-link-card__cta {
  text-decoration: underline;
}

/* Embedly cards on news-weekly articles (match live centered 600px hug) */
#article-content .embedly-card,
#article-content .embedly-card-hug,
#article-content iframe.embedly-card {
  display: block;
  max-width: 600px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

@media screen and (max-width: 768px) {
  .text-rich-text h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .text-rich-text h3 {
    font-size: 1.3rem;
    line-height: 1.6;
  }

  .text-rich-text h4 {
    font-size: 1.1rem;
  }

  .w-richtext figure {
    max-width: 100%;
  }
}

/* Custom 404 page */
.not-found-panel {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.not-found-code {
  margin: 0 0 0.5rem;
  font-size: 4rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #165e83;
  opacity: 0.35;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: center;
  margin: 1.75rem 0 0;
}

.not-found-actions .button.is-secondary {
  background-color: transparent;
  color: #165e83;
  border: 1px solid #165e83;
}

.not-found-actions .button.is-secondary:hover {
  background-color: #165e83;
  color: #fff;
}
