/* Articles: article pages, the articles index, and article cards
   (also used on the landing page). */

/* ===== PAGE SHELL ===== */

.article-page,
.articles-index {
  padding: 8px 0 32px;
}

.article,
.article-try,
.article-back {
  max-width: var(--w-read);
  margin-left: auto;
  margin-right: auto;
}

/* How-to copy below the tools on explore.html and compare.html */
.tool-guide {
  max-width: var(--w-read);
  margin: 64px auto 0;
}

/* Breadcrumb */
.article-breadcrumb {
  max-width: var(--w-read);
  margin: 0 auto 24px;
  font-size: 13px;
  color: var(--text-3);
}

.articles-index .article-breadcrumb {
  max-width: none;
}

.article-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  list-style: none;
}

.article-breadcrumb li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.article-breadcrumb li + li::before {
  content: '/';
  margin: 0 8px;
  opacity: .6;
}

.article-breadcrumb a {
  font-weight: 700;
  color: var(--text-2);
  text-decoration: none;
}

.article-breadcrumb a:hover {
  color: var(--primary-ink);
}

.article-breadcrumb [aria-current] {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== ARTICLE HEADER ===== */

.article-header {
  margin-bottom: 24px;
}

.article-eyebrow {
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-ink);
}

.article-header h1 {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.12;
  font-weight: 600;
  color: var(--text);
}

.article-meta {
  font-size: 14px;
  color: var(--text-2);
}

/* Summary */
.article-summary {
  margin-bottom: 32px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--primary-soft);
}

.article-summary p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
}

/* ===== ARTICLE BODY ===== */

.article-body {
  font-size: 18px;
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: break-word;
}

.article-body p {
  margin: 0 0 1.1em;
}

.article-body h2 {
  margin: 2em 0 .5em;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.article-body h3 {
  margin: 1.6em 0 .4em;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.1em;
  padding-left: 1.3em;
}

.article-body li {
  margin-bottom: .45em;
  padding-left: .2em;
}

.article-body li::marker {
  color: var(--primary);
}

.article-body strong {
  font-weight: 700;
}

.article-body a,
.article-summary a {
  color: var(--primary-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--primary-ink) 40%, transparent);
}

.article-body a:hover,
.article-summary a:hover {
  text-decoration-color: var(--primary-ink);
}

/* Tables */
.article-table-wrap {
  margin: 0 0 1.4em;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}

.article-table th,
.article-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.article-table th {
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}

.article-table tbody tr:last-child td {
  border-bottom: 0;
}

.article-table td {
  min-width: 120px;
}

/* Prompt block */
.article-code {
  margin: 0 0 1.4em;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.article-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid var(--border);
}

.article-code-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.article-code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

/* FAQ and references */
.article-faq,
.article-refs {
  margin-top: 2.4em;
  padding-top: .4em;
  border-top: 1px solid var(--border);
}

.article-faq h3 {
  font-size: 18px;
}

.article-refs .article-refs-title {
  font-size: 24px;
}

.article-refs-list {
  padding-left: 1.2em;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.article-refs-list li {
  margin-bottom: .6em;
}

/* ===== VALUES LIST (personal values list article) ===== */

.values-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 0 1.4em;
}

@media (min-width: 640px) {
  .values-list {
    grid-template-columns: 1fr 1fr;
  }
}

.value-entry {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.article-body .value-entry h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 16px;
}

.value-entry-emoji {
  font-size: 18px;
  line-height: 1;
}

.article-body .value-entry p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

.article-body .value-entry-meaning {
  margin-bottom: 6px;
  color: var(--text);
}

.article-body .value-entry-example {
  font-size: 14px;
  color: var(--text-2);
}

.value-entry-label {
  font-weight: 700;
  color: var(--text);
}

/* ===== TRY-IT CARD ===== */

.article-try {
  margin-top: 40px;
  margin-bottom: 48px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--primary-soft);
}

.article-try-title {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
}

.article-try p {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}

@media (max-width: 639px) {
  .article-try .btn {
    width: 100%;
    min-height: 48px;
  }
}

/* ===== ARTICLE CARDS ===== */

.article-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .article-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (min-width: 1024px) {
  .article-card-grid--landing,
  .article-related .article-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease);
}

.article-card:hover {
  border-color: var(--border-strong);
}

.article-card-category {
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-ink);
}

.article-card-title {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text);
}

.article-card-blurb {
  flex: 1;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}

.article-card-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}

/* Related articles */
.article-related {
  margin-bottom: 24px;
}

.article-related h2 {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
}

.article-back {
  margin-top: 8px;
}

/* ===== ARTICLES INDEX ===== */

.articles-index-header {
  margin-bottom: 32px;
}

.articles-index-header h1 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.12;
  font-weight: 600;
  color: var(--text);
}

.articles-index-header p {
  max-width: var(--w-read);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
}

.articles-group {
  margin-bottom: 36px;
}

.articles-group h2 {
  margin-bottom: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
}

/* Landing page "browse all" link */
.articles-more {
  margin-top: 12px;
}

.articles-more a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-ink);
  text-decoration: none;
}

.articles-more a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 768px) {
  .article-page,
  .articles-index {
    padding-top: 24px;
  }

  .article-header h1,
  .articles-index-header h1 {
    font-size: 44px;
  }

  .article-body h2 {
    font-size: 32px;
  }
}

/* ===== ON THIS PAGE ===== */

.article-toc {
  margin: -8px 0 32px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.article-toc-title {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.article-toc ol {
  margin: 0;
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.8;
}

.article-toc a {
  color: var(--primary-ink);
  text-decoration: none;
}

.article-toc a:hover {
  text-decoration: underline;
}

/* A–Z quick list on the values list page */
.values-az {
  columns: 2;
  column-gap: 24px;
  margin: 0 0 1.4em;
  padding: 0;
  list-style: none;
  font-size: 16px;
  line-height: 1.9;
}

.values-az a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-strong);
}

.values-az a:hover {
  color: var(--primary-ink);
}

@media (min-width: 600px) {
  .values-az { columns: 3; }
}

/* ===== IN-ARTICLE CALL TO ACTION ===== */

.article-cta {
  position: relative;
  margin: 36px 0 40px;
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.article-body .article-cta p {
  margin: 0;
}

.article-body .article-cta-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--primary-ink);
}

.article-body .article-cta-title {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
}

.article-body .article-cta-text {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-2);
}

.article-cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 16px;
}

.article-cta-actions .btn {
  min-height: 46px;
  gap: 8px;
  text-decoration: none;
}

.app-store-badge--compact {
  height: 46px;
  padding: 0 15px 0 12px;
  border-radius: 11px;
  text-decoration: none;
}

.app-store-badge--compact .app-store-badge-logo { width: 23px; height: 23px; }
.app-store-badge--compact .app-store-badge-small { font-size: 10px; }
.app-store-badge--compact .app-store-badge-large { font-size: 19px; }

.article-try .article-cta-actions { margin-top: 0; }

@media (max-width: 639px) {
  .article-cta-actions .btn,
  .article-cta-actions .app-store-badge {
    width: 100%;
    justify-content: center;
  }
}

/* Download button on the worksheet page */
.article-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 28px;
}

.article-body .article-download .btn { text-decoration: none; }

.article-download span {
  font-size: 14px;
  color: var(--text-3);
}

/* Buttons inside article text keep their own colours, not the link colours */
.article-body .article-cta .btn-primary,
.article-body .article-download .btn-primary,
.article-body .article-cta .btn-primary:hover,
.article-body .article-download .btn-primary:hover {
  color: var(--on-primary);
  text-decoration: none;
}

.article-body .app-store-badge,
.article-body .app-store-badge:hover {
  color: #fff;
  text-decoration: none;
}
