/* Ink & Emerald News — component styles (from the design system's components/bundle.css).
   Wrap any component markup in an element with class "ie" (Elementor: container → Advanced → CSS Classes).
   Changes vs bundle.css: global body rule and preview-only scaffolding (.ie-demo, .ie-note) removed. */

.ie, .ie * { box-sizing: border-box; letter-spacing: 0; font-style: normal; }
.ie { direction: rtl; text-align: right; font-family: var(--font-sans); font-size: 16px; line-height: 28px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
.ie a { color: var(--accent); }
.ie a:hover { color: var(--accent-hover); }
.ie :focus-visible, .ie .is-focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.ie-dark :focus-visible, .ie-dark .is-focus { outline-color: var(--accent-on-dark); }
.ie-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ie-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.ie-stack { display: flex; flex-direction: column; gap: var(--space-3); }

/* icons: authored in LTR meaning; directional ones get .ie-icon--mirror */
.ie-icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .ie-icon--mirror { transform: scaleX(-1); }

/* ---------- Button ---------- */
.ie-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--size-control-md); padding-inline: var(--space-4); border: 1px solid transparent; border-radius: var(--radius-sm); font: inherit; font-size: 16px; line-height: 24px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; background: transparent; transition: background-color .15s, border-color .15s, color .15s; }
.ie-btn .ie-icon { width: 20px; height: 20px; }
.ie-btn--sm { height: var(--size-control-sm); padding-inline: var(--space-3); font-size: 14px; line-height: 22px; gap: 6px; }
.ie-btn--sm .ie-icon { width: 16px; height: 16px; }
.ie-btn--lg { height: var(--size-control-lg); padding-inline: var(--space-6); font-weight: 700; }
.ie-btn--block { display: flex; width: 100%; }
.ie a.ie-btn--primary, .ie-btn--primary { background: var(--accent); color: var(--on-accent); }
.ie-btn--primary:hover, .ie-btn--primary.is-hover { background: var(--accent-hover); color: var(--on-accent); }
.ie-btn--primary:active, .ie-btn--primary.is-active { background: var(--accent-hover); transform: translateY(1px); }
.ie a.ie-btn--secondary, .ie-btn--secondary { border-color: var(--primary); color: var(--primary); }
.ie-btn--secondary:hover, .ie-btn--secondary.is-hover { background: var(--surface); color: var(--primary); }
.ie-btn--secondary:active, .ie-btn--secondary.is-active { background: var(--primary); color: var(--on-primary); }
.ie a.ie-btn--ghost, .ie-btn--ghost { color: var(--accent); }
.ie-btn--ghost:hover, .ie-btn--ghost.is-hover { background: var(--accent-soft); color: var(--accent-hover); }
.ie-btn--ghost:active, .ie-btn--ghost.is-active { background: var(--border); color: var(--accent-hover); }
.ie-btn:disabled, .ie-btn[aria-disabled="true"] { background: var(--border); border-color: transparent; color: var(--disabled-ink); cursor: not-allowed; transform: none; }
.ie-btn--ghost:disabled, .ie-btn--ghost[aria-disabled="true"] { background: transparent; }
.ie-btn[aria-busy="true"] .ie-spin { animation: ie-spin .8s linear infinite; }
@keyframes ie-spin { to { transform: rotate(360deg); } }

/* ---------- Category chip ---------- */
.ie-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding-inline: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 12px; line-height: 18px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.ie a.ie-chip, .ie .ie-chip { color: var(--accent); }
.ie a.ie-chip:hover, .ie .ie-chip.is-hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ie .ie-chip--breaking { background: var(--highlight); border-color: var(--highlight); color: var(--on-highlight); font-weight: 700; }
.ie a.ie-chip--breaking:hover { background: var(--highlight); color: var(--on-highlight); text-decoration: underline; }
.ie-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: currentColor; flex: none; }
.ie-chip--live .ie-dot { animation: ie-pulse 1.6s ease-in-out infinite; }
@keyframes ie-pulse { 50% { opacity: .25; } }

/* ---------- Article-type badge ---------- */
.ie-type { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding-inline: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--muted); font-size: 12px; line-height: 18px; font-weight: 700; white-space: nowrap; }
.ie-type .ie-icon { width: 14px; height: 14px; stroke-width: 2; }
.ie-type--report, .ie-type--interview, .ie-type--infographic { color: var(--text); }
.ie-type--analysis { background: var(--info-soft); border-color: var(--info-ink); color: var(--info-ink); }
.ie-type--opinion { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- Byline ---------- */
.ie-byline { display: flex; align-items: center; gap: var(--space-3); }
.ie-avatar { width: var(--size-avatar); height: var(--size-avatar); border-radius: var(--radius-full); flex: none; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: 12px; line-height: 1; font-weight: 700; overflow: hidden; }
.ie-byline__text { display: flex; flex-direction: column; min-width: 0; }
.ie a.ie-byline__author { font-size: 14px; line-height: 22px; font-weight: 700; color: var(--accent); text-decoration: none; }
.ie a.ie-byline__author:hover { color: var(--accent-hover); text-decoration: underline; }
.ie-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-2); font-size: 12px; line-height: 18px; font-weight: 500; color: var(--muted); }
.ie-meta > * + *::before { content: "·"; margin-inline-end: var(--space-2); }
.ie-meta time { font-variant-numeric: tabular-nums; }

/* ---------- Article card ---------- */
.ie-card { position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.ie-media { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; max-width: 100%; background: var(--border); color: var(--muted); border-radius: var(--radius-md); overflow: hidden; }
.ie-media .ie-icon { width: 28px; height: 28px; stroke-width: 1.25; }
.ie-media--3x2 { aspect-ratio: 3 / 2; }
.ie-media--flat { border-radius: var(--radius-none); }
.ie-card__kicker { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ie-card__rutitr { margin: 0; font-size: 14px; line-height: 22px; font-weight: 500; color: var(--muted); }
.ie-card__title { margin: 0; color: var(--primary); text-wrap: balance; }
.ie .ie-card__title a { color: inherit; text-decoration: none; }
.ie .ie-card__title a:hover, .ie .ie-card.is-hover .ie-card__title a { color: var(--accent); }
.ie-card__lead { margin: 0; font-size: 16px; line-height: 28px; color: var(--text); }
.ie-card--hero .ie-card__title { font-size: 32px; line-height: 40px; font-weight: 700; }
.ie-card--large .ie-card__title { font-size: 24px; line-height: 32px; font-weight: 700; }
.ie-card--medium { flex-direction: row; align-items: flex-start; gap: var(--space-4); }
.ie-card--medium .ie-media { flex: none; width: 176px; aspect-ratio: 3 / 2; border-radius: var(--radius-none); }
.ie-card--medium .ie-card__body { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.ie-card--medium .ie-card__title, .ie-card--compact .ie-card__title { font-size: 20px; line-height: 28px; font-weight: 700; }
.ie-card--grid .ie-card__title { font-size: 18px; line-height: 28px; font-weight: 700; }
.ie-card--grid .ie-media { border-radius: var(--radius-none); }
.ie-card--compact { gap: var(--space-1); padding-block: var(--space-3); border-bottom: 1px solid var(--border); }
.ie-card--opinion .ie-byline { order: -1; }

/* ---------- Breaking ticker ---------- */
.ie-ticker { display: flex; align-items: stretch; height: var(--size-ticker); background: var(--primary); color: var(--on-primary); overflow: hidden; }
.ie-ticker__label { flex: none; display: flex; align-items: center; gap: var(--space-2); padding-inline: var(--space-4); background: var(--highlight); color: var(--on-highlight); font-size: 14px; line-height: 22px; font-weight: 800; }
.ie-ticker__viewport { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; }
.ie-ticker__track { display: flex; align-items: center; width: max-content; margin: 0; padding: 0; list-style: none; animation: ie-ticker 48s linear infinite; }
.ie-ticker__item { display: flex; align-items: center; gap: var(--space-2); padding-inline: var(--space-4); white-space: nowrap; font-size: 14px; line-height: 22px; font-weight: 500; }
.ie-ticker__item::before { content: ""; width: 6px; height: 6px; background: var(--highlight); flex: none; }
.ie-ticker__item time { color: var(--on-primary-muted); font-weight: 400; }
.ie .ie-ticker__item a { color: var(--on-primary); text-decoration: none; }
.ie .ie-ticker__item a:hover { color: var(--accent-on-dark); text-decoration: underline; }
.ie-ticker__toggle { flex: none; width: var(--size-ticker); border: 0; border-inline-start: 1px solid #ffffff26; background: transparent; color: var(--on-primary); display: grid; place-items: center; cursor: pointer; }
.ie-ticker__toggle:hover { color: var(--accent-on-dark); }
.ie-ticker__toggle .ie-icon { width: 18px; height: 18px; }
.ie-ticker:hover .ie-ticker__track, .ie-ticker:focus-within .ie-ticker__track, .ie-ticker.is-paused .ie-ticker__track { animation-play-state: paused; }
/* RTL: the track sits at the right edge and moves right, so each headline's first word enters first. Content is duplicated once; 50% = one copy. */
@keyframes ie-ticker { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) {
  .ie-ticker__track, .ie-chip--live .ie-dot, .ie-btn[aria-busy="true"] .ie-spin { animation: none; }
  .ie-ticker__viewport { overflow-x: auto; }
  .ie-ticker__track [aria-hidden="true"] { display: none; }
}

/* ---------- Market strip ---------- */
.ie-market { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--surface); border-block: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.ie-market__meta { flex: none; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--muted); padding-inline-end: var(--space-2); }
.ie-quote { flex: none; display: inline-flex; align-items: center; gap: 6px; height: var(--size-control-sm); padding-inline: var(--space-3); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; line-height: 22px; white-space: nowrap; text-decoration: none; }
.ie-quote__name { color: var(--muted); font-weight: 500; }
.ie-quote__value { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.ie-quote__delta { font-size: 12px; line-height: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ie-quote--up .ie-quote__delta { color: var(--positive-text); }
.ie-quote--down .ie-quote__delta { color: var(--negative); }
.ie-quote--flat .ie-quote__delta { color: var(--muted); }
.ie-quote--highlight { border-inline-start: 3px solid var(--highlight); }
a.ie-quote:hover { border-color: var(--accent); }

/* ---------- Section heading ---------- */
.ie-section-head { display: flex; align-items: center; gap: var(--space-4); padding-block-end: var(--space-3); border-bottom: 1px solid var(--border); }
.ie-section-head__title { margin: 0; padding-inline-start: var(--space-3); border-inline-start: 4px solid var(--accent); font-size: 24px; line-height: 32px; font-weight: 700; color: var(--primary); }
.ie-section-head--sm .ie-section-head__title { font-size: 20px; line-height: 28px; border-inline-start-width: 3px; }
.ie a.ie-section-head__more { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; line-height: 22px; font-weight: 500; color: var(--accent); text-decoration: none; white-space: nowrap; }
.ie a.ie-section-head__more:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---------- Sidebar widgets ---------- */
.ie-widget { display: flex; flex-direction: column; gap: var(--space-2); }
.ie-rank { margin: 0; padding: 0; list-style: none; }
.ie-rank li { display: flex; gap: var(--space-3); align-items: flex-start; padding-block: var(--space-3); border-bottom: 1px solid var(--border); }
.ie-rank li:last-child { border-bottom: 0; }
.ie-rank__num { flex: none; width: 28px; font-size: 32px; line-height: 32px; font-weight: 800; color: var(--accent); text-align: center; }
.ie .ie-rank a, .ie .ie-latest a { font-size: 16px; line-height: 28px; font-weight: 700; color: var(--primary); text-decoration: none; }
.ie .ie-rank a:hover, .ie .ie-latest a:hover { color: var(--accent); }
.ie-latest { margin: 0; padding: 0; list-style: none; }
.ie-latest li { display: flex; gap: var(--space-3); align-items: baseline; padding-block: var(--space-3); border-bottom: 1px solid var(--border); }
.ie-latest li:last-child { border-bottom: 0; }
.ie-latest time { flex: none; width: 40px; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.ie-box { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.ie-box__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 700; color: var(--primary); }
.ie-box__text { margin: 0; font-size: 14px; line-height: 22px; color: var(--text); }

/* ---------- Ad slots ---------- */
.ie-ad { position: relative; display: grid; place-items: center; max-width: 100%; margin-inline: auto; background: var(--surface); border: 1px dashed var(--border-input); color: var(--muted); font-size: 12px; line-height: 18px; font-weight: 500; font-variant-numeric: tabular-nums; overflow: hidden; }
.ie-ad::before { content: "تبلیغات"; position: absolute; inset-block-start: var(--space-1); inset-inline-start: var(--space-2); }
.ie-ad--970x250 { width: 970px; height: 250px; }
.ie-ad--728x90 { width: 728px; height: 90px; }
.ie-ad--336x280 { width: 336px; height: 280px; }
.ie-ad--300x250 { width: 300px; height: 250px; }
.ie-ad--300x600 { width: 300px; height: 600px; }
.ie-ad--320x100 { width: 320px; height: 100px; }

/* ---------- Pagination / tags / breadcrumb ---------- */
.ie-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ie .ie-page { min-width: var(--size-control-md); height: var(--size-control-md); display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding-inline: var(--space-3); background: var(--bg); border: 1px solid var(--border-input); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; line-height: 22px; font-weight: 500; text-decoration: none; font-variant-numeric: tabular-nums; }
.ie .ie-page:hover, .ie .ie-page.is-hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ie .ie-page[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ie .ie-page--gap { border-color: transparent; background: transparent; min-width: 24px; padding: 0; color: var(--muted); }
.ie .ie-page[aria-disabled="true"] { background: var(--surface); border-color: var(--border); color: var(--disabled-ink); pointer-events: none; }
.ie-page .ie-icon { width: 16px; height: 16px; }
.ie-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ie .ie-tag { display: inline-flex; align-items: center; height: var(--size-control-sm); padding-inline: var(--space-3); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; line-height: 22px; text-decoration: none; }
.ie-tag::before { content: "#"; color: var(--muted); margin-inline-end: 2px; }
.ie .ie-tag:hover, .ie .ie-tag.is-hover { border-color: var(--accent); color: var(--accent); }
.ie-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 22px; color: var(--muted); }
.ie-breadcrumb li { display: inline-flex; align-items: center; min-width: 0; }
/* Type the separator as U+203A «›». It is Bidi_Mirrored, so in an RTL run the browser draws it pointing left. Do not type U+2039 — it would flip back. */
.ie-breadcrumb li + li::before { content: "›"; margin-inline: var(--space-2); color: var(--muted); }
.ie .ie-breadcrumb a { color: var(--accent); text-decoration: none; }
.ie .ie-breadcrumb a:hover { text-decoration: underline; }
.ie-breadcrumb [aria-current="page"] { color: var(--muted); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ---------- Form fields ---------- */
.ie-form { display: flex; flex-direction: column; gap: var(--space-4); }
.ie-field { display: flex; flex-direction: column; gap: var(--space-2); }
.ie-field__label { font-size: 14px; line-height: 22px; font-weight: 500; color: var(--text); }
.ie-field__req { color: var(--negative); margin-inline-start: 2px; }
.ie-input, .ie-select, .ie-textarea { width: 100%; height: var(--size-input); padding-inline: var(--space-3); background: var(--bg); border: 1px solid var(--border-input); border-radius: var(--radius-sm); color: var(--text); font: inherit; font-size: 16px; line-height: 28px; text-align: right; }
.ie-input[dir="ltr"] { text-align: right; }
.ie-textarea { height: auto; min-height: 132px; padding-block: var(--space-2); resize: vertical; }
.ie-input::placeholder, .ie-textarea::placeholder { color: var(--muted); opacity: 1; }
.ie-input:hover, .ie-select:hover, .ie-textarea:hover, .ie-input.is-hover { border-color: var(--text); }
.ie-input:focus, .ie-select:focus, .ie-textarea:focus, .ie-input.is-focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.ie-input[aria-invalid="true"], .ie-textarea[aria-invalid="true"], .ie-select[aria-invalid="true"] { border-color: var(--negative); }
.ie-input:disabled, .ie-select:disabled, .ie-textarea:disabled { background: var(--surface); border-color: var(--border); color: var(--disabled-ink); cursor: not-allowed; }
.ie-select { appearance: none; padding-inline-end: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; }
.ie-field__help { margin: 0; font-size: 14px; line-height: 22px; color: var(--muted); }
.ie-field__error { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 22px; font-weight: 500; color: var(--negative); }
.ie-field__error .ie-icon { width: 16px; height: 16px; }
.ie-check { display: flex; align-items: flex-start; gap: var(--space-2); font-size: 14px; line-height: 22px; color: var(--text); cursor: pointer; }
.ie-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }

/* ---------- Comments ---------- */
.ie-comments { display: flex; flex-direction: column; gap: var(--space-6); }
.ie-comment { display: flex; gap: var(--space-3); }
.ie-comment__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.ie-comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.ie-comment__name { font-size: 14px; line-height: 22px; font-weight: 700; color: var(--primary); }
.ie-comment__text { margin: 0; font-size: 16px; line-height: 28px; color: var(--text); }
.ie-comment__actions { display: flex; gap: var(--space-2); margin-inline-start: -12px; }
.ie-comment--reply { margin-inline-start: 44px; padding-inline-start: var(--space-4); border-inline-start: 2px solid var(--border); }
.ie-staff { display: inline-flex; align-items: center; height: 20px; padding-inline: 6px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 12px; line-height: 18px; font-weight: 700; }
.ie-notice { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-3) var(--space-4); background: var(--info-soft); border: 1px solid var(--info-ink); border-radius: var(--radius-sm); color: var(--info-ink); font-size: 14px; line-height: 22px; }
.ie-notice .ie-icon { width: 18px; height: 18px; margin-top: 2px; }

@media (max-width: 767px) {
  .ie-card--hero .ie-card__title { font-size: 24px; line-height: 32px; }
  .ie-card--medium .ie-media { width: 120px; }
  .ie-comment--reply { margin-inline-start: 20px; }
}
