/* Стили каталога и страниц статей Distinctions Club — единая палитра Split D (80/15/5) */
@import url("assets/brand/palette.css");

:root {
  --ink: var(--dc-ink);
  --ink-soft: var(--dc-ink-soft);
  --muted: var(--dc-muted);
  --line: var(--dc-line);
  --line-strong: var(--dc-line-strong);
  --surface: var(--dc-surface);
  --surface-alt: var(--dc-surface-alt);
  --page: var(--dc-page);

  /* Distinctions Club — Contact Teal */
  --club: var(--dc-club);
  --club-dark: var(--dc-club-dark);
  --club-ink: var(--dc-club-ink);
  --club-soft: var(--dc-club-soft);
  --club-line: var(--dc-club-line);

  /* Distinctions Lab — Research Violet */
  --lab: var(--dc-lab);
  --lab-dark: var(--dc-lab-dark);
  --lab-soft: var(--dc-lab-soft);
  --lab-line: var(--dc-lab-line);

  /* Semantic Data Colors */
  --green: var(--dc-green);
  --green-soft: var(--dc-green-soft);
  --green-line: var(--dc-green-line);
  --rose: var(--dc-rose);
  --rose-soft: var(--dc-rose-soft);
  --rose-line: var(--dc-rose-line);
  --amber: var(--dc-amber);
  --amber-soft: var(--dc-amber-soft);
  --amber-line: var(--dc-amber-line);
  --blue: var(--dc-blue);
  --blue-soft: var(--dc-blue-soft);
  --blue-line: var(--dc-blue-line);
}

.articles-shell { max-width: 1220px; margin: 0 auto; padding: 14px 18px 28px; }
.article-shell  { max-width: 960px; margin: 0 auto; padding: 14px 18px 36px; }
.articles-topbar { margin-bottom: 16px; }
.articles-topbar .brand-text a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.articles-topbar .brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.articles-topbar .brand-copy { min-width: 0; }
.articles-topbar .brand-sub-club { color: var(--club); }
.articles-topbar .brand-text a:hover h1 { color: var(--club-dark); }
.articles-topbar .header-action { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

.articles-hero {
  border: 1px solid var(--club-line);
  background: linear-gradient(118deg, var(--club-soft) 0%, #f7fcfc 58%, var(--page) 100%);
  border-radius: 20px;
  padding: 28px 30px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.articles-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.articles-hero .eyebrow { color: var(--club); }
.articles-hero .eyebrow-dot { background: var(--club); }
.articles-hero h2 { font-size: 28px; line-height: 1.2; letter-spacing: -0.7px; margin: 0 0 10px; font-weight: 850; color: var(--ink); }
.articles-hero p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.62; margin: 0; max-width: 72ch; }
.hero-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-metric {
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.92); border: 1px solid var(--club-line); color: var(--club-dark);
}

.catalog-controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.catalog-search-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-input-wrap { position: relative; flex: 1 1 280px; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }
.catalog-search {
  width: 100%; min-height: 44px; padding: 10px 14px 10px 38px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--page); color: var(--ink);
  font: 14px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.catalog-search:focus {
  outline: none;
  border-color: var(--club);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 132, 139, 0.14);
}
.catalog-count { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }

.category-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px;
  border-radius: 11px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
  font-size: 12.5px; font-weight: 700; transition: all .15s ease;
}
.cat-pill:hover { border-color: #9bd6d1; background: var(--club-soft); color: var(--club-dark); }
.cat-pill.active { background: var(--club); border-color: var(--club); color: #fff; }
.cat-pill .pill-num { font-size: 11px; opacity: .8; }

.active-cat-banner {
  background: var(--club-soft); border: 1px solid var(--club-line); border-radius: 14px;
  padding: 12px 16px; font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; display: none;
}
.active-cat-banner.visible { display: block; }
.active-cat-banner strong { color: var(--club-ink); }

.articles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.article-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.article-card:hover { transform: translateY(-2px); border-color: #9bd6d1; box-shadow: 0 12px 28px rgba(11, 132, 139, 0.085); }
.article-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }

/* 6 Semantic Category Badges (synchronized with Discourse categories) */
.cat-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 750; padding: 4px 10px; border-radius: 999px; letter-spacing: .01em; }
.cat-badge.purple { background: var(--lab-soft); color: var(--lab-dark); }
.cat-badge.amber  { background: var(--amber-soft); color: var(--amber); }
.cat-badge.rose   { background: var(--rose-soft); color: var(--rose); }
.cat-badge.teal   { background: var(--club-soft); color: var(--club-dark); }
.cat-badge.indigo { background: var(--blue-soft); color: var(--blue); }
.cat-badge.green  { background: var(--green-soft); color: var(--green); }

.article-card-meta { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.article-card h3 { font-size: 17px; line-height: 1.32; letter-spacing: -.25px; margin: 0 0 8px; font-weight: 800; color: var(--ink); transition: color .15s; }
.article-card:hover h3 { color: var(--club-dark); }
.article-card p { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 14px; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-tag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 7px; background: var(--surface-alt); border: 1px solid var(--line); color: var(--ink-soft); }
.empty-state { grid-column: 1 / -1; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 18px; padding: 36px 20px; color: var(--muted); }

/* Individual Article Page */
.article-surface {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 30px 38px 36px; box-shadow: var(--shadow);
}
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--club-dark); text-decoration: none; font-weight: 650; }
.breadcrumbs a:hover { text-decoration: underline; }

.article-header { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.article-header-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.article-reading-time { font-size: 12px; color: var(--muted); font-weight: 600; }
.article-header h1 { font-size: 28px; line-height: 1.24; letter-spacing: -.6px; font-weight: 850; color: var(--ink); margin: 0 0 14px; }
.article-lead { font-size: 16px; line-height: 1.65; color: var(--ink-soft); margin: 0 0 16px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { font-size: 12px; font-weight: 650; background: var(--club-soft); border: 1px solid var(--club-line); color: var(--club-dark); padding: 4px 10px; border-radius: 8px; }

.toc { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-bottom: 28px; font-size: 14px; }
.toc-title { font-weight: 800; font-size: 11.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--club); margin-bottom: 9px; }
.toc ul { margin: 0; padding-left: 18px; }
.toc li { margin-bottom: 5px; }
.toc a { color: var(--ink); text-decoration: none; font-weight: 550; }
.toc a:hover { color: var(--club-dark); text-decoration: underline; }

.article-body { font-size: 16px; line-height: 1.72; color: #242e48; }
.article-body h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.35px; font-weight: 800; color: var(--ink); margin: 38px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.article-body h3 { font-size: 17px; line-height: 1.35; font-weight: 780; color: var(--ink); margin: 24px 0 10px; }
.article-body p { margin: 0 0 16px; }
.article-body a { color: var(--club-dark); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(11, 132, 139, 0.38); text-underline-offset: 3px; }
.article-body a:hover { color: var(--club); text-decoration-color: var(--club); }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }

/* Ware's 3 Doors — Semantic Tokens */
.door-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.door-pill { font-size: 12.5px; padding: 5px 12px; border-radius: 9px; font-weight: 700; }
.door-open   { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-line); }
.door-target { background: var(--lab-soft); color: var(--lab-dark); border: 1px solid var(--lab-line); }
.door-trap   { background: var(--rose-soft); color: var(--rose); border: 1px solid var(--rose-line); }

/* Editorial Callouts */
.callout { background: var(--club-soft); border: 1px solid var(--club-line); border-left: 4px solid var(--club); border-radius: 14px; padding: 18px 20px; margin: 24px 0; }
.callout.warning  { background: var(--rose-soft); border-color: var(--rose-line); border-left-color: var(--rose); }
.callout.practice { background: var(--green-soft); border-color: var(--green-line); border-left-color: var(--green); }
.callout-title { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--club-dark); margin-bottom: 8px; }
.callout.warning .callout-title  { color: var(--rose); }
.callout.practice .callout-title { color: var(--green); }
.callout p:last-child, .callout ul:last-child, .callout ol:last-child { margin-bottom: 0; }

.case-box { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; margin: 26px 0; }
.case-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--club); margin-bottom: 6px; }
.case-box h3 { margin-top: 0; margin-bottom: 12px; color: var(--ink); }
.dialogue { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 14px 0; font-size: 14.8px; }
.dialogue p { margin: 0 0 10px; }
.dialogue p:last-child { margin-bottom: 0; }
.speaker { font-weight: 750; color: var(--club-dark); }
.speaker.client { color: var(--rose); }
.note-inline { font-size: 13.5px; color: var(--muted); font-style: italic; }
.op-tag { display: inline-block; font-size: 11px; font-weight: 750; padding: 2px 8px; border-radius: 6px; background: var(--club-soft); border: 1px solid var(--club-line); color: var(--club-dark); margin-left: 5px; vertical-align: middle; }
.formula-box { background: linear-gradient(100deg, var(--club-soft), var(--page)); border: 1px solid var(--club-line); border-radius: 13px; padding: 16px 20px; margin: 22px 0; text-align: center; font-size: 16px; color: var(--club-ink); font-weight: 800; }

figure.diagram { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 16px 14px; margin: 28px 0; box-shadow: 0 4px 16px rgba(26, 35, 64, 0.035); text-align: center; }
figure.diagram svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
figure.diagram figcaption { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-soft); text-align: left; line-height: 1.5; }

.table-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); border-radius: 13px; }
.article-body table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.article-body th, .article-body td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.article-body th { background: var(--surface-alt); color: var(--ink); font-weight: 800; font-size: 12.5px; }
.article-body tr:last-child td { border-bottom: 0; }
.article-body tr:nth-child(even) td { background: var(--page); }

/* Distinctions Lab CTA — Distinct Research Violet Accent */
.matrix-cta {
  margin-top: 28px; padding: 18px 20px; border: 1px solid var(--lab-line);
  background: linear-gradient(105deg, var(--lab-soft), var(--page)); border-radius: 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.matrix-cta strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.matrix-cta span { font-size: 13px; color: var(--ink-soft); }
.matrix-cta a {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--lab); color: #fff !important; text-decoration: none !important;
  font-weight: 700; font-size: 13px; padding: 10px 16px; border-radius: 11px; white-space: nowrap;
  transition: background .15s;
}
.matrix-cta a:hover { background: var(--lab-dark); }

/* Distinctions Club Discourse CTA — Contact Teal */
.discourse-cta {
  margin-top: 14px;
  padding: 17px 20px;
  border: 1px solid var(--club-line);
  background: linear-gradient(105deg, var(--club-soft), var(--page));
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.discourse-cta strong { display: block; font-size: 14.5px; color: var(--club-ink); margin-bottom: 2px; }
.discourse-cta span { font-size: 13px; color: var(--ink-soft); }
.discourse-cta-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.discourse-cta a {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none !important; font-weight: 700; font-size: 13px;
  padding: 9px 15px; border-radius: 11px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.discourse-cta a.dc-primary {
  background: var(--club); color: #fff !important; border: 1px solid var(--club);
}
.discourse-cta a.dc-primary:hover { background: var(--club-dark); border-color: var(--club-dark); }
.discourse-cta a.dc-secondary {
  background: #fff; color: var(--ink-soft) !important; border: 1px solid var(--club-line);
}
.discourse-cta a.dc-secondary:hover { background: var(--club-soft); border-color: #8fd2cd; color: var(--club-ink) !important; }
#discourse-comments { margin-top: 24px; }

.related-section { margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); }
.related-heading { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 12px; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.related-card {
  display: flex; flex-direction: column; gap: 6px; padding: 15px 17px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface-alt);
  text-decoration: none !important; color: var(--ink) !important; transition: border-color .15s, background .15s;
}
.related-card:hover { border-color: #9bd6d1; background: var(--club-soft); }
.related-card strong { font-size: 14.5px; line-height: 1.35; color: var(--ink); }
.related-card:hover strong { color: var(--club-dark); }

.footer .term-link { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.footer .term-link:hover { color: var(--club); text-decoration: underline; }

@media (max-width: 820px) {
  .articles-grid, .related-grid { grid-template-columns: 1fr; }
  .article-surface { padding: 22px 20px 28px; border-radius: 16px; }
  .articles-hero { padding: 20px 18px; border-radius: 16px; }
  .articles-hero h2, .article-header h1 { font-size: 22px; }
}
@media (max-width: 540px) {
  .articles-shell, .article-shell { padding: 8px 8px 24px; }
  .article-surface { padding: 18px 14px 24px; }
  .case-box { padding: 16px 14px; }
  .article-body { font-size: 15px; }
  .articles-topbar .brand-mark { width: 26px; height: 26px; }
  .articles-topbar .brand-text a { gap: 9px; }
}
@media print {
  .topbar, .related-section, .matrix-cta, .discourse-cta, #discourse-comments, .footer { display: none !important; }
  .article-surface { border: 0; box-shadow: none; padding: 0; }
}

/* Mobile Landscape Phones */
@media (max-height: 540px) and (max-width: 1024px) and (orientation: landscape) {
  .articles-shell,
  .article-shell {
    padding: 8px max(14px, env(safe-area-inset-right, 0px)) 24px max(14px, env(safe-area-inset-left, 0px));
  }
  .topbar {
    min-height: 54px;
    padding: 8px 14px;
  }
  .brand-text p { display: none; }
}
