/*
 * Candidate overlay for pozdeev-editorial 0.1.6.
 * Load after assets/editorial.css. It is intentionally presentation-only:
 * no PHP hooks, schema, author markup, forms, QSM, checkout or content change.
 */

body.ap-editorial-page,
body.ap-editorial-catalog-page .ape-materials {
  --ap-ink: #1d2733;
  --ap-ink-soft: #58616a;
  --ap-paper: #fcf9f3;
  --ap-canvas: #f5eee3;
  --ap-gold: #957543;
  --ap-gold-pale: rgba(149, 117, 67, .18);
  --ap-navy-focus: #23486b;
}

/* New editorial articles only. The selector cannot match legacy pages. */
body.ap-editorial-page {
  background: var(--ap-canvas);
  color: var(--ap-ink);
}

body.ap-editorial-page .site { background: var(--ap-canvas); }

body.ap-editorial-page .content-area {
  margin-block: clamp(30px, 5vw, 72px) clamp(44px, 6vw, 92px);
}

/* The live Kadence container otherwise constrains N01 to 842 px. This scope
   is only a non-legacy single post article; category and custom legacy layouts
   keep their own container dimensions. */
body.ap-editorial-article .content-container.site-container {
  max-width: 1024px;
}

body.ap-editorial-page .site-main .single-entry {
  max-width: 976px;
  background: var(--ap-paper);
  border: 1px solid var(--ap-gold-pale);
  border-radius: 20px;
  box-shadow: 0 20px 46px rgba(48, 37, 21, .055);
}

body.ap-editorial-page .single-entry > .entry-content-wrap {
  padding: clamp(30px, 5.4vw, 66px) !important;
}

body.ap-editorial-page .single-entry .entry-header {
  max-width: 748px;
  margin: 0 auto clamp(24px, 3.4vw, 38px);
  padding-bottom: clamp(22px, 3vw, 34px);
  border-bottom: 1px solid var(--ap-gold-pale);
}

body.ap-editorial-page .entry-taxonomies {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

body.ap-editorial-page .entry-taxonomies::before {
  width: 24px;
  height: 1px;
  content: "";
  background: var(--ap-gold);
}

body.ap-editorial-page .entry-taxonomies a,
body.ap-editorial-page .ap-site-kicker {
  color: var(--ap-gold);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .105em;
  line-height: 1.35;
  text-transform: uppercase;
}

body.ap-editorial-page h1.entry-title,
body.ap-editorial-page .entry-hero h1,
body.ap-editorial-page .page-header h1,
body.ap-editorial-page .ap-article-body > h1,
body.ap-editorial-page .ap-self-check-hub > h1 {
  color: var(--ap-ink);
  font-family: inherit;
  font-size: clamp(34px, 4.7vw, 56px);
  font-weight: 620;
  letter-spacing: -.038em;
  line-height: 1.08;
  text-wrap: balance;
}

body.ap-editorial-page .entry-meta,
body.ap-editorial-page .ap-article-meta {
  color: var(--ap-ink-soft);
  font-size: 14px;
  letter-spacing: .01em;
}

body.ap-editorial-page .ap-article-body,
body.ap-editorial-page .ap-self-check-hub {
  max-width: 712px;
  color: var(--ap-ink);
  font-size: clamp(17px, 1.25vw, 19px);
  line-height: 1.78;
}

body.ap-editorial-page .ap-article-body > .ap-article-meta {
  margin-bottom: 1.7em;
  padding-bottom: 1.25em;
  border-bottom: 1px solid var(--ap-gold-pale);
}

/* Kadence already shows the linked author and date in the actual article
   header. Hide only the duplicate in-body label when that header exists.
   Legacy .ap-home articles retain their in-hero linked attribution. */
body.ap-editorial-page:not(.ap-editorial-legacy) .single-entry:has(.entry-header .posted-by) .ap-article-body > .ap-article-meta {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

body.ap-editorial-page .ap-article-body > .ap-article-meta + p,
body.ap-editorial-page .ap-article-body > p:first-child {
  color: #343c45;
  font-size: 1.13em;
  line-height: 1.66;
}

body.ap-editorial-page .ap-article-body > h2,
body.ap-editorial-page .ap-self-check-hub > h2 {
  position: relative;
  margin: 2.45em 0 .72em;
  padding-top: .72em;
  color: var(--ap-ink);
  font-family: inherit;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 630;
  letter-spacing: -.028em;
  line-height: 1.18;
}

body.ap-editorial-page .ap-article-body > h2::before,
body.ap-editorial-page .ap-self-check-hub > h2::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 2px;
  content: "";
  background: var(--ap-gold);
}

body.ap-editorial-page .ap-article-body > h3,
body.ap-editorial-page .ap-self-check-hub > h3 {
  margin-top: 1.9em;
  color: var(--ap-ink);
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 640;
  letter-spacing: -.018em;
}

body.ap-editorial-page .ap-article-body > ul,
body.ap-editorial-page .ap-article-body > ol {
  margin-block: 1.15em 1.6em;
  padding-left: 1.3em;
}

body.ap-editorial-page .ap-article-body > ul > li::marker { color: var(--ap-gold); }
body.ap-editorial-page .ap-article-body > ol > li::marker { color: var(--ap-gold); font-weight: 650; }

body.ap-editorial-page .ap-article-body > blockquote {
  margin: 2em 0;
  padding: clamp(20px, 3vw, 30px) clamp(22px, 4vw, 38px);
  border: 1px solid var(--ap-gold-pale);
  border-left: 3px solid var(--ap-gold);
  border-radius: 0 12px 12px 0;
  background: #fffdf9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}

body.ap-editorial-page .ap-article-body > table {
  overflow: hidden;
  border: 1px solid var(--ap-gold-pale);
  border-radius: 12px;
  background: #fffdf9;
}

body.ap-editorial-page .ap-article-body > table :is(th, td) {
  border-bottom-color: var(--ap-gold-pale);
  padding: 14px 16px;
}

body.ap-editorial-page .ap-article-body > table th {
  color: var(--ap-ink);
  font-weight: 650;
}

body.ap-editorial-page .ap-article-body a,
body.ap-editorial-page .ap-self-check-hub a,
body.ap-editorial-catalog-page .ape-materials a {
  color: #6f5428;
  text-decoration-color: rgba(111, 84, 40, .42);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

body.ap-editorial-page .ap-article-body a:hover,
body.ap-editorial-page .ap-self-check-hub a:hover,
body.ap-editorial-catalog-page .ape-materials a:hover {
  color: var(--ap-ink);
  text-decoration-color: currentColor;
}

body.ap-editorial-page :is(a, button, input, select, textarea):focus-visible,
body.ap-editorial-catalog-page .ape-materials a:focus-visible {
  outline: 3px solid var(--ap-navy-focus);
  outline-offset: 4px;
  border-radius: 3px;
}

/* Existing catalog markup only; the home hero and its six cornerstone cards remain untouched. */
body.ap-editorial-catalog-page .ape-materials {
  max-width: 840px;
  margin-top: clamp(30px, 5vw, 58px);
}

body.ap-editorial-catalog-page .ape-materials-list {
  border-top: 1px solid var(--ap-gold-pale);
}

body.ap-editorial-catalog-page .ape-materials .ape-material-row {
  position: relative;
  padding: clamp(24px, 3vw, 34px) 4px;
  border-bottom-color: var(--ap-gold-pale);
}

body.ap-editorial-catalog-page .ape-materials .ape-material-row::before {
  position: absolute;
  top: 50%;
  left: -10px;
  width: 2px;
  height: 0;
  content: "";
  background: var(--ap-gold);
  transition: height 180ms ease;
  transform: translateY(-50%);
}

body.ap-editorial-catalog-page .ape-materials .ape-material-row:hover::before,
body.ap-editorial-catalog-page .ape-materials .ape-material-row:focus-within::before { height: calc(100% - 28px); }

body.ap-editorial-catalog-page .ape-materials .ape-material-title {
  color: var(--ap-ink);
  font-size: clamp(22px, 2.55vw, 30px);
  font-weight: 620;
  letter-spacing: -.028em;
  line-height: 1.2;
}

body.ap-editorial-catalog-page .ape-materials .ape-material-excerpt {
  max-width: 65ch;
  color: var(--ap-ink-soft);
  font-size: 16px;
  line-height: 1.66;
}

body.ap-editorial-catalog-page .ape-materials .ape-pagination {
  gap: 10px;
  margin-top: 8px;
  padding-top: 30px;
}

body.ap-editorial-catalog-page .ape-materials :is(.ape-pagination a, .ape-current) {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--ap-gold-pale);
  border-radius: 50%;
}

body.ap-editorial-catalog-page .ape-materials .ape-current { background: #fffdf9; color: var(--ap-ink); }

@media (max-width: 600px) {
  body.ap-editorial-article .content-container.site-container { padding-inline: 0; }
  body.ap-editorial-page .content-area { margin-block: 20px 44px; }
  body.ap-editorial-page .site-main .single-entry { width: calc(100% - 24px); border-radius: 14px; }
  body.ap-editorial-page .single-entry > .entry-content-wrap { padding: 28px 20px 34px !important; }
  body.ap-editorial-page .single-entry .entry-header { margin-bottom: 26px; padding-bottom: 22px; }
  body.ap-editorial-page .ap-article-body, body.ap-editorial-page .ap-self-check-hub { font-size: 17px; line-height: 1.72; }
  body.ap-editorial-page .ap-article-body > h2, body.ap-editorial-page .ap-self-check-hub > h2 { margin-top: 2.15em; }
  body.ap-editorial-catalog-page .ape-materials .ape-material-row::before { left: -5px; }
}

@media (prefers-reduced-motion: reduce) {
  body.ap-editorial-page *,
  body.ap-editorial-catalog-page .ape-materials * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Local manifest-controlled editorial figures. */
body.ap-editorial-page .ap-article-visual {
  max-width: 712px;
  margin: clamp(22px, 3.5vw, 36px) auto clamp(28px, 4vw, 46px);
  padding: clamp(12px, 2vw, 18px);
  overflow: hidden;
  border: 1px solid var(--ap-gold-pale);
  border-radius: 12px;
  background: #fffdf9;
  box-shadow: 0 16px 38px rgba(48, 37, 21, .045);
}

body.ap-editorial-page .ap-article-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
}

/* Legacy pages have full-width custom .ap-home sections. Do not wrap them in
   the compact N01 article card just because they share editorial authorship. */
body.ap-editorial-page.ap-editorial-legacy .content-area {
  margin: 0;
}

body.ap-editorial-page.ap-editorial-legacy .site-main .single-entry {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.ap-editorial-page.ap-editorial-legacy .single-entry > .entry-content-wrap {
  padding: 0 !important;
}

body.ap-editorial-page.ap-editorial-legacy .ap-home .ap-article-visual {
  max-width: min(860px, calc(100% - 36px));
  margin: clamp(24px, 4vw, 48px) auto;
}
