/* ==========================================================
   INSIGHTS HOME PAGE (2.9)
   Hero with the newest article, topics, recent insights, the
   newsletter, how we work and About. Loaded on the home page,
   landing pages and in the page editor. Colors use the theme
   tokens, so dark mode follows automatically.
========================================================== */

/* ----------------------------------------------------------
   Hero: headline next to the newest article
---------------------------------------------------------- */

:is(.nn-home, .editor-styles-wrapper) .nn-ihero {
  background:
    radial-gradient(60% 70% at 92% 0%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--bg), var(--surface-alt));
  border-bottom: 1px solid var(--border);
  padding: clamp(56px, 7vw, 88px) 0 clamp(56px, 7vw, 80px);
}

:is(.nn-home, .editor-styles-wrapper) .nn-ihero__grid {
  align-items: center;
  display: grid;
  gap: clamp(40px, 5vw, 72px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}

:is(.nn-home, .editor-styles-wrapper) .nn-ihero h1 {
  font-size: clamp(2.6rem, 4.6vw, 4.1rem);
  margin-bottom: 24px;
}

:is(.nn-home, .editor-styles-wrapper) p.nn-ihero__intro {
  color: var(--text);
  font-size: 1.12rem;
  margin: 0 0 32px;
  max-width: 540px;
}

:is(.nn-home, .editor-styles-wrapper) .nn-ihero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* The newest article */
.nn-feature {
  display: grid;
  gap: 14px;
}

.nn-feature__lead {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.nn-feature__media {
  aspect-ratio: 40 / 21;
  background: var(--surface-alt);
  display: block;
  overflow: hidden;
  position: relative;
}

.nn-feature__media img,
.nn-feature__media .nn-card__placeholder {
  display: block;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.2s ease;
  width: 100%;
}

.nn-feature__lead:hover .nn-feature__media img {
  opacity: 0.92;
}

/* "Latest analysis" sits beside the topic, not over the data graphic. */
:is(.nn-home, .editor-styles-wrapper) .nn-feature p.nn-feature__kicker {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0 0 8px;
}

.nn-feature__badge {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  text-transform: uppercase;
}

.nn-feature__body {
  padding: 22px 26px 24px;
}

:is(.nn-home, .editor-styles-wrapper) .nn-feature .nn-eyebrow {
  color: var(--accent);
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 0;
  text-transform: uppercase;
}

/* Long headlines stay compact: at most three lines in the hero card.
   (Scoped to beat the home page's large section h2.) */
:is(.nn-home, .editor-styles-wrapper) .nn-feature h2.nn-feature__title {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--text-strong);
  display: -webkit-box;
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 8px;
  overflow: hidden;
}

.nn-feature__title a:hover {
  color: var(--accent);
}

:is(.nn-home, .editor-styles-wrapper) .nn-feature p.nn-feature__excerpt {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text-soft);
  display: -webkit-box;
  font-size: 0.94rem;
  line-height: 1.55;
  margin: 0 0 10px;
  overflow: hidden;
}

:is(.nn-home, .editor-styles-wrapper) .nn-feature p.nn-feature__meta {
  color: var(--text-muted);
  display: flex;
  font-size: 0.82rem;
  gap: 8px;
  margin: 0;
}

.nn-feature__more {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nn-feature__more a {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-strong);
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 12px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nn-feature__more a:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
}

.nn-feature__more-date {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  min-width: 46px;
  text-transform: uppercase;
}

.nn-feature__more-title {
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.35;
}

.nn-feature__more .nn-icon {
  color: var(--accent);
  height: 16px;
  width: 16px;
}

/* ----------------------------------------------------------
   Topics
---------------------------------------------------------- */

:is(.nn-home, .editor-styles-wrapper) .nn-topics .section-heading {
  margin: 0 auto 44px;
  max-width: 680px;
}

:is(.nn-home, .editor-styles-wrapper) .nn-topics .section-heading p:where(:not(.nn-div, .nn-span)) {
  margin-inline: auto;
}

.nn-topics-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.nn-topic-card {
  background: var(--mc-soft);
  border: 1px solid var(--mc-border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.nn-topic-card:hover {
  border-color: var(--mc);
  box-shadow: var(--shadow-sm);
}

.nn-topic-card__link {
  display: block;
  flex: 1;
  padding: 24px 24px 20px;
}

.nn-topic-card__icon {
  color: var(--mc);
  display: inline-block;
  height: 28px;
  margin-bottom: 18px;
  width: 28px;
}

.nn-topic-card__icon .nn-icon {
  height: 100%;
  width: 100%;
}

:is(.nn-home, .editor-styles-wrapper) h3.nn-topic-card__title {
  color: var(--mc-ink);
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 8px;
}

:is(.nn-home, .editor-styles-wrapper) p.nn-topic-card__text {
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}

.nn-topic-card__latest {
  background: var(--mc-strong);
  border-top: 1px solid var(--mc-border);
  color: var(--text-strong);
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
  padding: 14px 24px 16px;
}

.nn-topic-card__latest span {
  color: var(--mc-ink);
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.nn-topic-card__latest:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------------
   Newsletter (navy)
---------------------------------------------------------- */

:is(.nn-home, .editor-styles-wrapper) .nn-newsletter-section {
  background:
    radial-gradient(50% 80% at 100% 0%, rgba(16, 184, 129, 0.16), transparent 70%),
    linear-gradient(140deg, #071c34, #0a2a4a 65%, #0b2442);
  color: #fff;
}

:is(.nn-home, .editor-styles-wrapper) .nn-newsletter-section__grid {
  align-items: center;
  display: grid;
  gap: clamp(40px, 6vw, 96px);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

:is(.nn-home, .editor-styles-wrapper) .nn-newsletter-section .eyebrow {
  color: #8fd9bd;
}

:is(.nn-home, .editor-styles-wrapper) .nn-newsletter-section h2 {
  color: #fff;
  font-size: clamp(2rem, 3.2vw, 3rem);
}

:is(.nn-home, .editor-styles-wrapper) .nn-newsletter-section p:where(:not(.nn-div, .nn-span)) {
  color: #c9d6e8;
  max-width: 520px;
}

:is(.nn-home, .editor-styles-wrapper) .nn-checks {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

:is(.nn-home, .editor-styles-wrapper) .nn-checks li {
  color: #e6edf7;
  font-weight: 600;
  padding-left: 30px;
  position: relative;
}

:is(.nn-home, .editor-styles-wrapper) .nn-checks li::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat, #10b881;
  border-radius: 999px;
  content: "";
  height: 20px;
  left: 0;
  position: absolute;
  top: 3px;
  width: 20px;
}

/* The signup form as a white card on the navy section */
.nn-signup--feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.5);
  padding: clamp(24px, 3vw, 36px);
}

.nn-signup--feature .nn-signup__title {
  font-size: 1.5rem;
}

:is(.nn-home, .editor-styles-wrapper) .nn-signup--feature p.nn-signup__blurb {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin: 0 0 18px;
}

.nn-signup--feature .nn-signup__form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.nn-signup--feature .nn-signup__form .button {
  width: auto;
}

.nn-signup--feature .nn-signup__form input[type="email"] {
  font-size: 0.95rem;
  min-height: 48px;
}

.nn-signup--feature .nn-signup__form .button {
  min-height: 48px;
}

:is(.nn-home, .editor-styles-wrapper) .nn-signup--feature :is(p.nn-signup__note, p.nn-signup__admin, p.nn-signup__status) {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 12px 0 0;
}

/* ----------------------------------------------------------
   How we work
---------------------------------------------------------- */

:is(.nn-home, .editor-styles-wrapper) .nn-approach__grid {
  align-items: start;
  display: grid;
  gap: clamp(32px, 5vw, 72px);
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
}

:is(.nn-home, .editor-styles-wrapper) .nn-approach h2.nn-h-sm {
  font-size: clamp(1.6rem, 2.3vw, 2.15rem);
  line-height: 1.12;
  margin: 0;
}

:is(.nn-home, .editor-styles-wrapper) .nn-approach__list {
  display: grid;
  gap: 0 32px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

:is(.nn-home, .editor-styles-wrapper) .nn-approach__item {
  border-top: 2px solid var(--text-strong);
  padding-top: 18px;
}

:is(.nn-home, .editor-styles-wrapper) p.nn-approach__num {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}

:is(.nn-home, .editor-styles-wrapper) .nn-approach__item h3 {
  color: var(--text-strong);
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

:is(.nn-home, .editor-styles-wrapper) .nn-approach__item p:where(:not(.nn-div, .nn-span)) {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* ----------------------------------------------------------
   About and contact
---------------------------------------------------------- */

:is(.nn-home, .editor-styles-wrapper) .nn-about {
  padding-top: 0;
}

:is(.nn-home, .editor-styles-wrapper) .nn-about__box {
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 24px;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: clamp(28px, 4vw, 52px);
}

:is(.nn-home, .editor-styles-wrapper) .nn-about h2.nn-h-sm {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.15;
  margin-bottom: 14px;
  max-width: 760px;
}

:is(.nn-home, .editor-styles-wrapper) .nn-about p:where(:not(.nn-div, .nn-span)) {
  margin: 0;
  max-width: 720px;
}

/* ----------------------------------------------------------
   Smaller screens
---------------------------------------------------------- */

@media (max-width: 1100px) {
  :is(.nn-home, .editor-styles-wrapper) .nn-ihero__grid,
  :is(.nn-home, .editor-styles-wrapper) .nn-approach__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nn-topics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  :is(.nn-home, .editor-styles-wrapper) .nn-newsletter-section__grid,
  :is(.nn-home, .editor-styles-wrapper) .nn-about__box {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(.nn-home, .editor-styles-wrapper) .nn-approach__list {
    gap: 28px;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .nn-topics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nn-feature__body {
    padding: 18px 20px 20px;
  }

  .nn-signup--feature .nn-signup__form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The card keeps its own colors inside the navy section. */
:is(.nn-home, .editor-styles-wrapper) .nn-newsletter-section h2.nn-signup__title {
  color: var(--text-strong);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 6px;
}

/* Topic card colors (light, then dark). */
.nn-accent--green {
  --mc: #0d9d6d;
  --mc-ink: #0b815a;
  --mc-soft: #f1faf6;
  --mc-strong: #e3f5ec;
  --mc-border: #cfeade;
}

.nn-accent--blue {
  --mc: #114bc4;
  --mc-ink: #114bc4;
  --mc-soft: #f2f6fd;
  --mc-strong: #e4ecfb;
  --mc-border: #d4def3;
}

.nn-accent--navy {
  --mc: #12345c;
  --mc-ink: #071c34;
  --mc-soft: #f4f6f9;
  --mc-strong: #e8ecf2;
  --mc-border: #dce1e8;
}

.nn-accent--amber {
  --mc: #cd8408;
  --mc-ink: #9c6406;
  --mc-soft: #fdf9f0;
  --mc-strong: #fcefd6;
  --mc-border: #f4dfb6;
}

.is-dark .nn-accent--green {
  --mc: #3fcf9b;
  --mc-ink: #52e0b1;
  --mc-soft: #102520;
  --mc-strong: #133029;
  --mc-border: #22463a;
}

.is-dark .nn-accent--blue {
  --mc: #7ea6f6;
  --mc-ink: #a9c3f8;
  --mc-soft: #111f37;
  --mc-strong: #152846;
  --mc-border: #253d66;
}

.is-dark .nn-accent--navy {
  --mc: #a9b5c6;
  --mc-ink: #eef3fb;
  --mc-soft: #131c2a;
  --mc-strong: #1a2536;
  --mc-border: #2a3a52;
}

.is-dark .nn-accent--amber {
  --mc: #e0a33a;
  --mc-ink: #f7ba53;
  --mc-soft: #221809;
  --mc-strong: #2c1f0d;
  --mc-border: #4a3516;
}

