/* بوابة نيوز - الأنماط الرئيسية */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@400;500;600;700&display=swap');

:root {
  --pulse: #f2a900;
  --pulse-soft: #fff6dc;
  --navy: #0b1f33;
  --navy-2: #112d49;
  --ink: #101820;
  --radius: 0.45rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e0dcd8;
}

.site-header::before {
  content: "";
  position: absolute;
  right: 7%;
  top: 10px;
  width: 86px;
  height: 64px;
  border: 10px solid rgba(242, 169, 0, 0.12);
  border-bottom: 0;
  border-radius: 46px 46px 0 0;
  pointer-events: none;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0;
}

.site-branding .custom-logo-link img {
  height: 56px;
  width: auto;
}

.site-title-wrapper {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 0.18rem;
}

.site-title {
  font-size: 1.85rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.05em;
  margin: 0;
}

.site-title a {
  color: var(--navy);
  text-decoration: none;
}

.site-title a::after {
  content: "نيوز";
  color: var(--pulse);
  margin-right: 0.18rem;
}

.site-description {
  grid-column: 1 / -1;
  font-size: 0.59rem;
  margin-top: 0.45rem;
  color: #888;
  font-weight: 500;
}

/* Primary Navigation */
.primary-menu-container {
  background: var(--navy);
  color: white;
  box-shadow: 0 12px 28px rgba(5, 18, 32, 0.12);
}

.primary-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.primary-menu li {
  position: relative;
}

.primary-menu a {
  display: block;
  padding: 1.08rem 0.85rem;
  font-size: 0.79rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.79);
  text-decoration: none;
  position: relative;
  transition: color 180ms ease;
}

.primary-menu a::after {
  content: "";
  position: absolute;
  right: 0.85rem;
  left: 0.85rem;
  bottom: 0.55rem;
  height: 2px;
  background: var(--pulse);
  transform: scaleX(0);
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.primary-menu a:hover,
.primary-menu li.current-menu-item > a {
  color: white;
}

.primary-menu a:hover::after,
.primary-menu li.current-menu-item > a::after {
  transform: scaleX(1);
}

/* Main Content */
.site-content {
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1450px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 1024px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.post-card {
  background: white;
  border: 1px solid #e0dcd8;
  overflow: hidden;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 180ms ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.post-card-image {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms cubic-bezier(0.23, 1, 0.32, 1);
}

.post-card:hover .post-card-image img {
  transform: scale(1.035);
}

.post-card-category {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.36rem 0.65rem;
  background: var(--pulse);
  color: var(--navy);
  font-size: 0.66rem;
  font-weight: 700;
}

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

.post-card-title {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 700;
}

.post-card-title a {
  color: var(--navy);
  text-decoration: none;
}

.post-card-title a:hover {
  color: var(--pulse);
}

.post-card-excerpt {
  margin: 0 0 1rem;
  color: #666;
  font-size: 0.78rem;
  line-height: 1.8;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.65rem;
  color: #999;
}

.post-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Single Post */
.single-post {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 0;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1.2;
  margin: 1rem 0;
  color: var(--navy);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0dcd8;
  font-size: 0.85rem;
  color: #666;
}

.post-author,
.post-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-author a,
.post-date a {
  color: var(--navy);
  font-weight: 600;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #333;
}

.post-content p {
  margin: 1.5rem 0;
}

.post-content h2,
.post-content h3 {
  margin: 2rem 0 1rem;
  color: var(--navy);
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
}

.post-content blockquote {
  padding: 1.5rem;
  margin: 2rem 0;
  border-right: 4px solid var(--pulse);
  background: #f9f8f6;
  font-style: italic;
  color: #666;
}

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

.post-content a:hover {
  color: var(--navy);
}

/* Related Posts */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e0dcd8;
}

.related-posts-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--navy);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Sidebar */
.sidebar {
  margin-top: 2rem;
}

.widget {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid #e0dcd8;
}

.widget-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  color: var(--navy);
  border-bottom: 2px solid var(--pulse);
  padding-bottom: 0.5rem;
}

.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0ede9;
}

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

.widget a {
  color: var(--navy);
  text-decoration: none;
  font-size: 0.9rem;
}

.widget a:hover {
  color: var(--pulse);
}

/* Footer */
.site-footer {
  background: #061421;
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-widget h4 {
  margin: 0 0 1rem;
  color: var(--pulse);
  font-size: 0.95rem;
}

.footer-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-widget li {
  margin-bottom: 0.5rem;
}

.footer-widget a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-widget a:hover {
  color: var(--pulse);
}

.site-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Comments */
.comments-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e0dcd8;
}

.comments-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--navy);
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f9f8f6;
  border-radius: var(--radius);
}

.comment-author {
  font-weight: 600;
  color: var(--navy);
}

.comment-date {
  font-size: 0.8rem;
  color: #999;
  margin-left: 0.5rem;
}

.comment-content {
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* Forms */
.comment-form {
  margin-top: 2rem;
}

.comment-form-group {
  margin-bottom: 1rem;
}

.comment-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--navy);
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e0dcd8;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
}

.comment-form textarea {
  resize: vertical;
  min-height: 120px;
}

.comment-form button {
  padding: 0.75rem 1.5rem;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease;
}

.comment-form button:hover {
  background: var(--pulse);
  color: var(--navy);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  list-style: none;
  padding: 0;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e0dcd8;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--navy);
  transition: all 180ms ease;
}

.pagination a:hover {
  background: var(--pulse);
  color: white;
  border-color: var(--pulse);
}

.pagination .current {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

/* Search */
.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.search-form input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #e0dcd8;
  border-radius: var(--radius);
  font-size: 1rem;
}

.search-form button {
  padding: 0.75rem 1.5rem;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}

.search-form button:hover {
  background: var(--pulse);
}

/* Responsive */
@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .single-post {
    padding: 1.5rem 0;
  }

  .post-title {
    font-size: 1.8rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.5rem 0;
  }

  .site-title {
    font-size: 1.5rem;
  }

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

  .primary-menu a {
    padding: 0.75rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-title {
    font-size: 1.3rem;
  }

  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

/* Dark Mode */
body.dark-mode {
  background-color: #0d1117;
  color: #e8e8e8;
}

body.dark-mode .site-header {
  background: rgba(13, 17, 23, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .post-card {
  background: #1a1f26;
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .post-card-title a {
  color: #e8e8e8;
}

body.dark-mode .widget {
  background: #1a1f26;
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .comment {
  background: #1a1f26;
}

body.dark-mode .comment-form input,
body.dark-mode .comment-form textarea {
  background: #1a1f26;
  color: #e8e8e8;
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .search-form input {
  background: #1a1f26;
  color: #e8e8e8;
  border-color: rgba(255, 255, 255, 0.1);
}
