/* =========================================================================
   NewsForge — main.css
   Component styles ONLY consume var(--theme-*) custom properties, which
   are printed at runtime by inc/design-system/class-css-vars.php from
   saved Customizer values. Never hard-code a color/spacing value here —
   register a new token in inc/design-system/class-design-tokens.php
   instead so it stays admin-configurable.
   ========================================================================= */

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; }
img, picture, video { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; }
a { text-decoration: none; color: var(--theme-link); }
a:hover, a:focus { color: var(--theme-link-hover); }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.screen-reader-text:focus {
	position: fixed; top: 8px; left: 8px;
	width: auto; height: auto; z-index: 100000;
	padding: 10px 16px;
	background: var(--theme-surface); color: var(--theme-text);
	border-radius: var(--theme-radius);
	box-shadow: var(--theme-shadow);
	clip: auto;
}

:focus-visible {
	outline: none;
	box-shadow: var(--theme-focus-ring);
	border-radius: 2px;
}

@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;
	}
}

/* ---- Base ---------------------------------------------------------------- */
body {
	font-family: var(--theme-font-body);
	font-size: var(--theme-font-size-base);
	line-height: var(--theme-line-height-base);
	color: var(--theme-text);
	background: var(--theme-background);
	transition: background-color .2s ease, color .2s ease;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--theme-font-heading);
	color: var(--theme-heading);
	line-height: 1.25;
	margin: 0 0 .5em;
	font-weight: 700;
}
h1 { font-size: var(--theme-font-size-h1); }
h2 { font-size: var(--theme-font-size-h2); }
h3 { font-size: var(--theme-font-size-h3); }
h4 { font-size: var(--theme-font-size-h4); }
h5 { font-size: var(--theme-font-size-h5); }
h6 { font-size: var(--theme-font-size-h6); text-transform: uppercase; letter-spacing: .04em; }

p { margin: 0 0 1.2em; }

.nf-container {
	max-width: var(--theme-site-width);
	margin-inline: auto;
	padding-inline: var(--theme-container-padding);
}

.nf-section { padding-block: var(--theme-section-spacing); }
.nf-section__head {
	display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
	margin-bottom: calc(var(--theme-section-spacing) / 2.5);
	border-bottom: 2px solid var(--theme-border);
	padding-bottom: 12px;
}
.nf-section__title {
	margin: 0; font-size: 1.4rem; position: relative; padding-inline-start: 14px;
	border-inline-start: 4px solid var(--theme-primary);
}
.nf-section__more { font-size: .85rem; font-weight: 600; white-space: nowrap; }

/* ---- Buttons & Forms ------------------------------------------------------ */
.nf-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: .7em 1.4em;
	border-radius: var(--theme-button-radius);
	background: var(--theme-btn-primary); color: var(--theme-btn-text);
	border: none; font-weight: 600; font-size: .95rem;
	transition: background-color .15s ease, transform .1s ease;
}
.nf-btn:hover, .nf-btn:focus { background: var(--theme-btn-hover); color: var(--theme-btn-text); }
.nf-btn--secondary { background: var(--theme-btn-secondary); }
.nf-btn--success { background: var(--theme-btn-success); }
.nf-btn--warning { background: var(--theme-btn-warning); }
.nf-btn--danger  { background: var(--theme-btn-danger); }

input[type="text"], input[type="search"], input[type="email"], input[type="url"], textarea, select {
	width: 100%;
	background: var(--theme-form-bg); color: var(--theme-form-text);
	border: 1px solid var(--theme-form-border);
	border-radius: var(--theme-input-radius);
	padding: .65em .9em;
	transition: box-shadow .15s ease, border-color .15s ease;
}
input:focus, textarea:focus, select:focus {
	outline: none;
	border-color: var(--theme-input-focus);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-input-focus) 20%, transparent);
}

.nf-search-form { display: flex; gap: 8px; }

/* ---- Top Bar --------------------------------------------------------------- */
.nf-topbar {
	background: var(--theme-topbar-bg); color: var(--theme-topbar-text);
	font-size: .85rem;
}
.nf-topbar .nf-container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.nf-topbar a { color: inherit; opacity: .9; }
.nf-topbar a:hover { opacity: 1; color: var(--theme-primary); }
.nf-topbar__left, .nf-topbar__right { display: flex; align-items: center; gap: 16px; }
.nf-topbar__social { display: flex; gap: 10px; }
.nf-topbar__social a {
	width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%; background: rgba(255,255,255,.08); font-size: .7rem;
}

/* ---- Header ----------------------------------------------------------------- */
.nf-header {
	background: var(--theme-header-bg);
	border-bottom: 1px solid var(--theme-border);
	position: relative; z-index: 40;
}
.nf-header--sticky { position: sticky; top: 0; }
.nf-header.is-scrolled { box-shadow: var(--theme-shadow); }
.nf-header--transparent { position: absolute; inset-inline: 0; background: transparent; border-bottom: none; }

.nf-header__inner {
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding-block: 16px;
}
body.nf-header-logo-center-nav-below .nf-header__inner { flex-direction: column; }
body.nf-header-logo-center-utility .nf-header__inner { flex-direction: column; }

/* Header layout presets (spec §9) — visual treatment per nf_header_layout value.
   Structural markup stays identical; only spacing/borders/typography change. */
body.nf-header-logo-left-nav-right .nf-header__inner { justify-content: space-between; }

body.nf-header-logo-center-nav-below .nf-site-branding,
body.nf-header-logo-center-utility .nf-site-branding { justify-content: center; width: 100%; }
body.nf-header-logo-center-nav-below .nf-header__actions,
body.nf-header-logo-center-utility .nf-header__actions { position: absolute; top: 18px; inset-inline-end: var(--theme-container-padding); }
body.nf-header-logo-center-nav-below .nf-header,
body.nf-header-logo-center-utility .nf-header { position: relative; }

body.nf-header-logo-left-nav-center .nf-header__inner { justify-content: space-between; }
body.nf-header-logo-left-nav-center .nf-nav { flex: 1; }
body.nf-header-logo-left-nav-center .nf-nav .nf-container { justify-content: center; }

body.nf-header-newspaper .nf-header__inner { padding-block: 24px; border-bottom: 3px solid var(--theme-heading); }
body.nf-header-newspaper .nf-site-branding { margin-inline: auto; }
body.nf-header-newspaper .nf-site-title { font-size: 2.4rem; letter-spacing: -0.01em; }
body.nf-header-newspaper .nf-site-description { text-align: center; text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; }
body.nf-header-newspaper .nf-header__inner { flex-direction: column; }
body.nf-header-newspaper .nf-nav { border-block: 1px solid var(--theme-heading); }
body.nf-header-newspaper .nf-nav__menu { justify-content: center; width: 100%; }

body.nf-header-minimal .nf-header__inner { padding-block: 10px; }
body.nf-header-minimal .nf-topbar { display: none; }
body.nf-header-minimal .nf-site-title { font-size: 1.25rem; }
body.nf-header-minimal .nf-nav__menu > li > a { padding-block: 10px; font-weight: 500; }

/* Editorial Masthead — dense, cream-canvas, hairline-bordered, serif, no color
   blocks in the chrome (modeled on modern serif-first news sites like Semafor). */
body.nf-header-editorial .nf-header { border-bottom: 1px solid var(--theme-heading); background: var(--theme-background); }
body.nf-header-editorial .nf-header__inner { padding-block: 20px 14px; justify-content: center; }
body.nf-header-editorial .nf-site-branding { justify-content: center; }
body.nf-header-editorial .nf-site-title { font-size: 1.9rem; letter-spacing: -0.01em; }
body.nf-header-editorial .nf-site-title a { color: var(--theme-heading); }
body.nf-header-editorial .nf-header__actions { position: absolute; top: 20px; inset-inline-end: var(--theme-container-padding); }
body.nf-header-editorial .nf-header { position: relative; }
body.nf-header-editorial .nf-topbar { background: transparent; color: var(--theme-text); border-bottom: 1px solid var(--theme-border); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
body.nf-header-editorial .nf-topbar a { color: var(--theme-text); }
body.nf-header-editorial .nf-nav { background: transparent; border-block: 1px solid var(--theme-heading); }
body.nf-header-editorial .nf-nav .nf-container { justify-content: center; }
body.nf-header-editorial .nf-nav__menu { gap: 0; }
body.nf-header-editorial .nf-nav__menu > li > a {
	color: var(--theme-heading); font-weight: 600; text-transform: uppercase; font-size: .78rem; letter-spacing: .07em;
	padding: 12px 18px;
}
body.nf-header-editorial .nf-nav__menu > li > a:hover,
body.nf-header-editorial .nf-nav__menu > li.current-menu-item > a { background: transparent; color: var(--theme-primary); }
body.nf-header-editorial .nf-breaking { border-bottom: 1px solid var(--theme-heading); }

.nf-site-branding { display: flex; align-items: center; }
.nf-site-branding img { max-width: var(--nf-logo-max-width, 180px); height: auto; }
.nf-site-title { margin: 0; font-family: var(--theme-font-heading); font-size: 1.6rem; }
.nf-site-title a { color: var(--theme-heading); }
.nf-site-description { margin: 0; font-size: .8rem; color: var(--theme-muted); }

.nf-header__actions { display: flex; align-items: center; gap: 14px; }
.nf-header__actions button {
	background: transparent; border: none; color: var(--theme-heading);
	width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}
.nf-header__actions button:hover { background: var(--theme-surface); }

.nf-search-panel { display: none; padding-block: 12px; border-top: 1px solid var(--theme-border); }
.nf-search-panel.is-open { display: block; }

/* ---- Navigation --------------------------------------------------------------- */
.nf-nav {
	background: var(--theme-nav-bg);
	font-family: var(--theme-font-nav);
}
body.nf-nav-horizontal .nf-nav,
body.nf-nav-full-width .nf-nav { background: transparent; }
body.nf-nav-horizontal .nf-nav .nf-nav__menu > li > a,
body.nf-nav-full-width .nf-nav .nf-nav__menu > li > a { color: var(--theme-heading); }

.nf-nav .nf-container { display: flex; align-items: center; }
body.nf-nav-centered .nf-nav .nf-container { justify-content: center; }

body.nf-nav-full-width .nf-nav .nf-container { max-width: none; }
.nf-nav--align-left .nf-container { justify-content: flex-start; }
.nf-nav--align-center .nf-container { justify-content: center; }
.nf-nav--align-right .nf-container { justify-content: flex-end; }
.nf-nav--align-space-between .nf-container { justify-content: space-between; }

.nf-nav__menu {
	display: flex; flex-wrap: wrap; list-style: none; gap: 4px;
	letter-spacing: var(--theme-letter-spacing-nav);
}
.nf-nav__menu > li > a {
	display: block; padding: 14px 16px; color: var(--theme-nav-text); font-weight: 600; font-size: .93rem;
	transition: background-color .15s ease;
}
.nf-nav__menu > li > a:hover,
.nf-nav__menu > li.current-menu-item > a { background: rgba(0,0,0,.12); color: var(--theme-nav-text); }

.nf-nav__menu li { position: relative; }
.nf-nav__menu ul {
	list-style: none; position: absolute; inset-inline-start: 0; top: 100%; min-width: 220px;
	background: var(--theme-surface); box-shadow: var(--theme-shadow); border-radius: 0 0 var(--theme-radius) var(--theme-radius);
	display: none; z-index: 50; padding: 6px 0;
}
.nf-nav__menu li:hover > ul,
.nf-nav__menu li.is-open > ul { display: block; }
.nf-nav__menu ul a { color: var(--theme-text); padding: 10px 16px; font-weight: 500; }
.nf-nav__menu ul a:hover { background: var(--theme-background); color: var(--theme-primary); }
.nf-nav__menu .menu-item-has-children > a::after { content: "\25BE"; margin-inline-start: 6px; font-size: .7em; }

.nf-nav__toggle {
	display: none; background: transparent; border: none; color: var(--theme-nav-text);
	width: 42px; height: 42px; align-items: center; justify-content: center;
}
.nf-nav__toggle span, .nf-nav__toggle::before, .nf-nav__toggle::after {
	content: ""; display: block; width: 22px; height: 2px; background: currentColor; margin: 5px auto; transition: transform .2s ease;
}

/* ---- Breaking News ------------------------------------------------------------- */
.nf-breaking {
	background: var(--theme-breaking-bg); color: var(--theme-breaking-text);
	display: flex; align-items: center;
}
.nf-breaking__label {
	flex-shrink: 0; display: flex; align-items: center; gap: 6px;
	background: rgba(0,0,0,.15); padding: 10px 16px; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
}
.nf-breaking__viewport { overflow: hidden; flex: 1; padding-inline: 12px; }
.nf-breaking__track { display: flex; gap: 48px; white-space: nowrap; animation: nf-marquee var(--nf-breaking-speed, 40s) linear infinite; }
.nf-breaking__track.is-paused { animation-play-state: paused; }
.nf-breaking__track.is-static { animation: none; }
.nf-breaking__track a { color: var(--theme-breaking-text); font-weight: 600; font-size: .9rem; }
@keyframes nf-marquee {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}
[dir="rtl"] .nf-breaking__track { animation-name: nf-marquee-rtl; }
@keyframes nf-marquee-rtl {
	from { transform: translateX(0); }
	to   { transform: translateX(50%); }
}

.nf-breaking--static .nf-breaking__item { display: none; white-space: normal; }
.nf-breaking--static .nf-breaking__item.is-active { display: block; }
.nf-breaking__nav { display: flex; gap: 6px; padding-inline-end: 10px; flex-shrink: 0; }
.nf-breaking__nav button { background: rgba(0,0,0,.15); color: inherit; border: none; width: 26px; height: 26px; border-radius: 50%; }

/* ---- Hero / Slider --------------------------------------------------------------- */
.nf-hero { display: grid; gap: var(--theme-grid-gap); grid-template-columns: 1.6fr 1fr; }
.nf-hero__main { position: relative; border-radius: var(--theme-radius); overflow: hidden; min-height: 360px; }
.nf-hero__main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nf-hero__overlay {
	position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px;
	background: linear-gradient(0deg, var(--theme-overlay) 0%, transparent 65%);
}
.nf-hero__overlay .nf-category-badge { margin-bottom: 10px; }
.nf-hero__overlay h2, .nf-hero__overlay h2 a { color: #fff; margin: 0 0 10px; font-size: 1.8rem; }
.nf-hero__overlay .nf-meta, .nf-hero__overlay .nf-meta a { color: rgba(255,255,255,.85); }
.nf-hero__side { display: flex; flex-direction: column; gap: var(--theme-grid-gap); }
.nf-hero__side-item { display: flex; gap: 12px; }
.nf-hero__side-item img { width: 110px; height: 78px; object-fit: cover; border-radius: var(--theme-image-radius); flex-shrink: 0; }
.nf-hero__side-item h3 { font-size: 1rem; margin: 0 0 6px; }
.nf-hero__side-item h3 a { color: var(--theme-heading); }

/* ---- Hero Carousel (nf_hero_style = carousel) ------------------------------------- */
.nf-hero-carousel { position: relative; border-radius: var(--theme-radius); overflow: hidden; }
.nf-hero-carousel__track {
	display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.nf-hero-carousel__track::-webkit-scrollbar { display: none; }
.nf-hero-carousel__slide {
	position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: 440px; aspect-ratio: 16 / 7;
}
.nf-hero-carousel__slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nf-hero-carousel__overlay {
	position: absolute; inset: 0; display: flex; align-items: flex-end;
	background: linear-gradient(0deg, var(--theme-overlay) 0%, transparent 60%);
	padding-block: 32px;
}
.nf-hero-carousel__overlay h2, .nf-hero-carousel__overlay h2 a { color: #fff; font-size: 2rem; margin: 10px 0; max-width: 720px; }
.nf-hero-carousel__overlay .nf-meta, .nf-hero-carousel__overlay .nf-meta a { color: rgba(255,255,255,.85); }
.nf-hero-carousel__prev, .nf-hero-carousel__next {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
	width: 44px; height: 44px; border-radius: 50%; border: none;
	background: rgba(0,0,0,.35); color: #fff; font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
}
.nf-hero-carousel__prev { inset-inline-start: 16px; }
.nf-hero-carousel__next { inset-inline-end: 16px; }
.nf-hero-carousel__prev:hover, .nf-hero-carousel__next:hover { background: var(--theme-primary); }
.nf-hero-carousel__dots { position: absolute; bottom: 16px; inset-inline: 0; display: flex; justify-content: center; gap: 8px; z-index: 5; }
.nf-hero-carousel__dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.5); padding: 0; }
.nf-hero-carousel__dot.is-active { background: #fff; width: 22px; border-radius: 5px; transition: width .2s ease; }

/* ---- Category badge --------------------------------------------------------------- */
.nf-category-badge {
	display: inline-block; background: var(--theme-primary); color: var(--theme-btn-text);
	font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
	padding: 4px 10px; border-radius: var(--theme-button-radius);
}

/* ---- Meta line --------------------------------------------------------------------- */
.nf-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: var(--theme-font-size-meta); color: var(--theme-muted); }
.nf-meta a { color: var(--theme-muted); }
.nf-meta a:hover { color: var(--theme-primary); }
.nf-meta > span:not(:last-child)::after { content: "\2022"; margin-inline-start: 10px; opacity: .6; }

/* ---- News Card component (variants: default / compact / featured / overlay / horizontal) ---- */
.nf-card { background: var(--theme-surface); border-radius: var(--theme-radius); overflow: hidden; box-shadow: var(--theme-shadow); display: flex; flex-direction: column; height: 100%; }
.nf-card__media { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; }
.nf-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.nf-card:hover .nf-card__media img { transform: scale(1.05); }
.nf-card__media .nf-category-badge { position: absolute; top: 10px; inset-inline-start: 10px; }
.nf-card__body { padding: var(--theme-card-spacing); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nf-card__title { font-size: 1.05rem; margin: 0; }
.nf-card__title a { color: var(--theme-heading); }
.nf-card__title a:hover { color: var(--theme-primary); }
.nf-card__excerpt { color: var(--theme-text); font-size: .92rem; margin: 0; }

.nf-card--compact { flex-direction: row; align-items: center; background: transparent; box-shadow: none; gap: 12px; border-radius: 0; border-bottom: 1px solid var(--theme-divider); padding-bottom: 10px; }
.nf-card--compact .nf-card__media { width: 84px; height: 64px; flex-shrink: 0; aspect-ratio: auto; border-radius: var(--theme-image-radius); }
.nf-card--compact .nf-card__body { padding: 0; }
.nf-card--compact .nf-card__title { font-size: .92rem; }
.nf-card--compact .nf-card__excerpt { display: none; }

.nf-card--featured { grid-column: span 2; }
.nf-card--featured .nf-card__media { aspect-ratio: 16 / 9; }
.nf-card--featured .nf-card__title { font-size: 1.5rem; }

.nf-card--overlay { position: relative; }
.nf-card--overlay .nf-card__media { aspect-ratio: 4 / 3; }
.nf-card--overlay .nf-card__body {
	position: absolute; inset: 0; justify-content: flex-end;
	background: linear-gradient(0deg, var(--theme-overlay) 0%, transparent 70%);
}
.nf-card--overlay .nf-card__title a,
.nf-card--overlay .nf-meta,
.nf-card--overlay .nf-meta a { color: #fff; }

.nf-card--horizontal { flex-direction: row; }
.nf-card--horizontal .nf-card__media { width: 40%; aspect-ratio: auto; }
.nf-card--horizontal .nf-card__body { width: 60%; }

.nf-card--minimal { background: transparent; box-shadow: none; }
.nf-card--list { flex-direction: row; align-items: flex-start; background: transparent; box-shadow: none; border-bottom: 1px solid var(--theme-divider); border-radius: 0; padding-block: var(--theme-card-spacing); gap: 16px; }
.nf-card--list .nf-card__media { width: 160px; flex-shrink: 0; aspect-ratio: 3/2; }
.nf-card--list .nf-card__body { padding: 0; }

/* ---- News Grid --------------------------------------------------------------------- */
.nf-grid { display: grid; gap: var(--theme-grid-gap); grid-template-columns: repeat(var(--nf-grid-cols, 4), 1fr); }
.nf-grid--1 { --nf-grid-cols: 1; }
.nf-grid--2 { --nf-grid-cols: 2; }
.nf-grid--3 { --nf-grid-cols: 3; }
.nf-grid--4 { --nf-grid-cols: 4; }
.nf-grid--masonry { columns: var(--nf-grid-cols, 3); column-gap: var(--theme-grid-gap); }
.nf-grid--masonry .nf-card { margin-bottom: var(--theme-grid-gap); break-inside: avoid; }
.nf-widget-list { display: flex; flex-direction: column; gap: 12px; }

.nf-widget-categories { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.nf-widget-categories li { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--theme-divider); }
.nf-widget-categories a { color: var(--theme-text); font-weight: 600; }
.nf-widget-categories a:hover { color: var(--theme-primary); }
.nf-widget-categories__count { color: var(--theme-muted); font-size: .82rem; background: var(--theme-background); padding: 2px 8px; border-radius: 999px; }

/* ---- Trending / Hot / Popular --------------------------------------------------------- */
.nf-trending { background: var(--theme-trending-bg); border-radius: var(--theme-radius); padding: var(--theme-card-spacing); }
.nf-hotnews { background: var(--theme-hotnews-bg); border-radius: var(--theme-radius); padding: var(--theme-card-spacing); }
.nf-ranked-list { list-style: none; counter-reset: nf-rank; display: flex; flex-direction: column; gap: 14px; }
.nf-ranked-list li { counter-increment: nf-rank; display: flex; gap: 12px; align-items: flex-start; }
.nf-ranked-list li::before {
	content: counter(nf-rank); flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
	background: var(--theme-primary); color: var(--theme-btn-text); font-weight: 700; font-size: .8rem;
	display: flex; align-items: center; justify-content: center;
}
.nf-ranked-list h3 { font-size: .95rem; margin: 0 0 4px; }

/* ---- Layout: content + sidebar ------------------------------------------------------ */
.nf-layout { display: grid; gap: var(--theme-grid-gap); grid-template-columns: 1fr; }
body.nf-has-sidebar .nf-layout { grid-template-columns: minmax(0,1fr) var(--theme-sidebar-width); }
.nf-content { min-width: 0; }
.nf-sidebar { min-width: 0; display: flex; flex-direction: column; gap: var(--theme-grid-gap); }

.nf-widget { background: var(--theme-surface); border-radius: var(--theme-radius); padding: var(--theme-card-spacing); }
.nf-widget__title { font-size: 1.05rem; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--theme-border); }

/* ---- Article ------------------------------------------------------------------------- */
.nf-article-header { margin-bottom: 24px; }
.nf-article-header h1 { font-size: var(--theme-font-size-h1); }
.nf-article-header .nf-subtitle { color: var(--theme-muted); font-size: 1.1rem; margin-top: -6px; }
.nf-article-featured-image { border-radius: var(--theme-radius); overflow: hidden; margin-block: 20px; }
.nf-article-featured-image figcaption { font-size: var(--theme-font-size-caption); color: var(--theme-muted); padding-top: 8px; }

.nf-article-content { font-size: 1.05rem; }
.nf-article-content > * + * { margin-top: 1.2em; }
.nf-article-content h2 { margin-top: 1.6em; }
.nf-article-content h3 { margin-top: 1.4em; }
.nf-article-content blockquote {
	border-inline-start: 4px solid var(--theme-primary); margin: 1.6em 0; padding: 4px 0 4px 20px;
	font-style: italic; color: var(--theme-heading); font-family: var(--theme-font-heading); font-size: 1.15rem;
}
.nf-article-content table { width: 100%; border-collapse: collapse; }
.nf-article-content table th, .nf-article-content table td { border: 1px solid var(--theme-border); padding: 10px; }
.nf-article-content pre { background: var(--theme-secondary); color: #fff; padding: 16px; border-radius: var(--theme-radius); overflow-x: auto; }
.nf-article-content code { background: var(--theme-surface); padding: .1em .4em; border-radius: 4px; }
.nf-article-content hr { border: none; border-top: 1px solid var(--theme-divider); margin: 2em 0; }
.nf-article-content figure.wp-block-pullquote { border-block: 3px solid var(--theme-heading); padding: 1em 0; text-align: center; font-family: var(--theme-font-heading); }
.nf-article-content .wp-block-gallery img { border-radius: var(--theme-image-radius); }

.nf-reading-progress { position: sticky; top: 0; z-index: 45; height: 3px; background: var(--theme-border); }
.nf-reading-progress__bar { height: 100%; width: 0; background: var(--theme-primary); transition: width .1s linear; }

.nf-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.nf-tags a { background: var(--theme-surface); padding: 6px 12px; border-radius: 999px; font-size: .8rem; color: var(--theme-text); }
.nf-tags a:hover { background: var(--theme-primary); color: var(--theme-btn-text); }

.nf-share { display: flex; gap: 8px; }
.nf-share__link { width: 36px; height: 36px; border-radius: 50%; background: var(--theme-surface); display: inline-flex; align-items: center; justify-content: center; }
.nf-share__link:hover { background: var(--theme-primary); }

.nf-author-box { display: flex; gap: 16px; background: var(--theme-surface); border-radius: var(--theme-radius); padding: 20px; margin-block: 32px; }
.nf-author-box__avatar img { border-radius: 50%; }
.nf-author-box__name { margin: 0 0 6px; }
.nf-author-box__bio { color: var(--theme-text); margin: 0 0 10px; }

.nf-post-nav { display: flex; justify-content: space-between; gap: 16px; margin-block: 32px; border-block: 1px solid var(--theme-divider); padding-block: 16px; }
.nf-post-nav a { max-width: 45%; }
.nf-post-nav .nf-post-nav__label { display: block; font-size: .75rem; color: var(--theme-muted); text-transform: uppercase; }

.nf-related { margin-top: 40px; }

/* ---- Comments ---------------------------------------------------------------------- */
.nf-comment__body { display: flex; gap: 14px; margin-block: 20px; }
.nf-comment__avatar img { border-radius: 50%; }
.nf-comment__author { color: var(--theme-heading); }
.nf-comment__date { color: var(--theme-muted); font-size: .8rem; margin-inline-start: 8px; }

/* ---- Breadcrumbs & pagination ------------------------------------------------------- */
.nf-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; font-size: .82rem; color: var(--theme-muted); }
.nf-breadcrumbs li:not(:last-child)::after { content: "/"; margin-inline-start: 6px; }
.nf-breadcrumbs a { color: var(--theme-muted); }

.nav-links, .pagination { display: flex; gap: 8px; justify-content: center; margin-top: var(--theme-section-spacing); }
.nav-links .page-numbers, .pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding-inline: 10px;
	background: var(--theme-surface); border-radius: var(--theme-button-radius); color: var(--theme-text); font-weight: 600;
}
.nav-links .page-numbers.current, .pagination .page-numbers.current { background: var(--theme-primary); color: var(--theme-btn-text); }

/* ---- Newsletter -------------------------------------------------------------------- */
.nf-newsletter { background: var(--theme-secondary); color: #fff; border-radius: var(--theme-radius); padding: 40px; text-align: center; }
.nf-newsletter h2, .nf-newsletter p { color: #fff; }
.nf-newsletter form { display: flex; gap: 10px; max-width: 460px; margin: 20px auto 0; }
.nf-newsletter input[type="email"] { flex: 1; }

/* ---- Advertisement slots ------------------------------------------------------------ */
.nf-ad-slot { display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; margin-block: var(--theme-section-spacing); }
.nf-ad-slot__label { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--theme-muted); display: block; margin-bottom: 6px; }

/* ---- Footer ------------------------------------------------------------------------ */
.nf-footer { background: var(--theme-footer-bg); color: var(--theme-footer-text); }
.nf-footer a { color: var(--theme-footer-text); }
.nf-footer a:hover { color: var(--theme-primary); }
.nf-footer__widgets { background: var(--theme-footer-widget-bg); padding-block: var(--theme-section-spacing); }
.nf-footer__columns { display: grid; gap: var(--theme-grid-gap); grid-template-columns: repeat(4, 1fr); }
body.nf-footer-columns-3 .nf-footer__columns { grid-template-columns: repeat(3, 1fr); }
.nf-footer__columns .nf-widget { background: transparent; padding: 0; }
.nf-footer__columns .nf-widget__title { border-color: rgba(255,255,255,.15); color: #fff; }

.nf-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding-block: 20px; }
.nf-footer__bottom .nf-container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.nf-footer__social { display: flex; gap: 10px; }
.nf-footer__social a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.08); display: inline-flex; align-items: center; justify-content: center; }

.nf-back-to-top {
	position: fixed; bottom: 24px; inset-inline-end: 24px; width: 46px; height: 46px; border-radius: 50%;
	background: var(--theme-primary); color: var(--theme-btn-text); border: none; display: flex; align-items: center; justify-content: center;
	opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .2s ease; z-index: 60;
}
.nf-back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---- Social icon glyphs (lightweight, no icon-font dependency) ----------------------- */
.nf-icon { font-style: normal; font-size: .85rem; line-height: 1; }
.nf-icon--facebook::before  { content: "f"; font-weight: 700; }
.nf-icon--twitter::before   { content: "X"; font-weight: 700; }
.nf-icon--instagram::before { content: "\25CB"; }
.nf-icon--youtube::before   { content: "\25B6"; }
.nf-icon--tiktok::before    { content: "\266A"; }
.nf-icon--linkedin::before  { content: "in"; font-weight: 700; }
.nf-icon--pinterest::before { content: "P"; font-weight: 700; }
.nf-icon--telegram::before  { content: "\27A4"; }
.nf-icon--whatsapp::before  { content: "\260E"; }
.nf-icon--threads::before   { content: "@"; }

/* ---- Utility ------------------------------------------------------------------------ */
.nf-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.alignwide { max-width: calc(var(--theme-content-width) + 160px); }
.alignfull { width: 100vw; margin-inline-start: 50%; transform: translateX(-50%); max-width: none; }
[dir="rtl"] .alignfull { transform: translateX(50%); }

/* =========================================================================
   Responsive — mobile-first overrides
   ========================================================================= */
@media (max-width: 1024px) {
	.nf-grid--4 { --nf-grid-cols: 3; }
	.nf-hero { grid-template-columns: 1fr; }
	body.nf-has-sidebar .nf-layout { grid-template-columns: 1fr; }
	.nf-sidebar { order: 3; }
}

@media (max-width: 880px) {
	.nf-nav__toggle { display: inline-flex; flex-direction: column; }
	.nf-nav__menu {
		display: none; flex-direction: column; position: absolute; inset-inline: 0; top: 100%;
		background: var(--theme-nav-bg); padding: 10px; box-shadow: var(--theme-shadow); z-index: 55;
	}
	.nf-nav__menu.is-open { display: flex; }
	.nf-nav__menu ul { position: static; box-shadow: none; display: none; background: rgba(0,0,0,.1); }
	.nf-nav__menu li.is-open > ul { display: block; }
	.nf-nav .nf-container { position: relative; justify-content: space-between; }

	.nf-grid--4, .nf-grid--3 { --nf-grid-cols: 2; }
	.nf-card--featured { grid-column: span 2; }
	.nf-footer__columns { grid-template-columns: repeat(2, 1fr); }
	.nf-topbar .nf-container { flex-wrap: wrap; }
}

@media (max-width: 600px) {
	:root { --theme-font-size-h1: 1.9rem; --theme-font-size-h2: 1.5rem; }
	.nf-grid--4, .nf-grid--3, .nf-grid--2 { --nf-grid-cols: 1; }
	.nf-card--featured { grid-column: span 1; }
	.nf-hero__side-item { flex-direction: row; }
	.nf-footer__columns { grid-template-columns: 1fr; }
	.nf-newsletter form { flex-direction: column; }
	.nf-breaking__label span.nf-breaking__text { display: none; }
	.nf-card--horizontal, .nf-card--list { flex-direction: column; }
	.nf-card--horizontal .nf-card__media, .nf-card--list .nf-card__media { width: 100%; }
	.nf-post-nav { flex-direction: column; }
	.nf-post-nav a { max-width: 100%; }
}
