/* ==========================================================================
   ARTICLES — LIGHT THEME TOKENS
   Loaded after style.css. Uses its own --a-* variables so the dark tokens
   (--bg, --text, --line, etc.) stay untouched for the navbar/footer/cookie
   bar, which keep the brand's dark look on top of this light section.
   ========================================================================== */
:root {
  --a-bg: #FFFFFF;
  --a-text: #1A1A1A;
  --a-text-secondary: #5F6368;
  --a-border: #E5E7EB;
  --a-card: #F8F9FA;
  --a-accent: #D6A94D;
  --a-accent-dim: rgba(214, 169, 77, 0.12);
}

body.articles-page { background: var(--a-bg); color: var(--a-text); }
body.articles-page p { color: var(--a-text-secondary); }
body.articles-page h1, body.articles-page h2, body.articles-page h3, body.articles-page h4 { color: var(--a-text); }

/* Header stays permanently on the dark brand style — a transparent-to-dark
   navbar (like the homepage) would put light text over this section's white
   background at the top of the page. */
body.articles-page .navbar {
  background: rgba(11, 11, 11, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
body.articles-page .navbar__inner { height: 68px; }

/* Footer keeps the original dark tokens explicitly, since the body's
   background is overridden to white above. */
body.articles-page .footer {
  background: var(--bg);
  color: var(--text);
}
body.articles-page .footer p { color: var(--text-secondary); }

/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  z-index: 300;
  background: transparent;
  pointer-events: none;
}
.reading-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--a-accent);
}

/* ==========================================================================
   ARTICLES HERO (listing page)
   ========================================================================== */
.articles-hero {
  padding: 168px 0 56px;
  text-align: center;
}
.articles-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.18;
  max-width: 780px;
  margin: 0 auto 18px;
}
.articles-hero p {
  max-width: 620px;
  margin: 0 auto;
  font-size: 17px;
}

/* ==========================================================================
   TOOLBAR — search + category filters
   ========================================================================== */
.articles-toolbar { padding-bottom: 56px; }

.articles-search {
  position: relative;
  max-width: 480px;
  margin: 0 auto 28px;
}
.articles-search svg {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--a-text-secondary);
  pointer-events: none;
}
.articles-search input {
  width: 100%;
  height: 52px;
  padding: 0 20px 0 48px;
  border-radius: var(--radius);
  border: 1px solid var(--a-border);
  background: var(--a-card);
  color: var(--a-text);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 250ms var(--ease), box-shadow 250ms var(--ease);
}
.articles-search input::placeholder { color: var(--a-text-secondary); }
.articles-search input:focus {
  outline: none;
  border-color: var(--a-accent);
  box-shadow: 0 0 0 3px var(--a-accent-dim);
}

.articles-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.filter-pill {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--a-border);
  background: var(--a-bg);
  color: var(--a-text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 250ms var(--ease), color 250ms var(--ease), background 250ms var(--ease);
}
.filter-pill:hover { border-color: var(--a-accent); color: var(--a-text); }
.filter-pill.active { background: var(--a-accent); border-color: var(--a-accent); color: #1A1A1A; }

/* ==========================================================================
   ARTICLES GRID + CARDS
   ========================================================================== */
.articles-grid-section { padding-bottom: 56px; }
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 980px) { .articles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .articles-grid { grid-template-columns: 1fr; } }

.article-card {
  border: 1px solid var(--a-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--a-bg);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), border-color 300ms var(--ease);
}
.article-card:hover {
  transform: scale(1.02);
  box-shadow: 0 14px 32px rgba(20, 20, 20, 0.07);
  border-color: #D8DBE0;
}
.article-card__link { display: block; }
.article-card__image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--a-card);
}
.article-card__image img { width: 100%; height: 100%; object-fit: cover; }
.article-card__body { padding: 22px 24px 26px; }
.article-card__category {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--a-accent);
  margin-bottom: 10px;
}
.article-card__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--a-text);
}
.article-card__excerpt {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 18px;
  color: var(--a-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--a-text-secondary);
}
.article-card__meta span:not(:last-child)::after { content: '•'; margin-left: 8px; }

.articles-empty {
  display: none;
  text-align: center;
  padding: 64px 0;
  color: var(--a-text-secondary);
  font-size: 15px;
}
.articles-empty.visible { display: block; }

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.articles-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
}
.articles-pagination[hidden] { display: none; }
.articles-pagination button {
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--a-border);
  background: var(--a-bg);
  color: var(--a-text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 250ms var(--ease), color 250ms var(--ease), background 250ms var(--ease);
}
.articles-pagination button:hover:not(:disabled) { border-color: var(--a-accent); color: var(--a-text); }
.articles-pagination button.active { background: var(--a-accent); border-color: var(--a-accent); color: #1A1A1A; font-weight: 600; }
.articles-pagination button:disabled { opacity: 0.35; cursor: default; }

/* ==========================================================================
   ARTICLE HEADER (individual page)
   ========================================================================== */
.article-header { padding: 152px 0 0; }
.article-back-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--a-text-secondary);
  margin-bottom: 16px;
  transition: color 200ms var(--ease);
}
.article-back-link svg { width: 15px; height: 15px; }
.article-back-link:hover { color: var(--a-accent); }
.article-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--a-accent);
  margin-bottom: 18px;
}
.article-header h1 {
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.16;
  max-width: 820px;
  margin-bottom: 16px;
}
.article-header__subtitle {
  font-size: 19px;
  color: var(--a-text-secondary);
  max-width: 720px;
  margin-bottom: 26px;
}
.article-header__info {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  color: var(--a-text-secondary);
  padding-bottom: 32px;
  border-bottom: 1px solid var(--a-border);
}
.article-header__info span { display: flex; align-items: center; gap: 6px; }
.article-header__info svg { width: 15px; height: 15px; color: var(--a-accent); }

/* ==========================================================================
   AUDIO PLAYER
   ========================================================================== */
.article-audio {
  margin-top: 32px;
  max-width: 420px;
  padding: 18px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--a-border);
  background: var(--a-card);
}
.article-audio__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--a-text);
  margin-bottom: 14px;
}
.article-audio__title svg { width: 18px; height: 18px; color: var(--a-accent); }
.article-audio audio { width: 100%; height: 40px; display: block; }
.article-audio__duration { margin-top: 10px; font-size: 12.5px; color: var(--a-text-secondary); }

/* ==========================================================================
   SHARE BUTTONS
   ========================================================================== */
.article-share {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.article-share__label { font-size: 13px; color: var(--a-text-secondary); margin-right: 4px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--a-border);
  background: var(--a-bg);
  color: var(--a-text-secondary);
  font-size: 13.5px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 250ms var(--ease), color 250ms var(--ease);
  text-decoration: none;
}
.share-btn svg { width: 16px; height: 16px; }
.share-btn:hover { border-color: var(--a-accent); color: var(--a-text); }
.share-btn.share-btn--copied { border-color: var(--a-accent); color: var(--a-text); }

/* ==========================================================================
   LAYOUT — content + sticky sidebar
   ========================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
  padding: 48px 0 96px;
}
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: 1fr; }
}

.article-content { max-width: 700px; font-size: 17px; line-height: 1.85; }
.article-content > *:first-child { margin-top: 0; }
.article-content h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.25;
  margin-top: 56px;
  margin-bottom: 20px;
  scroll-margin-top: 100px;
}
.article-content h3 {
  font-size: 18px;
  margin-top: 36px;
  margin-bottom: 14px;
  scroll-margin-top: 100px;
}
.article-content p { margin: 0 0 22px; }
.article-content ul, .article-content ol { margin: 0 0 22px; padding-left: 22px; color: var(--a-text-secondary); }
.article-content li { margin-bottom: 10px; line-height: 1.7; }
.article-content li::marker { color: var(--a-accent); }

/* ---------- Content components ---------- */
.callout {
  margin: 32px 0;
  padding: 24px 26px;
  border-radius: var(--radius);
  font-size: 15.5px;
  line-height: 1.7;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 12px; }
.callout__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.callout__label svg { width: 15px; height: 15px; }

.callout--highlight { background: var(--a-accent-dim); border-left: 3px solid var(--a-accent); }
.callout--highlight .callout__label { color: #9C7A35; }
.callout--highlight p { color: var(--a-text); font-weight: 600; font-size: 16.5px; }

.callout--tip { background: #F1F8F5; border-left: 3px solid #4C9A79; }
.callout--tip .callout__label { color: #357A5C; }
.callout--tip p { color: var(--a-text-secondary); }
.callout--tip ul { margin: 0; padding-left: 20px; color: var(--a-text-secondary); }
.callout--tip li { margin-bottom: 8px; }
.callout--tip li:last-child { margin-bottom: 0; }

.callout--warning { background: #FBF3EE; border-left: 3px solid #C6602F; }
.callout--warning .callout__label { color: #A24D24; }
.callout--warning p { color: var(--a-text-secondary); }

.callout--example { background: var(--a-card); border: 1px solid var(--a-border); border-left: 3px solid #6B7280; }
.callout--example .callout__label { color: #5F6368; }
.callout--example p { color: var(--a-text-secondary); }

/* ---------- Images ---------- */
.article-figure { margin: 40px 0; }
.article-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--a-border);
}
.article-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--a-text-secondary);
  text-align: center;
}

/* ---------- Standardized CTA ---------- */
.article-cta {
  margin-top: 64px;
  padding: 56px 44px;
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
}
body.articles-page .article-cta h3 {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 30px);
  margin-bottom: 14px;
}
body.articles-page .article-cta p { color: var(--text-secondary); max-width: 520px; margin: 0 auto 28px; }

/* ---------- Author ---------- */
.article-author {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--a-border);
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.article-author__avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--a-accent), #B8863A);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  overflow: hidden;
}
.article-author__avatar img { width: 100%; height: 100%; object-fit: cover; }
.article-author__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--a-text);
  margin-bottom: 6px;
}
.article-author__bio { font-size: 14px; color: var(--a-text-secondary); line-height: 1.6; max-width: 520px; }

/* ---------- Related articles (bottom of content) ---------- */
.article-related { margin-top: 64px; }
.article-related__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 24px;
}
.article-related .articles-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .article-related .articles-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.article-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (max-width: 1100px) { .article-sidebar { position: static; } }

.sidebar-card {
  border: 1px solid var(--a-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  background: var(--a-card);
}
.sidebar-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--a-text);
  cursor: pointer;
  list-style: none;
}
.sidebar-card > summary::-webkit-details-marker { display: none; }
.sidebar-card > summary .chevron {
  width: 16px; height: 16px;
  color: var(--a-text-secondary);
  transition: transform 250ms var(--ease);
}
.sidebar-card[open] > summary .chevron { transform: rotate(180deg); }
.sidebar-card[open] > summary { margin-bottom: 16px; }

@media (min-width: 1101px) {
  .sidebar-card > summary { cursor: default; pointer-events: none; }
  .sidebar-card > summary .chevron { display: none; }
}

.article-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--a-border);
}
.article-toc__list a {
  display: block;
  padding: 8px 0 8px 16px;
  margin-left: -2px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--a-text-secondary);
  border-left: 2px solid transparent;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.article-toc__list a:hover { color: var(--a-text); }
.article-toc__list a.active { color: var(--a-accent); border-left-color: var(--a-accent); font-weight: 600; }

.related-mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.related-mini-list a { font-size: 13.5px; line-height: 1.5; color: var(--a-text); font-weight: 500; }
.related-mini-list a:hover { color: var(--a-accent); }
