/* Issue #670 V2 desktop correction.
   Keep mobile/tablet below 900px on the existing presentation contract.
   The hero is a sibling of the article in the generated SharePlane shell,
   so desktop hero selectors must not depend on an article ancestor. */

.i670-hero {
  --i670-navy: #071d3d;
  --i670-blue: #195a9b;
  --i670-green: #17633c;
  --i670-gold: #c89436;
}

.i670-hero__copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.i670-byline {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 1.1rem 0 0;
  color: #52677a;
  font: 650 0.9rem/1.4 system-ui, sans-serif;
}

.i670-byline strong {
  font-weight: 760;
}

.i670-byline a {
  color: var(--i670-navy);
  text-decoration: none;
}

.i670-byline a:hover,
.i670-byline a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.i670-byline time {
  color: #61778a;
}

.i670-hero__signal {
  display: none;
}

html[data-theme="dark"] .i670-byline,
html[data-effective-theme="dark"] .i670-byline,
html[data-theme="dark"] .i670-byline time,
html[data-effective-theme="dark"] .i670-byline time {
  color: #c2d0da;
}

html[data-theme="dark"] .i670-byline a,
html[data-effective-theme="dark"] .i670-byline a {
  color: #ffffff;
}

@media (min-width: 900px) {
  .sp-article.sp-reading[data-shareplane-special="issue-670"] {
    width: min(calc(100% - 3rem), 78rem);
  }

  .sp-article[data-shareplane-special="issue-670"] > section {
    width: min(100%, 48rem);
    margin-left: auto;
    margin-right: auto;
  }

  .sp-article[data-shareplane-special="issue-670"] > section#the-decision,
  .sp-article[data-shareplane-special="issue-670"] > section#google-wins-the-church-decision-microsoft-wins-several-technical-categories {
    width: min(100%, 52rem);
  }

  .sp-article[data-shareplane-special="issue-670"] > section#weighted-church-fit-model {
    width: min(100%, 64rem);
  }

  .sp-article[data-shareplane-special="issue-670"] > section#weighted-church-fit-model > p,
  .sp-article[data-shareplane-special="issue-670"] > section#weighted-church-fit-model > h2 {
    max-width: 48rem;
  }

  .i670-hero {
    position: relative;
    width: min(70rem, calc(100vw - 3rem));
    min-height: 31rem;
    margin: 2rem auto 4rem;
    overflow: hidden;
    padding: clamp(2.8rem, 4.8vw, 4.5rem);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 30px;
    background:
      radial-gradient(circle at 83% 16%, rgba(232, 180, 90, 0.2), transparent 22%),
      radial-gradient(circle at 76% 72%, rgba(23, 99, 60, 0.3), transparent 33%),
      linear-gradient(145deg, #06182a 0%, #0a2942 56%, #103c42 100%);
    color: #f7fbff;
    box-shadow: 0 30px 84px rgba(7, 29, 61, 0.2);
  }

  .i670-hero::after {
    content: "";
    position: absolute;
    right: -3rem;
    bottom: -6rem;
    width: 26rem;
    height: 26rem;
    opacity: 0.2;
    background:
      conic-gradient(from 30deg, transparent 0 10%, #c89436 10% 17%, transparent 17% 29%, #195a9b 29% 36%, transparent 36% 48%, #17633c 48% 55%, transparent 55% 67%, #c89436 67% 74%, transparent 74% 100%);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    pointer-events: none;
  }

  .i670-hero .i670-eyebrow {
    position: relative;
    z-index: 2;
    margin-bottom: 1rem;
    color: #efbd68;
  }

  .i670-hero h1 {
    position: relative;
    z-index: 2;
    max-width: 13ch;
    margin: 0;
    color: #ffffff;
    font-size: clamp(3.7rem, 5vw, 5rem);
    line-height: 0.94;
    letter-spacing: -0.05em;
    text-wrap: balance;
  }

  .i670-hero .i670-dek {
    position: relative;
    z-index: 2;
    max-width: 42rem;
    margin-top: 1.35rem;
    color: #d8e4ed;
    font-size: clamp(1.2rem, 1.7vw, 1.42rem);
    line-height: 1.52;
  }

  .i670-hero .i670-byline,
  .i670-hero .i670-byline time {
    color: #bacbd8;
  }

  .i670-hero .i670-byline a {
    color: #ffffff;
  }

  .i670-hero .i670-recommendation {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 0.3rem;
    max-width: 42rem;
    margin-top: 1.7rem;
    padding: 1.15rem 1.3rem;
    border-left: 5px solid #e7b75e;
    border-radius: 0 15px 15px 0;
    background: rgba(19, 92, 57, 0.96);
    color: #f8fff9;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.15);
  }

  .i670-hero .i670-recommendation strong {
    color: #ffffff;
  }

  .i670-hero .i670-recommendation span {
    color: #e5f0e7;
  }

  .i670-hero .i670-hero__principles {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.25rem;
  }

  .i670-hero .i670-hero__principles span {
    padding: 0.5rem 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #eef5f8;
    font: 720 0.75rem/1 system-ui, sans-serif;
  }

  .sp-article[data-shareplane-special="issue-670"] > .i670-decision,
  .sp-article[data-shareplane-special="issue-670"] > .i670-models,
  .sp-article[data-shareplane-special="issue-670"] > .i670-graph,
  .sp-article[data-shareplane-special="issue-670"] > .i670-close,
  .sp-article[data-shareplane-special="issue-670"] > .i670-figure {
    position: relative;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .sp-article[data-shareplane-special="issue-670"] > .i670-decision {
    width: min(100%, 70rem);
    margin-top: 4.1rem;
    margin-bottom: 2.2rem;
  }

  .sp-article[data-shareplane-special="issue-670"] > .i670-models,
  .sp-article[data-shareplane-special="issue-670"] > .i670-graph,
  .sp-article[data-shareplane-special="issue-670"] > .i670-close {
    width: min(100%, 68rem);
  }

  .sp-article[data-shareplane-special="issue-670"] > .i670-figure {
    width: min(100%, 64rem);
    margin-top: 4rem;
    margin-bottom: 4rem;
  }
}

@media (min-width: 1180px) {
  .i670-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(21rem, 0.85fr);
    gap: clamp(2.8rem, 4.5vw, 5.2rem);
    width: min(77.5rem, calc(100vw - 4rem));
    min-height: 35rem;
    align-items: center;
    padding: clamp(3.25rem, 4.2vw, 4.8rem);
  }

  .i670-hero__copy {
    max-width: 43rem;
  }

  .i670-hero h1 {
    font-size: clamp(4rem, 4.6vw, 5.35rem);
  }

  .i670-hero__signal {
    position: relative;
    z-index: 2;
    display: grid;
    min-height: 27rem;
    align-content: space-between;
    gap: 1.25rem;
    overflow: hidden;
    padding: 1.6rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    background:
      linear-gradient(155deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
      rgba(4, 20, 34, 0.3);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
  }

  .i670-hero__mosaic {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
    width: min(100%, 18rem);
    margin-left: auto;
  }

  .i670-hero__mosaic span {
    aspect-ratio: 1;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
  }

  .i670-hero__mosaic span:nth-child(1),
  .i670-hero__mosaic span:nth-child(5),
  .i670-hero__mosaic span:nth-child(9) {
    background: rgba(232, 180, 90, 0.78);
  }

  .i670-hero__mosaic span:nth-child(2),
  .i670-hero__mosaic span:nth-child(7) {
    background: rgba(57, 132, 190, 0.72);
  }

  .i670-hero__mosaic span:nth-child(4),
  .i670-hero__mosaic span:nth-child(8) {
    background: rgba(60, 133, 87, 0.82);
  }

  .i670-hero__choice {
    display: grid;
    gap: 0.45rem;
    padding: 1.25rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .i670-hero__choice small,
  .i670-hero__rule span {
    color: #efbd68;
    font: 760 0.72rem/1.2 system-ui, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .i670-hero__choice strong {
    color: #ffffff;
    font-size: clamp(1.6rem, 2vw, 2.15rem);
    line-height: 1.05;
  }

  .i670-hero__choice > span {
    color: #d8e4ed;
    font-size: 0.98rem;
    line-height: 1.45;
  }

  .i670-hero__rule {
    display: grid;
    gap: 0.3rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .i670-hero__rule strong {
    color: #ffffff;
    font-size: 1.15rem;
  }

  .sp-article[data-shareplane-special="issue-670"] > .i670-decision {
    width: min(100%, 72rem);
  }

  .sp-article[data-shareplane-special="issue-670"] > .i670-models,
  .sp-article[data-shareplane-special="issue-670"] > .i670-graph,
  .sp-article[data-shareplane-special="issue-670"] > .i670-close {
    width: min(100%, 70rem);
  }

  .sp-article[data-shareplane-special="issue-670"] > .i670-figure {
    width: min(100%, 66rem);
  }
}

@media (min-width: 1600px) {
  .i670-hero {
    width: 77.5rem;
    min-height: 37rem;
  }
}
