/**
 * Nowoka Blog Widget — front-end styles.
 *
 * Conventions:
 *  - All selectors are scoped under .nbw-* to avoid theme collisions.
 *  - Font family / weight are intentionally NOT set so cards inherit the
 *    active theme's typography. Only structural sizing uses em/rem.
 *  - Elementor SELECTOR controls override colors/radius/etc. — defaults
 *    below are designed to look correct without any overrides.
 */

.nbw {
	--nbw-radius: 16px;
	--nbw-border: 1px solid rgba(0, 0, 0, 0.04);
	--nbw-divider: 1px solid rgba(0, 0, 0, 0.08);
	--nbw-muted: rgba(0, 0, 0, 0.55);
	--nbw-accent: #E97A2A;
	--nbw-accent-contrast: #ffffff;
	--nbw-bg: #ffffff;
	--nbw-gap: 1.5rem;
	color: inherit;
	font-family: inherit;
}

/* Shadow presets ----------------------------------------------------------- */
.nbw--shadow-none .nbw-card,
.nbw--shadow-none .nbw-list { box-shadow: none; }

.nbw--shadow-soft .nbw-card,
.nbw--shadow-soft .nbw-list { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); }

.nbw--shadow-lift .nbw-card,
.nbw--shadow-lift .nbw-list { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); }

/* Card base ---------------------------------------------------------------- */
.nbw-card,
.nbw-list {
	background: var(--nbw-bg);
	border: var(--nbw-border);
	border-radius: var(--nbw-radius);
	overflow: hidden;
}

.nbw-card {
	display: flex;
	flex-direction: column;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nbw-card:hover { transform: translateY(-2px); }

.nbw-card__thumb {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.04);
}

.nbw-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.nbw-card:hover .nbw-card__thumb img { transform: scale(1.03); }

.nbw-card__body {
	padding: 1.25rem 1.5rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	flex: 1;
}

.nbw-card__title {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.3;
}

.nbw-card__title--hero {
	font-size: clamp( 1.5rem, 2.2vw, 2.25rem );
	line-height: 1.2;
}

.nbw-card__title a,
.nbw-list__title a {
	color: inherit;
	text-decoration: none;
}

.nbw-card__title a:hover,
.nbw-list__title a:hover { text-decoration: underline; }

.nbw-card__excerpt,
.nbw-list__excerpt {
	margin: 0;
	color: var(--nbw-muted);
	line-height: 1.6;
}

.nbw-card__footer {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 0.5rem;
}

/* Read More — Nowoka brand pill.
   Default: lime (#D9F45F) with near-black text and an up-right "go" arrow.
   Hover/focus: inverts to black on white text. Glossy soft-radius pill that
   matches the card radius family. Elementor's "Read More Button" style
   section can still override background/color per-placement. */
.nbw-card__more {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 1.3rem;
	border-radius: 999px;
	background-color: #D9F45F;
	color: #111518;
	text-decoration: none;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	border: 1px solid transparent;
	box-shadow: 0 1px 2px rgba(17, 21, 24, 0.08);
	transition: background-color 0.2s ease, color 0.2s ease,
		box-shadow 0.2s ease, transform 0.15s ease;
}

.nbw-card__more:hover,
.nbw-card__more:focus-visible {
	background-color: #111518;
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(17, 21, 24, 0.18);
	transform: translateY(-1px);
}

.nbw-card__more:focus-visible {
	outline: 2px solid #111518;
	outline-offset: 2px;
}

.nbw-icon--arrow {
	transition: transform 0.2s ease;
}

.nbw-card__more:hover .nbw-icon--arrow,
.nbw-card__more:focus-visible .nbw-icon--arrow {
	transform: translate(2px, -2px);
}

.nbw-card__date {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	color: var(--nbw-muted);
	font-size: 0.9rem;
}

/* Grid layout -------------------------------------------------------------- */
.nbw--grid {
	display: grid;
	gap: var(--nbw-gap);
	grid-template-columns: 1fr;
}

.nbw--grid.nbw--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nbw--grid.nbw--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nbw--grid.nbw--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
	.nbw--grid.nbw--cols-3,
	.nbw--grid.nbw--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	.nbw--grid { grid-template-columns: 1fr !important; }
}

/* Horizontal (row) card variant ------------------------------------------- */
.nbw--horizontal .nbw-card {
	flex-direction: row;
	align-items: stretch;
}

.nbw--horizontal .nbw-card__thumb {
	flex: 0 0 40%;
	max-width: 40%;
	aspect-ratio: auto;
}

.nbw--horizontal .nbw-card__body {
	flex: 1;
}

@media (max-width: 600px) {
	.nbw--horizontal .nbw-card { flex-direction: column; }
	.nbw--horizontal .nbw-card__thumb { flex-basis: auto; max-width: 100%; aspect-ratio: 16 / 9; }
}

/* Featured layout — hero + list side by side ------------------------------ */
.nbw--featured {
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	gap: var(--nbw-gap);
	align-items: start;
}

@media (max-width: 900px) {
	.nbw--featured { grid-template-columns: 1fr; }
}

/* Hero card — large title, full-width image on top */
.nbw-card--hero .nbw-card__body { padding: 1.5rem 1.75rem 1.75rem; gap: 1rem; }
.nbw-card--hero .nbw-card__thumb { aspect-ratio: 16 / 10; }

/* List container (used standalone OR alongside a hero) -------------------- */
.nbw-list {
	display: flex;
	flex-direction: column;
	padding: 0.25rem 1.5rem;
}

.nbw-list__item {
	padding: 1.25rem 0;
	border-bottom: var(--nbw-divider);
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.nbw-list__item:last-child { border-bottom: 0; }

/* List items with a leading thumbnail (row layout) ------------------------ */
.nbw-list__item--with-thumb {
	flex-direction: row;
	align-items: flex-start;
	gap: 1rem;
}

.nbw-list__thumb {
	flex: 0 0 96px;
	width: 96px;
	height: 96px;
	border-radius: 10px;
	overflow: hidden;
	display: block;
	background: rgba(0, 0, 0, 0.04);
}

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

.nbw-list__content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

@media (max-width: 480px) {
	.nbw-list__item--with-thumb { flex-direction: column; }
	.nbw-list__thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; flex-basis: auto; }
}

.nbw-list__title {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.35;
}

/* Meta row (author + date with icons) ------------------------------------- */
.nbw-meta {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	color: var(--nbw-muted);
	font-size: 0.875rem;
	margin-top: 0.25rem;
}

.nbw-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.nbw-meta__item:first-child { margin-right: auto; }

.nbw-icon {
	flex-shrink: 0;
	vertical-align: middle;
	opacity: 0.85;
}

/* Category chips ----------------------------------------------------------- */
.nbw-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 0.25rem;
}

.nbw-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	background-color: rgba(217, 244, 95, 0.35);
	color: #111518;
	border: 1px solid transparent;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

a.nbw-chip:hover,
a.nbw-chip:focus-visible {
	background-color: #111518;
	color: #ffffff;
	outline: 0;
}

/* Footer meta cluster (date + read time) ---------------------------------- */
.nbw-card__footer-meta {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

.nbw-card__read-time .nbw-icon { opacity: 0.85; }

/* Accessibility helper ----------------------------------------------------- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	overflow: hidden;
	position: absolute !important;
	white-space: nowrap;
}

/* ===========================================================================
 * Featured layout — right-side GRID variant
 * Used when inner_layout = grid (Category Filter widget).
 * ======================================================================== */
.nbw-featured-side--grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.nbw-card--mini .nbw-card__thumb { aspect-ratio: 16 / 10; }
.nbw-card--mini .nbw-card__body { padding: 0.75rem 1rem 1rem; gap: 0.4rem; }
.nbw-card--mini .nbw-card__title { font-size: 1rem; }

@media (max-width: 600px) {
	.nbw-featured-side--grid { grid-template-columns: 1fr; }
}

/* ===========================================================================
 * Category Filter widget
 * ======================================================================== */
.ncf {
	--ncf-accent: #D9F45F;
	--ncf-accent-contrast: #111518;
	--ncf-muted: rgba(17, 21, 24, 0.08);
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	color: inherit;
	font-family: inherit;
}

/* Header row: tabs + See More link sit on one line on wide screens, wrap
   gracefully on small ones. */
.ncf-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

/* See-more row — wraps the link so it can be aligned independently of the
   tab list. Used both inside .ncf-header (top placement) and at the end of
   .ncf (bottom placement). */
.ncf-see-more-row {
	display: flex;
	align-items: center;
}

.ncf-see-more-row--top {
	flex: 0 0 auto;
}

.ncf-see-more-row--bottom {
	margin-top: 1.25rem;
	width: 100%;
}

.ncf-see-more-row--left   { justify-content: flex-start; }
.ncf-see-more-row--center { justify-content: center; }
.ncf-see-more-row--right  { justify-content: flex-end; }

/* When the top row is "left" or "center", we want it to push the tabs out of
   its way rather than ride the space-between gap. Simplest: let the tabs not
   grow and put the see-more row in its own slot. The tab list already has
   flex:1 which keeps it filling space — for left/center we give see-more its
   own full-width slot below the tabs. */
.ncf-see-more-row--top.ncf-see-more-row--left,
.ncf-see-more-row--top.ncf-see-more-row--center {
	flex: 1 0 100%;
	margin-top: 0.5rem;
}

/* Tab nav --------------------------------------------------------------- */
.ncf-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	flex: 1;
	min-width: 0;
}

.ncf--filter-list .ncf-tabs {
	flex-direction: column;
	align-items: flex-start;
}

/* See More link.
   Inherits the surrounding text color so it stays readable on any background.
   On hover, a single-line underline slides in from the left using a scaled
   pseudo-element — smoother than animating `text-decoration` and avoids the
   sub-pixel jitter you get with border-bottom transitions. */
.ncf-see-more {
	--ncf-see-more-hover: #FF2D78; /* Nowoka secondary — high contrast on light bg */
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	padding: 0.4rem 0;
	flex-shrink: 0;
	transition: color 0.2s ease;
}

.ncf-see-more::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.15rem;
	height: 2px;
	background-color: currentColor;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.3s ease, background-color 0.2s ease;
}

.ncf-see-more:hover,
.ncf-see-more:focus-visible {
	color: var(--ncf-see-more-hover);
}

.ncf-see-more:hover::after,
.ncf-see-more:focus-visible::after {
	transform: scaleX(1);
	background-color: var(--ncf-see-more-hover);
}

.ncf-see-more:hover .nbw-icon--arrow,
.ncf-see-more:focus-visible .nbw-icon--arrow {
	transform: translate(2px, -2px);
}

.ncf-see-more:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
	border-radius: 2px;
}

.ncf-tab {
	display: inline-flex;
	align-items: center;
	padding: 0.55rem 1.1rem;
	border-radius: 999px;
	background: transparent;
	border: 1px solid var(--ncf-muted);
	color: inherit;
	font-family: inherit;
	font-weight: 500;
	cursor: pointer;
	line-height: 1;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ncf-tab:hover {
	background: var(--ncf-muted);
}

.ncf-tab[aria-selected="true"] {
	background: var(--ncf-accent-contrast);
	border-color: var(--ncf-accent-contrast);
	color: #ffffff;
}

.ncf-tab:focus-visible {
	outline: 2px solid var(--ncf-accent-contrast);
	outline-offset: 2px;
}

/* Results pane ---------------------------------------------------------- */
.ncf-results {
	transition: opacity 0.2s ease;
	min-height: 1rem;
}

.ncf-results.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

.ncf-empty {
	margin: 0;
	padding: 2rem 1rem;
	text-align: center;
	color: rgba(0, 0, 0, 0.55);
}

/* List-style filter sits vertically beside the results on wide screens. */
@media (min-width: 900px) {
	.ncf--filter-list {
		flex-direction: row;
		align-items: flex-start;
	}
	.ncf--filter-list .ncf-tabs { flex: 0 0 200px; }
	.ncf--filter-list .ncf-results { flex: 1; min-width: 0; }
}
