/*
Theme Name: CoreTech
Theme URI: https://coretech.cam
Author: abolfazl
Description: قالب اختصاصی CoreTech برای اخبار تکنولوژی
Version: 1
*/

/* ===========================
   فونت اصلی: Vazir
   =========================== */
@font-face {
  font-family: "Vazir";
  src: url("../fonts/Vazir-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazir";
  src: url("../fonts/Vazir-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazir";
  src: url("../fonts/Vazir-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazir";
  src: url("../fonts/Vazir-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===========================
   رنگ‌ها و متغیرهای پایه
   =========================== */
:root {
  --radius: 8px;
  --transition: 0.3s ease;
  --font-main: "Vazir", system-ui, sans-serif;

  /* حالت پیش‌فرض: تیره */
  --color-bg: #111;
  --color-card: #1b1b1b;
  --color-border: #333;
  --color-text: #e0e0e0;
  --color-subtext: #aaa;
  --color-accent: #bbb;
  --color-hover: #222;
  --color-button-bg: #2a2a2a;
  --color-button-text: #fff;
}

/* حالت روشن */
body[data-mode="light"] {
  --color-bg: #ffffff;
  --color-card: #f3f3f3;
  --color-border: #ddd;
  --color-text: #111;
  --color-subtext: #444;
  --color-accent: #333;
  --color-hover: #e9e9e9;
  --color-button-bg: #e0e0e0;
  --color-button-text: #111;
}

/* حالت تیره */
body[data-mode="dark"] {
  --color-bg: #1d1d1d;
  --color-card: #2a2a2a;
  --color-border: #444;
  --color-text: #f1f1f1;
  --color-subtext: #bbb;
  --color-accent: #ccc;
  --color-hover: #333;
  --color-button-bg: #333;
  --color-button-text: #fff;
}

/* مشکی کامل */
body[data-mode="black"] {
  --color-bg: #000;
  --color-card: #0d0d0d;
  --color-border: #222;
  --color-text: #e5e5e5;
  --color-subtext: #999;
  --color-accent: #888;
  --color-hover: #111;
  --color-button-bg: #111;
  --color-button-text: #eee;
}

/* ===========================
   ساختار پایه
   =========================== */
body {
  margin: 0;
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  scroll-behavior: smooth;
  transition: background var(--transition), color var(--transition);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--color-accent);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* عنوان بخش‌ها */
.section-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0.5rem 0 0.5rem 0;
  border-right: 4px solid var(--color-accent);
  padding-right: 10px;
  display: inline-block;
}

/* ===== CoreTech — Editors Picks */

.coretech-editors-picks {
  margin: 1rem auto 1rem auto;
  width: min(95%, 1200px);
}

.coretech-editors-picks .section-title {
  margin-bottom: 0.8rem;
  display: block;
}

.main-post-wrapper {
  margin-bottom: 1.5rem;
}

.main-post {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.main-post .thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform var(--transition);
}

.main-post:hover .thumb img {
  transform: none;
}

.main-post .overlay-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}
.main-post .overlay-title h3 {
  font-size: 1.25rem;
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
  font-weight: 500;
  transition: none;
}

.main-post:hover .overlay-title h3 {
  color: var(--color-text);
}

@media (max-width: 768px) {
  .main-post .overlay-title h3 {
    font-size: 1.05rem;
    font-weight: 400;
  }
}

/* پست‌های کوچک */
.side-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.side-post {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), background var(--transition);
}
.side-post:hover {
  transform: translateY(-3px);
  background: var(--color-hover);
}
.side-post .thumb img {
  width: 100px;
  height: 65px;
  object-fit: cover;
}
.side-post .title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
  transition: color var(--transition);
}
.side-post:hover .title {
  color: var(--color-accent);
}

/* ======================
   آخرین نوشته‌ها
   ====================== */
.coretech-latest-posts {
  margin: 0.9rem auto 0.2rem auto;
  width: min(95%, 1200px);
}

.latest-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.latest-post {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), background var(--transition);
}
.latest-post:hover {
  transform: translateY(-5px);
  background: var(--color-hover);
}
.latest-post .thumb img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.latest-post .post-info {
  padding: 0.8rem;
  text-align: right;
}
.latest-post .title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 0 0 0.5rem 0;
  transition: color var(--transition);
}
.latest-post:hover .title {
  color: var(--color-accent);
}
.latest-post .meta {
  font-size: 0.85rem;
  color: var(--color-subtext);
}

/* ======================
   نسخه موبایل
   ====================== */
@media (max-width: 768px) {
  .side-row {
    grid-template-columns: 1fr;
  }
  .latest-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 0 !important;
  }
  .latest-post {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding: 0;
  }
  .latest-post .thumb {
    flex: 0 0 100px;
    margin-left: 12px;
  }
  .latest-post .thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
  }
}

/* ======================
   دکمه‌ها
   ====================== */
button,
.coretech-mode-switch button {
  background: var(--color-button-bg);
  color: var(--color-button-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
button:hover,
.coretech-mode-switch button:hover {
  background: var(--color-accent);
  color: var(--color-bg);
}

/* ======================
   جست‌وجوی AJAX CoreTech
   ====================== */
.coretech-search-trigger {
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease;
}
.coretech-search-trigger:hover {
  transform: scale(1.1);
}
.coretech-search-trigger img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: invert(80%);
}

.coretech-loadmore-wrapper {
  text-align: center;
  margin-top: 1rem;
}

.coretech-loadmore-btn {
  position: relative;
  display: inline-block;
  background: linear-gradient(145deg, #5a5a5a, #4a4a4a);
  color: #f2f2f2;
  padding: 14px 36px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.coretech-loadmore-btn:hover {
  background: linear-gradient(145deg, #6a6a6a, #5a5a5a);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.coretech-loadmore-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.coretech-loadmore-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.15), transparent, rgba(255,255,255,0.05));
  transition: all 0.5s ease;
}

.coretech-loadmore-btn:hover::after {
  left: 100%;
}

.coretech-loadmore-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ======================
   CoreTech - نوشته‌های ویژه (Featured Posts)
   ====================== */

.latest-post.featured {
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-card);
  overflow: hidden;
  transition: none;
}

.latest-post.featured:hover {
  transform: none;
  background: var(--color-card);
}

.latest-post.featured a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.latest-post.featured .thumb img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}


.latest-post.featured .post-info {
  padding: 0.8rem;
  text-align: right;
}

.latest-post.featured .title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.latest-post.featured .meta {
  font-size: 0.85rem;
  color: var(--color-subtext);
}

/* ======================
   حالت موبایل (کارت ویژه)
   ====================== */
@media (max-width: 768px) {
  .latest-post.featured {
    display: block;
    border: none;
    margin: 5%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-card);
    padding-bottom: 12px;
    position: relative;
  }

  .latest-post.featured .thumb {
    width: 100%;
    margin: 0;
  }

  .latest-post.featured .thumb img {
    width: 100%;
    aspect-ratio: 5 / 3;
    object-fit: cover;
    display: block;
    border-radius: var(--radius);
  }

  .latest-post.featured .post-info {
    padding: 12px 8px 0 8px;
    text-align: right;
  }

  .latest-post.featured .title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--color-text);
  }

  .latest-post.featured .meta {
    font-size: 0.9rem;
    color: var(--color-subtext);
  }

  .latest-post.featured::after {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    background-color: var(--color-accent);
    position: absolute;
    bottom: 0;
    left: 0;
  }
}

/* footer button below both columns */
  .featured-footer {
    flex-basis: 100%;
    text-align: center;
    margin-top: 12px;
  }
}

/* MOBILE adjustments: stacked list with small paddings */
@media (max-width:768px) {
  .featured-list { grid-template-columns: 1fr; gap:6px; }
  .featured-side-item > .featured-side-link,
  .featured-side-item > a { padding:8px; }
  .side-thumb { width:72px; flex-basis:72px; }
}

/* footer button */
.featured-footer { text-align:center; margin-top:10px; }
.featured-footer .view-all-btn {
  display:inline-block;
  padding:10px 22px;
  border-radius:10px;
  font-weight:700;
  font-size:0.95rem;
  text-decoration:none;
  color: var(--color-button-text, #fff);
  background: linear-gradient(145deg, rgba(120,120,120,0.95), rgba(80,80,80,0.95));
  border:1px solid rgba(255,255,255,0.03);
  box-shadow:0 6px 14px rgba(0,0,0,0.15);
}

/* safety */
.coretech-featured-category, .coretech-featured-category * { box-sizing:border-box; max-width:100%; }

/* ===============================
   CoreTech - Featured Category (Final v3)
   Responsive section for "نقد و بررسی"
   =============================== */

.coretech-featured-category {
  margin: 0.5rem auto 0.2rem auto;
  max-width: 1200px;
  padding: 0 10px;
  box-sizing: border-box;
}

/* Header */
.featured-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.featured-header .section-title {
  font-size: 1.3rem;
  font-weight: 700;
}
.featured-header .view-all {
  display: none !important;
}

/* Featured Main Post (شاخص) */
.featured-main {
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-card);
  position: relative;
}
.featured-main-item .featured-thumb {
  width: 100%;
  aspect-ratio: 7 / 5;
}
.featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.28), rgba(0,0,0,0.12));
  pointer-events: none;
}
.featured-title {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  z-index: 2;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

/* Featured List Container */
.featured-list {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

/* Side Items */
.featured-side-item {
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-card);
  transition: background 0.18s ease, transform 0.18s ease;
}
.featured-side-item > .featured-side-link,
.featured-side-item > a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}
.side-thumb {
  flex: 0 0 88px;
  width: 88px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
}
.side-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.side-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.25;
  color: var(--color-text);
  font-weight: 600;
  word-break: break-word;
  overflow: hidden;
  display: block;
}

/* Hover */
.featured-side-item:hover > .featured-side-link,
.featured-side-item:hover > a {
  background: var(--color-hover);
  transform: translateY(-3px);
}

/* Footer */
.featured-footer {
  text-align: center;
  margin-top: 10px;
}
.featured-footer .view-all-btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--color-button-text, #fff);
  background: linear-gradient(145deg, rgba(120,120,120,0.95), rgba(80,80,80,0.95));
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

/* ======= Layouts ======= */

/* MOBILE (Default) */
@media (max-width: 768px) {
  .featured-thumb { aspect-ratio: 3 / 2; }
  .featured-list { grid-template-columns: 1fr; gap: 6px; }
  .featured-side-item > .featured-side-link,
  .featured-side-item > a { padding: 8px; }
  .side-thumb { width: 72px; flex-basis: 72px; }
}

/* LAPTOP & DESKTOP (apply desktop layout only above 1024px) */
@media (min-width: 1024px) {
  .featured-grid {
    display: flex;
    align-items: stretch;
    gap: 12px;
  }

  .featured-main {
    flex: 0 0 65%; /* شاخص در سمت چپ */
  }

  .featured-list {
    flex: 0 0 35%; /* ۶ نوشته در سمت راست */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .featured-side-item {
    flex: 1;
  }

  .featured-side-item > .featured-side-link,
  .featured-side-item > a {
    padding: 10px;
  }

  .side-thumb {
    flex-basis: 80px;
    width: 80px;
  }

  .side-title {
    font-size: 0.95rem;
  }
}

/* Safety */
.coretech-featured-category, .coretech-featured-category * {
  box-sizing: border-box;
  max-width: 100%;
}

/* ===============================
   تنظیمات عمومی و ضد اسکرول
   =============================== */
html, body {
  overflow-x: hidden !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

.coretech-special-category,
.coretech-special-category * {
  max-width: 100%;
}

/* ======================
   محبوب‌ترین نوشته‌ها (Most Popular)
   ====================== */
.coretech-most-popular {
  margin: 0.5rem auto 1rem auto;
  width: min(90%, 1200px);
  text-align: center;
}

.coretech-most-popular .section-header {
  text-align: right;
  margin-bottom: 0.5rem;
}

.popular-posts-grid {
  display: grid;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}

.popular-post {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), background var(--transition);
}

.popular-post:hover {
  transform: translateY(-5px);
  background: var(--color-hover);
}

.popular-post .thumb img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.popular-post .post-info {
  padding: 0.8rem;
  text-align: right;
}

.popular-post .title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 0;
  transition: color var(--transition);
}

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

/* نوشته‌ها) */
@media (max-width: 768px) {
  .popular-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 0 !important;
  }

  .popular-post {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding: 0;
  }

  .popular-post .thumb {
    flex: 0 0 100px;
    margin-left: 12px;
  }

  .popular-post .thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
  }
}

/* نسخه لپ‌تاپ / دسکتاپ عریض */
@media (min-width: 1200px) {
  .popular-posts-grid {
    grid-template-columns: repeat(4, minmax(260px, 1fr));
    width: 80%;
    margin-inline: auto;
  }
}

/* ================================
SINGLE POST - MOBILE ONLY (0–900px)
FINAL + CLEAN + MERGED
================================ */

@media (max-width: 900px) {

.coretech-single {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.single-inner {
  display: block;
  padding: 0;
  margin: 0;
}

/* -------------------------------
Featured Image
------------------------------- */
.single-thumb {
  width: 100%;
  margin: 0;
  padding: 0;
}

.single-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0 !important;
}

/* -------------------------------
Taxonomies
------------------------------- */
.single-tax {
  padding: 0 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-subtext);
  direction: rtl;
}

.single-tax a {
  color: inherit;
  text-decoration: none;
}

.dot {
  margin: 0 0.35rem;
}

/* -------------------------------
Title
------------------------------- */
.single-title {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.1rem;
  padding: 0 1rem;
  line-height: 1.6;
  color: var(--color-text);
}

/* -------------------------------
Top Meta (author | time | repost)
------------------------------- */
.single-meta-row {
  margin-top: -1rem;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.1rem;
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-subtext);
  direction: rtl;
}

.meta-sep {
  opacity: 0.6;
}

.single-repost-btn,
.coretech-mode-switch button {
  background: var(--color-button-bg);
  color: var(--color-button-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-size: 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.single-repost-btn:hover,
.coretech-mode-switch button:hover {
  background: var(--color-accent);
  color: var(--color-bg);
}

/* -------------------------------
Content
------------------------------- */
.single-content {
  padding: 0 1rem;
  margin-top: 0.3rem;
  font-size: 0.95rem;
  line-height: 1.8;
  font-weight: 400;
  color: var(--color-text);
}

.single-content p {
  margin-bottom: 0.3rem;
}

.single-content img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.5rem 0;
  border-radius: 0;
  object-fit: cover;
}

/* -------------------------------
Bottom Meta
------------------------------- */
.single-meta-bottom {
  margin-top: 0.5rem;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-subtext);
}

/* -------------------------------
Separator Line (1px Gray)
------------------------------- */
.single-sep-line {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin: 0.5rem 0;
}

/* -------------------------------
Editors Picks
------------------------------- */
.single-editors-picks {
  margin-top: 0.5rem;
  padding: 0 1rem;
}

/* -------------------------------
Comments
------------------------------- */
.single-comments {
  padding: 0 1rem;
  margin-top: 1rem;
}


/* =========================================================
RELATED POSTS — MOBILE
۱۰۰٪ هماهنگ با Latest Posts موبایل
========================================================= */
.single-related-mobile,
.sidebar-related {
  padding: 0 1rem;
  margin-top: 1rem;
}

.related-grid,
.sidebar-related-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.related-item,
.sidebar-related-item {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 12px;
  padding: 0;
  border-bottom: 1px solid var(--color-border);
}

.related-item a,
.sidebar-related-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 0;
  text-decoration: none;
  color: inherit;
}

.related-item img,
.sidebar-related-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 100px;
}

.related-item h4,
.sidebar-related-item h4 {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
}

/* =========================================================
POPULAR POSTS — MOBILE
۱۰۰٪ هماهنگ با Latest Posts موبایل
========================================================= */
.single-popular-mobile,
.sidebar-popular {
  padding: 0 1rem;
  margin-top: 1rem;
}

.popular-list-mobile,
.sidebar-popular-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.popular-item-mobile,
.sidebar-popular-item {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 12px;
  padding: 0;
  border-bottom: 1px solid var(--color-border);
}

.popular-item-mobile a,
.sidebar-popular-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 0;
  text-decoration: none;
  color: inherit;
}

.popular-item-mobile img,
.sidebar-popular-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 100px;
}

.popular-item-mobile h4,
.sidebar-popular-item h4 {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
}

/* Visibility */
.single-related-mobile,
.single-popular-mobile,
.sidebar-related,
.sidebar-popular {
  display: block;
}

}

/* ================================
SINGLE POST — DESKTOP FIXES (≥901px)
================================ */

@media (min-width: 901px) {

  /* container */
  .coretech-single {
    width: 100%;
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
  }

  .single-inner {
    display: flex;
    flex-direction: row;
    gap: 32px;
    align-items: flex-start;
    justify-content: space-between;
  }

  .single-main,
  .single-inner > article.single-article {
    flex: 0 0 70%;
    max-width: 70%;
    box-sizing: border-box;
  }

  .single-sidebar {
    flex: 0 0 30%;
    max-width: 30%;
    box-sizing: border-box;
    display: block;
  }

  .single-sidebar {
    min-width: 300px;
  }

  /* ---------------------------
     Ensure main inner spacing matches mobile styles
     (no visual changes to single content styles)
     --------------------------- */
  .single-main .single-thumb img { border-radius: 0 !important; }
  .single-main .single-tax,
  .single-main .single-title,
  .single-main .single-meta-row,
  .single-main .single-content,
  .single-main .single-meta-bottom,
  .single-main .single-sep-line,
  .single-main .single-editors-picks,
  .single-main .single-comments {
    padding-inline: 0;
    margin: 0;
  }

  .single-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
  }

  .single-meta-row .meta-left,
  .single-meta-row .meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .single-meta-row .meta-left {
    direction: rtl;
    font-weight: 300;
    color: var(--color-subtext);
    white-space: nowrap;
    font-size: 0.95rem;
  }

  .single-meta-row .meta-right {
    flex: 0 0 auto;
    direction: ltr;
  }

  .single-repost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-button-bg);
    color: var(--color-button-text);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .single-repost-btn:hover {
    background: var(--color-accent);
    color: var(--color-bg);
  }

  .single-meta-row { flex-wrap: nowrap; }
  .single-meta-row .meta-left { overflow: hidden; text-overflow: ellipsis; }

  .sidebar-inner { padding: 0; }

  .sidebar-related,
  .sidebar-popular {
    margin-bottom: 1.25rem;
  }

  .sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--color-text);
  }

  .sidebar-related-list,
  .sidebar-popular-list {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .sidebar-related-item,
  .sidebar-popular-item {
    display: flex;
    flex-direction: row-reverse; /* image left in RTL layout */
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
  }
  
  .sidebar-related-item a,
  .sidebar-popular-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-decoration: none;
    color: inherit;
    padding: 6px 0;
  }

  .sidebar-related-item img,
  .sidebar-popular-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    flex: 0 0 100px;
  }

  .sidebar-related-item h4,
  .sidebar-popular-item h4 {
    margin: 0;
    font-size: 0.97rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--color-text);
  }

  .single-sidebar { position: relative; }

  @supports (display: grid) {
    .single-inner { align-items: flex-start; }
  }
}

/* ----------------------
  Single post layout (desktop)
  - 70% content, 30% sidebar
  - container relative for absolute anchoring
------------------------*/
@media (min-width: 901px) {

  .single-inner {
    position: relative;
    display: flex;
    gap: 2%;
    align-items: flex-start;
  }

  .single-article {
    width: 68%;
    min-width: 0;
  }

  .single-sidebar {
    width: 30%;
  }

  .sidebar-sticky {
    position: relative;
  }
}

@media (max-width: 900px) {
  .mobile-before-comments { display: block; margin-top: 1rem; }
}

.single-inner { box-sizing: border-box; }

/* ======================
   آرشیو نوشته‌ها
   ====================== */
.coretech-archive-posts {
  margin: 0.9rem auto 0.2rem auto;
  width: min(95%, 1200px);
}

.archive-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.archive-post {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), background var(--transition);
}
.archive-post:hover {
  transform: translateY(-5px);
  background: var(--color-hover);
}
.archive-post .thumb img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.archive-post .post-info {
  padding: 0.8rem;
  text-align: right;
}
.archive-post .title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 0 0 0.5rem 0;
  transition: color var(--transition);
}
.archive-post:hover .title {
  color: var(--color-accent);
}
.archive-post .meta {
  font-size: 0.85rem;
  color: var(--color-subtext);
}

/* ======================
   نسخه موبایل آرشیو – اصلاح‌شده
   ====================== */
@media (max-width: 768px) {

  .coretech-archive .latest-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 0 !important;
  }

  .coretech-archive .latest-post a {
    display: flex !important;
    flex-direction: row-reverse;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding: 0;
    gap: 0;
    width: 100%;
  }

  .coretech-archive .latest-post {
    background: var(--color-card);
    border-radius: 0;
    overflow: hidden;
    padding: 0;
  }

  .coretech-archive .latest-post .thumb {
    flex: 0 0 100px;
    margin-left: 12px;
  }

  .coretech-archive .latest-post .thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .coretech-archive .latest-post .post-info {
    padding: 0.6rem 0 0.6rem 0;
  }
}

.archive-description {
  margin: 0.8rem 0 1.2rem;
  padding: 0.9rem 1.1rem;
  background: var(--color-card);
  border-left: 4px solid var(--color-accent);
  color: var(--color-text);
  line-height: 1.7;
  border-radius: var(--radius);
  font-size: 0.96rem;
}

@media (max-width: 768px) {
  .archive-description {
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
  }
}