/* ===== المتغيرات ===== */
:root {
	--tfl-color-text: #1a1a1a;
	--tfl-color-muted: #6b6b6b;
	--tfl-color-bg: #ffffff;
	--tfl-color-border: #e5e5e5;
	--tfl-color-accent: #b3001b;
	--tfl-font: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--tfl-container: 1200px;
	--tfl-gap: 1.5rem;
}

/* ===== الأساس ===== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	direction: rtl;
}

body {
	margin: 0;
	font-family: var(--tfl-font);
	font-size: 1.0625rem;
	line-height: 1.8;
	color: var(--tfl-color-text);
	background: var(--tfl-color-bg);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	color: var(--tfl-color-accent);
}

.container {
	width: 100%;
	max-width: var(--tfl-container);
	margin-inline: auto;
	padding-inline: 1rem;
}

/* ===== الوصولية ===== */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip-link:focus {
	clip: auto;
	width: auto;
	height: auto;
	inset-block-start: 1rem;
	inset-inline-start: 1rem;
	padding: 0.5rem 1rem;
	background: var(--tfl-color-text);
	color: var(--tfl-color-bg);
	z-index: 1000;
}

/* ===== الرأس ===== */
.site-header {
	border-block-end: 1px solid var(--tfl-color-border);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--tfl-gap);
	padding-block: 1rem;
	flex-wrap: wrap;
}

.site-title {
	font-size: 1.75rem;
	font-weight: 700;
}

.site-description {
	margin: 0;
	font-size: 0.875rem;
	color: var(--tfl-color-muted);
}

.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 1.25rem;
}

.menu-toggle {
	display: none;
	background: none;
	border: 1px solid var(--tfl-color-border);
	padding: 0.4rem 0.9rem;
	font: inherit;
	cursor: pointer;
}

@media (max-width: 768px) {
	.menu-toggle {
		display: block;
	}

	.main-navigation {
		display: none;
		width: 100%;
	}

	.main-navigation.is-open {
		display: block;
	}

	.main-navigation ul {
		flex-direction: column;
		gap: 0.75rem;
	}
}

/* ===== المحتوى ===== */
.site-main {
	padding-block: 2rem;
}

.posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: var(--tfl-gap);
}

.card__title {
	font-size: 1.125rem;
	line-height: 1.6;
	margin: 0.75rem 0 0.25rem;
}

.card__date {
	font-size: 0.8125rem;
	color: var(--tfl-color-muted);
}

/* ===== التذييل ===== */
.site-footer {
	border-block-start: 1px solid var(--tfl-color-border);
	padding-block: 1.5rem;
	font-size: 0.875rem;
	color: var(--tfl-color-muted);
}

.site-footer__inner {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
}

.footer-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 1rem;
}

/* ===== التغطية المباشرة ===== */
.live-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.15rem 0.7rem;
	background: var(--tfl-color-accent);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 700;
}

.live-badge::before {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: currentColor;
	animation: tfl-pulse 1.5s infinite;
}

.live-badge.is-ended {
	background: var(--tfl-color-muted);
}

.live-badge.is-ended::before {
	animation: none;
}

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

.live-header__title {
	margin: 0.75rem 0;
	line-height: 1.5;
}

.live-header__excerpt {
	color: var(--tfl-color-muted);
}

.live-body {
	max-width: 820px;
}

.live-pinned:empty {
	display: none;
}

.live-pinned .live-update {
	margin-bottom: 1.5rem;
	padding: 1rem;
	border: 2px solid var(--tfl-color-accent);
}

.live-pinned .live-update::before {
	content: "مثبّت";
	display: inline-block;
	margin-bottom: 0.5rem;
	color: var(--tfl-color-accent);
	font-size: 0.8125rem;
	font-weight: 700;
}

.live-update {
	padding-block: 1.25rem;
	padding-inline-start: 1.25rem;
	border-inline-start: 2px solid var(--tfl-color-border);
}

.live-update--important {
	border-inline-start-color: var(--tfl-color-accent);
}

.live-update__meta {
	display: flex;
	gap: 0.5rem;
	font-size: 0.8125rem;
	color: var(--tfl-color-muted);
}

.live-update__flag {
	color: var(--tfl-color-accent);
	font-weight: 700;
}

.live-update__content p {
	margin: 0.5rem 0;
}

.live-update__image {
	margin: 0.75rem 0 0;
}

.live-new-banner {
	position: sticky;
	top: 1rem;
	z-index: 10;
	display: block;
	margin: 0 auto 1rem;
	padding: 0.5rem 1.25rem;
	border: 0;
	border-radius: 999px;
	background: var(--tfl-color-accent);
	color: #fff;
	font: inherit;
	cursor: pointer;
}

.live-new-banner[hidden] {
	display: none;
}

.live-more {
	display: block;
	margin: 1.5rem auto 0;
	padding: 0.6rem 1.5rem;
	border: 1px solid var(--tfl-color-border);
	background: none;
	font: inherit;
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	.live-badge::before {
		animation: none;
	}
}

/* ===== شريط العاجل ===== */
.breaking-bar {
	background: var(--tfl-color-accent);
	color: #fff;
}

.breaking-bar[hidden] {
	display: none;
}

.breaking-bar__inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding-block: 0.5rem;
	overflow: hidden;
}

.breaking-bar__label {
	flex: none;
	padding: 0.1rem 0.6rem;
	background: #fff;
	color: var(--tfl-color-accent);
	font-size: 0.875rem;
	font-weight: 700;
}

.breaking-bar__list {
	display: flex;
	gap: 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	white-space: nowrap;
	scrollbar-width: none;
}

.breaking-bar__list a:hover {
	color: inherit;
	text-decoration: underline;
}

.live-more[hidden] {
	display: none;
}