/*
Theme Name: Shashof News
Description: A high-performance Arabic news theme for WordPress
Version: 1.0.0
Author: Shashof Team
Text Domain: shashof
Requires at least: 6.7
Tested up to: 6.7
Requires PHP: 8.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* Prevent CLS during font loading */
@font-face {
  font-family: 'Noto Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/noto-sans-arabic-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./assets/fonts/noto-sans-arabic-semibold.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./assets/fonts/noto-sans-arabic-bold.woff2') format('woff2');
}

/* RTL Base Styles */
body {
  direction: rtl;
  text-align: right;
}

/* Professional Arabic Typography */
body,
.entry-content p,
.entry-content li {
  line-height: 1.7;
  font-size: 1.125rem;
}

.entry-content h1,
.entry-content h2,
.entry-content h3 {
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Dark Mode Variables */
:root {
  --shashof-bg: var(--wp--preset--color--background-light);
  --shashof-text: var(--wp--preset--color--text-primary);
  --shashof-text-secondary: var(--wp--preset--color--text-secondary);
}

[data-theme="dark"] {
  --shashof-bg: var(--wp--preset--color--background-dark-mode);
  --shashof-text: var(--wp--preset--color--text-dark-mode);
  --shashof-text-secondary: #d1d5db;
}

body {
  background-color: var(--shashof-bg);
  color: var(--shashof-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: var(--wp--preset--color--primary-news-blue);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dark-mode-toggle:hover {
  background: var(--wp--preset--color--secondary-accent);
}

/* RTL Layout Adjustments */
.wp-block-group,
.wp-block-columns {
  direction: rtl;
}

/* Navigation RTL */
.wp-block-navigation .wp-block-navigation-item {
  float: right;
  margin-left: 0;
  margin-right: 1rem;
}

/* Post Content RTL */
.wp-block-post-content p,
.wp-block-post-content li {
  text-align: right;
}

/* Prevent layout shifts */
* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

/* Performance optimizations */
.lazy {
  opacity: 0;
  transition: opacity 0.3s;
}

.lazy.loaded {
  opacity: 1;
}

/* Professional Ad Zones */
.shashof-ad-zone {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
  position: relative;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shashof-ad-zone::before {
  content: 'إعلان';
  position: absolute;
  top: -10px;
  right: 20px;
  background: #dc2626;
  color: white;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
  font-weight: bold;
}

[data-theme="dark"] .shashof-ad-zone {
  background: #374151;
  border-color: #4b5563;
}

/* Breaking News Ticker */
.breaking-news-ticker {
  background: var(--wp--preset--color--breaking-news-red);
  color: white;
  padding: 10px 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.ticker-label {
  background: white;
  color: var(--wp--preset--color--breaking-news-red);
  padding: 5px 15px;
  font-weight: bold;
  margin-right: 20px;
  border-radius: 4px;
  flex-shrink: 0;
}

.ticker-content {
  display: flex;
  animation: scroll-left 30s linear infinite;
  flex: 1;
}

.ticker-item {
  white-space: nowrap;
  margin-right: 50px;
  font-weight: 600;
}

.ticker-item a {
  color: white;
  text-decoration: none;
}

.ticker-item a:hover {
  text-decoration: underline;
}

@keyframes scroll-left {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Hero Grid Layout */
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin: 30px 0;
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .hero-sidebar {
    display: none; /* Hide sidebar on mobile */
  }
}

.hero-main {
  position: relative;
}

.hero-main img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
}

.hero-sidebar {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 15px;
}

.hero-sidebar .hero-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.hero-sidebar img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

/* Category Badges */
.category-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--wp--preset--color--primary-news-blue);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.8);
  z-index: 9999;
}

.progress-bar {
  height: 100%;
  background: var(--wp--preset--color--primary-news-blue);
  width: 0%;
  transition: width 0.3s ease;
}

/* Breadcrumbs */
.breadcrumbs {
  margin: 1rem 0 2rem 0;
  font-size: 0.9rem;
}

.breadcrumb-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: '>';
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  color: var(--shashof-text-secondary);
}

.breadcrumb-item a {
  color: var(--wp--preset--color--primary-news-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
  color: var(--wp--preset--color--secondary-accent);
}

/* Author Box - E-E-A-T Compliance */
.author-box {
  display: flex;
  background: var(--shashof-bg);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  margin: 3rem 0;
  gap: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.author-avatar {
  flex-shrink: 0;
}

.author-avatar img {
  border-radius: 50%;
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.author-info {
  flex: 1;
}

.author-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--shashof-text);
}

.author-credentials {
  font-size: 0.9rem;
  color: var(--wp--preset--color--secondary-accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.author-bio {
  color: var(--shashof-text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.author-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--shashof-text-secondary);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.author-social {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.author-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--wp--preset--color--primary-news-blue);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.author-social a:hover {
  background: var(--wp--preset--color--secondary-accent);
}

.author-website::before { content: '🌐'; }
.author-twitter::before { content: '🐦'; }
.author-facebook::before { content: '📘'; }
.author-linkedin::before { content: '💼'; }

/* Dark Mode for Author Box */
[data-theme="dark"] .author-box {
  background: #374151;
  border-color: #4b5563;
}