/**
 * Salam Khabar WordPress Theme Styles
 * RTL News Theme - Clean & Standards-Compliant
 */

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Top Bar */
.header-top-bar {
  background-color: #000000;
  color: #ffffff;
}

.header-top-bar .wp-block-columns {
  margin: 0;
  padding: 0;
}

.header-top-bar .wp-block-column {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.header-top-bar .wp-block-navigation {
  margin: 0;
  padding: 0;
}

.header-top-bar .wp-block-navigation__container {
  gap: 2rem;
}

.header-top-bar .wp-block-navigation-item a {
  color: #ffffff !important;
  text-decoration: none;
  font-size: 0.875rem;
}

.header-top-bar .wp-block-navigation-item a:hover {
  opacity: 0.8;
}

/* Hide mobile menu button in top bar on desktop */
.header-top-bar .wp-block-navigation__responsive-container-open {
  display: none;
}

/* Show mobile menu button in top bar only on mobile */
@media (max-width: 768px) {
  .header-top-bar .wp-block-navigation__responsive-container-open {
    display: flex;
  }
}

/* Site Branding Area */
.site-branding-area {
  /* border-bottom: 1px solid rgba(0, 0, 0, 0.1); */
}

.wp-block-site-logo {
  margin: 0;
}

.wp-block-site-logo img {
  max-height: 48px;
  width: auto;
}

.wp-block-site-title {
  margin: 0;
  padding: 0;
}

.wp-block-site-title a {
  text-decoration: none;
  color: inherit;
}

/* Search Form - Clean Single Input with Button Inside */
.site-search-form {
  max-width: 20rem;
  margin: 0;
}

/* Hide on mobile */
@media (max-width: 768px) {
  .site-search-form,
  .site-search-wrapper {
    display: none !important;
  }
}

.site-search-wrapper {
  max-width: 20rem;
}

.site-search-form {
  display: flex;
  align-items: center;
  background: #f3f3f5;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

.site-search-input {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  outline: none;
  box-shadow: none;
  font-family: "Vazirmatn", sans-serif;
}

.site-search-input:focus {
  outline: none;
  box-shadow: none;
}

.site-search-input::placeholder {
  color: #717182;
}

.site-search-button {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: #717182;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.site-search-button:hover {
  color: #dc2626;
}

.site-search-button .search-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.site-search-form .wp-block-search__inside-wrapper {
  display: flex;
  align-items: center;
  background: #f3f3f5;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
  padding: 0;
}

.site-search-form .wp-block-search__input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  padding: 0.5rem 1rem !important;
  font-size: 0.875rem;
  outline: none !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.site-search-form .wp-block-search__input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.site-search-form .wp-block-search__button {
  background: transparent !important;
  border: none !important;
  padding: 0.5rem 1rem !important;
  cursor: pointer;
  color: #717182;
  min-width: auto !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.site-search-form .wp-block-search__button:hover {
  color: #dc2626;
  background: transparent !important;
}

.site-search-form .wp-block-search__button svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Primary Navigation */
.primary-navigation {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin: 0;
  padding: 0 !important;
}

.primary-navigation .wp-block-navigation__responsive-container {
  padding: 0;
}

.primary-navigation .wp-block-navigation__container {
  padding-right: 2.5rem !important;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  /* Right align - start from right in RTL */
  justify-content: flex-start;
}

.primary-navigation .wp-block-navigation-item {
  margin: 0;
}

.primary-navigation .wp-block-navigation-item__content {
  display: block;
  padding: 0.65rem 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
}

.primary-navigation .wp-block-navigation-item__content:hover {
  color: #dc2626;
}

/* Hide mobile menu button in desktop - IMPORTANT */
.primary-navigation .wp-block-navigation__responsive-container-open {
  display: none !important;
}

/* Show mobile menu button only on mobile */
@media (max-width: 1023px) {
  .primary-navigation .wp-block-navigation__responsive-container-open {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.65rem;
    border: none;
    background: transparent;
    cursor: pointer;
    margin-left: auto;
  }

  /* Hide navigation items on mobile, show hamburger */
  .primary-navigation
    .wp-block-navigation__responsive-container:not(.is-menu-open)
    .wp-block-navigation__responsive-container-content {
    display: none;
  }
}

/* Mobile Overlay Menu - BLACK background for visibility */
.primary-navigation .wp-block-navigation__responsive-container.is-menu-open {
  padding: 1.5rem;
  background: #000000 !important;
}

.primary-navigation
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item
  a {
  color: #ffffff !important;
}

/* Full screen overlay on mobile */
@media (max-width: 1023px) {
  .primary-navigation .wp-block-navigation__responsive-container.is-menu-open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000 !important;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    padding: 2rem;
  }

  .primary-navigation
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__responsive-container-close {
    color: #ffffff;
  }
}

/* ==========================================================================
   Breaking News
   ========================================================================== */

.breaking-news-bar {
  background-color: #dc2626 !important;
  padding: 0.9rem 0 !important;
  min-height: auto !important;
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

.breaking-news-bar .wp-block-cover__background {
  background-color: #dc2626 !important;
}

.breaking-news-bar .wp-block-cover__inner-container {
  padding: 0;
  margin: 0;
}

.breaking-news-bar .wp-block-group {
  margin: 0;
  padding: 0;
}

.breaking-news-bar .wp-block-paragraph {
  margin: 0;
  padding: 0;
}

.live-badge {
  background: #ffffff;
  color: #dc2626;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  display: inline-block;
  font-weight: 600;
  line-height: 1.5;
}

/* ==========================================================================
   Content
   ========================================================================== */

/* Separators - Very Light */
.wp-block-separator,
hr {
  background-color: rgba(0, 0, 0, 0.06) !important;
  opacity: 1 !important;
  height: 1px;
  border: none;
  margin: 2rem 0;
}

/* Section Titles */
.section-title,
.wp-block-heading.section-title {
  border-right: 4px solid #dc2626;
  padding-right: 1rem;
  margin: 0 0 1.5rem 0;
}

/* ==========================================================================
   Posts
   ========================================================================== */

/* Post Featured Images */
.wp-block-post-featured-image {
  margin-bottom: 1rem;
}

.wp-block-post-featured-image img {
  border-radius: 0.5rem;
  width: 100%;
  height: auto;
}

/* Post Terms (Categories) - RED COLOR */
.wp-block-post-terms,
.wp-block-post-terms a,
.cat-links,
.cat-links a {
  color: #dc2626 !important;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.wp-block-post-terms a:hover,
.cat-links a:hover {
  text-decoration: underline;
}

/* Post Dates */
.wp-block-post-date {
  color: #717182;
  font-size: 0.875rem;
}

/* Post Titles */
.wp-block-post-title a {
  text-decoration: none;
  color: inherit;
}

.wp-block-post-title a:hover {
  text-decoration: underline;
}

/* Post Excerpts */
.wp-block-post-excerpt {
  color: #717182;
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */

/* Trending Widget - Border LEFT (RTL) */
.widget-trending {
  border-left: 4px solid #dc2626;
  padding-left: 1rem;
  margin-bottom: 2rem;
}

.widget-trending .wp-block-post-terms a {
  color: #dc2626 !important;
}

/* Most Read Widget */
.widget-most-read {
  background-color: rgba(236, 236, 240, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
}

.widget-most-read ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget-most-read li {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: flex-start;
}

.widget-most-read li:last-child {
  margin-bottom: 0;
}

.post-number,
.ranking-number {
  font-size: 1.5rem;
  color: #dc2626;
  line-height: 1;
  flex-shrink: 0;
  font-weight: 700;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: #000000;
  color: #ffffff;
}

.site-footer .wp-block-heading {
  color: #ffffff;
}

.site-footer .wp-block-paragraph {
  color: #9ca3af;
}

.site-footer .wp-block-navigation a {
  color: #9ca3af !important;
  text-decoration: none;
}

.site-footer .wp-block-navigation a:hover {
  color: #ffffff !important;
}

.site-footer .wp-block-paragraph a {
  color: #9ca3af;
  text-decoration: none;
}

.site-footer .wp-block-paragraph a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ==========================================================================
   Archive & Search Pages
   ========================================================================== */

.archive-header,
.search-header {
  border-bottom: 4px solid #dc2626;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.wp-block-query-title {
  margin: 0 0 0.5rem 0;
}

.wp-block-term-description {
  color: #717182;
  margin: 0;
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.template-404 {
  min-height: 60vh;
}

.error-404-title {
  color: #dc2626;
  font-size: 6rem;
  line-height: 1;
  margin: 0;
}

.error-404-subtitle {
  font-size: 2rem;
  margin: 1rem 0;
}

.error-404-description {
  color: #717182;
  font-size: 1.125rem;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.wp-block-query-pagination {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  gap: 0.5rem;
}

.wp-block-query-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.375rem;
  color: inherit;
  text-decoration: none;
  transition: all 0.2s;
}

.wp-block-query-pagination .page-numbers:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.wp-block-query-pagination .page-numbers.current {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .wp-block-site-title a {
    font-size: 1.5rem;
  }

  .error-404-title {
    font-size: 4rem;
  }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-red-600 {
  color: #dc2626 !important;
}

.bg-red-600 {
  background-color: #dc2626 !important;
}

.border-red-600 {
  border-color: #dc2626 !important;
}

/* Force category links to be red everywhere */
a[class*="cat-"],
a[rel="category"],
a[rel="category tag"],
.wp-block-post-terms a,
.taxonomy-category a {
  color: #dc2626 !important;
}

/* Container max-width */
.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ==========================================================================
   Single Post Page Specific Styles
   ========================================================================== */

/* Back to home link */
.single-post-page .back-to-home {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  color: #717182;
}

.single-post-page .back-to-home:hover {
  color: #dc2626 !important;
  text-decoration: none !important;
}

.single-post-page .back-to-home svg {
  flex-shrink: 0;
}

/* Category badge - Red BG, White text */
.single-post-page .category-badge {
  background: #dc2626 !important;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
}

.single-post-page .category-badge:hover {
  background: #b91c1c !important;
}

/* Post meta - no bullets, with icons */
.single-post-page .block-post-meta {
  list-style: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.single-post-page .block-post-meta a {
  text-decoration: none;
  color: inherit;
}

.single-post-page .block-post-meta a:hover {
  color: #dc2626;
}

/* Tags - Gray BG, Red link */
.single-post-page .tag-link {
  background: #ececf0 !important;
  color: #dc2626 !important;
  text-decoration: none;
  font-weight: 500;
  border-radius: 0.375rem;
}

.single-post-page .tag-link:hover {
  background: #e0e0e4 !important;
  color: #b91c1c !important;
}

/* Social share buttons */
.single-post-page .pattern-social-share-section {
  background: rgba(236, 236, 240, 0.3);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.single-post-page .pattern-social-share-section > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.single-post-page .social-share-buttons {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.single-post-page .share-btn,
.single-post-page .pattern-social-share-section a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.375rem;
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  white-space: nowrap;
  transition: all 0.2s;
}

.single-post-page .share-btn:hover,
.single-post-page .pattern-social-share-section a:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
}

.single-post-page .share-btn svg,
.single-post-page .pattern-social-share-section a svg {
  flex-shrink: 0;
}

.single-post-page .share-btn span,
.single-post-page .pattern-social-share-section a span {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}

/* Related posts grid */
.single-post-page .related-posts .post-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.3s;
}

.single-post-page .related-posts .post-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.single-post-page .related-posts .category-link {
  color: #dc2626 !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
}

.single-post-page .related-posts .category-link:hover {
  color: #b91c1c !important;
}

.single-post-page .related-posts .post-title a {
  color: inherit;
  text-decoration: none;
}

.single-post-page .related-posts .post-title a:hover {
  color: #dc2626;
}

/* Sticky Sidebar - Single Post Only */
.single-post-sidebar {
  position: relative;
}

.single-post-sidebar .sticky {
  position: sticky;
  top: 6rem;
}

/* Trending widget - Red border RIGHT (RTL) */
.single-post-sidebar .widget-trending {
  border-right: 4px solid #dc2626;
  border-left: none !important;
  padding-right: 1rem;
  padding-left: 0;
}

.single-post-sidebar .widget-trending .category-link {
  color: #dc2626 !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
}

.single-post-sidebar .widget-trending .category-link:hover {
  color: #b91c1c !important;
}

.single-post-sidebar .widget-trending .sidebar-post a {
  text-decoration: none;
  color: inherit;
}

.single-post-sidebar .widget-trending .sidebar-post a:hover {
  color: #dc2626;
}

.single-post-sidebar .ranking-number {
  font-size: 2rem;
  color: #dc2626;
  font-weight: 700;
  line-height: 1;
}

/* Most Read widget */
.single-post-sidebar .widget-most-read {
  background: rgba(236, 236, 240, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
}

.single-post-sidebar .widget-most-read .category-link {
  color: #dc2626 !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
}

.single-post-sidebar .widget-most-read .category-link:hover {
  color: #b91c1c !important;
}

.single-post-sidebar .widget-most-read .sidebar-post a {
  text-decoration: none;
  color: inherit;
}

.single-post-sidebar .widget-most-read .sidebar-post a:hover {
  color: #dc2626;
}

/* Comments Section */
.single-post-page .comments-area {
  margin-top: 3rem;
}

.single-post-page .comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.single-post-page .comment {
  list-style: none;
}

.single-post-page .comment-body {
  background: rgba(236, 236, 240, 0.3);
  padding: 1.5rem;
  border-radius: 0.5rem;
}

.single-post-page .comment-author .avatar {
  width: 2.5rem;
  height: 2.5rem;
  background: #dc2626;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.single-post-page .comment-metadata {
  color: #717182;
  font-size: 0.875rem;
}

.single-post-page .comment-content p {
  margin: 0;
  line-height: 1.6;
}

/* Comment Form */
.single-post-page .comment-form input,
.single-post-page .comment-form textarea {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.375rem;
  background: #f3f3f5;
  font-family: "Vazirmatn", sans-serif;
}

.single-post-page .comment-form input:focus,
.single-post-page .comment-form textarea:focus {
  outline: none;
  ring: 2px;
  ring-color: #dc2626;
  border-color: #dc2626;
}

.single-post-page .comment-form button[type="submit"],
.single-post-page .comment-form input[type="submit"],
.single-post-page .wp-block-post-comments-form input[type="submit"],
.single-post-page .wp-block-post-comments-form button[type="submit"] {
  background: #000000 !important;
  color: #ffffff !important;
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.single-post-page .comment-form button[type="submit"]:hover,
.single-post-page .comment-form input[type="submit"]:hover,
.single-post-page .wp-block-post-comments-form input[type="submit"]:hover,
.single-post-page .wp-block-post-comments-form button[type="submit"]:hover {
  background: #1f2937 !important;
}
.single-post-category a {
  display: inline-block;
  padding: 0.375rem 1rem;
  background: #dc2626;
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.single-post-category a:hover {
  background: #b91c1c;
}
.block-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: #717182;
}
.block-post-author,
.block-post-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.single-post-author-name a,
.single-post-date a,
.single-post-date time {
  color: #717182 !important;
  text-decoration: none !important;
}
.single-post-author-name a:hover {
  color: #dc2626 !important;
}
.single-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.single-post-tags::before {
  content: "برچسب‌ها:";
  font-size: 0.875rem;
  color: #717182;
  margin-left: 0.5rem;
}
.single-post-tags a {
  padding: 0.375rem 0.75rem;
  background: #ececf0 !important;
  color: #5c5a5a !important;
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.single-post-tags a:hover {
  background: #e0e0e4 !important;
  color: #262020 !important;
}
