/*
Theme Name: Malaeb Live
Theme URI: https://example.com/malaeb-live
Author: Your Name
Author URI: https://example.com
Description: قالب رياضي عربي (RTL) لعرض جدول المباريات والنتائج والأخبار، مع وضع ليلي وتصميم متجاوب. قالب أصلي مستوحى من التخطيط الرياضي الشائع.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: malaeb-live
Tags: rtl-language-support, blog, news, three-columns, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, dark-mode
*/

:root {
	--main: #c1121f;
	--main-dark: #931800;
	--body-bg: #eceef2;
	--header-bg: #ffffff;
	--header-color: #222222;
	--title-bg: #1f2024;
	--footer-bg: #ffffff;
	--footer-color: #222222;
	--footer-border: #dddddd;
	--copy-bg: #eceef2;
	--copy-color: #222222;
	--gray-1: #eceef2;
	--gray-2: #dddddd;
	--gray-3: #d8dbe1;
	--light: #ffffff;
	--dark: #273340;
	--light-2: #f6f7fa;
	--shadow: rgba(0, 0, 0, 0.3);
	--rounded: 8px;
	--padding: 12px;
	--post-width: 220px;
	--kickoff-yesterday: #104783;
	--kickoff-today: #c1121f;
	--kickoff-tomorrow: #af5100;
}

html.Night {
	--body-bg: #1c2733;
	--header-bg: #263545;
	--header-color: #ffffff;
	--gray-1: #1c2733;
	--gray-2: #2b3b4d;
	--gray-3: #1c2733;
	--light: #263545;
	--light-2: #1c2733;
	--footer-bg: #263545;
	--footer-color: #ffffff;
	--footer-border: #1c2733;
	--copy-bg: #1c2733;
	--copy-color: #e6e6e6;
	--dark: #1c2733;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
	padding: 0;
	outline: 0;
	list-style: none;
}

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

body {
	font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
	line-height: 1.6;
	background: var(--body-bg);
	color: #000;
	font-size: 16px;
	font-weight: 500;
	transition: background 0.3s ease, color 0.3s ease;
}

html.Night body {
	color: #fff;
}

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

a {
	color: #222;
	text-decoration: none;
	transition: color 0.3s ease;
}

html.Night a {
	color: #e9edf2;
}

a:hover,
a:focus {
	color: var(--main);
}

ul,
ol {
	list-style: none;
}

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

.d-none {
	display: none;
}

.d-fx {
	display: flex;
}

.fx-cen {
	display: flex;
	align-items: center;
}

.fx-wrap {
	display: flex;
	flex-wrap: wrap;
}

.gap-5 {
	gap: 5px;
}

.gap-10 {
	gap: 10px;
}

.gap-20 {
	gap: 20px;
}

.container {
	max-width: 1024px;
	margin-left: auto;
	margin-right: auto;
	padding: 0 var(--padding);
}

.skip-link {
	position: absolute;
	top: -100px;
	right: 0;
	background: var(--main);
	color: #fff;
	padding: 10px 16px;
	z-index: 999;
	border-radius: 0 0 var(--rounded) var(--rounded);
}

.skip-link:focus {
	top: 0;
}

/* Buttons */
.btn {
	position: relative;
	background: var(--dark);
	padding: 6px 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--rounded);
	color: #fff;
	font-size: 15px;
	text-align: center;
	border: 0;
	cursor: pointer;
}

.btn:hover,
.btn:focus {
	color: #fff;
	opacity: 0.85;
}

/* Header */
.site-header {
	position: relative;
	margin-bottom: 15px;
}

.site-header__inner {
	background: var(--header-bg);
	box-shadow: 0 0 4px var(--shadow);
	position: relative;
}

.site-header__inner > .container {
	min-height: 85px;
}

.site-logo {
	background: var(--main);
	max-width: 200px;
	border-radius: var(--rounded);
	padding: 5px;
}

.site-logo a {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.site-logo .site-name {
	color: #fff;
	font-size: 28px;
	line-height: 1.2;
	text-align: center;
	font-weight: 700;
}

.site-logo .site-url {
	color: rgba(255, 255, 255, 0.85);
	font-size: 13px;
	text-align: center;
}

.site-logo .custom-logo {
	border-radius: var(--rounded);
	max-height: 75px;
	width: auto;
}

.main-nav {
	flex: 1;
}

.main-menu {
	display: flex;
	flex-wrap: wrap;
}

.main-menu li > a {
	display: block;
	padding: 8px;
	white-space: nowrap;
	font-size: 16px;
	color: var(--header-color);
}

.main-menu li.current-menu-item > a,
.main-menu li.current_page_item > a {
	color: var(--main);
}

.social-nav {
	display: flex;
	gap: 5px;
}

.icon-btn {
	height: 35px;
	width: 35px;
	background: var(--dark);
	display: inline-flex;
	cursor: pointer;
	justify-content: center;
	align-items: center;
	border-radius: var(--rounded);
	color: #fff;
	border: 0;
}

.icon-btn svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.icon-btn:hover {
	opacity: 0.85;
}

.night-toggle__sun {
	display: none;
}

.night-toggle__moon {
	display: inline-flex;
}

html.Night .night-toggle__moon {
	display: none;
}

html.Night .night-toggle__sun {
	display: inline-flex;
}

.night-toggle__sun svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.nav-toggle,
.nav-close {
	display: none;
}

.hamburger {
	display: flex;
	flex-direction: column;
}

.hamburger .line {
	display: block;
	width: 22px;
	height: 3px;
	background: #fff;
	border-radius: 1px;
	margin: 2.5px 0;
}

/* Blocks */
.block {
	margin-bottom: 20px;
	box-shadow: 0 0 4px var(--shadow);
	background: var(--light);
	overflow: hidden;
	border-radius: var(--rounded);
}

.block__head {
	padding: 12px;
	overflow: hidden;
	border-bottom: 1px solid var(--gray-2);
	border-radius: var(--rounded) var(--rounded) 0 0;
	background: var(--gray-1);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}

html.Night .block__head {
	background: #121a23;
}

.block__head h1,
.block__head h2 {
	font-size: 16px;
	color: #fff;
	background: var(--title-bg);
	padding: 5px 14px;
	border-radius: var(--rounded);
	display: inline-flex;
}

.block__head h1 a,
.block__head h2 a {
	color: #fff;
}

.block__footer {
	text-align: center;
	padding: 0 var(--padding) var(--padding);
	margin: 0;
}

.block__footer .btn {
	min-width: 170px;
}

/* Day tabs */
.day-tabs {
	display: flex;
	gap: 5px;
}

.day-tabs a {
	padding: 6px 12px;
	border-radius: var(--rounded);
	color: #fff;
	font-size: 14px;
	background: var(--dark);
}

.day-tabs .is-yesterday {
	background: var(--kickoff-yesterday);
}

.day-tabs .is-today {
	background: var(--kickoff-today);
}

.day-tabs .is-tomorrow {
	background: var(--kickoff-tomorrow);
}

.day-tabs a[aria-current="page"] {
	outline: 2px solid rgba(255, 255, 255, 0.7);
}

.timezone-label {
	display: flex;
	justify-content: flex-end;
	padding: 2px 6px 0;
}

.timezone-label span {
	font-size: 10px;
	padding: 2px 8px;
	background: var(--gray-1);
	border-radius: 6px 6px 0 0;
	color: #555;
}

html.Night .timezone-label span {
	color: #cfd6df;
}

/* Match card */
.match-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	padding: var(--padding);
}

.match-card {
	text-align: center;
	background: var(--gray-1);
	border-radius: var(--rounded);
	position: relative;
	overflow: hidden;
}

.match-card__link {
	display: block;
	color: inherit;
}

.match-card__link:hover {
	color: inherit;
}

.match-card__inner {
	display: flex;
	align-items: center;
	padding: 10px;
}

.match-team {
	display: flex;
	align-items: center;
	flex: 1;
	gap: 6px;
}

.match-team--away {
	flex-direction: row-reverse;
}

.match-team__logo {
	width: 50%;
}

.match-team__logo img {
	margin: 8px auto;
	width: 64px;
	height: 64px;
	object-fit: contain;
}

.match-team__logo .logo-fallback {
	margin: 8px auto;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--main);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	font-weight: 700;
}

.match-team__name {
	margin: 8px auto;
	font-size: 15px;
	font-weight: 500;
	width: 100%;
}

.match-data {
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 90px;
}

.match-time {
	font-size: 16px;
}

.match-score {
	font-size: 21px;
	display: inline-flex;
	gap: 5px;
	justify-content: center;
	align-items: center;
	font-weight: 700;
}

.match-status {
	font-size: 13px;
	margin: 6px auto 0;
	padding: 3px 10px;
	min-width: 64px;
	border-radius: var(--rounded);
	background: var(--dark);
	color: #fff;
	display: inline-block;
}

.match-card.is-live .match-status {
	background: #d00000;
	animation: blinker 1s steps(2, start) infinite;
}

.match-card.is-finished .match-status {
	background: #474747;
}

.match-card.is-not-started .match-status {
	background: #0f6f37;
}

@keyframes blinker {
	50% {
		opacity: 0.55;
	}
}

.match-info {
	border-top: 1px solid var(--gray-2);
	display: flex;
	width: 100%;
}

.match-info li {
	flex: 1;
	font-size: 13px;
	padding: 6px 5px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.match-info li::before {
	content: "🎤";
	margin-left: 6px;
}

.match-info li:first-child::before {
	content: "📺";
}

.match-info li:last-child::before {
	content: "🏆";
}

.match-league {
	font-size: 12px;
	text-align: center;
	padding: 5px;
	color: #626883;
}

.match-card__mask {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.6);
	z-index: 9;
	transition: opacity 0.2s;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.match-card:hover .match-card__mask,
.match-card:focus-within .match-card__mask {
	opacity: 1;
}

.match-card__mask span {
	border: 2px solid #fff;
	border-radius: 50%;
	width: 46px;
	height: 46px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
}

.match-card__mask svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}

/* Posts grid */
.posts-grid {
	display: grid;
	grid-gap: 12px;
	padding: var(--padding);
	grid-template-columns: repeat(auto-fill, minmax(var(--post-width), 1fr));
}

.post-card {
	border-radius: var(--rounded);
	background: var(--gray-1);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.post-card__thumb {
	display: block;
	width: 100%;
	position: relative;
	overflow: hidden;
	padding-top: 62%;
	background: var(--dark);
}

.post-card__thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-card__body {
	padding: 10px;
}

.post-card__title {
	font-size: 15px;
	font-weight: 500;
	margin-bottom: 6px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.post-card__meta {
	font-size: 11px;
	color: #626883;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

html.Night .post-card__meta {
	color: #9d9fa4;
}

/* Entry / article */
.entry-header {
	margin-bottom: 20px;
	padding: 15px 20px;
	background: var(--gray-1);
	border-radius: var(--rounded) var(--rounded) 0 0;
	border-bottom: 1px solid var(--gray-2);
}

.entry-title {
	font-size: 24px;
	overflow: hidden;
}

.entry-meta {
	font-size: 12px;
	color: #626883;
	margin-top: 8px;
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

html.Night .entry-meta {
	color: #9d9fa4;
}

.entry-content {
	padding: 15px 20px;
	font-size: 17px;
	line-height: 1.9;
	font-weight: 400;
}

.entry-content p {
	margin-bottom: 15px;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin: 18px 0 12px;
	font-weight: 700;
	line-height: 1.4;
}

.entry-content a {
	color: var(--main);
	text-decoration: underline;
}

.entry-content ul,
.entry-content ol {
	padding-right: 22px;
	margin-bottom: 15px;
}

.entry-content ul {
	list-style: disc;
}

.entry-content ol {
	list-style: decimal;
}

.entry-content blockquote {
	background: var(--gray-3);
	padding: 12px;
	margin: 15px 0;
	text-align: center;
	font-weight: 700;
	border-radius: var(--rounded);
}

.entry-content img {
	border-radius: var(--rounded);
	margin: 0 auto 15px;
}

.entry-content iframe {
	max-width: 100%;
	border-radius: var(--rounded);
}

.entry-thumb img {
	width: 100%;
	border-radius: 0;
	margin-bottom: 0;
}

.post-footer {
	padding: 0 20px 20px;
}

.post-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.post-tags a {
	padding: 3px 10px;
	background: var(--gray-1);
	border-radius: var(--rounded);
	font-size: 80%;
}

/* Single match */
.match-hero {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	padding: 24px 12px;
	background: var(--gray-1);
	flex-wrap: wrap;
}

.match-hero__team {
	text-align: center;
	width: 130px;
}

.match-hero__team img {
	width: 80px;
	height: 80px;
	object-fit: contain;
	margin: 0 auto 8px;
}

.match-hero__team .logo-fallback {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: var(--main);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	font-weight: 700;
	margin: 0 auto 8px;
}

.match-hero__name {
	font-size: 16px;
	font-weight: 700;
}

.match-hero__center {
	text-align: center;
}

.match-hero__score {
	font-size: 32px;
	font-weight: 700;
}

.match-hero__time {
	font-size: 18px;
}

.match-details {
	list-style: none;
	padding: 12px 20px;
}

.match-details li {
	display: flex;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 1px solid var(--gray-2);
	font-size: 15px;
}

.match-details li:last-child {
	border-bottom: 0;
}

.match-details .label {
	color: #626883;
}

html.Night .match-details .label {
	color: #9d9fa4;
}

/* Pagination */
.pagination {
	padding: 15px;
	text-align: center;
}

.pagination .page-numbers {
	display: inline-block;
	min-width: 38px;
	padding: 6px 10px;
	margin: 0 3px;
	background: var(--gray-1);
	border-radius: var(--rounded);
}

.pagination .current {
	background: var(--main);
	color: #fff;
}

/* Sidebar / widgets */
.widget {
	margin-bottom: 20px;
	background: var(--light);
	border-radius: var(--rounded);
	box-shadow: 0 0 4px var(--shadow);
	padding: 12px;
}

.widget-title {
	font-size: 16px;
	font-weight: 700;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--gray-2);
	position: relative;
}

.widget-title::before {
	content: "";
	position: absolute;
	bottom: -1px;
	right: 0;
	width: 23px;
	height: 3px;
	background: var(--main);
}

.widget ul li {
	border-bottom: 1px solid var(--gray-2);
	line-height: 1.9;
}

.widget ul li:last-child {
	border-bottom: 0;
}

.layout {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 20px;
	align-items: start;
}

@supports (display: grid) {
	.layout {
		grid-template-columns: minmax(0, 1fr) 300px;
	}
}

/* Footer */
.site-footer {
	margin-top: 15px;
	box-shadow: 0 0 4px var(--shadow);
	background: var(--footer-bg);
}

.footer-widgets {
	display: flex;
	flex-wrap: wrap;
	padding: 10px 0;
}

.footer-widgets .footer-column {
	width: 25%;
	padding: 10px 12px;
}

.footer-widgets .widget {
	box-shadow: none;
	background: transparent;
	margin-bottom: 0;
	padding: 0;
}

.footer-widgets .widget-title {
	border-bottom: 1px solid var(--footer-border);
	color: var(--footer-color);
}

.site-info {
	background: var(--copy-bg);
	color: var(--copy-color);
	padding: 18px 0;
	text-align: center;
	font-size: 13px;
}

.site-info a {
	color: var(--copy-color);
	text-decoration: underline;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="date"],
textarea,
select {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--gray-2);
	border-radius: var(--rounded);
	background: var(--light);
	color: inherit;
	font-family: inherit;
	font-size: 15px;
}

textarea {
	min-height: 120px;
}

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

.search-form input[type="search"] {
	flex: 1;
}

/* Comments */
.comments-area {
	padding: 15px 20px 20px;
}

.comments-title {
	font-size: 18px;
	margin-bottom: 15px;
}

.comment-list {
	list-style: none;
}

.comment-list .comment-body {
	background: var(--gray-1);
	padding: 12px;
	border-radius: var(--rounded);
	margin-bottom: 12px;
}

.comment-list .children {
	padding-right: 22px;
}

.comment-meta {
	font-size: 12px;
	color: #626883;
	margin-bottom: 6px;
}

.comment-form p {
	margin-bottom: 12px;
}

.comment-form label {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
}

/* Misc */
.no-results {
	padding: 30px 20px;
	text-align: center;
}

@media screen and (max-width: 900px) {
	.layout {
		grid-template-columns: 1fr;
	}

	.footer-widgets .footer-column {
		width: 50%;
	}
}

@media screen and (max-width: 1000px) {
	.nav-toggle {
		display: inline-flex;
	}

	.site-header__inner > .container {
		gap: 12px;
	}

	.main-nav {
		position: fixed;
		top: 0;
		right: -300px;
		width: 280px;
		height: 100%;
		background: var(--light);
		z-index: 99;
		padding: 60px 15px 15px;
		overflow-x: hidden;
		transition: right 0.4s ease;
		box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
		display: flex;
		flex-direction: column;
	}

	.main-nav.is-open {
		right: 0;
	}

	.main-menu {
		flex-direction: column;
	}

	.main-menu li {
		width: 100%;
		margin-bottom: 12px;
	}

	.main-menu li > a {
		background: var(--dark);
		color: #fff;
		border-radius: var(--rounded);
		padding: 8px 12px;
	}

	.social-nav {
		justify-content: space-between;
	}

	.nav-close {
		display: inline-flex;
		position: absolute;
		top: 18px;
		right: 12px;
		width: 24px;
		height: 24px;
		background: transparent;
		border: 0;
		cursor: pointer;
	}

	.nav-close::before,
	.nav-close::after {
		content: "";
		position: absolute;
		right: 2px;
		width: 20px;
		height: 3px;
		background: var(--dark);
	}

	html.Night .nav-close::before,
	html.Night .nav-close::after {
		background: #fff;
	}

	.nav-close::before {
		transform: rotate(45deg);
	}

	.nav-close::after {
		transform: rotate(-45deg);
	}

	.overlay {
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.8);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s;
		z-index: 50;
	}

	html.nav-open .overlay {
		opacity: 1;
		visibility: visible;
	}

	html.nav-open,
	html.nav-open body {
		overflow: hidden;
	}
}

@media screen and (max-width: 640px) {
	body {
		--padding: 8px;
	}

	.block__head {
		padding: 8px;
	}

	.site-logo {
		margin: 6px auto;
	}

	.match-team__logo img,
	.match-team__logo .logo-fallback {
		width: 50px;
		height: 50px;
	}

	.match-team__name {
		font-size: 13px;
	}

	.match-info li {
		font-size: 11px;
	}

	.day-tabs {
		width: 100%;
	}

	.day-tabs a {
		flex: 1;
		text-align: center;
		font-size: 12px;
		padding: 6px 4px;
	}

	.posts-grid {
		--post-width: 150px;
	}

	.latest-posts .post-card {
		flex-direction: row;
	}

	.latest-posts .post-card__thumb {
		width: 38%;
		min-width: 120px;
		padding-top: 0;
	}

	.latest-posts .post-card__thumb img {
		position: static;
	}

	.footer-widgets .footer-column {
		width: 100%;
	}
}
