/* ==========================================================================
   Jawaker Blog Theme - Dark RTL Gaming Blog
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Colors - matching jawaker.com */
  --color-bg-primary: #18181A;
  --color-bg-secondary: #18181A;
  --color-bg-card: #18181A;
  --color-text-primary: #f1f1f1;
  --color-text-secondary: #a0a0a0;
  --color-accent: #F7B717;
  --color-accent-hover: #e5a915;
  --color-border: #2a2a2d;

  /* Typography - Tailwind's default system font stack */
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Arabic", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-primary: var(--font-sans);
  --font-bold: var(--font-sans);

  /* Spacing */
  --nav-height: 64px;
  --container-width: 1200px;
  --container-padding: 20px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  font-size: 1rem;
  min-height: 100vh;
  direction: rtl;
  text-align: right;
}

/* Screen reader only utility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* LTR Support */
[dir="ltr"] body {
  direction: ltr;
  text-align: left;
}

a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

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

ul, ol {
  list-style-position: inside;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-bold);
  line-height: 1.4;
  margin-bottom: 0.5em;
}

/* --------------------------------------------------------------------------
   Header & Navigation (Jawaker Style)
   -------------------------------------------------------------------------- */
.site-header {
  position: relative;
  z-index: 1000;
}

/* Main Navigation Bar */
.nav-main-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(16, 16, 18, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
}

.nav-main-bar .nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Logo - Right in RTL, Left in LTR */
.nav-logo {
  order: 1;
  flex-shrink: 0;
}

/* Main Nav Links (Store, Support, Careers) - pushed away from logo */
.nav-links {
  order: 2;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-inline-start: auto;
}

.nav-link {
  color: #d1d5db;
  font-size: 1rem;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
  white-space: nowrap;
  line-height: 1.5;
}

.nav-link:hover {
  color: #fff;
}

/* Language Selector - after menu links */
.nav-lang {
  order: 3;
  margin-inline-start: 1.5rem;
}

.lang-btn {
  color: #fff;
  font-size: 0.875rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.lang-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.nav-logo a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
}

.nav-logo img {
  height: 40px;
  width: auto;
}

/* Topics Filter */
.nav-topics-bar {
  background: transparent;
  margin-top: 64px;
}

.nav-topics-bar .nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: center;
}

.topics-list {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  position: relative;
}

.topics-list::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: -50px;
  right: -50px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.topic-link {
  color: #9ca3af;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.topic-link:hover {
  color: #fff;
}

.topic-link.active {
  color: #fff;
  position: relative;
}

.topic-link.active::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  order: 4;
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: #fff;
  margin-inline-start: auto;
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

.mobile-menu-btn .close-icon {
  display: none;
}

.mobile-menu-btn.is-open .menu-icon {
  display: none;
}

.mobile-menu-btn.is-open .close-icon {
  display: block;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  background-color: #101012;
  padding: 1rem;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu-section {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-section:last-child {
  border-bottom: none;
}

.mobile-section-title {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  margin-bottom: 0.25rem;
}

.mobile-link {
  display: block;
  color: #d1d5db;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.mobile-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}

.mobile-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-link.lang {
  color: #9b87f5;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-lang {
    display: none;
  }

  .nav-topics-bar {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */
.site-main {
  min-height: calc(100vh - 112px - 200px);
  padding-top: 40px;
  padding-bottom: 40px;
}

@media (max-width: 768px) {
  .site-main {
    padding-top: 104px; /* 64px nav + 40px spacing */
  }

  .nav-topics-bar {
    display: none;
  }
}

.posts-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* --------------------------------------------------------------------------
   Post Cards (Jawaker Style)
   -------------------------------------------------------------------------- */
.post-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-card-link:hover {
  color: inherit;
}

/* Post Cards Grid */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.post-card {
  background-color: var(--color-bg-card);
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.2s ease;
  height: 100%;
}

.post-card:hover {
  transform: translateY(-4px);
}

.post-card .post-card-image-wrapper {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.post-card .post-card-image {
  height: 100%;
  width: 100%;
  border-radius: 5px;
}

.post-card .post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card .post-card-image img.fallback-image {
  object-fit: contain;
  background: #1f1f23;
  padding: 2rem;
}

.post-card .post-card-content {
  padding: 1rem;
}

.post-card .post-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #fff;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-link:hover .post-card-title {
  color: var(--color-accent);
}

.post-card .post-card-excerpt {
  font-size: 0.875rem;
  color: #9ca3af;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  line-height: 1.6;
}

/* Post Card Meta */
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.meta-separator {
  color: #9ca3af;
}

.post-card-category {
  color: #9ca3af;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 50px;
  padding: 20px 0;
}

.pagination-prev,
.pagination-next {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-bg-card);
  transition: background-color var(--transition-fast);
}

.pagination-prev:hover,
.pagination-next:hover {
  background-color: var(--color-border);
}

.pagination-prev svg,
.pagination-next svg {
  width: 20px;
  height: 20px;
}

.page-nums {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 0.9rem;
  border-radius: 4px;
  background-color: var(--color-bg-card);
  transition: all var(--transition-fast);
}

.page-num:hover {
  background-color: var(--color-border);
}

.page-num.active {
  background-color: var(--color-accent);
  color: var(--color-bg-primary);
  font-family: var(--font-bold);
}

/* --------------------------------------------------------------------------
   Single Post Page
   -------------------------------------------------------------------------- */
.post-full {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.post-full-header {
  text-align: center;
  margin-bottom: 30px;
}

.post-full-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 50px;
  padding: 20px 0;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.post-full-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tag {
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-secondary);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.post-tag:hover {
  color: var(--color-accent);
  background-color: rgba(247, 183, 23, 0.1);
}

.post-full-date {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.post-full-title {
  font-size: 2.5rem;
  line-height: 1.3;
  margin-bottom: 15px;
}

.post-full-description {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.post-full-image {
  margin: 30px 0;
  border-radius: 8px;
  overflow: hidden;
}

.post-full-image img {
  width: 100%;
}

/* Post Content */
.post-full-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-full-content h2 {
  font-size: 1.75rem;
  margin-top: 40px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-accent);
}

.post-full-content h3 {
  font-size: 1.4rem;
  margin-top: 30px;
  margin-bottom: 15px;
}

.post-full-content p {
  margin-bottom: 1.5em;
}

.post-full-content ul,
.post-full-content ol {
  margin-bottom: 20px;
  padding-right: 20px;
}

[dir="ltr"] .post-full-content ul,
[dir="ltr"] .post-full-content ol {
  padding-right: 0;
  padding-left: 20px;
}

.post-full-content li {
  margin-bottom: 10px;
}

.post-full-content img {
  border-radius: 8px;
  margin: 20px auto;
  max-width: min(500px, 100%);
}

.post-full-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

.post-full-content table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  overflow: hidden;
}

.post-full-content th,
.post-full-content td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--color-border);
}

[dir="ltr"] .post-full-content th,
[dir="ltr"] .post-full-content td {
  text-align: left;
}

.post-full-content th {
  background-color: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: #fff;
}

.post-full-content tr:last-child td {
  border-bottom: none;
}

.post-full-content tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.post-full-content blockquote {
  margin: 30px 0;
  padding: 20px 30px;
  background-color: var(--color-bg-card);
  border-right: 4px solid var(--color-accent);
  border-radius: 4px;
}

[dir="ltr"] .post-full-content blockquote {
  border-right: none;
  border-left: 4px solid var(--color-accent);
}

.post-full-content code {
  background-color: var(--color-bg-card);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.post-full-content pre {
  background-color: var(--color-bg-card);
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
}

.post-full-content pre code {
  background: none;
  padding: 0;
}

/* Share Buttons */
.post-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 40px 0;
  padding: 20px;
  background-color: var(--color-bg-card);
  border-radius: 8px;
}

.share-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.share-buttons {
  display: flex;
  gap: 12px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.share-btn:hover {
  transform: scale(1.1);
}

.share-btn svg {
  width: 20px;
  height: 20px;
}

.share-btn.whatsapp {
  background-color: #25D366;
  color: white;
}

.share-btn.facebook {
  background-color: #1877F2;
  color: white;
}

.share-btn.twitter {
  background-color: #000;
  color: white;
  border: 1px solid var(--color-border);
}

/* Author Info */
.post-author {
  text-align: center;
  padding: 20px;
  margin-top: 30px;
}

.author-name {
  font-family: var(--font-bold);
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Related Posts
   -------------------------------------------------------------------------- */
.related-posts {
  max-width: 800px;
  margin: 50px auto 0;
  padding: 0 var(--container-padding);
}

.related-posts h3 {
  font-size: 1.5rem;
  margin-bottom: 25px;
  text-align: center;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.related-post-card {
  background-color: var(--color-bg-card);
  border-radius: 8px;
  overflow: hidden;
}

.related-post-image-link {
  display: block;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.related-post-image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-post-card h4 {
  padding: 15px;
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0;
}

/* --------------------------------------------------------------------------
   List Page
   -------------------------------------------------------------------------- */
.list-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 0 var(--container-padding);
}

.list-title {
  font-size: 2rem;
  margin-bottom: 10px;
}

.list-description {
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Footer (Jawaker Style)
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: #18181A;
  padding: 3rem 0;
  margin-top: 3rem;
}

.footer-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .footer-container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .footer-container {
    padding: 0 2rem;
  }
}

/* Top Section */
.footer-top {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
  }
}

/* Follow Us Section */
.footer-social {
  margin-bottom: 0;
}

.footer-heading {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
}

.social-links {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 0.75rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transition: color 0.2s ease;
}

.social-link:hover {
  color: #fff;
}

.social-link svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* App Badges */
.footer-badges {
  display: flex;
  gap: 1rem;
}

.app-badge img {
  height: 3rem;
  width: auto;
}

/* Separator */
.footer-separator {
  height: 1px;
  background-color: #374151;
  margin: 2rem 0;
}

/* Bottom Section */
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

/* Company Address */
.footer-address {
  color: #9ca3af;
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-address p {
  margin: 0;
}

.footer-address .company-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Footer Links */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a {
  color: #9ca3af;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #fff;
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

  .post-full-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-full-title {
    font-size: 1.75rem;
  }

  .post-full-content {
    font-size: 1rem;
  }

  .post-share {
    flex-direction: column;
    gap: 15px;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .page-nums {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .nav-logo img {
    height: 32px;
  }

  .post-card-content {
    padding: 15px;
  }

  .post-card-title {
    font-size: 1.1rem;
  }

  .app-badges {
    flex-direction: column;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   Error Page (404)
   -------------------------------------------------------------------------- */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 20px;
}

.error-code {
  font-size: 8rem;
  font-weight: bold;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 20px;
}

.error-title {
  font-size: 2rem;
  margin-bottom: 15px;
}

.error-message {
  color: var(--color-text-secondary);
  margin-bottom: 30px;
}

.error-link {
  display: inline-block;
  padding: 12px 30px;
  background-color: var(--color-accent);
  color: var(--color-bg-primary);
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.error-link:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-bg-primary);
}

/* --------------------------------------------------------------------------
   Hall of Fame Gallery
   -------------------------------------------------------------------------- */
#group-gallery {
  max-width: 800px;
  margin: 0 auto;
}

.group-block {
  margin-bottom: 30px;
}

.group-title {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.celeb-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.celeb-card {
  width: 100px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.celeb-card:hover {
  transform: scale(1.05);
}

.post-full-content .celeb-card img,
.celeb-card img {
  width: 100px !important;
  height: 100px !important;
  max-width: 100px !important;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px auto !important;
}

.celeb-card span {
  display: block;
  font-size: 0.85rem;
  color: #fff;
}

.celeb-section {
  text-align: center;
  padding: 20px;
}

.celeb-section.hidden {
  display: none;
}

.celeb-profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 16px auto;
  display: block;
}

.back-button {
  background-color: #FFD700;
  color: black;
  padding: 6px 12px;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 16px;
}

.back-button:hover {
  background-color: #e5c200;
}

