/*
 * New Perspectives Blog storefront styles.
 *
 * Sizes are in px: the MRSMART theme (Luma based) sets the root font size to
 * 62.5 %, so 1rem is 10px there. Colours and fonts follow the theme variables
 * and fall back to the MRSMART palette when a variable is missing.
 *
 * Palette (owner's choice 2026-10-27): neutral grey surfaces in the tone of
 * the shop's category icon circles (#f2f2f2) and the icons' slate blue
 * (#396177) for links, tags and accents.
 */
.np-blog {
    --np-accent: #396177;
    --np-accent-strong: #2c4d5f;
    --np-accent-soft: #eef1f3;
    --np-ink: var(--heading__color__base, #111);
    --np-text: #3a3f45;
    --np-muted: #6b7280;
    --np-line: #e6e8eb;
    --np-surface: #f2f2f2;
    --np-radius: 12px;
    --np-radius-small: 8px;
    --np-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 10px 28px rgba(17, 24, 39, .07);
    --np-font: var(--font-family-name__base, Jost, sans-serif);
    --np-heading-font: var(--heading__font-family__base, var(--np-font));
    color: var(--np-text);
    font-family: var(--np-font);
    font-size: 16px;
    line-height: 1.6;
}

.np-blog *,
.np-blog *::before,
.np-blog *::after {
    box-sizing: border-box;
}

.np-blog a {
    color: inherit;
}

.np-blog img {
    height: auto;
    max-width: 100%;
}

.np-visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.np-section-title {
    color: var(--np-ink);
    font-family: var(--np-heading-font);
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1.25;
    margin: 0 0 18px;
}

.np-button {
    align-items: center;
    background: var(--np-accent);
    border: 1px solid var(--np-accent);
    border-radius: var(--button__border-radius, 5px);
    color: #fff !important;
    display: inline-flex;
    font-size: 15px;
    font-weight: 500;
    gap: 8px;
    justify-content: center;
    line-height: 1.2;
    min-height: 44px;
    padding: 10px 22px;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.np-button:hover,
.np-button:focus-visible {
    background: var(--np-accent-strong);
    border-color: var(--np-accent-strong);
}

.np-button--ghost {
    background: #fff;
    border-color: var(--np-ink);
    color: var(--np-ink) !important;
}

.np-button--ghost:hover,
.np-button--ghost:focus-visible {
    background: var(--np-ink);
    color: #fff !important;
}

.np-blog a:focus-visible,
.np-blog button:focus-visible,
.np-blog input:focus-visible,
.np-blog summary:focus-visible {
    outline: 2px solid var(--np-accent);
    outline-offset: 2px;
}

/* Chips and tags ---------------------------------------------------------- */

.np-chips {
    margin: 0 0 24px;
}

.np-chips__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.np-chip {
    align-items: center;
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: 999px;
    color: var(--np-ink) !important;
    display: inline-flex;
    font-size: 14px;
    font-weight: 500;
    gap: 7px;
    line-height: 1.2;
    min-height: 38px;
    padding: 7px 14px;
    text-decoration: none !important;
    transition: border-color .2s ease, background-color .2s ease;
    white-space: nowrap;
}

.np-chip:hover {
    border-color: var(--np-ink);
}

.np-chip.is-active {
    background: var(--np-ink);
    border-color: var(--np-ink);
    color: #fff !important;
}

.np-chip__count {
    background: var(--np-surface);
    border-radius: 999px;
    color: var(--np-muted);
    font-size: 12px;
    font-weight: 500;
    min-width: 22px;
    padding: 2px 7px;
    text-align: center;
}

.np-chip.is-active .np-chip__count {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.np-tag {
    align-items: center;
    background: var(--np-accent-soft);
    border-radius: 6px;
    color: var(--np-accent-strong) !important;
    display: inline-flex;
    font-size: 13px;
    font-weight: 500;
    gap: 6px;
    line-height: 1.3;
    padding: 4px 10px;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease;
}

.np-tag::before {
    content: '#';
    opacity: .6;
}

.np-tag:hover,
.np-tag.is-active {
    background: var(--np-accent);
    color: #fff !important;
}

.np-tag__count {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* Listing hero and search ------------------------------------------------- */

.np-blog-hero {
    background: var(--np-surface);
    border: 1px solid var(--np-surface);
    border-radius: 18px;
    margin: 0 0 20px;
    padding: clamp(24px, 4vw, 44px) clamp(24px, 4vw, 48px);
}

.np-blog-hero__text {
    max-width: 820px;
}

.np-blog-hero__eyebrow,
.np-post-hero__eyebrow,
.np-product-guides__eyebrow {
    color: var(--np-accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.np-blog-hero__title {
    color: var(--np-ink);
    font-family: var(--np-heading-font);
    font-size: clamp(30px, 4.2vw, 46px);
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.12;
    margin: 0 0 14px;
}

.np-blog-hero__intro {
    color: var(--np-text);
    font-size: 18px;
    line-height: 1.6;
    max-width: 640px;
}

.np-blog-hero__intro p {
    margin: 0;
}

.np-blog-hero__count {
    color: var(--np-muted);
    font-size: 14px;
    margin: 12px 0 0;
}

/* Toolbar: the search on its own line under the hero, topic chips below it, on every screen. */
.np-blog-toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 0 18px;
}

.np-blog-toolbar .np-chips,
.np-blog-toolbar .np-tag-strip {
    margin: 0;
}

.np-blog-search {
    margin: 0;
}

.np-blog-toolbar .np-blog-search__control {
    padding: 5px 5px 5px 18px;
}

/* 16px also keeps phones from zooming into the field. */
.np-blog-toolbar .np-blog-search input[type="search"] {
    font-size: 16px;
    height: 40px;
}

.np-blog-toolbar .np-blog-search__button {
    min-height: 40px;
    padding: 0 22px;
}

.np-blog-search__control {
    align-items: center;
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: 999px;
    display: flex;
    gap: 6px;
    padding: 4px 4px 4px 14px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.np-blog-search__control:hover {
    border-color: #d4d8db;
}

.np-blog-search__control:focus-within {
    border-color: var(--np-accent);
    box-shadow: 0 0 0 3px rgba(57, 97, 119, .18);
}

.np-blog-search__icon {
    color: var(--np-muted);
    flex: 0 0 auto;
}

.np-blog-search input[type="search"] {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--np-ink);
    flex: 1;
    font-family: var(--np-font);
    font-size: 15px;
    height: 34px;
    min-width: 0;
    outline: none;
    padding: 0 4px;
}

.np-blog-search__button {
    background: var(--np-ink);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-family: var(--np-font);
    font-size: 14px;
    font-weight: 500;
    min-height: 34px;
    padding: 0 16px;
}

.np-blog-search__button:hover {
    background: var(--np-accent);
}

.np-quick-tags {
    margin: -4px 0 28px;
}

.np-tag-strip {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
}

.np-tag-strip__label {
    color: var(--np-muted);
    font-size: 14px;
    margin-right: 4px;
}

/* Cards ------------------------------------------------------------------- */

.np-blog-grid {
    display: grid;
    gap: 28px 24px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.np-card {
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}

.np-card:hover {
    border-color: #d5dade;
    box-shadow: var(--np-shadow);
    transform: translateY(-2px);
}

.np-card__media {
    aspect-ratio: 16 / 9;
    background: var(--np-surface);
    display: block;
    overflow: hidden;
}

.np-card__media img {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
    width: 100%;
}

.np-card:hover .np-card__media img {
    transform: scale(1.03);
}

.np-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 20px 22px 22px;
}

.np-card__eyebrow {
    color: var(--np-accent) !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .07em;
    position: relative;
    text-decoration: none !important;
    text-transform: uppercase;
    z-index: 2;
}

.np-card__title {
    color: var(--np-ink);
    font-family: var(--np-heading-font);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1.3;
    margin: 0;
}

.np-card__title a {
    color: inherit !important;
    text-decoration: none !important;
}

/* The title link covers the whole card; inner links stay clickable above it. */
.np-card__title a::after {
    content: '';
    inset: 0;
    position: absolute;
    z-index: 1;
}

.np-card__excerpt {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: var(--np-text);
    display: -webkit-box;
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
    overflow: hidden;
}

.np-card__meta {
    color: var(--np-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 4px 14px;
    margin: auto 0 0;
    padding-top: 4px;
}

.np-card__meta > * + *::before {
    background: currentColor;
    border-radius: 50%;
    content: '';
    display: inline-block;
    height: 4px;
    margin: 0 10px 3px -4px;
    opacity: .5;
    width: 4px;
}

.np-row .np-card__tags,
.np-product-guides .np-card__tags {
    display: none;
}

.np-card__tags .np-tag {
    font-size: 12px;
    padding: 3px 8px;
}

.np-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
}

.np-card--lead .np-card__body {
    padding: 26px 28px 28px;
}

.np-card--lead .np-card__title {
    font-size: clamp(22px, 2.6vw, 30px);
    line-height: 1.22;
}

.np-card--lead .np-card__excerpt {
    -webkit-line-clamp: 4;
    font-size: 16px;
}

.np-card--row {
    display: grid;
    grid-template-columns: minmax(150px, 38%) 1fr;
}

.np-card--row .np-card__media {
    aspect-ratio: auto;
    height: 100%;
    min-height: 150px;
}

.np-card--row .np-card__body {
    gap: 8px;
    padding: 18px 20px;
}

.np-card--row .np-card__title {
    font-size: 18px;
}

.np-card--row .np-card__excerpt {
    -webkit-line-clamp: 2;
    font-size: 14px;
}

.np-card--compact .np-card__title {
    font-size: 17px;
}

/* Landing sections -------------------------------------------------------- */

.np-blog-featured,
.np-blog-hubs,
.np-blog-latest,
.np-blog-tags {
    margin: 0 0 56px;
}

.np-blog-featured__grid {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.np-blog-featured__side {
    display: grid;
    gap: 24px;
    grid-template-rows: 1fr 1fr;
}

.np-blog-hubs__grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.np-hub__link {
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius);
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    padding: 20px 22px;
    position: relative;
    text-decoration: none !important;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.np-hub__link::after {
    color: var(--np-accent);
    content: '→';
    font-size: 20px;
    position: absolute;
    right: 20px;
    top: 16px;
    transition: transform .2s ease;
}

.np-hub__link:hover {
    border-color: var(--np-accent);
    box-shadow: var(--np-shadow);
}

.np-hub__link:hover::after {
    transform: translateX(3px);
}

.np-hub__title {
    color: var(--np-ink);
    font-size: 18px;
    font-weight: 500;
    padding-right: 28px;
}

.np-hub__text {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--np-text);
    display: -webkit-box;
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
}

.np-hub__count {
    color: var(--np-muted);
    font-size: 13px;
    margin-top: auto;
    padding-top: 4px;
}

.np-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.np-tag-cloud .np-tag {
    font-size: 14px;
    padding: 7px 12px;
}

.np-blog-empty {
    background: var(--np-surface);
    border-radius: var(--np-radius);
    padding: 32px;
    text-align: center;
}

.np-blog .pages {
    margin-top: 36px;
}

/* Article ----------------------------------------------------------------- */

.np-post {
    margin: 0 auto;
    max-width: 1200px;
}

.np-post-hero {
    margin: 0 0 40px;
}

.np-post-hero__text {
    margin: 0 auto 28px;
    max-width: 820px;
    text-align: center;
}

.np-post-hero__eyebrow a {
    text-decoration: none !important;
}

.np-post-hero__title {
    color: var(--np-ink);
    font-family: var(--np-heading-font);
    font-size: clamp(30px, 4.4vw, 48px);
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.12;
    margin: 0 0 16px;
}

.np-post-hero__lead {
    color: var(--np-text);
    font-size: 19px;
    line-height: 1.6;
    margin: 0 0 16px;
}

.np-post-meta {
    color: var(--np-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    gap: 6px 18px;
    justify-content: center;
    margin: 0;
}

.np-post-meta > span + span::before {
    background: currentColor;
    border-radius: 50%;
    content: '';
    display: inline-block;
    height: 4px;
    margin: 0 12px 3px -6px;
    opacity: .45;
    width: 4px;
}

.np-post-hero__media {
    border-radius: 18px;
    margin: 0;
    overflow: hidden;
}

.np-post-hero__media img {
    aspect-ratio: 2 / 1;
    display: block;
    object-fit: cover;
    width: 100%;
}

.np-post-layout {
    display: grid;
    gap: 48px;
    grid-template-columns: minmax(0, 1fr);
    justify-content: center;
}

.np-post--with-toc .np-post-layout {
    grid-template-columns: 260px minmax(0, 760px);
}

.np-post-body {
    margin: 0 auto;
    max-width: 760px;
    min-width: 0;
    width: 100%;
}

.np-post-aside {
    min-width: 0;
}

.np-toc {
    position: sticky;
    top: 96px;
}

.np-toc__details {
    border-left: 2px solid var(--np-line);
    padding-left: 18px;
}

.np-toc__summary {
    color: var(--np-ink);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .06em;
    list-style: none;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.np-toc__summary::-webkit-details-marker {
    display: none;
}

.np-toc__list {
    counter-reset: nptoc;
    list-style: none;
    margin: 0;
    padding: 0;
}

.np-toc__list li {
    margin: 0;
}

.np-toc__list a {
    color: var(--np-text) !important;
    display: block;
    font-size: 14px;
    line-height: 1.45;
    padding: 6px 0;
    text-decoration: none !important;
}

.np-toc__list a:hover {
    color: var(--np-accent) !important;
}

.np-post-content h2[id] {
    scroll-margin-top: 100px;
}

.np-post-tags {
    align-items: center;
    border-top: 1px solid var(--np-line);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 40px 0 0;
    padding-top: 24px;
}

.np-post-tags__label {
    color: var(--np-ink);
    font-size: 14px;
    font-weight: 600;
}

.np-post-tags__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.np-post-back {
    margin: 28px 0 0;
}

.np-post-section {
    border-top: 1px solid var(--np-line);
    margin: 56px 0 0;
    padding-top: 40px;
}

.np-post-section__intro {
    color: var(--np-muted);
    margin: -8px 0 24px;
}

/* Article body typography (authored content) ------------------------------ */

.np-post-content {
    color: var(--np-text);
    font-size: 17px;
    line-height: 1.75;
}

.np-post-content > :first-child,
.np-article > :first-child {
    margin-top: 0;
}

.np-article .np-lead {
    color: var(--np-ink);
    font-size: 20px;
    line-height: 1.6;
}

.np-article h2 {
    color: var(--np-ink);
    font-family: var(--np-heading-font);
    font-size: clamp(24px, 2.6vw, 30px);
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1.25;
    margin: 2.2em 0 .6em;
}

.np-article h3 {
    color: var(--np-ink);
    font-family: var(--np-heading-font);
    font-size: 21px;
    font-weight: 500;
    line-height: 1.3;
    margin: 1.8em 0 .5em;
}

.np-article p,
.np-article ul,
.np-article ol {
    margin: 0 0 1.2em;
}

.np-article ul,
.np-article ol {
    padding-left: 1.35em;
}

.np-article li + li {
    margin-top: .4em;
}

.np-article a {
    color: var(--np-accent-strong);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.np-article a:hover {
    color: var(--np-accent);
}

.np-article img {
    border-radius: var(--np-radius-small);
}

.np-article figure {
    margin: 2rem 0;
}

.np-article figcaption {
    color: #4b5563;
    font-size: 14px;
    margin-top: 8px;
}

.np-article .np-product-figure {
    background: var(--np-surface);
    border-radius: var(--np-radius);
    padding: 16px;
    text-align: center;
}

.np-article .np-product-figure img {
    max-height: 420px;
    object-fit: contain;
    width: auto;
}

.np-article .np-figure--diagram img {
    height: auto;
    max-height: none;
    max-width: 100%;
}

.np-article .np-figure__zoom {
    border-radius: 8px;
    cursor: zoom-in;
    display: inline-block;
    max-width: 100%;
}

.np-article .np-figure__zoom:focus-visible {
    outline: 3px solid var(--np-accent, #396177);
    outline-offset: 3px;
}

/* In-page image viewer (js/image-lightbox.js) ----------------------------- */

.np-article .np-lightbox-trigger {
    cursor: zoom-in;
}

.np-article img.np-lightbox-trigger:focus-visible {
    outline: 3px solid var(--np-accent, #396177);
    outline-offset: 3px;
}

html.np-lightbox-open,
html.np-lightbox-open body {
    overflow: hidden;
}

.np-lightbox {
    background: #11181c;
    border: 0;
    color: #fff;
    display: none;
    height: 100%;
    inset: 0;
    margin: 0;
    max-height: none;
    max-width: none;
    padding: 0;
    position: fixed;
    width: 100%;
}

.np-lightbox[open] {
    display: flex;
    flex-direction: column;
}

.np-lightbox::backdrop {
    background: rgba(17, 24, 28, .9);
}

.np-lightbox__bar {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    justify-content: flex-end;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
}

.np-lightbox__bar button {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    gap: 8px;
    min-height: 44px;
    padding: 8px 16px;
}

.np-lightbox__bar button:hover,
.np-lightbox__bar button:focus-visible {
    background: rgba(255, 255, 255, .22);
}

.np-lightbox__bar button:focus-visible {
    outline: 3px solid #9cc7dc;
    outline-offset: 2px;
}

.np-lightbox__close {
    background: #fff !important;
    color: #11181c !important;
}

.np-lightbox__stage {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 8px 12px;
    -webkit-overflow-scrolling: touch;
}

.np-lightbox__image {
    background: #fff;
    border-radius: 6px;
    cursor: zoom-in;
    height: auto;
    margin: auto;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.np-lightbox.is-zoomed .np-lightbox__image {
    cursor: zoom-out;
    flex: 0 0 auto;
}

.np-lightbox__caption {
    color: #d7dee2;
    flex: 0 0 auto;
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
    max-height: 30vh;
    overflow: auto;
    padding: 8px 16px max(14px, env(safe-area-inset-bottom));
}

@media (max-width: 480px) {
    .np-lightbox__bar button {
        font-size: 14px;
        padding: 8px 13px;
    }

    .np-lightbox__stage {
        padding: 4px;
    }
}

.np-article .np-callout {
    background: var(--np-accent-soft);
    border-left: 4px solid var(--np-accent);
    border-radius: 0 var(--np-radius) var(--np-radius) 0;
    margin: 1.8em 0;
    padding: 18px 22px;
}

/* Level boxes ("Nivå 1/2/3"): a small robot shows the reader's level (owner 2026-10-28). */
.np-article .np-callout--level {
    min-height: 76px;
    padding-left: 84px;
    position: relative;
}

.np-article .np-callout--level::before {
    background: no-repeat center / contain;
    content: "";
    height: 48px;
    left: 22px;
    position: absolute;
    top: 16px;
    width: 48px;
}

.np-article .np-callout--level-1::before {
    background-image: url("../images/levels/robot-niva-1.svg");
}

.np-article .np-callout--level-2::before {
    background-image: url("../images/levels/robot-niva-2.svg");
}

.np-article .np-callout--level-3::before {
    background-image: url("../images/levels/robot-niva-3.svg");
}

@media (max-width: 480px) {
    .np-article .np-callout--level {
        min-height: 64px;
        padding-left: 66px;
    }

    .np-article .np-callout--level::before {
        height: 38px;
        left: 16px;
        top: 14px;
        width: 38px;
    }
}

.np-article .np-callout--warning {
    background: #fff7eb;
    border-left-color: #e8891d;
}

/* Short editorial notes break long guides into useful, scannable checkpoints. */
.np-article .np-guide-note {
    align-items: start;
    background: #f7fafb;
    border: 1px solid #d9e4e8;
    border-radius: var(--np-radius);
    box-shadow: 0 8px 24px rgba(29, 49, 58, .05);
    display: grid;
    gap: 14px;
    grid-template-columns: 44px minmax(0, 1fr);
    margin: 1.8em 0;
    padding: 18px 20px;
}

.np-article .np-guide-note__icon {
    align-items: center;
    background: #dcecf2;
    border-radius: 50%;
    color: #17324d;
    display: flex;
    /* Older article bodies contain ?, i, a tick or an emoji here. Keep those
       aria-hidden fallback characters out of the layout; no icon font needed. */
    font-size: 0;
    height: 44px;
    justify-content: center;
    line-height: 1;
    width: 44px;
}

.np-article .np-guide-note__icon::before {
    background: url("../images/notes/sporsmal-robot-valg.svg") no-repeat center / contain;
    content: "";
    display: block;
    height: 32px;
    width: 32px;
}

.np-article .np-guide-note strong {
    color: var(--np-ink);
    display: block;
    font-size: 15px;
    margin: 1px 0 4px;
}

.np-article .np-guide-note p {
    margin: 0;
}

.np-article .np-guide-note--fact {
    background: #f5f2fb;
    border-color: #ddd3ef;
}

.np-article .np-guide-note--fact .np-guide-note__icon {
    background: #e8dff6;
    color: #543878;
}

.np-article .np-guide-note--fact .np-guide-note__icon::before {
    background-image: url("../images/notes/fakta-lyspaere-krets.svg");
}

.np-article .np-guide-note--tip {
    background: #f2f8f3;
    border-color: #cfe2d2;
}

.np-article .np-guide-note--tip .np-guide-note__icon {
    background: #d9ecdc;
    color: #245d32;
}

.np-article .np-guide-note--tip .np-guide-note__icon::before {
    background-image: url("../images/notes/tips-fastnokkel-gnist.svg");
}

.np-article .np-guide-note--check {
    background: #fff8ed;
    border-color: #ecd7b5;
}

.np-article .np-guide-note--check .np-guide-note__icon {
    background: #f6e3c3;
    color: #7b4a0e;
}

.np-article .np-guide-note--check .np-guide-note__icon::before {
    background-image: url("../images/notes/kontroll-sjekkliste-krets.svg");
}

.np-article .np-guide-note--question {
    background: #f1f7fb;
    border-color: #cbdfea;
}

.np-article .np-guide-note--question .np-guide-note__icon {
    background: #d9eaf4;
    color: #24557a;
}

@media (max-width: 480px) {
    .np-article .np-guide-note {
        gap: 11px;
        grid-template-columns: 36px minmax(0, 1fr);
        padding: 15px 16px;
    }

    .np-article .np-guide-note__icon {
        height: 36px;
        width: 36px;
    }

    .np-article .np-guide-note__icon::before {
        height: 28px;
        width: 28px;
    }
}

.np-article .np-quick-answer {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: var(--np-radius);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .04);
    margin: 1.6em 0 2em;
    padding: 20px 24px;
    position: relative;
}

.np-article .np-quick-answer::before {
    background: var(--np-accent);
    border-radius: var(--np-radius) 0 0 var(--np-radius);
    bottom: 0;
    content: '';
    left: 0;
    position: absolute;
    top: 0;
    width: 4px;
}

.np-article .np-quick-answer strong {
    color: var(--np-ink);
    display: block;
    font-size: 13px;
    letter-spacing: .08em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.np-table-wrap {
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius);
    margin: 1.8em 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.np-post-content table {
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    width: 100%;
}

.np-post-content th,
.np-post-content td {
    border-bottom: 1px solid var(--np-line);
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

.np-post-content th {
    background: var(--np-surface);
    color: var(--np-ink);
    font-weight: 600;
}

.np-post-content tr:last-child td {
    border-bottom: 0;
}

.np-article .np-flow {
    align-items: center;
    background: var(--np-surface);
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 1.8em 0;
    padding: 22px;
}

.np-article .np-flow__node {
    background: #fff;
    border: 1px solid #cdd6db;
    border-radius: var(--np-radius-small);
    color: var(--np-ink);
    font-size: 15px;
    font-weight: 600;
    padding: 10px 14px;
    text-align: center;
}

.np-article .np-flow__arrow {
    color: var(--np-accent);
    font-size: 22px;
    font-weight: 700;
}

.np-article .np-code {
    background: #1f2b32;
    border-radius: var(--np-radius-small);
    color: #eef1f3;
    font: 14px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    margin: 1.7em 0;
    overflow-x: auto;
    padding: 18px 20px;
    tab-size: 4;
}

.np-article .np-code code {
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 0;
    white-space: pre;
}

/* A long address or path in running text must not widen the page on a phone. */
.np-article :not(pre) > code {
    overflow-wrap: anywhere;
}

/* Copy bar from code-copy.js; without JavaScript the code block is unchanged. */
.np-article .np-code-block {
    background: #1f2b32;
    border-radius: var(--np-radius-small);
    margin: 1.7em 0;
    overflow: hidden;
}

.np-article .np-code-block > .np-code {
    border-radius: 0;
    margin: 0;
}

.np-article .np-code-bar {
    align-items: center;
    background: #172126;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: #aab6bd;
    display: flex;
    font: 600 12px/1.2 var(--np-font);
    gap: 12px;
    justify-content: space-between;
    letter-spacing: .05em;
    padding: 6px 8px 6px 16px;
    text-transform: uppercase;
}

.np-article .np-code-copy {
    align-items: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    box-shadow: none;
    color: #eef1f3;
    cursor: pointer;
    display: inline-flex;
    font: 600 13px/1 var(--np-font);
    gap: 6px;
    letter-spacing: 0;
    min-height: 32px;
    padding: 6px 12px;
    text-transform: none;
}

.np-article .np-code-copy:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .42);
    color: #fff;
}

.np-article .np-code-copy:focus-visible {
    outline: 2px solid #9fc1d2;
    outline-offset: 2px;
}

.np-article .np-code-copy.is-copied {
    border-color: #7fc49b;
    color: #bfe8cd;
}

.np-article .np-code-copy.is-failed {
    border-color: #e3a29a;
    color: #f3c9c3;
}

.np-article .np-steps {
    counter-reset: npstep;
    list-style: none;
    padding: 0;
}

.np-article .np-steps > li {
    padding: 0 0 1.1em 48px;
    position: relative;
}

.np-article .np-steps > li::before {
    background: var(--np-accent);
    border-radius: 50%;
    color: #fff;
    content: counter(npstep);
    counter-increment: npstep;
    display: grid;
    font-size: 15px;
    font-weight: 600;
    height: 32px;
    left: 0;
    place-items: center;
    position: absolute;
    top: -1px;
    width: 32px;
}

.np-article .np-product-box {
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius);
    margin: 2em 0;
    padding: 22px;
}

.np-article .np-product-box h3 {
    margin-top: 0;
}

/* Resistor colour calculator (one article) */
.np-resistor-calculator { background: var(--np-surface); border: 1px solid var(--np-line); border-radius: 14px; margin: 1.8em 0 2.2em; padding: clamp(18px, 4vw, 30px); }
.np-resistor-calculator h3 { margin-top: 0; }
.np-resistor-calculator__controls { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.np-resistor-calculator__controls label { color: var(--np-ink); display: grid; font-size: 14px; font-weight: 600; gap: 7px; }
.np-resistor-calculator__controls select { background-color: #fff; border: 1px solid #aebfc5; border-radius: 8px; color: var(--np-ink); font: inherit; min-height: 44px; padding: 8px 34px 8px 10px; width: 100%; }
.np-resistor-calculator__preview { align-items: center; display: flex; justify-content: center; margin: 28px auto 22px; }
.np-resistor-calculator__lead { background: #899399; display: block; height: 4px; width: min(16vw, 130px); }
.np-resistor-calculator__body { align-items: stretch; background: #dfc995; border: 1px solid #c6ae79; border-radius: 38px; box-shadow: inset 0 0 16px rgba(102, 74, 25, .15), 0 7px 18px rgba(29, 49, 58, .08); display: flex; gap: 13px; height: 82px; justify-content: center; padding: 0 28px; width: min(52vw, 330px); }
.np-resistor-calculator__body i { border-left: 1px solid rgba(255, 255, 255, .22); border-right: 1px solid rgba(0, 0, 0, .16); display: block; height: 100%; min-width: 13px; width: 13px; }
.np-resistor-calculator__body i[data-np-preview-band="tolerance"] { margin-left: auto; }
.np-resistor-calculator__result { color: var(--np-ink); font-size: 20px; font-weight: 600; margin-bottom: 7px; text-align: center; }
.np-resistor-calculator__range { color: var(--np-muted); margin-bottom: 0; text-align: center; }

.np-actuator-calculator { background: linear-gradient(145deg, #f8fbfc, #eef4f6); border: 1px solid var(--np-line); border-radius: 20px; box-shadow: 0 18px 46px rgba(29, 49, 58, .09); margin: 1.8em 0 2.4em; overflow: hidden; }
.np-actuator-calculator__header { background: #17324d; color: #fff; padding: clamp(22px, 5vw, 38px); }
.np-actuator-calculator__header h3 { color: #fff; margin: 0 0 8px; }
.np-actuator-calculator__header p { color: #dce9ef; margin: 0; max-width: 64ch; }
.np-actuator-calculator__presets { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px clamp(18px, 4vw, 30px) 0; }
.np-actuator-calculator button { -webkit-tap-highlight-color: transparent; }
.np-actuator-calculator__preset, .np-actuator-calculator__animate { background: #fff; border: 1px solid #aebfc5; border-radius: 11px; color: #17324d; cursor: pointer; font: inherit; font-weight: 700; min-height: 48px; padding: 10px 14px; }
.np-actuator-calculator__preset:hover, .np-actuator-calculator__preset:focus-visible, .np-actuator-calculator__animate:hover, .np-actuator-calculator__animate:focus-visible { border-color: #e46b2d; box-shadow: 0 0 0 3px rgba(228, 107, 45, .17); outline: 0; }
.np-actuator-calculator__workspace { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); padding: clamp(18px, 4vw, 30px); }
.np-actuator-calculator__visual, .np-actuator-calculator__controls, .np-actuator-calculator__results { background: #fff; border: 1px solid #d4e0e5; border-radius: 16px; }
.np-actuator-calculator__visual { align-self: start; overflow: hidden; padding: 12px; }
.np-actuator-calculator__visual svg { background: linear-gradient(#fafdfe 0 70%, #edf3f5 70%); border-radius: 12px; display: block; height: auto; max-width: 100%; touch-action: none; width: 100%; }
.np-actuator-calculator__visual [data-drag] { cursor: grab; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .18)); }
.np-actuator-calculator__visual [data-drag]:active { cursor: grabbing; }
.np-actuator-calculator__motion { align-items: center; display: grid; gap: 10px; grid-template-columns: 1fr auto; margin-top: 12px; }
.np-actuator-calculator__motion label { display: grid; font-size: 13px; font-weight: 700; gap: 5px; }
.np-actuator-calculator input[type="range"] { accent-color: #e46b2d; min-height: 28px; width: 100%; }
.np-actuator-calculator__controls { display: grid; gap: 17px; padding: 18px; }
.np-actuator-calculator__controls fieldset { border: 0; display: grid; gap: 13px; margin: 0; padding: 0; }
.np-actuator-calculator__controls fieldset + fieldset { border-top: 1px solid #e1e9ec; padding-top: 15px; }
.np-actuator-calculator__controls legend { color: #17324d; font-size: 16px; font-weight: 800; margin-bottom: 12px; padding: 0; }
.np-actuator-calculator__control { display: grid; gap: 5px; grid-template-columns: minmax(0, 1fr) 92px; }
.np-actuator-calculator__control > span { color: #334f63; font-size: 13px; font-weight: 700; grid-column: 1 / -1; }
.np-actuator-calculator__control input[type="number"] { background: #fff; border: 1px solid #aebfc5; border-radius: 8px; color: #17324d; font: inherit; min-height: 42px; padding: 7px 9px; width: 100%; }
.np-actuator-calculator__results { margin: 0 clamp(18px, 4vw, 30px) clamp(18px, 4vw, 30px); padding: clamp(18px, 4vw, 28px); }
.np-actuator-calculator__status { border-left: 4px solid #3f8a55; color: #17324d; font-weight: 700; margin: 0 0 18px; padding: 5px 0 5px 12px; }
.np-actuator-calculator__results[data-state="invalid"] .np-actuator-calculator__status { border-left-color: #c83c35; color: #8f2925; }
.np-actuator-calculator__result-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.np-actuator-calculator__metric { background: #f5f8fa; border-radius: 12px; margin: 0; min-width: 0; padding: 14px; }
.np-actuator-calculator__metric dt { color: #526d7e; font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.np-actuator-calculator__metric dd { color: #17324d; font-size: clamp(17px, 2vw, 22px); font-weight: 800; margin: 5px 0 0; overflow-wrap: anywhere; }
.np-actuator-calculator__warning { color: #8a4a18; font-size: 14px; font-weight: 650; min-height: 1.5em; }
.np-actuator-calculator__curve { border-top: 1px solid #e1e9ec; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(220px, .65fr); margin-top: 18px; padding-top: 18px; }
.np-actuator-calculator__curve p { margin: 0; }
.np-actuator-calculator__curve svg { height: auto; max-width: 100%; width: 100%; }
.np-actuator-calculator__note { color: var(--np-muted); font-size: 13px; margin: 14px 0 0; }

/* Products in an article -------------------------------------------------- */

.np-product-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.np-product-card {
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius);
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow: hidden;
    transition: box-shadow .25s ease, border-color .25s ease;
}

.np-product-card:hover {
    border-color: #d5dade;
    box-shadow: var(--np-shadow);
}

.np-product-card__media {
    background: #fff;
    display: block;
    padding: 16px 16px 0;
}

.np-product-card__media .product-image-container {
    display: block;
    margin: 0 auto;
    width: 100% !important;
}

.np-product-card__media img {
    display: block;
    height: auto;
    margin: 0 auto;
    max-height: 220px;
    object-fit: contain;
    width: 100%;
}

.np-product-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px 18px;
}

.np-product-card__name {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    margin: 0;
}

.np-product-card__name a {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--np-ink) !important;
    display: -webkit-box;
    overflow: hidden;
    text-decoration: none !important;
}

.np-product-card__price .price {
    color: var(--np-ink);
    font-size: 18px;
    font-weight: 600;
}

.np-product-card__price .price-box {
    margin: 0;
}

.np-product-card__stock {
    font-size: 13px;
    margin: 0;
}

.np-product-card__stock::before {
    border-radius: 50%;
    content: '';
    display: inline-block;
    height: 8px;
    margin-right: 6px;
    width: 8px;
}

.np-product-card__stock.is-in-stock::before {
    background: #1e9e5a;
}

.np-product-card__stock.is-out-of-stock::before {
    background: #c9a227;
}

.np-product-card__actions {
    margin-top: auto;
    padding-top: 6px;
}

.np-product-card__actions .np-button,
.np-product-card__actions .action.primary {
    width: 100%;
}

/* Guides on a product page ------------------------------------------------ */

.np-product-guides {
    background: #f4f4f4;
    border: 1px solid #f4f4f4;
    border-radius: 18px;
    clear: both;
    margin: 48px 0;
    padding: clamp(22px, 3.5vw, 40px);
}

.np-product-guides__head {
    margin-bottom: 22px;
    max-width: 720px;
}

.np-product-guides__head .np-section-title {
    margin-bottom: 8px;
}

.np-product-guides__intro {
    color: var(--np-text);
    margin: 0;
}

.np-product-guides__list {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.np-product-guides--single .np-product-guides__list {
    grid-template-columns: minmax(0, 860px);
}

.np-product-guides__more {
    margin: 22px 0 0;
}

/* Private preview: a quiet note above the article, which otherwise looks published. */
.np-post-preview-note {
    background: var(--np-accent-soft);
    border-left: 3px solid var(--np-accent);
    border-radius: var(--np-radius-small);
    color: var(--np-accent-strong);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 20px;
    padding: 10px 14px;
}

/* Home page section ------------------------------------------------------- */

.np-home-guides-row {
    margin-bottom: 0;
    margin-top: 0;
}

.np-home-guides {
    background: #f4f4f4;
    border: 1px solid #f4f4f4;
    border-radius: 16px;
    margin: 40px 0 48px;
    padding: 30px 32px 28px;
}

.np-home-guides__head {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 32px;
    justify-content: space-between;
    margin: 0 0 16px;
}

.np-home-guides__titles {
    max-width: 720px;
}

.np-home-guides .np-section-title {
    font-size: clamp(22px, 2.2vw, 28px);
    margin: 0 0 6px;
}

.np-home-guides__intro {
    color: var(--np-text);
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}

.np-home-guides__actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.np-home-guides__all {
    color: var(--np-accent-strong) !important;
    font-size: 15px;
    font-weight: 600;
    margin-left: 8px;
    text-decoration: none !important;
    white-space: nowrap;
}

.np-home-guides__all::after {
    content: ' \2192';
}

.np-home-guides__all:hover {
    text-decoration: underline !important;
}

/* Arrows appear only when the track is wider than the section. */
.np-carousel__arrow {
    align-items: center;
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: 50%;
    color: var(--np-ink);
    cursor: pointer;
    display: none;
    height: 40px;
    justify-content: center;
    padding: 0;
    transition: border-color .2s ease, color .2s ease, opacity .2s ease;
    width: 40px;
}

.np-home-guides.is-scrollable .np-carousel__arrow {
    display: inline-flex;
}

.np-carousel__arrow:hover:not(:disabled) {
    border-color: var(--np-accent);
    color: var(--np-accent-strong);
}

.np-carousel__arrow:disabled {
    cursor: default;
    opacity: .35;
}

.np-home-guides__topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.np-home-guides__topics li {
    margin: 0;
}

.np-home-guides__topics .np-tag {
    min-height: 34px;
}

/* Three cards per view on desktop, a peek of the next card on smaller screens. */
.np-carousel__track {
    display: grid;
    gap: 20px;
    grid-auto-columns: calc((100% - 40px) / 3);
    grid-auto-flow: column;
    margin: -6px -4px -12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 6px 4px 12px;
    scroll-behavior: smooth;
    scroll-padding: 0 4px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.np-carousel__track::-webkit-scrollbar {
    display: none;
}

.np-carousel__track > * {
    scroll-snap-align: start;
}

.np-carousel__track:focus-visible {
    outline: 2px solid var(--np-accent);
    outline-offset: 2px;
}

.np-home-guides__cards .np-card {
    border-color: transparent;
}

.np-home-guides__cards .np-card:hover {
    transform: none;
}

.np-home-guides__cards .np-card__body {
    gap: 8px;
    padding: 18px 20px 20px;
}

.np-home-guides__cards .np-card__title {
    font-size: 18px;
}

.np-home-guides__cards .np-card__excerpt {
    -webkit-line-clamp: 2;
    font-size: 14px;
}

.np-home-guides__cards .np-card__tags {
    display: none;
}

@media (max-width: 1023px) {
    .np-carousel__track {
        grid-auto-columns: calc((100% - 20px) / 2.15);
    }
}

@media (max-width: 767px) {
    .np-home-guides {
        border-radius: 0;
        margin: 28px -15px 36px;
        padding: 24px 0;
    }

    .np-home-guides__head,
    .np-home-guides__topics {
        padding: 0 15px;
    }

    .np-home-guides__head {
        align-items: flex-start;
        flex-direction: column;
    }

    .np-home-guides__all {
        margin-left: 0;
    }

    .np-home-guides .np-carousel__arrow {
        display: none;
    }

    /* One swipeable line of topics instead of a tall wall of chips. */
    .np-home-guides__topics {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .np-home-guides__topics::-webkit-scrollbar {
        display: none;
    }

    .np-home-guides__topics li {
        flex: 0 0 auto;
    }

    .np-carousel__track {
        gap: 14px;
        grid-auto-columns: 80%;
        margin: 0;
        padding: 4px 15px 10px;
        scroll-padding: 0 15px;
    }
}

/* Footer link and widgets ------------------------------------------------- */

.np-blog-footer-link {
    padding: 0 0 16px;
    text-align: center;
}

.np-blog-footer-link a {
    color: var(--footer-links-color, #666);
    font-weight: 500;
}

.np-blog-widget__grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Comments ---------------------------------------------------------------- */

.np-blog-comments { border-top: 1px solid var(--np-line); margin-top: 48px; padding-top: 32px; }
.np-blog-comments__list { list-style: none; margin: 0 0 32px; padding: 0; }
.np-blog-comments__list li { border-bottom: 1px solid var(--np-line); padding: 16px 0; }
.np-blog-comments__list time { color: var(--np-muted); font-size: 13px; margin-left: 12px; }
.np-blog-comments__form { display: grid; gap: 16px; max-width: 700px; }
.np-blog-comments__form input,
.np-blog-comments__form textarea { box-sizing: border-box; width: 100%; }
.np-blog-comments__honeypot { height: 1px; left: -10000px; overflow: hidden; position: absolute; width: 1px; }

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1199px) {
    .np-post--with-toc .np-post-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 36px;
    }
}

@media (max-width: 1023px) {
    .np-post-hero__media img {
        aspect-ratio: 16 / 9;
    }

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

    .np-blog-featured__grid {
        grid-template-columns: 1fr;
    }

    .np-blog-featured__side {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: none;
    }

    .np-blog-featured__side .np-card--row {
        display: flex;
    }

    .np-blog-featured__side .np-card--row .np-card__media {
        aspect-ratio: 16 / 9;
        height: auto;
        min-height: 0;
    }

    .np-blog-hubs__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .np-post--with-toc .np-post-layout {
        gap: 0;
        grid-template-columns: minmax(0, 1fr);
    }

    .np-post-aside {
        margin: 0 auto 32px;
        max-width: 760px;
        width: 100%;
    }

    .np-toc {
        position: static;
    }

    .np-toc__details {
        background: var(--np-surface);
        border: 1px solid var(--np-line);
        border-radius: var(--np-radius);
        padding: 16px 20px;
    }

    .np-toc__summary {
        margin: 0;
    }

    .np-toc__details[open] .np-toc__summary {
        margin-bottom: 10px;
    }

    .np-toc__summary::after {
        content: '+';
        float: right;
        font-size: 18px;
        line-height: 1;
    }

    .np-toc__details[open] .np-toc__summary::after {
        content: '−';
    }

    .np-product-guides__list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .np-blog {
        font-size: 16px;
    }

    /* The H1 repeats the current page; keep the trail to one short line. */
    .np-blog-page--post .breadcrumbs .items > .item:last-child {
        display: none;
    }

    .np-blog-page--post .breadcrumbs .items > .item:nth-last-child(2)::after {
        display: none;
    }

    .np-blog-hero {
        border-radius: 14px;
        margin-left: -4px;
        margin-right: -4px;
    }

    .np-blog-hero__intro {
        font-size: 16px;
    }

    .np-chips {
        margin: 0 -15px 24px;
        overflow-x: auto;
        padding: 2px 15px 6px;
        scrollbar-width: none;
    }

    .np-chips::-webkit-scrollbar {
        display: none;
    }

    .np-blog-toolbar .np-chips {
        margin: 0 -15px;
        padding: 2px 15px 6px;
    }

    .np-chips__list {
        flex-wrap: nowrap;
    }

    .np-blog-grid,
    .np-blog-hubs__grid,
    .np-blog-featured__side {
        grid-template-columns: 1fr;
    }

    .np-card--row {
        grid-template-columns: 112px 1fr;
    }

    .np-card--row .np-card__media {
        min-height: 100%;
    }

    .np-card--row .np-card__body {
        padding: 14px 16px;
    }

    .np-card--row .np-card__title {
        font-size: 16px;
    }

    .np-card--row .np-card__excerpt,
    .np-card--row .np-card__meta time {
        display: none;
    }

    .np-card--row .np-card__meta > * + *::before {
        display: none;
    }

    .np-blog-featured__side .np-card--row {
        display: grid;
    }

    .np-blog-featured__side .np-card--row .np-card__media {
        aspect-ratio: auto;
        height: 100%;
    }

    .np-post-hero__text {
        text-align: left;
    }

    .np-post-meta {
        justify-content: flex-start;
    }

    .np-post-hero__media {
        border-radius: 12px;
        margin: 0 -4px;
    }

    .np-post-content {
        font-size: 16px;
        line-height: 1.7;
    }

    .np-article .np-lead {
        font-size: 18px;
    }

    .np-post-content th,
    .np-post-content td {
        min-width: 140px;
        padding: 10px 12px;
    }

    .np-article .np-flow {
        align-items: stretch;
        flex-direction: column;
    }

    .np-article .np-flow__arrow {
        line-height: 1;
        text-align: center;
        transform: rotate(90deg);
    }

    .np-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .np-product-card__body {
        padding: 12px;
    }

    .np-product-card__name {
        font-size: 14px;
    }

    .np-product-card__price .price {
        font-size: 16px;
    }

    .np-resistor-calculator__controls { grid-template-columns: 1fr; }
    .np-resistor-calculator__lead { width: 10vw; }
    .np-resistor-calculator__body { gap: 8px; height: 68px; padding: 0 20px; width: 68vw; }
    .np-actuator-calculator__presets, .np-actuator-calculator__workspace, .np-actuator-calculator__result-grid, .np-actuator-calculator__curve { grid-template-columns: 1fr; }
    .np-actuator-calculator__motion { grid-template-columns: 1fr; }
    .np-actuator-calculator__animate { width: 100%; }
}

/* Magazine landing ------------------------------------------------------- */

.np-quick-tags {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.np-quick-tags__label {
    color: var(--np-muted);
    font-size: 13px;
    margin-right: 2px;
}

.np-chip--small {
    font-size: 14px;
    min-height: 34px;
    padding: 5px 12px;
}

.np-row {
    margin: 0 0 52px;
}

.np-row__head {
    align-items: end;
    display: flex;
    gap: 12px 24px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.np-row__titles .np-section-title {
    margin: 0;
}

.np-row__titles .np-section-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.np-row__titles .np-section-title a:hover {
    color: var(--np-accent) !important;
}

.np-row__eyebrow {
    color: var(--np-accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.np-row__intro {
    color: var(--np-text);
    font-size: 15px;
    margin: 6px 0 0;
    max-width: 680px;
}

.np-row__more {
    color: var(--np-ink) !important;
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none !important;
    white-space: nowrap;
}

.np-row__more::after {
    content: ' →';
    color: var(--np-accent);
}

.np-row__more:hover {
    color: var(--np-accent) !important;
}

.np-row__track {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.np-row--tag {
    background: var(--np-surface);
    border-radius: 18px;
    padding: 28px;
}

.np-row--tag .np-card {
    border-color: transparent;
}

.np-row .np-card__excerpt {
    -webkit-line-clamp: 2;
    font-size: 14px;
}

.np-row .np-card__title {
    font-size: 18px;
}

.np-row .np-card__body {
    padding: 16px 18px 18px;
}

.np-hub__link {
    align-items: center;
    flex-direction: row;
    gap: 16px;
    padding: 14px 44px 14px 14px;
}

.np-hub__media {
    border-radius: 10px;
    flex: 0 0 96px;
    height: 72px;
    overflow: hidden;
}

.np-hub__media img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.np-hub__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.np-hub__link::after {
    top: 50%;
    transform: translateY(-50%);
}

.np-hub__link:hover::after {
    transform: translate(3px, -50%);
}

.np-hub__title {
    padding-right: 0;
}

.np-blog-cta {
    align-items: center;
    background: var(--np-ink);
    border-radius: 18px;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    justify-content: space-between;
    margin: 8px 0 56px;
    padding: 28px 32px;
}

.np-blog-cta__title {
    color: #fff;
    font-size: 22px;
    font-weight: 500;
    margin: 0 0 4px;
}

.np-blog-cta__text {
    color: rgba(255, 255, 255, .75);
    margin: 0;
}

.np-blog-cta .np-button {
    background: #fff;
    border-color: #fff;
    color: var(--np-ink) !important;
}

.np-blog-cta .np-button:hover {
    background: var(--np-accent);
    border-color: var(--np-accent);
    color: #fff !important;
}

.np-blog-featured--single .np-blog-featured__grid {
    grid-template-columns: minmax(0, 1fr);
}

.np-blog-featured--single .np-card--lead {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

@media (max-width: 1199px) {
    .np-row__track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .np-row__track > :nth-child(n+4) {
        display: none;
    }
}

@media (max-width: 1023px) {
    .np-row__track {
        grid-auto-columns: minmax(260px, 42%);
        grid-auto-flow: column;
        grid-template-columns: none;
        margin: 0 -15px;
        overflow-x: auto;
        padding: 0 15px 8px;
        scroll-padding: 0 15px;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
    }

    .np-row__track > * {
        scroll-snap-align: start;
    }

    .np-row__track > :nth-child(n+4) {
        display: flex;
    }

    .np-row--tag {
        padding: 22px 15px;
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
    }

    .np-row--tag .np-row__track {
        margin: 0 -15px;
    }
}

@media (max-width: 767px) {
    .np-row__track {
        grid-auto-columns: 78%;
        gap: 14px;
    }

    .np-row__head {
        align-items: start;
        flex-direction: column;
        gap: 6px;
    }

    .np-hub__media {
        flex-basis: 72px;
        height: 56px;
    }

    .np-blog-cta {
        padding: 22px;
    }

    .np-blog-featured--single .np-card--lead {
        display: flex;
    }
}

/* Topic graph: shop links ------------------------------------------------ */

.np-topic-shop {
    border-top: 1px solid var(--np-line);
    margin: 0 0 52px;
    padding-top: 36px;
}

.np-topic-shop__categories {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}

.np-topic-shop__category {
    align-content: center;
    background: var(--np-accent-soft);
    border: 1px solid #e3e3e3;
    border-radius: var(--np-radius);
    display: grid;
    gap: 2px 12px;
    grid-template-columns: 1fr auto;
    height: 100%;
    padding: 14px 18px;
    text-decoration: none !important;
    transition: background-color .2s ease, border-color .2s ease;
}

.np-topic-shop__category::after {
    align-self: center;
    color: var(--np-accent);
    content: '→';
    font-size: 18px;
    grid-column: 2;
    grid-row: 1 / span 2;
}

.np-topic-shop__category:hover {
    background: #e4e9ec;
    border-color: var(--np-accent);
}

.np-topic-shop__name {
    color: var(--np-ink);
    font-size: 16px;
    font-weight: 500;
    grid-column: 1;
    line-height: 1.3;
}

.np-topic-shop__count {
    color: var(--np-muted);
    font-size: 13px;
    grid-column: 1;
}

.np-product-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.np-shop-links {
    align-items: center;
    background: var(--np-accent-soft);
    border-radius: var(--np-radius);
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 24px 0 0;
    padding: 16px 20px;
}

.np-shop-links__label {
    color: var(--np-ink);
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.np-shop-links__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.np-shop-link {
    align-items: center;
    background: #fff;
    border: 1px solid #dcdfe1;
    border-radius: 999px;
    color: var(--np-ink) !important;
    display: inline-flex;
    font-size: 14px;
    font-weight: 500;
    gap: 8px;
    padding: 6px 14px;
    text-decoration: none !important;
}

.np-shop-link:hover {
    border-color: var(--np-accent);
}

.np-shop-link__count {
    color: var(--np-muted);
    font-size: 12px;
    font-weight: 400;
}

.np-category-guides {
    clear: both;
    margin: 48px 0 24px;
}

.np-row__track--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1023px) {
    .np-product-grid--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .np-row__track--three {
        grid-template-columns: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .np-card,
    .np-card__media img,
    .np-hub__link::after {
        transition: none;
    }

    .np-card:hover,
    .np-card:hover .np-card__media img {
        transform: none;
    }

    .np-carousel__track {
        scroll-behavior: auto;
    }
}

/*
 * Build guides: project card, parts list, expected output, result figures, cards, foldouts and
 * hands-on tools (docs/EDITORIAL-GUIDE.md section 5b). Everything reads without JavaScript except the
 * tools themselves, which keep a <noscript> route to the formulas.
 */
.np-article .np-project-card {
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius);
    box-shadow: var(--np-shadow);
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin: 1.8em 0;
    overflow: hidden;
    padding: 0;
}

.np-article .np-project-card > div {
    background: var(--np-surface);
    margin: 0;
    padding: 14px 16px;
}

/* Two columns on a phone: an odd last item fills its row instead of leaving an empty cell. */
@media (max-width: 480px) {
    .np-article .np-project-card > div:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

.np-article .np-project-card dt {
    color: var(--np-muted);
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px;
}

.np-article .np-project-card dd {
    color: var(--np-ink);
    font-weight: 700;
    margin: 0;
}

.np-article .np-parts {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    list-style: none;
    margin: 1.4em 0 1.8em;
    padding: 0;
}

.np-article .np-parts > li {
    align-items: center;
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius-small);
    display: grid;
    gap: 12px;
    grid-template-columns: 64px minmax(0, 1fr);
    margin: 0;
    padding: 10px 12px;
}

.np-article .np-parts img {
    border-radius: 6px;
    display: block;
    height: 64px;
    object-fit: contain;
    width: 64px;
}

.np-article .np-parts strong {
    color: var(--np-ink);
    display: block;
    font-size: 15px;
    line-height: 1.3;
}

.np-article .np-parts small {
    color: var(--np-muted);
    display: block;
    font-size: 13px;
    line-height: 1.35;
    margin-top: 2px;
}

.np-article .np-terminal {
    background: #14191d;
    border-radius: var(--np-radius-small);
    color: #d6f5d6;
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.5;
    margin: 1em 0 1.6em;
    overflow-x: auto;
    padding: 40px 16px 14px;
    position: relative;
    white-space: pre;
}

.np-article .np-terminal::before {
    background: #262d33;
    border-radius: var(--np-radius-small) var(--np-radius-small) 0 0;
    color: #c6ced4;
    content: attr(data-title);
    font-family: var(--np-font);
    font-size: 13px;
    left: 0;
    padding: 5px 16px;
    position: absolute;
    right: 0;
    top: 0;
}

.np-article .np-figure--result {
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius);
    padding: 12px 12px 4px;
}

.np-article .np-figure-row {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin: 1.8em 0;
}

.np-article .np-figure-row > figure {
    margin: 0;
}

.np-article .np-cards {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin: 1.6em 0;
}

.np-article .np-card {
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius);
    border-top: 4px solid var(--np-accent);
    padding: 16px 18px;
}

.np-article .np-card > strong {
    color: var(--np-ink);
    display: block;
    font-size: 17px;
    margin-bottom: 6px;
}

.np-article .np-card > p {
    margin: 0 0 .6em;
}

.np-article .np-card > p:last-child {
    margin-bottom: 0;
}

.np-article .np-fold {
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius-small);
    margin: 10px 0;
}

.np-article .np-fold > summary {
    color: var(--np-ink);
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    padding: 12px 40px 12px 16px;
    position: relative;
}

.np-article .np-fold > summary::-webkit-details-marker {
    display: none;
}

.np-article .np-fold > summary::after {
    color: var(--np-accent);
    content: "+";
    font-size: 22px;
    line-height: 1;
    position: absolute;
    right: 16px;
    top: 12px;
}

.np-article .np-fold[open] > summary::after {
    content: "\2212";
}

.np-article .np-fold > summary:focus-visible {
    outline: 2px solid var(--np-accent);
    outline-offset: 2px;
}

.np-article .np-fold > :not(summary) {
    margin: 0 16px 12px;
}

.np-article .np-fold--quiz {
    background: var(--np-accent-soft);
    border-color: #d5dee3;
}

.np-article .np-widget {
    background: var(--np-surface);
    border-radius: var(--np-radius);
    margin: 1.8em 0;
    padding: 18px 20px 20px;
}

.np-article .np-widget__title {
    margin: 0 0 10px;
}

.np-article .np-widget__hint {
    margin: 0 0 12px;
}

.np-article .np-widget__form {
    display: grid;
    gap: 10px 16px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin: 0 0 14px;
}

.np-article .np-widget__field {
    align-items: center;
    display: grid;
    gap: 4px 8px;
    grid-template-columns: minmax(0, 1fr) 42px;
    margin: 0;
}

.np-article .np-widget__label {
    color: var(--np-ink);
    font-size: 14px;
    font-weight: 600;
    grid-column: 1 / -1;
}

.np-article .np-widget__field input {
    background: #fff;
    border: 1px solid #c7ccd1;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    height: 40px;
    min-width: 0;
    padding: 0 10px;
    width: 100%;
}

.np-article .np-widget__field input[type="text"] {
    font-family: Menlo, Consolas, "Courier New", monospace;
    grid-column: 1 / -1;
}

.np-article .np-widget__unit {
    color: var(--np-muted);
    font-size: 13px;
}

.np-article .np-widget__result {
    background: #fff;
    border-radius: var(--np-radius-small);
    padding: 12px 14px;
}

.np-article .np-widget__row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    justify-content: space-between;
    margin: 0 0 6px;
}

.np-article .np-widget__note {
    margin: 8px 0 0;
}

.np-article .np-widget__warning {
    color: #9a3412;
    font-weight: 600;
    margin: 0;
}

.np-article .np-widget__presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.np-article .np-widget__preset {
    background: #fff;
    border: 1px solid #c7ccd1;
    border-radius: 18px;
    color: var(--np-ink);
    cursor: pointer;
    font-size: 14px;
    min-height: 36px;
    padding: 4px 14px;
}

.np-article .np-microbit-grid {
    background: #1c2226;
    border-radius: 14px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, 40px);
    justify-content: center;
    margin: 0 auto;
    max-width: 280px;
    padding: 18px;
}

.np-article .np-microbit-grid__led {
    background: #3b2326;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    height: 40px;
    padding: 0;
    width: 40px;
}

.np-article .np-microbit-grid__led[aria-pressed="true"] {
    background: #ff3b30;
    box-shadow: 0 0 12px 3px rgba(255, 59, 48, .65);
}

.np-article .np-microbit-grid__led:focus-visible,
.np-article .np-widget__preset:focus-visible {
    outline: 3px solid #7cc0e0;
    outline-offset: 2px;
}

.np-article .np-lcd {
    background: #1b3fae;
    border: 8px solid #20262b;
    border-radius: 8px;
    margin: 0 0 16px;
    max-width: 100%;
    overflow-x: auto;
    padding: 10px;
}

.np-article .np-lcd__row {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin: 2px 0;
}

.np-article .np-lcd__cell {
    background: #2450cc;
    color: #eef4ff;
    display: inline-block;
    flex: 0 0 auto;
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 17px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    width: 17px;
}

.np-article .np-lcd__cell--bad {
    background: #ffb020;
}

@media (max-width: 480px) {
    .np-article .np-lcd__cell {
        font-size: 13px;
        height: 22px;
        line-height: 22px;
        width: 13px;
    }

    .np-article .np-microbit-grid {
        gap: 6px;
        grid-template-columns: repeat(5, 36px);
        padding: 14px;
    }

    .np-article .np-microbit-grid__led {
        height: 36px;
        width: 36px;
    }

    .np-article .np-widget {
        padding: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .np-article .np-microbit-grid__led[aria-pressed="true"] {
        box-shadow: none;
    }
}

.np-article .np-parts > li:not(:has(img)) {
    grid-template-columns: minmax(0, 1fr);
}

/* The drawing needs the full article width to stay readable; the inputs sit under it in two columns. */
.np-actuator-calculator__workspace {
    grid-template-columns: minmax(0, 1fr);
}

.np-actuator-calculator__visual svg {
    display: block;
    height: auto;
    width: 100%;
}

@media (min-width: 720px) {
    .np-actuator-calculator__controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
