/*
Theme Name: 1XFA News
Theme URI: https://abzarwp.com/onexfa-news
Author: AbzarWP.Com
Author URI: https://abzarwp.com
Description: Fast RTL news theme matching the provided 1XFA screenshots.
Version: 1.0.0
Text Domain: onexfa-news
*/

:root {
  --bg: #e3e3e3;
  --surface: #cdcdcd;
  --text: #1e1e1e;
  --muted: #787878;
  --border: #d8d8d8;
  --primary: #1f346f;
  --chip: #efefef;
  --chip-active: #171717;
  --white: #ffffff;
  --radius-lg: 18px;
  --radius-md: 9px;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  font-family: "YekanBakh", Tahoma, sans-serif;
  line-height: 1.8;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.site-header {
  background: #f1f1f1;
  border-bottom: 1px solid #dbdbdb;
}

.header-shell {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  position: relative;
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: transform .18s ease;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-logo-image {
  display: block;
  max-height: 56px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform .18s ease, opacity .18s ease, filter .18s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
  line-height: 1;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f346f 0%, #315ca0 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.brand-text {
  display: grid;
  gap: 3px;
  color: #16213f;
}

.brand-text b {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-text small {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

.site-logo:hover {
  transform: translateY(-1px);
}

.main-nav a {
  color: #1f1f1f;
  font-size: 31px;
  font-weight: 600;
}

.page-wrap {
  max-width: 760px;
  margin: 48px auto 0;
  padding: 0 18px;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.news-card {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.news-media {
  display: block;
  width: 100%;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #c7c7c7;
  overflow: hidden;
}

.news-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.news-category {
  position: absolute;
  right: 18px;
  top: 18px;
  background: #f4f4f4;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 15px;
  font-weight: 700;
  color: #232323;
}

.news-body {
  display: block;
  padding: 18px 20px 14px;
  border-top: 2px solid #a7b9e9;
}

.news-title {
  display: block;
  margin: 0;
  text-align: right;
  font-size: clamp(19px, 1.7vw, 26px);
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.2px;
}

.news-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(14px, 1.45vw, 22px);
  text-align: right;
}

.news-excerpt {
  margin: 12px 0 16px;
  color: #3a3a3a;
  text-align: right;
  font-size: clamp(14px, 1.3vw, 18px);
  line-height: 2.1;
  max-width: 100%;
}

.news-actions {
  text-align: left;
}

.news-cta {
  visibility: visible;
  opacity: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  height: 44px;
  padding: 0 14px;
  border-radius: 7px;
  color: var(--white);
  background: #22357f;
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 700;
}

.single-post-shell {
  max-width: 1100px;
  margin: 28px auto 0;
  padding: 0 24px 40px;
}

.single-post-hero {
  display: flex;
  justify-content: center;
  margin: 18px 0 34px;
}

.single-post-hero img {
  width: min(100%, 360px);
  height: auto;
  border-radius: 6px;
}

.single-post-header {
  text-align: right;
  margin-bottom: 26px;
}

.single-post-category {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #1f1f1f;
}

.single-post-title {
  margin: 0 0 14px;
  color: #121212;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.45;
  font-weight: 800;
}

.single-post-meta {
  color: var(--muted);
  font-size: clamp(14px, 1.2vw, 18px);
}

.single-post-content {
  color: #1f1f1f;
  font-size: clamp(18px, 1.45vw, 22px);
  line-height: 2.15;
  text-align: right;
}

.single-post-content > *:first-child {
  margin-top: 0;
}

.single-post-content > *:last-child {
  margin-bottom: 0;
}

.single-post-content p,
.single-post-content ul,
.single-post-content ol,
.single-post-content blockquote,
.single-post-content h1,
.single-post-content h2,
.single-post-content h3,
.single-post-content h4,
.single-post-content h5,
.single-post-content h6 {
  margin: 0 0 18px;
}

.single-post-content p {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.single-post-content h2,
.single-post-content h3 {
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 1.6;
  font-weight: 800;
}

.single-post-content img {
  display: block;
  margin: 22px auto;
  max-width: 100%;
  height: auto;
}

.pagination-wrap {
  margin: 40px 0 68px;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
}

.pagination .page-numbers {
  min-width: 56px;
  height: 52px;
  border-radius: 14px;
  background: #f7f7f7;
  color: #1f1f1f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  padding: 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.pagination a.page-numbers:hover,
.pagination a.page-numbers:focus-visible {
  transform: translateY(-1px);
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.pagination .page-numbers.dots {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  min-width: 30px;
  padding: 0 8px;
  color: #7a7a7a;
}

.pagination .page-numbers.current {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.2);
}

.site-footer {
  margin-top: 56px;
  padding: 40px 24px 22px;
  background: #f1f1f1;
  border-top: 1px solid #d4d4d4;
}

.footer-shell {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) minmax(220px, 1fr) minmax(180px, 0.8fr);
  gap: 28px;
  align-items: start;
}

.footer-brand,
.footer-latest,
.footer-links {
  min-width: 0;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.footer-brand p {
  max-width: 360px;
  margin: 12px 0 0;
  color: #555555;
  font-size: 14px;
  line-height: 1.9;
}

.footer-latest h2,
.footer-links h2 {
  margin: 0 0 12px;
  color: #151515;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-list li {
  margin: 0 0 8px;
  color: #333333;
  font-size: 14px;
  line-height: 1.7;
}

.footer-list a {
  color: inherit;
  transition: color 0.2s ease;
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--primary);
}

.footer-copy {
  max-width: 1200px;
  margin: 30px auto 0;
  padding-top: 18px;
  border-top: 1px solid #d8d8d8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  text-align: center;
  color: #555555;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 991px) {
  .header-shell {
    min-height: 68px;
    padding: 0 14px;
  }

  .site-logo {
    width: auto;
    height: auto;
    border-radius: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 14px;
  }

  .brand-text b {
    font-size: 18px;
  }

  .brand-text small {
    font-size: 9px;
    letter-spacing: 1.5px;
  }

  .header-actions {
    gap: 12px;
  }

  .main-nav a {
    font-size: 22px;
  }

  .page-wrap {
    margin-top: 18px;
    padding: 0 12px;
  }

  .news-grid {
    gap: 14px;
  }

  .news-category {
    right: 8px;
    top: 8px;
    font-size: 11px;
    border-radius: 5px;
    padding: 3px 8px;
  }

  .news-body {
    padding: 12px;
  }

  .news-title {
    font-size: 21px;
  }

  .news-meta {
    font-size: 13px;
  }

  .news-excerpt {
    font-size: 13px;
    margin: 8px 0 10px;
    line-height: 1.8;
  }

  .news-actions {
    text-align: left;
  }

  .news-cta {
    min-width: 96px;
    height: 34px;
    font-size: 12px;
    border-radius: 5px;
    padding: 0 12px;
  }

  .pagination-wrap {
    margin: 18px 0 28px;
  }

  .pagination {
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
  }

  .pagination .page-numbers {
    min-width: 40px;
    height: 34px;
    font-size: 14px;
    border-radius: 10px;
    padding: 0 10px;
  }

  .site-footer {
    margin-top: 32px;
    padding: 28px 16px 18px;
  }

  .footer-shell {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .footer-logo {
    font-size: 24px;
  }

  .footer-brand p {
    max-width: none;
    font-size: 13px;
  }

  .footer-copy {
    margin-top: 24px;
    justify-content: flex-start;
    text-align: right;
    font-size: 12px;
  }
}

/* Surface and background elements should rely on variables */
.site-header { background: var(--surface); border-bottom-color: var(--border); }
.news-card { background: var(--surface); }
.news-body { border-top-color: var(--primary); color: var(--text); }
.news-excerpt, .footer-brand p, .footer-copy { color: var(--muted); }
.main-nav a { color: var(--text); }
.news-cta { background: var(--primary); }
.footer-copy { border-top-color: var(--border); background: transparent; }
