/* ثورة 14 فبراير - Site CSS Supplement */
/* Fills in missing template assets and provides mobile-first layout */

:root {
  --color-primary: #8B1A1A;    /* deep red - revolution theme */
  --color-secondary: #C0392B;
  --color-accent: #E74C3C;
  --color-bg: #f5f5f5;
  --color-header-bg: #ffffff;
  --color-nav-bg: #8B1A1A;
  --color-text: #222;
  --color-link: #8B1A1A;
  --color-border: #ddd;
  --font-arabic: 'Segoe UI', Tahoma, Arial, sans-serif;
}

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

/* Base */
body {
  font-family: var(--font-arabic);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  direction: rtl;
  text-align: right;
}

/* Wrapper */
#ja-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  min-width: 0 !important;
  overflow-x: hidden;
}

/* Header */
#ja-header {
  background: var(--color-header-bg);
  padding: 12px 0;
}

#ja-header .main {
  width: 100% !important;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

#ja-header .main-inner1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

h1.logo-right {
  margin: 0;
}

h1.logo-right a {
  background: url(/templates/Event/images/themes/default-rtl/logo.png) no-repeat right center;
  background-size: contain;
  display: block;
  width: 212px;
  height: 100px;
}

h1.logo-right a span { position: absolute; top: -1000px; }

.lang-switcher {
  display: flex;
  gap: 8px;
}

.lang-switcher a, .lang-switcher span.art-title-static {
  color: #fff;
  background: var(--color-primary);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 3px;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.lang-switcher a:hover, .lang-switcher a.active {
  color: #fff;
  background: var(--color-secondary);
}
.lang-switcher span.art-title-static {
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 3px;
  min-height: 36px;
  display: flex;
  align-items: center;
}

/* Navigation */
#ja-mainnav {
  background: var(--color-nav-bg);
  position: relative;
}

#ja-mainnav .main {
  width: 100% !important;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

#ja-mainnav .main-inner1,
#ja-mainnav .main-inner2 {
  width: 100% !important;
}

ul#ja-cssmenu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 0;
}

ul#ja-cssmenu > li {
  position: relative;
}

ul#ja-cssmenu > li > a {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  /* menu/css.css paints a light glossy strip (menu-bg.png) behind these links —
     text must be DARK on it, never white */
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  min-height: 44px;
  transition: background 0.2s, color 0.2s;
}

ul#ja-cssmenu > li:hover > a,
ul#ja-cssmenu > li.active > a {
  /* shorthand intentionally drops the light strip image: solid dark maroon + white text */
  background: rgba(0,0,0,0.25);
  color: #fff;
}

/* Dropdown */
ul#ja-cssmenu li.havechild > ul.submenu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  min-width: 200px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

ul#ja-cssmenu li.havechild:hover > ul.submenu {
  display: block;
}

ul#ja-cssmenu li.havechild ul.submenu li a {
  display: block;
  padding: 9px 14px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.875rem;
  border-bottom: 1px solid #f0f0f0;
  min-height: 44px;
  line-height: 1.4;
}

ul#ja-cssmenu li.havechild ul.submenu li a:hover {
  background: #fef5f5;
  color: var(--color-primary);
}

/* Container */
#ja-container .main {
  width: 100% !important;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* Breadcrumb */
.breadcrumb {
  padding: 8px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.breadcrumb ol li {
  font-size: 0.85rem;
  color: #666;
}

.breadcrumb ol li a {
  color: var(--color-link);
  text-decoration: none;
}

.breadcrumb ol li a:hover { text-decoration: underline; }

.breadcrumb ol li:not(:last-child)::before {
  content: '«';
  margin-right: 4px;
  color: #999;
}

/* Content */
#ja-main {
  min-height: 400px;
}

#ja-content-main {
  padding: 16px 0;
}

/* Homepage */
.home-content .section-title {
  font-size: 1.2rem;
  color: var(--color-primary);
  border-right: 4px solid var(--color-accent);
  padding-right: 10px;
  margin-bottom: 16px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-item {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.news-item h2.contentheading {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.news-item h2.contentheading a {
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.5;
}

.news-item h2.contentheading a:hover {
  color: var(--color-primary);
}

/* Category page */
.category-page h1.page-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cat-item {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.cat-item h2.contentheading {
  font-size: 1rem;
  margin: 0 0 4px;
}

.cat-item h2.contentheading a {
  color: var(--color-text);
  text-decoration: none;
}

.cat-item h2.contentheading a:hover {
  color: var(--color-primary);
}

/* Article page */
article.item-page h1.contentheading {
  font-size: clamp(1.3rem, 3.5vw, 1.9rem);
  color: #1a1a2e;
  line-height: 1.4;
  margin-bottom: 12px;
  font-weight: 700;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: #666;
}

.article-meta a { color: var(--color-link); text-decoration: none; }
.article-meta a:hover { text-decoration: underline; }

.art-main-img {
  margin-bottom: 20px;
  text-align: center;
}

.art-main-img img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
}

.article-body p {
  margin-bottom: 1em;
}

.article-body img {
  max-width: 100%;
  height: auto;
}

.article-body div {
  margin-bottom: 0.5em;
}

/* Dates */
.art-date { color: #666; font-size: 0.82rem; }

/* Footer */
#ja-footer {
  background: var(--color-header-bg);
  color: #444;
  padding: 20px 0;
  margin-top: 40px;
}

#ja-footer .main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.footer-inner { text-align: center; }

#ja-footer .footer-logo a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-copy {
  font-size: 0.85rem;
  margin-top: 8px;
}

#ja-footer .footer-copy a { color: var(--color-primary); text-decoration: none; }
#ja-footer a:hover, #ja-footer a:focus, #ja-footer a:active { color: var(--color-secondary); text-decoration: underline; }

/* Mobile menu toggle */
#menu-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Mobile styles */
@media (max-width: 768px) {
  #menu-toggle { display: flex; align-items: center; justify-content: center; }

  ul#ja-cssmenu {
    display: none;
    flex-direction: column;
  }

  #ja-mainnav.mobile-open ul#ja-cssmenu {
    display: flex;
  }

  ul#ja-cssmenu > li > a {
    padding: 14px 16px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
  }

  ul#ja-cssmenu li.havechild > ul.submenu {
    display: none !important;
  }

  #ja-container .main { padding: 12px; }

  .article-meta { flex-direction: column; gap: 4px; }
}

/* Wide table handling */
table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

/* Override template CSS width restrictions */
body.bd .main { width: auto !important; max-width: 1200px !important; }
body.bd #ja-wrapper { min-width: 0 !important; }

/* Override archive.org injected system CSS issues */
.system-unpublished { display: none; }
#system-debug { display: none; }
