/*
Theme Name: FMToday
Theme URI: https://facilitiesmanaging.com/
Author: Facilities Managing
Author URI: https://facilitiesmanaging.com/
Description: A professional editorial theme for facilities management news. Features Swiss Modernism design, WCAG 2.1 AA accessibility, responsive layouts, and Tailwind CSS utility classes. Built for credibility, readability, and trust.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fmtoday
Tags: news, blog, one-column, two-columns, three-columns, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, theme-options, translation-ready, accessibility-ready
*/

/* ─── Design System Tokens ──────────────────────────────────── */
:root {
	/* Primary palette */
	--color-navy:        #0F172A;
	--color-navy-light:  #1E293B;
	--color-navy-muted:  #334155;
	--color-brand:       #0369A1;
	--color-brand-light: #0EA5E9;
	--color-brand-dark:  #075985;
	--color-amber:       #D97706;
	--color-amber-light: #F59E0B;
	--color-amber-dark:  #B45309;
	--color-surface:     #F8FAFC;

	/* Semantic */
	--color-success:     #059669;
	--color-error:       #DC2626;
	--color-warning:     #D97706;

	/* Typography */
	--font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
	--font-sans:  'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;

	/* Spacing scale */
	--space-xs:  0.25rem;
	--space-sm:  0.5rem;
	--space-md:  1rem;
	--space-lg:  1.5rem;
	--space-xl:  2rem;
	--space-2xl: 3rem;
	--space-3xl: 4rem;

	/* Transitions */
	--duration-fast: 150ms;
	--duration-base: 200ms;
	--duration-slow: 300ms;
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);

	/* Shadows */
	--shadow-sm:  0 1px 2px rgba(15, 23, 42, 0.06);
	--shadow-md:  0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
	--shadow-lg:  0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
	--shadow-xl:  0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

	/* Radii */
	--radius-sm: 0.375rem;
	--radius-md: 0.5rem;
	--radius-lg: 0.75rem;
	--radius-xl: 1rem;
	--radius-full: 9999px;

	/* Z-index scale */
	--z-dropdown: 10;
	--z-sticky:   20;
	--z-fixed:    30;
	--z-overlay:  40;
	--z-modal:    50;
	--z-toast:    60;
}

/* ─── Base Reset & Typography ───────────────────────────────── */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	font-family: var(--font-sans);
	color: var(--color-navy);
	background-color: var(--color-surface);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ─── Focus States (Accessibility) ──────────────────────────── */
:focus-visible {
	outline: 3px solid var(--color-brand);
	outline-offset: 2px;
	border-radius: 2px;
}

:focus:not(:focus-visible) {
	outline: none;
}

/* Skip link */
.skip-link {
	position: absolute;
	top: -100%;
	left: var(--space-md);
	z-index: var(--z-toast);
	padding: var(--space-sm) var(--space-md);
	background: var(--color-brand);
	color: #fff;
	font-weight: 600;
	border-radius: var(--radius-sm);
	transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
	top: var(--space-md);
}

/* ─── Prose (Article Content) ───────────────────────────────── */
.prose {
	font-family: var(--font-sans);
	line-height: 1.75;
	color: var(--color-navy-light);
}

.prose h2,
.prose h3,
.prose h4 {
	font-family: var(--font-serif);
	color: var(--color-navy);
	font-weight: 700;
	line-height: 1.3;
	margin-top: 2em;
	margin-bottom: 0.75em;
}

.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.125rem; }

.prose p {
	margin-bottom: 1.25em;
}

.prose a {
	color: var(--color-brand);
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color var(--duration-fast);
}

.prose a:hover {
	color: var(--color-brand-dark);
}

.prose blockquote {
	border-left: 4px solid var(--color-brand);
	padding-left: var(--space-lg);
	margin: var(--space-xl) 0;
	font-style: italic;
	color: var(--color-navy-muted);
}

.prose ul,
.prose ol {
	padding-left: 1.5em;
	margin-bottom: 1.25em;
}

.prose li {
	margin-bottom: 0.5em;
}

.prose img {
	border-radius: var(--radius-lg);
	margin: var(--space-xl) 0;
	max-width: 100%;
	height: auto;
}

.prose figure {
	margin: var(--space-xl) 0;
}

.prose figcaption {
	font-size: 0.875rem;
	color: var(--color-navy-muted);
	text-align: center;
	margin-top: var(--space-sm);
}

.prose pre {
	background: var(--color-navy);
	color: #e2e8f0;
	padding: var(--space-lg);
	border-radius: var(--radius-md);
	overflow-x: auto;
	font-size: 0.875rem;
	margin: var(--space-xl) 0;
}

.prose code {
	background: #f1f5f9;
	padding: 0.125em 0.375em;
	border-radius: var(--radius-sm);
	font-size: 0.875em;
}

.prose pre code {
	background: none;
	padding: 0;
	border-radius: 0;
	font-size: inherit;
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	margin: var(--space-xl) 0;
}

.prose th,
.prose td {
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid #e2e8f0;
	text-align: left;
}

.prose th {
	font-weight: 600;
	background: #f8fafc;
}

/* ─── Breaking News Ticker ──────────────────────────────────── */
@keyframes ticker-scroll {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

.ticker-wrap {
	overflow: hidden;
	white-space: nowrap;
}

.ticker-track {
	display: inline-flex;
	animation: ticker-scroll 30s linear infinite;
}

.ticker-track:hover,
.ticker-wrap:hover .ticker-track {
	animation-play-state: paused;
}

/* ─── Category Chips ────────────────────────────────────────── */
.cat-chip { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.625rem; border-radius: var(--radius-full); display: inline-block; }

/* FM-specific categories */
.cat-maintenance      { background: #DBEAFE; color: #1E40AF; }
.cat-technology       { background: #F3E8FF; color: #6B21A8; }
.cat-sustainability   { background: #D1FAE5; color: #065F46; }
.cat-compliance       { background: #FEF3C7; color: #92400E; }
.cat-people           { background: #FCE7F3; color: #9D174D; }
.cat-workplace        { background: #E0E7FF; color: #3730A3; }
.cat-energy           { background: #CCFBF1; color: #134E4A; }

/* Business / finance categories (current site content) */
.cat-business         { background: #E0F2FE; color: #075985; }  /* business-news    */
.cat-entrepreneurship { background: #FEF9C3; color: #854D0E; }  /* entrepreneurship */
.cat-investments      { background: #DCFCE7; color: #166534; }  /* investments      */
.cat-startups         { background: #FFE4E6; color: #9F1239; }  /* startups         */
.cat-stock            { background: #F0FDF4; color: #15803D; }  /* stock-market     */

/* Fallback for any unmapped category */
.cat-default          { background: #F1F5F9; color: #334155; }


/* ─── Nav Link Hover Underline ──────────────────────────────── */
.nav-link {
	position: relative;
}

.nav-link::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 0;
	height: 2px;
	background: var(--color-brand);
	transition: width var(--duration-base) var(--ease-out);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
	width: 100%;
}

/* ─── Card Hover ────────────────────────────────────────────── */
.news-card {
	transition: box-shadow var(--duration-base) var(--ease-out),
	            transform var(--duration-base) var(--ease-out);
}

.news-card:hover {
	box-shadow: var(--shadow-lg);
	transform: translateY(-2px);
}

/* ─── Filter Buttons ────────────────────────────────────────── */
.filter-btn {
	transition: background-color var(--duration-fast),
	            color var(--duration-fast);
}

.filter-btn.active {
	background-color: var(--color-navy);
	color: #fff;
}

/* ─── Pagination ────────────────────────────────────────────── */
.navigation.pagination .nav-links {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.navigation.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.75rem;
	border-radius: var(--radius-md);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--color-navy-muted);
	background: #fff;
	border: 1px solid #e2e8f0;
	transition: all var(--duration-fast);
	cursor: pointer;
}

.navigation.pagination .page-numbers:hover {
	background: var(--color-surface);
	border-color: var(--color-brand);
	color: var(--color-brand);
}

.navigation.pagination .page-numbers.current {
	background: var(--color-brand);
	border-color: var(--color-brand);
	color: #fff;
	cursor: default;
}

/* ─── WordPress Alignment Classes ───────────────────────────── */
.alignleft   { float: left; margin: 0 var(--space-lg) var(--space-lg) 0; }
.alignright  { float: right; margin: 0 0 var(--space-lg) var(--space-lg); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide   { max-width: 1200px; margin-left: auto; margin-right: auto; }
.alignfull   { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; }

.wp-caption {
	max-width: 100%;
}

.wp-caption-text {
	font-size: 0.875rem;
	color: var(--color-navy-muted);
	text-align: center;
	margin-top: var(--space-xs);
}

/* ─── Reduced Motion ────────────────────────────────────────── */
@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;
	}

	.ticker-track {
		animation: none;
	}
}

/* ─── Print Styles ──────────────────────────────────────────── */
@media print {
	body { background: #fff; color: #000; }
	header, footer, .ticker-wrap, .stats-strip, nav, .filter-btn { display: none !important; }
	.prose a::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
	.news-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}
