/**
 * Telegram Pro - Professional RTL / Persian / Performance / Beauty
 * Version 2.0.0
 */

:root {
  --tp-primary: #0088cc;
  --tp-primary-dark: #006699;
  --tp-accent: #e63946;
  --tp-text: #1a1a2e;
  --tp-text-muted: #4a4a5a;
  --tp-bg: #ffffff;
  --tp-bg-soft: #f5f7fa;
  --tp-border: #e8ecf0;
  --tp-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  --tp-shadow-hover: 0 10px 32px rgba(0, 0, 0, 0.12);
  --tp-radius: 12px;
  --tp-radius-sm: 8px;
  --tp-transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --tp-font: Tahoma, "Segoe UI", "Iranian Sans", "Vazirmatn", system-ui, -apple-system, sans-serif;
}

/* Persian / RTL base */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.telegram-pro,
body.rtl-ready,
body {
  font-family: var(--tp-font) !important;
  color: var(--tp-text);
  line-height: 1.85;
  background-color: var(--tp-bg-soft);
}

body.rtl,
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

h1, h2, h3, h4, h5, h6,
.site-title,
.entry-title,
.widget-title,
.twp-section-title {
  font-family: var(--tp-font) !important;
  font-weight: 700;
  line-height: 1.4;
  color: var(--tp-text);
  letter-spacing: -0.01em;
}

a {
  transition: var(--tp-transition);
}

a:hover {
  color: var(--tp-primary);
}

/* Cards & posts - modern look */
.article-wrapper,
.twp-article,
.entry-content article,
.post,
.twp-post-item,
.twp-news-item,
.widget .twp-article {
  border-radius: var(--tp-radius);
  overflow: hidden;
  box-shadow: var(--tp-shadow);
  transition: var(--tp-transition);
  background: var(--tp-bg);
  border: 1px solid var(--tp-border);
}

.article-wrapper:hover,
.twp-article:hover,
.twp-post-item:hover,
.twp-news-item:hover {
  box-shadow: var(--tp-shadow-hover);
  transform: translateY(-3px);
}

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

/* Widget titles */
.widget-title,
.twp-section-title,
.widget .widget-title {
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 18px;
  font-size: 1.2rem;
  border-bottom: 3px solid var(--tp-primary);
  display: inline-block;
}

/* Buttons */
button,
.button,
input[type="submit"],
.wp-block-button__link,
.twp-btn {
  border-radius: var(--tp-radius-sm) !important;
  transition: var(--tp-transition);
  font-family: var(--tp-font) !important;
  font-weight: 600;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.3);
}

/* Navigation */
.main-navigation a,
.primary-menu a {
  font-family: var(--tp-font) !important;
  font-weight: 500;
  transition: var(--tp-transition);
}

.main-navigation a:hover,
.primary-menu a:hover {
  color: var(--tp-primary) !important;
}

/* Header */
.site-header,
.twp-header,
.twp-topbar-section {
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
  background: var(--tp-bg);
}

/* Category badges */
.cat-links a,
.twp-categories a,
.category a {
  background: var(--tp-primary);
  color: #fff !important;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  transition: var(--tp-transition);
}

.cat-links a:hover,
.twp-categories a:hover {
  background: var(--tp-primary-dark);
}

/* Sidebar widgets */
#secondary .widget,
.widget-area .widget {
  background: var(--tp-bg);
  padding: 22px;
  border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow);
  margin-bottom: 28px;
  border: 1px solid var(--tp-border);
}

/* Footer */
.site-footer,
.twp-footer {
  background: #1a1a2e;
  color: #e0e0e0;
}

.site-footer a,
.twp-footer a {
  color: #bbb;
}

.site-footer a:hover,
.twp-footer a:hover {
  color: #fff;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea,
select {
  border-radius: var(--tp-radius-sm) !important;
  border: 1px solid var(--tp-border) !important;
  padding: 10px 14px !important;
  transition: var(--tp-transition);
  font-family: var(--tp-font) !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--tp-primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.15) !important;
  outline: none !important;
}

/* Accessibility */
a:focus,
button:focus {
  outline: 2px solid var(--tp-primary);
  outline-offset: 2px;
}

/* Performance hint */
.widget,
.twp-article,
article {
  content-visibility: auto;
  contain-intrinsic-size: auto 280px;
}

/* Dark mode (system) */
@media (prefers-color-scheme: dark) {
  :root {
    --tp-text: #e8e8f0;
    --tp-text-muted: #a0a0b0;
    --tp-bg: #1a1a2e;
    --tp-bg-soft: #12121f;
    --tp-border: #2a2a40;
    --tp-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  }
  body {
    background-color: var(--tp-bg-soft);
    color: var(--tp-text);
  }
  .site-header,
  .twp-topbar-section,
  #secondary .widget,
  .article-wrapper,
  .twp-article {
    background: var(--tp-bg);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  #secondary,
  .twp-topbar-section {
    display: none !important;
  }
}

/* Archive featured image fixes */
.twp-archive-post .twp-image-section {
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.twp-archive-post .twp-image.bg-image {
  width: 100%;
  height: 100%;
  min-height: 220px;
  background-color: #e8ecf0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.twp-archive-post .twp-image.twp-no-thumb {
  background-color: #d0d5dd;
  background-image: none !important;
}

/* Prevent solid blue from category overlay covering the whole image */
.twp-archive-post .twp-category.twp-category-with-bg {
  position: absolute;
  z-index: 2;
}

.twp-archive-post .twp-image-section > a {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Persian button */
.twp-read-more-btn {
  font-family: Tahoma, "Segoe UI", sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
