/* =========================================================
   WPNfinite Editorial System
   Version 1.4.6
   ========================================================= */

.wpnfinite-editorial-shell {
  --wpnfinite-reading-width: 760px;
  --wpnfinite-wide-width: 1080px;
  --wpnfinite-editorial-gap: clamp(1.75rem, 3vw, 2.5rem);
  width: 100%;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.wpnfinite-editorial {
  width: 100%;
}

/* Hero */
.wpnfinite-editorial-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--wpnfinite-border);
  background:
    radial-gradient(circle at 84% 18%, color-mix(in srgb, var(--wpnfinite-accent) 12%, transparent), transparent 32%),
    linear-gradient(135deg, rgba(7,16,10,.99), rgba(2,8,5,.99));
}

.wpnfinite-editorial-hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -190px;
  bottom: -250px;
  border: 1px solid color-mix(in srgb, var(--wpnfinite-accent) 18%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.wpnfinite-editorial-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr);
  align-items: end;
  gap: clamp(2.5rem, 5vw, 5rem);
  width: min(calc(100% - 48px), 1220px);
  margin-inline: auto;
  padding: clamp(2.5rem, 4vw, 3.75rem) 0 clamp(1.25rem, 2vw, 1.75rem);
}

.wpnfinite-editorial-hero:not(.wpnfinite-editorial-hero--has-media) .wpnfinite-editorial-hero__inner {
  grid-template-columns: minmax(0, 920px);
}

.wpnfinite-editorial-hero__content { min-width: 0; }

.wpnfinite-editorial-hero__media {
  margin: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--wpnfinite-accent) 16%, var(--wpnfinite-border));
  border-radius: clamp(16px, 2vw, 24px);
  background: var(--wpnfinite-surface);
  box-shadow: 0 28px 70px rgba(0,0,0,.28);
}

.wpnfinite-editorial-hero__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.wpnfinite-editorial-kicker {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.2rem;
  color: var(--wpnfinite-accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.wpnfinite-editorial-kicker::before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
}

.wpnfinite-editorial-category {
  display: inline-flex;
  margin-bottom: 1.15rem;
  color: var(--wpnfinite-muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.wpnfinite-editorial-category:hover { color: var(--wpnfinite-accent); }

.wpnfinite-editorial-title {
  max-width: 820px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.9rem, 5.8vw, 5.5rem);
  line-height: .98;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.wpnfinite-editorial-deck {
  max-width: 690px;
  margin: 1.55rem 0 0;
  color: rgba(255,255,255,.78);
  font-size: clamp(1.05rem, 1.7vw, 1.27rem);
  line-height: 1.65;
}

.wpnfinite-editorial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1.8rem;
  color: rgba(255,255,255,.58);
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}


/* Reading column */
.wpnfinite-editorial-body {
  width: min(calc(100% - 40px), 1220px);
  margin-inline: auto;
  padding-top: clamp(1rem, 1.6vw, 1.5rem);
}

.wpnfinite-editorial-body--with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}

.wpnfinite-editorial-content {
  min-width: 0;
}

.wpnfinite-editorial-body:not(.wpnfinite-editorial-body--with-sidebar) .wpnfinite-editorial-content {
  width: min(100%, var(--wpnfinite-wide-width));
  margin-inline: auto;
}

.wpnfinite-editorial-body--with-sidebar .wpnfinite-editorial-content > * {
  margin-left: 0;
  margin-right: 0;
}

.wpnfinite-editorial-sidebar {
  min-width: 0;
}

.wpnfinite-editorial-sidebar__inner {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 1rem;
}

.wpnfinite-editorial-widget {
  margin: 0;
  padding: 1.35rem;
  border: 1px solid var(--wpnfinite-border);
  border-radius: var(--wpnfinite-radius);
  background: color-mix(in srgb, var(--wpnfinite-surface) 92%, transparent);
}

.wpnfinite-editorial-widget__title,
.wpnfinite-editorial-widget .wp-block-heading {
  margin: 0 0 .9rem;
  color: #fff;
  font-size: 1rem;
  line-height: 1.25;
}

.wpnfinite-editorial-widget p,
.wpnfinite-editorial-widget li {
  font-size: .9rem;
  line-height: 1.6;
}

.wpnfinite-editorial-widget ul,
.wpnfinite-editorial-widget ol {
  margin: 0;
  padding-left: 1.1rem;
}

.wpnfinite-editorial-widget a {
  color: var(--wpnfinite-text);
}

.wpnfinite-editorial-widget a:hover { color: var(--wpnfinite-accent); }

/* Override the legacy direct-child width rule for editorial posts. */
.wpnfinite-editorial-content > * {
  width: min(100%, var(--wpnfinite-reading-width));
  max-width: var(--wpnfinite-reading-width);
  margin-left: auto;
  margin-right: auto;
}

.wpnfinite-editorial-content > .alignwide,
.wpnfinite-editorial-content > .wpnfinite-editorial-wide,
.wpnfinite-editorial-content > .wp-block-gallery,
.wpnfinite-editorial-content > .wp-block-columns {
  width: min(100%, var(--wpnfinite-wide-width));
  max-width: var(--wpnfinite-wide-width);
}

.wpnfinite-editorial-content > .alignfull {
  position: relative;
  left: 50%;
  width: 100vw;
  max-width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* The article should begin immediately after the hero.
   Section-heading margins still create generous rhythm later in the story,
   but the first block/heading must not stack that margin on top of body spacing. */
.wpnfinite-editorial-content > :first-child {
  margin-top: 0;
}

.wpnfinite-editorial-content > h1:first-child,
.wpnfinite-editorial-content > h2:first-child,
.wpnfinite-editorial-content > h3:first-child,
.wpnfinite-editorial-content > h4:first-child,
.wpnfinite-editorial-content > section:first-child > h1:first-child,
.wpnfinite-editorial-content > section:first-child > h2:first-child,
.wpnfinite-editorial-content > section:first-child > h3:first-child,
.wpnfinite-editorial-content > section:first-child > h4:first-child,
.wpnfinite-editorial-content > div:first-child > h1:first-child,
.wpnfinite-editorial-content > div:first-child > h2:first-child,
.wpnfinite-editorial-content > div:first-child > h3:first-child,
.wpnfinite-editorial-content > div:first-child > h4:first-child {
  margin-top: 0;
}

.wpnfinite-editorial-content p,
.wpnfinite-editorial-content li {
  font-size: clamp(1.02rem, 1.4vw, 1.12rem);
  line-height: 1.82;
}

.wpnfinite-editorial-content p { margin-bottom: 1.35rem; }

.wpnfinite-editorial-content h2 {
  margin-top: clamp(2.5rem, 4vw, 4rem);
  margin-bottom: 1.25rem;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.wpnfinite-editorial-content h3 {
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  font-size: clamp(1.45rem, 2.7vw, 2rem);
  letter-spacing: -.02em;
}

.wpnfinite-editorial-content h4 {
  margin-top: 2rem;
  font-size: 1.2rem;
}

.wpnfinite-editorial-content ul,
.wpnfinite-editorial-content ol {
  padding-left: 1.4rem;
  margin-top: 1.25rem;
  margin-bottom: 1.75rem;
}

.wpnfinite-editorial-content li + li { margin-top: .55rem; }

.wpnfinite-editorial-content a:not(.wp-block-button__link):not(.wpnfinite-editorial-chip) {
  text-decoration: underline;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

.wpnfinite-editorial-content blockquote {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  padding: 1.6rem 1.75rem;
  border-left: 3px solid var(--wpnfinite-accent);
  background: color-mix(in srgb, var(--wpnfinite-surface) 84%, transparent);
  border-radius: 0 var(--wpnfinite-radius) var(--wpnfinite-radius) 0;
}

.wpnfinite-editorial-content blockquote p {
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.42rem);
  line-height: 1.6;
}

.wpnfinite-editorial-content .wp-block-image {
  margin-top: 2.75rem;
  margin-bottom: 2.75rem;
}

.wpnfinite-editorial-content .wp-block-image img { border-radius: var(--wpnfinite-radius); }

.wpnfinite-editorial-content hr {
  margin-top: 4rem;
  margin-bottom: 4rem;
  border: 0;
  border-top: 1px solid var(--wpnfinite-border);
}

/* Resource/guide primitives. These are intentionally generic and reusable. */
.wpnfinite-editorial-callout,
.wpnfinite-editorial-checklist,
.wpnfinite-editorial-compare,
.wpnfinite-editorial-steps,
.wpnfinite-editorial-note {
  width: min(100%, var(--wpnfinite-wide-width));
  max-width: var(--wpnfinite-wide-width);
}

.wpnfinite-editorial-callout {
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: clamp(1.35rem, 3vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--wpnfinite-accent) 30%, var(--wpnfinite-border));
  border-left: 4px solid var(--wpnfinite-accent);
  border-radius: 4px var(--wpnfinite-radius) var(--wpnfinite-radius) 4px;
  background: color-mix(in srgb, var(--wpnfinite-accent) 7%, var(--wpnfinite-surface));
}

.wpnfinite-editorial-callout > :last-child { margin-bottom: 0; }

.wpnfinite-editorial-eyebrow {
  display: block;
  margin-bottom: .65rem;
  color: var(--wpnfinite-accent);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.wpnfinite-editorial-compare.wp-block-columns { gap: 1rem; }

.wpnfinite-editorial-card {
  height: 100%;
  padding: clamp(1.35rem, 3vw, 2rem);
  border: 1px solid var(--wpnfinite-border);
  border-radius: var(--wpnfinite-radius);
  background: color-mix(in srgb, var(--wpnfinite-surface) 92%, transparent);
}

.wpnfinite-editorial-card > :last-child { margin-bottom: 0; }
.wpnfinite-editorial-card h3,
.wpnfinite-editorial-card h4 { margin-top: 0; }

.wpnfinite-editorial-steps {
  margin-top: 2rem;
  margin-bottom: 2rem;
  counter-reset: wpnfinite-step;
}

.wpnfinite-editorial-step {
  position: relative;
  min-height: 56px;
  padding: 1.25rem 0 1.25rem 4.4rem;
  border-bottom: 1px solid var(--wpnfinite-border);
  counter-increment: wpnfinite-step;
}

.wpnfinite-editorial-step:first-child { border-top: 1px solid var(--wpnfinite-border); }
.wpnfinite-editorial-step::before {
  content: counter(wpnfinite-step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.15rem;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--wpnfinite-dark);
  background: var(--wpnfinite-accent);
  font-size: .75rem;
  font-weight: 900;
}
.wpnfinite-editorial-step > :last-child { margin-bottom: 0; }

.wpnfinite-editorial-checklist {
  margin-top: 3rem;
  margin-bottom: 3rem;
  padding: clamp(1.65rem, 4vw, 3rem);
  border-radius: clamp(16px, 2vw, 24px);
  color: var(--wpnfinite-dark);
  background: var(--wpnfinite-accent);
}

.wpnfinite-editorial-checklist h2,
.wpnfinite-editorial-checklist h3,
.wpnfinite-editorial-checklist p,
.wpnfinite-editorial-checklist li { color: var(--wpnfinite-dark); }

.wpnfinite-editorial-checklist h2,
.wpnfinite-editorial-checklist h3 { margin-top: 0; }

.wpnfinite-editorial-checklist ul {
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
}

.wpnfinite-editorial-checklist li {
  position: relative;
  padding: .9rem 0 .9rem 2rem;
  border-top: 1px solid color-mix(in srgb, var(--wpnfinite-dark) 18%, transparent);
  font-weight: 650;
}

.wpnfinite-editorial-checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: .82rem;
  font-weight: 900;
}

.wpnfinite-editorial-note {
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--wpnfinite-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--wpnfinite-surface) 80%, transparent);
  color: var(--wpnfinite-muted);
  font-size: .88rem;
}
.wpnfinite-editorial-note > :last-child { margin-bottom: 0; }

/* Guide style gets a stronger accent identity without hardcoding a brand. */
.wpnfinite-editorial--creator-guide .wpnfinite-editorial-hero:not(.wpnfinite-editorial-hero--has-media) {
  background:
    radial-gradient(circle at 78% 18%, color-mix(in srgb, var(--wpnfinite-accent) 22%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--wpnfinite-dark) 92%, var(--wpnfinite-accent)), var(--wpnfinite-dark));
}


/* Footer / related */
.wpnfinite-editorial-footer {
  width: min(calc(100% - 40px), var(--wpnfinite-wide-width));
  margin: var(--wpnfinite-editorial-gap) auto 0;
  padding-top: clamp(2.4rem, 5vw, 4rem);
  border-top: 1px solid var(--wpnfinite-border);
}

.wpnfinite-editorial-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.wpnfinite-editorial-footer__label {
  color: var(--wpnfinite-accent);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.wpnfinite-editorial-footer h2 {
  margin: .35rem 0 0;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  letter-spacing: -.03em;
}

.wpnfinite-editorial-topic-link {
  flex: 0 0 auto;
  padding: .75rem 1rem;
  border: 1px solid var(--wpnfinite-border);
  border-radius: 999px;
  color: var(--wpnfinite-text);
  font-size: .82rem;
  font-weight: 750;
}

.wpnfinite-editorial-related {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.wpnfinite-editorial-related-card {
  overflow: hidden;
  border: 1px solid var(--wpnfinite-border);
  border-radius: var(--wpnfinite-radius);
  background: var(--wpnfinite-surface);
}

.wpnfinite-editorial-related-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.wpnfinite-editorial-related-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.wpnfinite-editorial-related-card:hover img { transform: scale(1.025); }
.wpnfinite-editorial-related-card__placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--wpnfinite-surface-alt), var(--wpnfinite-surface)); }
.wpnfinite-editorial-related-card__body { padding: 1.15rem; }
.wpnfinite-editorial-related-card__body > span { color: var(--wpnfinite-accent); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.wpnfinite-editorial-related-card h3 { margin: .45rem 0 0; font-size: 1.08rem; line-height: 1.35; }
.wpnfinite-editorial-related-card h3 a { color: #fff; }

.wpnfinite-editorial-comments {
  width: min(calc(100% - 40px), var(--wpnfinite-reading-width));
  margin: clamp(3rem, 6vw, 5rem) auto 0;
}

@media (max-width: 900px) {
  .wpnfinite-editorial-hero__inner {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 2.25rem;
    padding-top: 3rem;
    padding-bottom: 2.25rem;
  }

  .wpnfinite-editorial-hero__media { max-width: 760px; }

  .wpnfinite-editorial-body--with-sidebar {
    grid-template-columns: 1fr;
  }

  .wpnfinite-editorial-sidebar__inner {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wpnfinite-editorial-related { grid-template-columns: 1fr; }
  .wpnfinite-editorial-related-card { display: grid; grid-template-columns: 130px 1fr; }
  .wpnfinite-editorial-related-card__media { aspect-ratio: 1 / 1; }
  .wpnfinite-editorial-footer__inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
  .wpnfinite-editorial-hero__inner,
  .wpnfinite-editorial-body,
  .wpnfinite-editorial-footer,
  .wpnfinite-editorial-comments { width: min(calc(100% - 30px), var(--wpnfinite-wide-width)); }

  .wpnfinite-editorial-hero__inner { padding-top: 2.5rem; padding-bottom: 2rem; }
  .wpnfinite-editorial-body { padding-top: 1.25rem; }
  .wpnfinite-editorial-title { font-size: clamp(2.65rem, 13vw, 4.5rem); }
  .wpnfinite-editorial-meta { gap: .45rem; font-size: .7rem; }
  .wpnfinite-editorial-sidebar__inner { grid-template-columns: 1fr; }
  .wpnfinite-editorial-related-card { grid-template-columns: 105px 1fr; }
  .wpnfinite-editorial-related-card__body { padding: .9rem; }
}

/* =========================================================
   Block editor authoring parity
   ========================================================= */
.editor-styles-wrapper {
  --wpnfinite-reading-width: 760px;
  --wpnfinite-wide-width: 1080px;
}

.editor-styles-wrapper .wp-block-post-content > p,
.editor-styles-wrapper .wp-block-post-content > h2,
.editor-styles-wrapper .wp-block-post-content > h3,
.editor-styles-wrapper .wp-block-post-content > h4,
.editor-styles-wrapper .wp-block-post-content > ul,
.editor-styles-wrapper .wp-block-post-content > ol,
.editor-styles-wrapper .wp-block-post-content > blockquote {
  width: min(100%, var(--wpnfinite-reading-width));
  max-width: var(--wpnfinite-reading-width);
  margin-left: auto;
  margin-right: auto;
}

.editor-styles-wrapper .wp-block-post-content > .wpnfinite-editorial-callout,
.editor-styles-wrapper .wp-block-post-content > .wpnfinite-editorial-checklist,
.editor-styles-wrapper .wp-block-post-content > .wpnfinite-editorial-compare,
.editor-styles-wrapper .wp-block-post-content > .wpnfinite-editorial-steps,
.editor-styles-wrapper .wp-block-post-content > .wpnfinite-editorial-note,
.editor-styles-wrapper .wp-block-post-content > .alignwide,
.editor-styles-wrapper .wp-block-post-content > .wp-block-columns,
.editor-styles-wrapper .wp-block-post-content > .wp-block-gallery {
  width: min(100%, var(--wpnfinite-wide-width));
  max-width: var(--wpnfinite-wide-width);
  margin-left: auto;
  margin-right: auto;
}

.editor-styles-wrapper .wpnfinite-editorial-callout,
.editor-styles-wrapper .wpnfinite-editorial-checklist,
.editor-styles-wrapper .wpnfinite-editorial-card,
.editor-styles-wrapper .wpnfinite-editorial-step,
.editor-styles-wrapper .wpnfinite-editorial-note {
  box-sizing: border-box;
}

.wpnfinite-editorial-settings-panel .components-notice {
  margin: 16px 0 0;
}
