/*
Theme Name: Iraneet
Theme URI: https://iraneet.com/
Author: Iraneet
Author URI: https://iraneet.com/
Description: قالب رسمی چندرسانه‌ای ایرانیت برای مجله، ویدیو، صوت، پروفایل سازندگان و داشبورد کاربری. نسخه Production با تمرکز بر سرعت، Core Web Vitals و SEO.
Version: 2.3.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: iraneet
Domain Path: /languages
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* --------------------------------------------------------------------------
   Iraneet root stylesheet
   This file is intentionally enqueued on every frontend request. Page-specific
   styling remains under assets/css/ and is loaded conditionally by functions.php.
   -------------------------------------------------------------------------- */
:root {
  --ir-bg: #00142a;
  --ir-surface: #08233f;
  --ir-surface-2: #0d2b49;
  --ir-text: #d2e4ff;
  --ir-muted: #a9bfd8;
  --ir-primary: #b0c6ff;
  --ir-secondary: #86d5c8;
  --ir-danger: #ff6b86;
  --ir-border: rgba(255,255,255,.11);
  --ir-shadow: 0 20px 70px rgba(0,0,0,.26);
  --ir-radius: 24px;
}

html { box-sizing: border-box; direction: rtl; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--ir-bg);
  color: var(--ir-text);
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
html:not(.dark) body { background: #f5f8ff; color: #12304c; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img, svg, video, canvas, audio, iframe { max-width: 100%; }
img, video { height: auto; }
img { display: block; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"], a { -webkit-tap-highlight-color: transparent; }
:where(a,button,input,select,textarea,[tabindex]):focus-visible { outline: 3px solid var(--ir-primary); outline-offset: 3px; }
::selection { background: var(--ir-primary); color: #002d6e; }

/* Stable main-shell fallback: keeps the theme usable if a page asset fails. */
.ir-page-shell,
.iraneet-site-main {
  width: min(1440px, calc(100% - 32px));
  margin-inline: auto;
}
.ir-page-shell { padding-top: 136px; padding-bottom: 80px; }
@media (min-width: 768px) {
  .ir-page-shell, .iraneet-site-main { width: min(1440px, calc(100% - 64px)); }
  .ir-page-shell { padding-top: 150px; }
}

.glass-card {
  border: 1px solid var(--ir-border);
  background: linear-gradient(145deg, rgba(13,43,73,.78), rgba(4,27,52,.62));
  box-shadow: var(--ir-shadow);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
}
html:not(.dark) .glass-card {
  background: rgba(255,255,255,.78);
  border-color: rgba(32,90,190,.13);
  box-shadow: 0 18px 55px rgba(32,75,128,.12);
}

.ir-primary-cta,
.ir-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 0;
  background: linear-gradient(135deg, var(--ir-primary), var(--ir-secondary));
  color: #002d55;
  cursor: pointer;
}

.ir-input,
.ir-form-card input,
.ir-form-card select,
.ir-form-card textarea {
  max-width: 100%;
  border: 1px solid var(--ir-border);
  background: rgba(0,15,33,.54);
  color: var(--ir-text);
}
html:not(.dark) :where(.ir-input,.ir-form-card input,.ir-form-card select,.ir-form-card textarea) {
  background: rgba(255,255,255,.9);
  color: #12304c;
  border-color: rgba(32,90,190,.18);
}

/* Prevent common CLS regressions around media and avatars. */
:where(.ir-card-media,.ir-cover,.ir-player,.ir-video-player,.ir-media-cover) { overflow: hidden; }
:where(.avatar,img.avatar) { object-fit: cover; }
:where(.ir-author-card,.post-author,.ir-post-author) :where(.avatar,img.avatar) {
  width: 72px; height: 72px; max-width: 72px; max-height: 72px; border-radius: 50%; flex: 0 0 72px;
}
@media (min-width: 768px) {
  :where(.ir-author-card,.post-author,.ir-post-author) :where(.avatar,img.avatar) {
    width: 92px; height: 92px; max-width: 92px; max-height: 92px; flex-basis: 92px;
  }
}

/* WordPress content safety. */
.wp-caption, .gallery, .wp-block-image, .wp-block-video, .wp-block-embed { max-width: 100%; }
.aligncenter { margin-inline: auto; }
.alignleft { float: left; margin: 0 1rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1rem; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  clip: auto !important; width: auto; height: auto; top: 8px; right: 8px; z-index: 100000;
  padding: 12px 16px; background: #fff; color: #000; border-radius: 10px;
}

/* Lower sections can be skipped by the renderer until needed. */
@supports (content-visibility: auto) {
  body.home main > section:nth-of-type(n+3),
  .ir-related-section,
  .ir-footer-content { content-visibility: auto; contain-intrinsic-size: auto 700px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* Iraneet 2.3.0 semantic helpers */
.ir-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.ir-directory-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem}
.ir-directory-card{padding:1.25rem;border-radius:24px}
.ir-directory-avatar{width:72px;height:72px;border-radius:22px;object-fit:cover}
.ir-empty-archive{padding:3rem 1.5rem;text-align:center;border-radius:28px}
