/* ==========================================================================
   مسار التقنية | Masar Tech - Main Stylesheet
   Modern, Lightweight, Responsive & RTL-Optimized for Google AdSense Approval
   ========================================================================== */

:root {
  --primary-color: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary-color: #0f172a;
  --accent-color: #059669;
  --text-main: #334155;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --ad-bg: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.8;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 75px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-color);
}

.brand-logo .logo-icon {
  background: var(--primary-color);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

nav ul li a {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-dark);
}

/* AdSense Slot Styles */
.ad-slot-container {
  margin: 25px 0;
  padding: 15px;
  background: var(--ad-bg);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  text-align: center;
}

.ad-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.ad-box {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #ffffff;
  padding: 60px 0;
  margin-bottom: 40px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-content h1 {
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero-content p {
  font-size: 18px;
  color: #cbd5e1;
  line-height: 1.6;
}

/* Main Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 35px;
  margin-bottom: 60px;
}

/* Articles Feed */
.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 60px;
  height: 2px;
  background-color: var(--primary-color);
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.article-card-body {
  padding: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.article-category {
  background-color: var(--primary-light);
  color: var(--primary-color);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.article-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.4;
}

.article-title a {
  color: var(--text-dark);
}

.article-title a:hover {
  color: var(--primary-color);
}

.article-excerpt {
  color: var(--text-main);
  font-size: 15px;
  margin-bottom: 18px;
  line-height: 1.7;
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary-color);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.widget-about-content p {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: 12px;
}

.recent-posts-list {
  list-style: none;
}

.recent-posts-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.recent-posts-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-posts-list a {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  display: block;
}

.recent-posts-list a:hover {
  color: var(--primary-color);
}

.recent-post-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Article Detail Page */
.single-article-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 35px;
  box-shadow: var(--shadow-sm);
}

.article-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 15px;
}

.article-body {
  font-size: 17px;
  color: var(--text-main);
  line-height: 2;
}

.article-body h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 35px 0 15px;
  padding-right: 12px;
  border-right: 4px solid var(--primary-color);
}

.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 25px 0 12px;
}

.article-body p {
  margin-bottom: 20px;
}

.article-body ul,
.article-body ol {
  margin: 20px 25px 25px 0;
}

.article-body li {
  margin-bottom: 10px;
}

.highlight-box {
  background: var(--primary-light);
  border-right: 4px solid var(--primary-color);
  padding: 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 25px 0;
}

.author-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 40px;
}

.author-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
}

.author-info h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.author-info p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Legal / Static Pages */
.static-page-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 50px;
}

.static-page-card h1 {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.static-page-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 30px 0 15px;
}

.static-page-card p {
  margin-bottom: 18px;
  font-size: 16px;
  line-height: 1.9;
}

/* Contact Form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 15px;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
}

textarea.form-control {
  resize: vertical;
  min-height: 130px;
}

.submit-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: var(--font-family);
}

.submit-btn:hover {
  background: var(--primary-hover);
}

.form-success-msg {
  display: none;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 15px;
  border-radius: var(--radius-sm);
  margin-top: 15px;
}

/* Footer */
footer {
  background: var(--secondary-color);
  color: #94a3b8;
  padding: 60px 0 30px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-about h3 {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 15px;
}

.footer-about p {
  font-size: 14px;
  line-height: 1.8;
  max-width: 450px;
}

.footer-links h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 10px;
}

.footer-links ul li a {
  color: #94a3b8;
  font-size: 14px;
}

.footer-links ul li a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 25px;
  text-align: center;
  font-size: 13px;
}

/* Responsive Design */
@media (max-width: 992px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 75px;
    right: 0;
    left: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-md);
  }
  nav ul.show {
    display: flex;
  }
  .hero-content h1 {
    font-size: 28px;
  }
  .single-article-content,
  .static-page-card {
    padding: 24px;
  }
}