/* ============================================================
 * Novara v7.2.0 — LUXURY MICRO-POLISH
 *
 * Final refinement pass. Touches:
 *   - animation timing curves (premium easing)
 *   - hover smoothness (will-change, GPU)
 *   - spacing rhythm (8-point grid)
 *   - typography hierarchy (clamp-based fluid)
 *   - loading transitions
 *   - skeleton loaders
 *   - dark-mode consistency
 *   - responsive edge cases
 *   - empty states
 *   - notification polish
 *   - mobile interaction feel
 *   - SPA transition smoothness
 *
 * Loaded LAST (after polish-final). Pure refinement — no redesign.
 * ============================================================ */

/* ──────────────────────────────────────────────
 * 1) PREMIUM EASING TOKENS
 * Unified bezier curves for luxury motion
 * ────────────────────────────────────────────── */
:root {
	--ease-luxury:    cubic-bezier(0.16, 1, 0.3, 1);   /* primary — silky */
	--ease-elegant:   cubic-bezier(0.65, 0, 0.35, 1);  /* dialog/modal */
	--ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1); /* playful bounce */
	--ease-sharp:     cubic-bezier(0.4, 0, 0.2, 1);    /* micro UI */
	--t-instant:      0.12s;
	--t-fast:         0.2s;
	--t-medium:       0.35s;
	--t-slow:         0.55s;
	--t-luxury:       0.7s;

	/* 8-point spacing */
	--space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
	--space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
	--space-12: 48px; --space-16: 64px;
}

/* ──────────────────────────────────────────────
 * 2) GLOBAL SMOOTH SCROLL + GPU HINTS
 * ────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

/* ──────────────────────────────────────────────
 * 3) FLUID TYPOGRAPHY HIERARCHY
 * (only refines existing rules — no redesign)
 * ────────────────────────────────────────────── */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-feature-settings: "kern", "liga", "calt";
}
h1, h2, h3, h4, h5, h6 {
	letter-spacing: -0.015em;
	text-wrap: balance;
}
p, li {
	text-wrap: pretty;
	hyphens: auto;
}

/* Refine article body for premium reading */
.novara-article__content,
.novara-content .entry-content {
	max-width: 72ch;
	font-size: clamp(16px, 1.05vw + 12px, 18px);
	line-height: 1.7;
}
.novara-article__content > p + p,
.entry-content > p + p {
	margin-top: 1.1em;
}

/* ──────────────────────────────────────────────
 * 4) CARD & LINK HOVER REFINEMENT
 * GPU-accelerated, never janky
 * ────────────────────────────────────────────── */
.novara-card,
.novara-post-card,
.novara-trending__item,
article.post {
	transition:
		transform var(--t-medium) var(--ease-luxury),
		box-shadow var(--t-medium) var(--ease-luxury),
		border-color var(--t-fast) var(--ease-sharp);
	will-change: transform;
	backface-visibility: hidden;
}
.novara-card:hover,
.novara-post-card:hover {
	transform: translate3d(0, -2px, 0);
}

a {
	transition:
		color var(--t-fast) var(--ease-sharp),
		opacity var(--t-fast) var(--ease-sharp);
}

/* ──────────────────────────────────────────────
 * 5) BUTTON LUXURY FEEL
 * ────────────────────────────────────────────── */
.novara-btn,
.button,
button.novara-btn,
.novara-subscribe-btn,
.novara-newsletter__btn {
	transition:
		background-color var(--t-fast) var(--ease-sharp),
		transform var(--t-fast) var(--ease-spring),
		box-shadow var(--t-fast) var(--ease-sharp);
	will-change: transform;
}
.novara-btn:hover,
.novara-subscribe-btn:hover,
.novara-newsletter__btn:hover {
	transform: translateY(-1px);
}
.novara-btn:active,
.novara-subscribe-btn:active,
.novara-newsletter__btn:active {
	transform: translateY(0) scale(0.98);
	transition-duration: var(--t-instant);
}

/* ──────────────────────────────────────────────
 * 6) FOCUS RING — luxury accessibility
 * ────────────────────────────────────────────── */
:focus-visible {
	outline: 2px solid var(--novara-crimson, #E63946);
	outline-offset: 2px;
	border-radius: 4px;
}
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
	outline-offset: 3px;
	box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.15);
}

/* ──────────────────────────────────────────────
 * 7) SKELETON LOADERS — refined shimmer
 * ────────────────────────────────────────────── */
.novara-skeleton,
.novara-skeleton-card {
	position: relative;
	overflow: hidden;
	background-color: var(--bg-secondary, #f1f3f5);
	border-radius: 10px;
}
.novara-skeleton::after,
.novara-skeleton-card::after {
	content: "";
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.55) 50%,
		transparent 100%
	);
	animation: novaraShimmer 1.5s var(--ease-sharp) infinite;
}
@keyframes novaraShimmer {
	100% { transform: translateX(100%); }
}
[data-theme="dark"] .novara-skeleton::after,
[data-theme="dark"] .novara-skeleton-card::after {
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.08) 50%,
		transparent 100%
	);
}

/* ──────────────────────────────────────────────
 * 8) PAGE TRANSITION — fade-in on load
 * ────────────────────────────────────────────── */
.novara-main {
	animation: novaraFadeIn var(--t-medium) var(--ease-luxury) both;
}
@keyframes novaraFadeIn {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* SPA transitions — match exactly */
[data-novara-spa-loading="true"] .novara-main {
	opacity: 0.5;
	transition: opacity var(--t-fast) var(--ease-sharp);
}

/* ──────────────────────────────────────────────
 * 9) EMPTY STATES — luxury & informative
 * ────────────────────────────────────────────── */
.novara-empty-state,
.no-results.not-found,
.novara-content-none {
	text-align: center;
	padding: clamp(40px, 6vw, 80px) 20px;
	max-width: 560px;
	margin: 0 auto;
}
.novara-empty-state__icon {
	font-size: 56px;
	margin-bottom: 16px;
	opacity: 0.55;
	animation: novaraEmptyFloat 4s var(--ease-luxury) infinite;
	display: inline-block;
}
@keyframes novaraEmptyFloat {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-6px); }
}
.novara-empty-state__title {
	font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
	font-size: clamp(22px, 2.4vw, 28px);
	font-weight: 800;
	margin: 0 0 10px;
}
.novara-empty-state__desc {
	color: var(--text-muted, #6b7280);
	font-size: 15px;
	line-height: 1.6;
	margin: 0 0 24px;
}

/* ──────────────────────────────────────────────
 * 10) NOTIFICATIONS / TOASTS — luxury polish
 * ────────────────────────────────────────────── */
.novara-toast,
.novara-notification,
.novara-newsletter__msg.is-visible {
	animation: novaraToastIn var(--t-medium) var(--ease-spring) both;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
	border-radius: 10px;
}
@keyframes novaraToastIn {
	from { opacity: 0; transform: translateY(12px) scale(0.95); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
.novara-toast.is-leaving {
	animation: novaraToastOut var(--t-fast) var(--ease-sharp) both;
}
@keyframes novaraToastOut {
	to { opacity: 0; transform: translateY(8px) scale(0.97); }
}

/* ──────────────────────────────────────────────
 * 11) DARK MODE CONSISTENCY
 * Fix subtle inconsistencies in existing cards
 * ────────────────────────────────────────────── */
[data-theme="dark"] .novara-widget,
[data-theme="dark"] .novara-card,
[data-theme="dark"] .novara-post-card,
[data-theme="dark"] .novara-trending__item {
	background-color: var(--bg-primary, #1A2332);
	border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .novara-widget:hover {
	border-color: rgba(244, 185, 66, 0.25);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] :focus-visible {
	outline-color: var(--novara-gold, #F4B942);
	box-shadow: 0 0 0 4px rgba(244, 185, 66, 0.2);
}
[data-theme="dark"] .novara-skeleton,
[data-theme="dark"] .novara-skeleton-card {
	background-color: rgba(255, 255, 255, 0.04);
}

/* ──────────────────────────────────────────────
 * 12) RESPONSIVE EDGE CASES
 * ────────────────────────────────────────────── */
/* Prevent horizontal scroll on small viewports */
html, body { overflow-x: clip; }
img, video, iframe { max-width: 100%; height: auto; }

/* Very small phones (<360px) */
@media (max-width: 359px) {
	.novara-container { padding-left: 12px; padding-right: 12px; }
	.novara-header__brand { max-width: 160px; }
	.novara-nav__list { gap: 2px; }
}

/* Landscape mobile — denser layout */
@media (max-height: 480px) and (orientation: landscape) {
	.novara-header { position: static; }
	.novara-topbar { display: none; }
}

/* Foldable / ultra-wide */
@media (min-width: 1920px) {
	.novara-container { max-width: 1440px; }
}

/* ──────────────────────────────────────────────
 * 13) MOBILE INTERACTION FEEL
 * Tap highlight + active scaling
 * ────────────────────────────────────────────── */
* {
	-webkit-tap-highlight-color: rgba(230, 57, 70, 0.12);
}
@media (hover: none) and (pointer: coarse) {
	.novara-card:active,
	.novara-post-card:active,
	.novara-btn:active {
		transform: scale(0.985);
		transition-duration: var(--t-instant);
	}
}

/* ──────────────────────────────────────────────
 * 14) SELECTION COLOR — branded
 * ────────────────────────────────────────────── */
::selection {
	background: var(--novara-crimson, #E63946);
	color: #fff;
}
[data-theme="dark"] ::selection {
	background: var(--novara-gold, #F4B942);
	color: #0F1620;
}

/* ──────────────────────────────────────────────
 * 15) SCROLLBAR REFINEMENT (webkit)
 * ────────────────────────────────────────────── */
@media (pointer: fine) {
	::-webkit-scrollbar { width: 10px; height: 10px; }
	::-webkit-scrollbar-track { background: transparent; }
	::-webkit-scrollbar-thumb {
		background: rgba(0, 0, 0, 0.18);
		border-radius: 10px;
		border: 2px solid transparent;
		background-clip: padding-box;
	}
	::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 0, 0, 0.32); background-clip: padding-box; }
	[data-theme="dark"] ::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.16); background-clip: padding-box; }
	[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.28); background-clip: padding-box; }
}

/* ──────────────────────────────────────────────
 * 16) IMAGE LOAD-IN FADE
 * ────────────────────────────────────────────── */
img:not([loading="eager"]) {
	transition: opacity var(--t-medium) var(--ease-luxury);
}
img[loading="lazy"]:not([src]) { opacity: 0; }

/* ──────────────────────────────────────────────
 * 17) STICKY HEADER REFINE — luxury shadow on scroll
 * ────────────────────────────────────────────── */
.novara-header.is-scrolled,
.novara-header[data-scrolled="true"] {
	box-shadow: 0 2px 18px rgba(15, 22, 32, 0.06);
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	background-color: rgba(255, 255, 255, 0.85);
}
[data-theme="dark"] .novara-header.is-scrolled,
[data-theme="dark"] .novara-header[data-scrolled="true"] {
	background-color: rgba(15, 22, 32, 0.85);
}

/* ──────────────────────────────────────────────
 * 18) PRINT REFINEMENT
 * ────────────────────────────────────────────── */
@media print {
	.novara-header, .novara-footer, .novara-topbar,
	.novara-mobile-menu, .novara-share-sticky, .novara-toast,
	.novara-ad-slot { display: none !important; }
	body { background: #fff !important; color: #000 !important; }
	a { color: #000 !important; text-decoration: underline; }
	.novara-article__content { max-width: 100%; }
}
