/*
 * NewsForge core styles for the public site.
 *
 * Themes set the design tokens below and style their own layout. This file
 * covers what the core renders: article content, embeds, comments, live
 * updates, forms, sharing, consent and the admin bar. Logical properties
 * (inline-start, block-end) keep right-to-left languages working.
 */

:root {
    --nf-accent: #c8102e;
    --nf-accent-contrast: #ffffff;
    --nf-bg: #ffffff;
    --nf-surface: #f5f5f3;
    --nf-text: #151515;
    --nf-muted: #5a5a5a;
    --nf-border: #e2e2de;
    --nf-radius: 4px;
    --nf-max-width: 1240px;
    --nf-gap: clamp(1rem, 2.5vw, 2rem);
    --nf-font-body:
        system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans',
        'Helvetica Neue', Arial, sans-serif;
    --nf-font-heading: var(--nf-font-body);
    --nf-font-mono:
        ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono',
        monospace;
    --nf-article-size: 18px;
    --nf-live: #d0021b;
    /* Backgrounds behind white text, such as the Live badge. Stays deep in dark mode. */
    --nf-live-bg: #c8102e;
    color-scheme: light;
}

:root[data-nf-scheme='dark'] {
    --nf-bg: #111214;
    --nf-surface: #1b1c1f;
    --nf-text: #ececea;
    --nf-muted: #a7a7a3;
    --nf-border: #2e2f33;
    --nf-live: #ff4d5e;
    --nf-live-bg: #b3121f;
    /* Dark-mode accents are light shades, so text on them is dark. */
    --nf-accent-contrast: #111214;
    color-scheme: dark;
}

/* Base */

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

/* Component display rules must never show something marked hidden. */
[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--nf-bg);
    color: var(--nf-text);
    font-family: var(--nf-font-body);
    font-size: 1rem;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe {
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--nf-accent);
    outline-offset: 2px;
}

.nf-icon {
    display: inline-block;
    flex: none;
    vertical-align: middle;
}

[dir='rtl'] .nf-icon--flip,
[dir='rtl'] .nf-block__more .nf-icon {
    transform: scaleX(-1);
}

.nf-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nf-skip {
    position: absolute;
    inset-inline-start: 1rem;
    inset-block-start: -100px;
    z-index: 1000;
    padding: 0.75rem 1rem;
    background: var(--nf-text);
    color: var(--nf-bg);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--nf-radius);
}

.nf-skip:focus {
    inset-block-start: 1rem;
}

.nf-main:focus {
    outline: none;
}

/* Hidden field that only bots fill in. */
.nf-hp {
    position: absolute !important;
    inset-inline-start: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Admin bar for signed-in staff */

.nf-admin-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    align-items: center;
    padding: 0.4rem 1rem;
    background: #1d1d1f;
    color: #f2f2f2;
    font: 500 0.8125rem/1.4 var(--nf-font-body);
}

.nf-admin-bar a {
    color: inherit;
    text-decoration: none;
}

.nf-admin-bar a:hover {
    text-decoration: underline;
}

.nf-admin-bar__note {
    margin-inline-start: auto;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: #f5b700;
    color: #1d1d1f;
}

/* Buttons and forms */

.nf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--nf-accent);
    border-radius: var(--nf-radius);
    background: var(--nf-accent);
    color: var(--nf-accent-contrast);
    font: 600 0.9375rem/1.2 var(--nf-font-body);
    text-decoration: none;
    cursor: pointer;
}

.nf-button:hover {
    filter: brightness(1.08);
}

.nf-button:disabled {
    opacity: 0.6;
    cursor: progress;
}

.nf-button--secondary {
    background: transparent;
    color: var(--nf-text);
    border-color: var(--nf-border);
}

.nf-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--nf-muted);
    font: inherit;
    font-size: 0.875rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.nf-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: var(--nf-radius);
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.nf-form {
    display: grid;
    gap: 1rem;
    max-width: 44rem;
}

.nf-field {
    display: grid;
    gap: 0.35rem;
}

.nf-field-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.nf-field label {
    font-weight: 600;
    font-size: 0.9375rem;
}

.nf-field__hint {
    color: var(--nf-muted);
    font-weight: 400;
}

.nf-form input:not([type='checkbox'], [type='radio'], [type='hidden']),
.nf-form textarea,
.nf-search-form input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    background: var(--nf-bg);
    color: var(--nf-text);
    font: inherit;
}

.nf-form textarea {
    resize: vertical;
}

.nf-form [aria-invalid='true'] {
    border-color: var(--nf-live);
}

.nf-form__status {
    margin: 0;
    min-height: 1.5em;
    font-size: 0.9375rem;
}

.nf-form__status.is-error {
    color: var(--nf-live);
}

.nf-form__status.is-success {
    color: #1a7f37;
}

:root[data-nf-scheme='dark'] .nf-form__status.is-success {
    color: #4ac26b;
}

/* Article content, as rendered from the editor */

.nf-content {
    font-size: var(--nf-article-size);
    line-height: 1.7;
    overflow-wrap: break-word;
}

.nf-content > * {
    margin-block: 0 1.2em;
}

.nf-content h2,
.nf-content h3,
.nf-content h4 {
    margin-block: 1.8em 0.6em;
    font-family: var(--nf-font-heading);
    line-height: 1.25;
}

.nf-content h2 {
    font-size: 1.5em;
}

.nf-content h3 {
    font-size: 1.25em;
}

.nf-content h4 {
    font-size: 1.1em;
}

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

.nf-content ul,
.nf-content ol {
    padding-inline-start: 1.4em;
}

.nf-content li + li {
    margin-block-start: 0.35em;
}

.nf-content blockquote {
    margin-inline: 0;
    padding-inline-start: 1.2em;
    border-inline-start: 4px solid var(--nf-accent);
    color: var(--nf-muted);
    font-style: italic;
}

.nf-content hr {
    border: 0;
    border-block-start: 1px solid var(--nf-border);
    margin-block: 2em;
}

.nf-content code {
    padding: 0.1em 0.35em;
    border-radius: 3px;
    background: var(--nf-surface);
    font-family: var(--nf-font-mono);
    font-size: 0.875em;
}

.nf-content pre {
    overflow-x: auto;
    padding: 1em;
    border-radius: var(--nf-radius);
    background: var(--nf-surface);
    font-size: 0.875em;
    line-height: 1.5;
}

.nf-content pre code {
    padding: 0;
    background: none;
}

.nf-content mark {
    background: #fff2a8;
    color: #151515;
}

.nf-content--drop-cap > p:first-of-type::first-letter {
    float: inline-start;
    margin-inline-end: 0.1em;
    font-family: var(--nf-font-heading);
    font-size: 3.6em;
    font-weight: 700;
    line-height: 0.85;
    color: var(--nf-accent);
}

.nf-align-center {
    text-align: center;
}

.nf-align-right {
    text-align: end;
}

.nf-align-justify {
    text-align: justify;
}

.nf-figure {
    margin-inline: 0;
}

.nf-figure img {
    display: block;
    width: 100%;
    border-radius: var(--nf-radius);
}

.nf-figure--wide {
    margin-inline: calc(-1 * min(4vw, 3rem));
}

.nf-figure--small {
    max-width: 50%;
    float: inline-end;
    margin-inline-start: 1.2em;
}

.nf-content figcaption,
.nf-article__media figcaption {
    margin-block-start: 0.5em;
    color: var(--nf-muted);
    font-family: var(--nf-font-body);
    font-size: 0.875rem;
    line-height: 1.45;
}

.nf-credit {
    color: var(--nf-muted);
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
}

.nf-credit::before {
    content: '© ';
}

.nf-gallery {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fill, minmax(min(12rem, 45%), 1fr));
}

.nf-gallery__item {
    margin: 0;
}

.nf-gallery__item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--nf-radius);
}

.nf-embed {
    margin-inline: 0;
}

.nf-embed__frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--nf-surface);
    border-radius: var(--nf-radius);
    overflow: hidden;
}

.nf-embed__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.nf-embed--soundcloud .nf-embed__frame,
.nf-embed--spotify .nf-embed__frame {
    aspect-ratio: auto;
}

.nf-embed--soundcloud iframe,
.nf-embed--spotify iframe {
    position: static;
    height: 166px;
}

.nf-social-embed {
    margin-inline: 0;
    padding: 1rem 1.2rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    font-style: normal;
}

.nf-callout {
    padding: 1em 1.2em;
    border-inline-start: 4px solid var(--nf-accent);
    border-radius: var(--nf-radius);
    background: var(--nf-surface);
    font-size: 0.95em;
}

.nf-callout > :last-child {
    margin-block-end: 0;
}

.nf-callout__title {
    margin-block: 0 0.4em;
}

.nf-callout--warning {
    border-color: #d97706;
}

.nf-callout--success {
    border-color: #16a34a;
}

.nf-callout--note {
    border-color: #2563eb;
}

.nf-pullquote {
    margin-inline: 0;
    padding-block: 0.4em;
    text-align: center;
}

.nf-pullquote blockquote {
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--nf-text);
    font-family: var(--nf-font-heading);
    font-size: 1.45em;
    font-style: normal;
    font-weight: 600;
    line-height: 1.3;
}

.nf-pullquote blockquote::before {
    content: '“';
    display: block;
    color: var(--nf-accent);
    font-size: 2.4em;
    line-height: 0.6;
}

.nf-pullquote figcaption {
    margin-block-start: 0.6em;
}

.nf-table {
    overflow-x: auto;
}

.nf-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.nf-table th,
.nf-table td {
    padding: 0.55em 0.7em;
    border: 1px solid var(--nf-border);
    text-align: start;
    vertical-align: top;
}

.nf-table th {
    background: var(--nf-surface);
}

.nf-embed-link a {
    word-break: break-all;
}

/* Ad slots stay out of the way until an ad fills them. */
.nf-ad-slot:empty {
    display: none;
}

/* Ads (ADR 0017). Zones stay hidden until the core script places an ad. */
.nf-ad {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    margin-block: 1.5rem;
    text-align: center;
}

.nf-ad--header,
.nf-ad--footer {
    margin-inline: auto;
    padding-inline: var(--nf-gap);
    max-width: var(--nf-max-width);
}

.nf-ad__label {
    margin: 0;
    color: var(--nf-muted);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nf-ad__slot {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.nf-ad__slot img {
    display: block;
    margin-inline: auto;
    max-width: 100%;
    height: auto;
}

/* Banners across the page stay banner-sized, whatever picture was uploaded. */
.nf-ad--header .nf-ad__slot img,
.nf-ad--footer .nf-ad__slot img {
    width: auto;
    max-height: 250px;
    object-fit: contain;
}

.nf-sponsored {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    color: var(--nf-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

/* "Read more" inside an article */

.nf-related {
    display: grid;
    gap: 0.4rem;
    padding: 0.9rem 1rem;
    border-block: 1px solid var(--nf-border);
    font-family: var(--nf-font-body);
}

.nf-related__label {
    color: var(--nf-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nf-related__link {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.35;
}

.nf-content .nf-related__link {
    color: var(--nf-text);
    text-decoration: none;
}

.nf-related__image {
    width: 5.5rem;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--nf-radius);
}

.nf-related__link:hover .nf-related__title {
    text-decoration: underline;
}

/* Listen to this article, AI disclosure */

.nf-listen {
    display: grid;
    gap: 0.5rem;
    margin-block: 0 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    background: var(--nf-surface);
}

.nf-listen__label {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.nf-listen__player {
    width: 100%;
}

.nf-ai-note {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-block: 1.5rem;
    padding: 0.75rem 1rem;
    border-inline-start: 3px solid var(--nf-border);
    color: var(--nf-muted);
    font-size: 0.875rem;
}

.nf-ai-note .nf-icon {
    flex: none;
    margin-block-start: 0.15em;
}

/* Memberships and the reader's account (ADR 0018) */

.nf-notice {
    padding: 0.75rem 1rem;
    border: 1px solid var(--nf-border);
    border-inline-start: 4px solid var(--nf-accent);
    border-radius: var(--nf-radius);
    background: var(--nf-surface);
}

.nf-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: var(--nf-gap);
    margin-block: 1.5rem;
}

.nf-plan {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    background: var(--nf-bg);
}

.nf-plan__name {
    margin: 0;
    font-family: var(--nf-font-heading);
}

.nf-plan__prices {
    display: grid;
    gap: 0.15rem;
    margin: 0;
}

.nf-plan__price:first-child {
    font-size: 1.5rem;
    font-weight: 700;
}

.nf-plan__trial {
    margin: 0;
    color: var(--nf-accent);
    font-weight: 600;
}

.nf-plan__features {
    margin: 0;
    padding-inline-start: 1.1rem;
}

.nf-plan__form {
    margin-top: auto;
}

.nf-plan__intervals {
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.nf-plan__pay,
.nf-account__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.nf-account__section {
    padding-block: 1.25rem;
    border-block-end: 1px solid var(--nf-border);
}

.nf-account__section h2 {
    margin-block: 0 0.5rem;
    font-size: 1.25rem;
}

.nf-account__table {
    width: 100%;
    border-collapse: collapse;
}

.nf-account__table th,
.nf-account__table td {
    padding: 0.5rem 0.25rem;
    border-block-end: 1px solid var(--nf-border);
    text-align: start;
}

.nf-paywall__meter {
    color: var(--nf-muted);
    font-size: 0.875rem;
}

/* Newsletter sign-up (ADR 0019) */

.nf-newsletter {
    display: grid;
    gap: 0.5rem;
    padding: 1.25rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    background: var(--nf-surface);
}

.nf-newsletter__title {
    margin: 0;
    font-family: var(--nf-font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.nf-newsletter__text {
    margin: 0;
    color: var(--nf-muted);
}

.nf-newsletter__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nf-newsletter__row input {
    flex: 1 1 12rem;
    min-width: 0;
}

/* Web push offer (ADR 0019) */

.nf-push-offer {
    position: fixed;
    inset-inline-end: 1rem;
    inset-block-end: 1rem;
    z-index: 900;
    display: grid;
    gap: 0.75rem;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    background: var(--nf-bg);
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.15);
}

.nf-push-offer__text {
    margin: 0;
    font-weight: 600;
}

.nf-push-offer__actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Paywall */

.nf-paywall {
    position: relative;
    margin-block: 1rem 2rem;
    padding: 1.5rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    background: var(--nf-surface);
    text-align: center;
}

.nf-paywall::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    inset-block-end: 100%;
    height: 5rem;
    background: linear-gradient(to bottom, transparent, var(--nf-bg));
    pointer-events: none;
}

.nf-paywall__title {
    margin-block: 0 0.5rem;
    font-family: var(--nf-font-heading);
}

.nf-paywall__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-block-end: 0;
}

/* Byline */

.nf-byline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    align-items: center;
    color: var(--nf-muted);
    font-size: 0.9rem;
}

.nf-byline p {
    margin: 0;
}

.nf-byline__avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    object-fit: cover;
}

.nf-byline__authors {
    color: var(--nf-text);
}

.nf-byline__authors a {
    font-weight: 600;
    text-decoration: none;
}

.nf-byline__authors a:hover {
    text-decoration: underline;
}

.nf-byline__role {
    display: block;
    color: var(--nf-muted);
    font-size: 0.85em;
}

.nf-byline__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.8rem;
    flex-basis: 100%;
}

/* Sharing */

.nf-share {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.nf-share__link,
.nf-share__native {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.6rem;
    border: 1px solid var(--nf-border);
    border-radius: 999px;
    background: transparent;
    color: var(--nf-text);
    font: 600 0.875rem var(--nf-font-body);
    text-decoration: none;
    cursor: pointer;
}

.nf-share__link:hover,
.nf-share__native:hover {
    border-color: var(--nf-text);
}

/* Breadcrumbs */

.nf-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--nf-muted);
    font-size: 0.8125rem;
}

.nf-breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-inline-start: 0.35rem;
    opacity: 0.6;
}

.nf-breadcrumbs a {
    text-decoration: none;
}

.nf-breadcrumbs a:hover {
    text-decoration: underline;
}

.nf-breadcrumbs [aria-current] {
    display: inline-block;
    max-width: 40ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* Pagination */

.nf-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-block: 2rem;
    font-weight: 600;
}

.nf-pagination ol {
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nf-pagination a,
.nf-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: var(--nf-radius);
    text-decoration: none;
}

.nf-pagination a {
    border: 1px solid var(--nf-border);
}

.nf-pagination a:hover {
    border-color: var(--nf-text);
}

.nf-pagination [aria-current] {
    background: var(--nf-text);
    color: var(--nf-bg);
}

/* Tags and simple link lists */

.nf-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nf-tag-list a {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--nf-border);
    border-radius: 999px;
    font-size: 0.875rem;
    text-decoration: none;
}

.nf-tag-list a:hover {
    border-color: var(--nf-text);
}

.nf-link-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nf-link-list a {
    display: block;
    padding-block: 0.35rem;
    text-decoration: none;
}

.nf-link-list a:hover {
    text-decoration: underline;
}

.nf-link-list__item--depth-1 {
    padding-inline-start: 1rem;
}

.nf-link-list__item--depth-2 {
    padding-inline-start: 2rem;
}

.nf-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nf-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    color: inherit;
}

.nf-social a:hover {
    background: color-mix(in srgb, currentColor 12%, transparent);
}

/* Language switcher */

.nf-languages ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nf-languages a {
    text-decoration: none;
}

.nf-languages a:hover {
    text-decoration: underline;
}

.nf-languages [aria-current] {
    font-weight: 700;
}

/* Live badge and live blog */

.nf-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    margin-inline-end: 0.35em;
    padding: 0.1em 0.5em;
    border-radius: 3px;
    background: var(--nf-live-bg);
    color: #ffffff;
    font-family: var(--nf-font-body);
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    vertical-align: 0.15em;
}

.nf-live-badge::before {
    content: '';
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background: currentColor;
    animation: nf-pulse 1.6s ease-in-out infinite;
}

@keyframes nf-pulse {
    50% {
        opacity: 0.25;
    }
}

.nf-live {
    margin-block: 2rem;
}

.nf-live__header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding-block-end: 0.75rem;
    border-block-end: 2px solid var(--nf-live);
}

.nf-live__title {
    margin: 0;
    font-family: var(--nf-font-heading);
    font-size: 1.35rem;
}

.nf-live__status {
    margin-inline-start: auto;
    color: var(--nf-muted);
    font-size: 0.8125rem;
}

.nf-live__key-events {
    margin-block: 1rem;
    padding: 1rem 1.2rem;
    border-radius: var(--nf-radius);
    background: var(--nf-surface);
}

.nf-live__key-events h3 {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nf-live__key-events ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nf-live__key-events li + li {
    margin-block-start: 0.35rem;
}

.nf-live__key-events a {
    text-decoration: none;
}

.nf-live__key-events a:hover {
    text-decoration: underline;
}

.nf-live__key-events time {
    margin-inline-end: 0.5rem;
    color: var(--nf-live);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.nf-live__new {
    position: sticky;
    inset-block-start: 4.5rem;
    z-index: 5;
    display: block;
    margin: 1rem auto;
    padding: 0.5rem 1.1rem;
    border: 0;
    border-radius: 999px;
    background: var(--nf-live-bg);
    color: #ffffff;
    font: 700 0.875rem var(--nf-font-body);
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.2);
    cursor: pointer;
}

.nf-live__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nf-live-update {
    position: relative;
    padding-block: 1.25rem;
    padding-inline-start: 1.25rem;
    border-block-end: 1px solid var(--nf-border);
    border-inline-start: 2px solid var(--nf-border);
}

.nf-live-update::before {
    content: '';
    position: absolute;
    inset-inline-start: -7px;
    inset-block-start: 1.6rem;
    width: 12px;
    height: 12px;
    border: 2px solid var(--nf-bg);
    border-radius: 50%;
    background: var(--nf-live);
}

.nf-live-update.is-pinned {
    border-inline-start-color: var(--nf-accent);
    background: var(--nf-surface);
    padding-inline-end: 1rem;
}

.nf-live-update.is-new {
    animation: nf-highlight 3s ease-out;
}

@keyframes nf-highlight {
    from {
        background: color-mix(in srgb, var(--nf-live) 14%, transparent);
    }
}

.nf-live-update__header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8125rem;
}

.nf-live-update__time {
    color: var(--nf-live);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}

.nf-live-update__flag {
    padding: 0.05rem 0.45rem;
    border-radius: 3px;
    background: var(--nf-surface);
    color: var(--nf-muted);
    font-weight: 600;
}

.nf-live-update__flag--key {
    background: var(--nf-text);
    color: var(--nf-bg);
}

.nf-live-update__title {
    margin: 0.4rem 0 0.2rem;
    font-family: var(--nf-font-heading);
    font-size: 1.2rem;
    line-height: 1.3;
}

.nf-live-update__content {
    font-size: calc(var(--nf-article-size) * 0.95);
}

.nf-live-update__content > :last-child {
    margin-block-end: 0;
}

.nf-live-update__author {
    margin: 0.5rem 0 0;
    color: var(--nf-muted);
    font-size: 0.8125rem;
}

.nf-live__empty {
    padding: 1.5rem 0;
    color: var(--nf-muted);
}

/* Comments */

.nf-comments {
    max-width: 48rem;
    margin-block: 3rem;
}

.nf-comments__title {
    font-family: var(--nf-font-heading);
    font-size: 1.4rem;
}

.nf-comments__list,
.nf-comment__replies {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nf-comment__replies {
    margin-inline-start: clamp(1rem, 4vw, 2.5rem);
    padding-inline-start: 1rem;
    border-inline-start: 2px solid var(--nf-border);
}

.nf-comment__inner {
    padding-block: 1rem;
    border-block-end: 1px solid var(--nf-border);
}

.nf-comment__header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.6rem;
    align-items: baseline;
    font-size: 0.9375rem;
}

.nf-comment__time {
    color: var(--nf-muted);
    font-size: 0.8125rem;
    text-decoration: none;
}

.nf-comment__staff {
    padding: 0 0.4rem;
    border-radius: 3px;
    background: var(--nf-accent);
    color: var(--nf-accent-contrast);
    font-size: 0.75rem;
    font-weight: 700;
}

.nf-comment__body {
    margin-block: 0.4rem;
}

.nf-comment-form {
    margin-block-start: 2rem;
    padding: 1.25rem;
    border-radius: var(--nf-radius);
    background: var(--nf-surface);
    max-width: none;
}

.nf-comment-form__title {
    margin: 0;
    font-family: var(--nf-font-heading);
}

.nf-comment-form__replying {
    margin: 0;
    font-weight: 600;
}

.nf-comments__closed {
    color: var(--nf-muted);
}

/* Cookie consent */

.nf-consent {
    position: fixed;
    inset-inline: 1rem;
    inset-block-end: 1rem;
    z-index: 900;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    max-width: 56rem;
    margin-inline: auto;
    padding: 1rem 1.25rem;
    border: 1px solid var(--nf-border);
    border-radius: calc(var(--nf-radius) + 4px);
    background: var(--nf-bg);
    color: var(--nf-text);
    box-shadow: 0 10px 40px rgb(0 0 0 / 0.18);
}

.nf-consent[hidden] {
    display: none;
}

.nf-consent__text {
    flex: 1 1 20rem;
    margin: 0;
    font-size: 0.9375rem;
}

.nf-consent__actions {
    display: flex;
    gap: 0.5rem;
}

/* Reading progress */

.nf-progress {
    position: fixed;
    inset-inline: 0;
    inset-block-start: 0;
    z-index: 950;
    height: 3px;
    pointer-events: none;
}

.nf-progress span {
    display: block;
    height: 100%;
    background: var(--nf-accent);
    transform-origin: left center;
    transform: scaleX(0);
}

[dir='rtl'] .nf-progress span {
    transform-origin: right center;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .nf-admin-bar,
    .nf-consent,
    .nf-share,
    .nf-comment-form,
    .nf-progress,
    .nf-live__new {
        display: none !important;
    }

    .nf-content a::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        word-break: break-all;
    }
}
