/* Global refinement for Mr.ChatGPT — light first, mobile focused */
:root {
  --mc-refresh-bg: #f5f8fd;
  --mc-refresh-surface: #fff;
  --mc-refresh-soft: #eef4fc;
  --mc-refresh-ink: #14233d;
  --mc-refresh-muted: #607089;
  --mc-refresh-blue: #147df5;
  --mc-refresh-line: rgba(28,76,135,.13);
  --mc-refresh-shadow: 0 20px 56px rgba(34,71,119,.12);
}
html[data-mc-theme="dark"] {
  --mc-refresh-bg: #101a30;
  --mc-refresh-surface: #15233d;
  --mc-refresh-soft: #1a2b49;
  --mc-refresh-ink: #f3f7fd;
  --mc-refresh-muted: #a7b6c9;
  --mc-refresh-blue: #2e8cff;
  --mc-refresh-line: rgba(139,190,255,.15);
  --mc-refresh-shadow: 0 22px 58px rgba(0,0,0,.25);
}

body {
  background: var(--mc-refresh-bg) !important;
  color: var(--mc-refresh-ink);
  font-family: 'Vazirmatn','dana',Tahoma,sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body :is(#wrapper,#main,.page-wrapper,.blog-wrapper,.shop-page-title) { background-color: transparent !important; }
body :is(p,li,td,th,label,input,textarea,select,button) { line-height: 1.85; }
body img { image-rendering: auto; }

/* Header */
#header .header-main {
  border-bottom: 1px solid var(--mc-refresh-line) !important;
  background: rgba(255,255,255,.9) !important;
  box-shadow: 0 10px 35px rgba(33,69,116,.08) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
html[data-mc-theme="dark"] #header .header-main { background: rgba(7,13,26,.91) !important; box-shadow: 0 12px 35px rgba(0,0,0,.26) !important; }
#header .header-inner { min-height: 76px; }
#header #logo img { max-height: 66px !important; object-fit: contain; }
#header .header-nav-main { border-color: var(--mc-refresh-line) !important; }
#header .nav > li > a { font-weight: 800; letter-spacing: -.01em; }
#header .header-button .button { box-shadow: none !important; }

/* Better focus and buttons */
body :is(a,button,input,select,textarea):focus-visible { outline: 3px solid rgba(20,125,245,.3); outline-offset: 3px; }
body .button:not(.icon), body button:not(.icon) { border-radius: 13px; }

/* Blog, category, author and search archives */
.blog-wrapper.blog-archive { padding: 48px 0 80px; }
.blog-archive .archive-page-header { margin: 0 auto 28px; padding: 0 18px; }
.blog-archive .archive-page-header .row { max-width: 1180px; }
.blog-archive .page-title {
  display: inline-block;
  margin: 0;
  padding: 13px 23px;
  border: 1px solid var(--mc-refresh-line);
  border-radius: 999px;
  color: var(--mc-refresh-ink) !important;
  background: rgba(255,255,255,.72);
  box-shadow: 0 12px 35px rgba(34,71,119,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: clamp(21px,3vw,34px) !important;
  line-height: 1.5;
  text-transform: none !important;
}
html[data-mc-theme="dark"] .blog-archive .page-title { background: rgba(20,35,61,.82); }
.blog-archive > .row.align-center { max-width: 1180px; width: calc(100% - 32px); }
.blog-archive > .row.align-center > .col { flex-basis: 100%; max-width: 100%; padding: 0; }
.blog-archive #post-list {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 22px;
}
.blog-archive #post-list article { margin: 0 !important; min-width: 0; }
.blog-archive article .article-inner {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--mc-refresh-line);
  border-radius: 26px;
  background: var(--mc-refresh-surface) !important;
  box-shadow: var(--mc-refresh-shadow);
}
.blog-archive article .entry-header { flex: 0 0 auto; }
.blog-archive article .entry-image {
  width: calc(100% - 28px);
  margin: 14px auto 0 !important;
  overflow: visible;
  border-radius: 19px;
  background: var(--mc-refresh-soft);
}
.blog-archive article .entry-image > a {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: inherit;
}
.blog-archive article .entry-image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 auto !important;
  object-fit: cover !important;
  object-position: center center !important;
}
.blog-archive article .post-date {
  top: 12px !important;
  right: 12px !important;
  left: auto !important;
  width: 62px;
  height: 68px;
  z-index: 3;
}
.blog-archive article .post-date .badge-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  border: 1px solid rgba(255,255,255,.4) !important;
  border-radius: 17px !important;
  color: #fff !important;
  background: linear-gradient(145deg,#2694ff,#0866ca) !important;
  box-shadow: 0 12px 25px rgba(9,97,198,.28);
}
.blog-archive article .entry-header-text { padding: 22px 24px 10px; }
.blog-archive article .entry-category { margin-bottom: 8px; }
.blog-archive article .entry-category a { color: var(--mc-refresh-blue) !important; font-weight: 900; }
.blog-archive article .entry-title { margin: 0; font-size: clamp(18px,2vw,24px); line-height: 1.75; }
.blog-archive article .entry-title a { color: var(--mc-refresh-ink) !important; }
.blog-archive article .entry-divider { margin: 14px auto 10px; background: var(--mc-refresh-blue); opacity: .65; }
.blog-archive article .entry-meta { color: var(--mc-refresh-muted) !important; font-size: 11px; text-transform: none !important; }
.blog-archive article .entry-meta :is(a,span,time) { color: inherit !important; }
.blog-archive article .entry-content { flex: 1; display: flex; padding: 0 24px 22px; }
.blog-archive article .entry-summary { width: 100%; display: flex; flex-direction: column; }
.blog-archive article .entry-summary > p { margin: 0 0 18px; color: var(--mc-refresh-muted) !important; font-size: 13px; line-height: 2; }
.blog-archive article .entry-summary .text-center { margin-top: auto; }
.blog-archive article .more-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  border: 0 !important;
  border-radius: 12px !important;
  color: #fff !important;
  background: linear-gradient(135deg,#218dff,#0b67d2) !important;
  box-shadow: 0 12px 25px rgba(20,125,245,.2);
  font-size: 12px;
  font-weight: 900;
}
.blog-archive article > .article-inner > footer.entry-meta {
  margin: 0 24px;
  padding: 16px 0 20px;
  border-top: 1px solid var(--mc-refresh-line);
}
.blog-archive article > .article-inner > footer.entry-meta .comments-link { float: none !important; }
.blog-archive .navigation.pagination { grid-column: 1 / -1; margin-top: 10px; }
.blog-archive .page-numbers { border-radius: 12px !important; }

/* WooCommerce/product archives */
.shop-container .products .product-small > .col-inner,
.related-products-wrapper .product-small > .col-inner {
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--mc-refresh-line);
  border-radius: 22px;
  background: var(--mc-refresh-surface);
  box-shadow: 0 16px 43px rgba(34,71,119,.09);
}
.shop-container .product-small .box-image,
.related-products-wrapper .product-small .box-image { margin: 13px auto 0; width: calc(100% - 26px); border-radius: 16px; overflow: hidden; }
.shop-container .product-small .box-image img,
.related-products-wrapper .product-small .box-image img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.shop-container .product-small .box-text,
.related-products-wrapper .product-small .box-text { padding: 18px; text-align: center; }

/* Single article readability */
.single-post .article-inner,
.page:not(.home) .page-inner {
  border-radius: 24px;
}
.single-post .entry-image img,
.page:not(.home) .entry-content > p > img,
.page:not(.home) .entry-content figure img {
  display: block;
  margin-inline: auto;
  border-radius: 18px;
}
.single-post .entry-content { font-size: 16px; line-height: 2.1; }
.single-post .entry-content :is(h2,h3) { color: var(--mc-refresh-ink); line-height: 1.65; }

/* Floating Telegram control should not cover content */
#qlwapp .qlwapp-toggle,
.qlwapp .qlwapp-toggle,
body .telegram-chat-widget,
body a[href*="t.me"].floating-button {
  box-shadow: 0 13px 33px rgba(13,129,190,.25) !important;
}

/* Footer */
#footer, .footer-wrapper, .absolute-footer { border-top-color: var(--mc-refresh-line) !important; }
#footer .widget-title { color: var(--mc-refresh-ink) !important; font-weight: 950; }
#footer :is(p,li,a,span) { line-height: 1.9; }

/* Mobile refinements */
@media (max-width: 849px) {
  #header .header-inner { min-height: 72px; padding-inline: 14px; }
  #header #logo { width: 78px !important; margin-inline: auto; }
  #header #logo img { max-height: 64px !important; }
  #header .mobile-nav { gap: 4px; }
  #header .mobile-nav .button.circle,
  #header .mobile-nav > li > a { width: 44px; min-width: 44px; height: 44px; padding: 0 !important; display: grid; place-items: center; border-radius: 50% !important; }
  #header .icon-menu { font-size: 25px; }
  .blog-wrapper.blog-archive { padding-top: 28px; }
  .blog-archive #post-list { grid-template-columns: 1fr; gap: 18px; }
  .blog-archive > .row.align-center { width: calc(100% - 22px); }
  .blog-archive .archive-page-header { margin-bottom: 20px; }
  .blog-archive .page-title { width: auto; max-width: calc(100% - 16px); padding: 10px 18px; font-size: 21px !important; }
  .blog-archive article .article-inner { border-radius: 22px; }
  .blog-archive article .entry-image { width: calc(100% - 24px); margin-top: 12px !important; border-radius: 16px; }
  .blog-archive article .entry-header-text { padding: 18px 18px 8px; }
  .blog-archive article .entry-title { font-size: 20px; line-height: 1.75; }
  .blog-archive article .entry-content { padding: 0 18px 19px; }
  .blog-archive article .entry-summary > p { font-size: 13px; line-height: 1.95; }
  .blog-archive article > .article-inner > footer.entry-meta { margin: 0 18px; }
  .blog-archive article .post-date { width: 55px; height: 62px; top: 9px !important; right: 9px !important; }
  #qlwapp .qlwapp-toggle,
  .qlwapp .qlwapp-toggle { width: 54px !important; height: 54px !important; bottom: 14px !important; left: 14px !important; right: auto !important; }
  .single-post .entry-content { font-size: 15px; }
}

@media (max-width: 480px) {
  #header .header-inner { padding-inline: 9px; }
  #header #logo { width: 70px !important; }
  #header .mobile-nav .button.circle,
  #header .mobile-nav > li > a { width: 41px; min-width: 41px; height: 41px; }
  .blog-archive .entry-meta .byline { display: none; }
  .blog-archive article .entry-summary > p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

/* Compact desktop navigation and readable account name */
@media (min-width: 850px) {
  #masthead .hide-for-medium.flex-left,
  #masthead .hide-for-medium.flex-left .header-nav-main { min-width: 0; }

  #masthead .hide-for-medium.flex-left .header-nav-main {
    flex-wrap: nowrap !important;
    white-space: nowrap;
    align-items: center;
  }

  #masthead .hide-for-medium.flex-left .header-nav-main > li { flex: 0 0 auto; }

  #masthead .hide-for-medium.flex-left .header-nav-main > li > a.nav-top-link {
    padding-inline: 7px !important;
    font-size: 13px !important;
  }
}

#header .account-item .header-button > a,
#header .account-item .header-button > a span,
#header .account-item a.nav-top-link,
#header .account-item a.nav-top-link span {
  color: #fff !important;
  text-shadow: none !important;
}
