@import url('fonts.css');

/*
 * Weblog listing — Figma "Parmis Landing Design" › Weblog Content (node 6603:14057), 1440px frame.
 * Tokens come straight from the file:
 *   Primary #643192 · Primary-subdued #E7DEF0 · Primary/100 #D9CBE5 · Text #1D1D1D / #3D3D3D
 *   Border #D6D6D6 · Tertiary #F2F2F2 · Disabled #E9E9E9 · Warning #F57C00
 * Typeface: IRANSansXFaNum (the design font). If the site does not load it, the bundled Vazirmatn is used.
 */

body.prm-canvas-page { margin: 0; background: #f7f7f7; }

#prm-mag {
  --prm-primary: #643192;
  --prm-primary-subdued: #e7def0;
  --prm-primary-100: #d9cbe5;
  --prm-text: #1d1d1d;
  --prm-text-2: #3d3d3d;
  --prm-border: #d6d6d6;
  --prm-tertiary: #f2f2f2;
  --prm-disabled: #e9e9e9;
  --prm-warning: #f57c00;
  --prm-shadow-400: 0 8px 24px -4px rgba(24, 39, 75, .08), 0 6px 12px -6px rgba(24, 39, 75, .12);
  --prm-font: 'IRANSansXFaNum', 'IRANSansX', 'IRANSans', PrmVazirmatn, Tahoma, sans-serif;

  direction: rtl;
  margin: 0;
  color: var(--prm-text);
  background: #f7f7f7; /* page background of the design; the blog list band below is white */
  font-family: var(--prm-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
  overflow-x: hidden;
  overflow-x: clip; /* the tag rows bleed to the viewport edge on purpose */
}
#prm-mag *, #prm-mag *::before, #prm-mag *::after { box-sizing: border-box; }
#prm-mag [hidden] { display: none !important; }
#prm-mag a { color: inherit; text-decoration: none; }
#prm-mag h1, #prm-mag h3, #prm-mag p, #prm-mag ul { margin: 0; padding: 0; }
#prm-mag ul { list-style: none; }
#prm-mag button, #prm-mag input { font: inherit; color: inherit; -webkit-appearance: none; appearance: none; border-radius: 0; }
#prm-mag button { cursor: pointer; }
#prm-mag img { display: block; max-width: none; }
#prm-mag a, #prm-mag button, #prm-mag summary { -webkit-tap-highlight-color: transparent; }
#prm-mag a:focus-visible, #prm-mag button:focus-visible, #prm-mag input:focus-visible, #prm-mag summary:focus-visible {
  outline: 2px solid var(--prm-primary); outline-offset: 2px;
}
#prm-mag .prm-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
#prm-mag .prm-i { flex: none; }

/* ---------- Frame: 1280px content, 40px top/bottom ---------- */
#prm-mag .prm-wrap { width: min(100% - 48px, 1280px); margin-inline: auto; padding-block: 40px; }

/* ---------- Blog band: white, full width ---------- */
#prm-mag .prm-main { margin-top: 16px; background: #fff; }

/* ---------- Blog header ---------- */
#prm-mag .prm-header { display: flex; flex-direction: column; gap: 24px; }
#prm-mag .prm-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 51px; }
#prm-mag .prm-head__title { display: flex; align-items: center; gap: 40px; min-width: 0; }
#prm-mag h1 { font-size: 32px; font-weight: 900; line-height: 1.6; white-space: nowrap; color: var(--prm-text); }

/* Search 400×48 */
#prm-mag .prm-search { position: relative; flex: none; width: 400px; max-width: 100%; height: 48px; }
#prm-mag .prm-search::before {
  content: ""; position: absolute; inset: 0; border-radius: 12px;
  background: radial-gradient(ellipse 187.15px 130.74px at 0 24.5px, rgba(100, 49, 146, .3) 0%, rgba(100, 49, 146, .05) 100%);
}
#prm-mag .prm-search__box {
  position: relative; display: flex; align-items: center; gap: 8px; height: 48px;
  padding: 4px 0; padding-left: 8px; padding-right: 16px; /* physical: 8px icon side (left), 16px text side (right) */
  border: 1px solid var(--prm-primary-100); border-radius: 12px; background: rgba(231, 222, 240, .6);
}
#prm-mag .prm-search input[type="search"] {
  flex: 1 1 0; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent;
  font-size: 14px; line-height: 1.6; text-align: right; color: var(--prm-text-2);
}
#prm-mag .prm-search input[type="search"]::placeholder { color: var(--prm-text-2); opacity: 1; }
#prm-mag .prm-search input[type="search"]::-webkit-search-cancel-button,
#prm-mag .prm-search input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
#prm-mag .prm-search__btn {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: var(--prm-primary); filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .2));
}
#prm-mag .prm-search__btn .prm-i-search { transform: scaleX(-1); } /* the design mirrors the icon */
#prm-mag .prm-search__btn .prm-i-clear { display: none; }
/* States from the design: default · focused/typing (purple 1px border) · applied query (clear ⊗ button) */
#prm-mag .prm-search__box { transition: border-color .15s ease; }
#prm-mag .prm-search__box:focus-within { border-color: var(--prm-primary); }
#prm-mag .prm-search.is-applied .prm-search__box:not(:focus-within) .prm-i-search { display: none; }
#prm-mag .prm-search.is-applied .prm-search__box:not(:focus-within) .prm-i-clear { display: block; }

/* Sort button 44px (details/summary: works without JS). Desktop: list drops flush under the button. Mobile: bottom sheet. */
#prm-mag .prm-sort { position: relative; flex: none; }
#prm-mag .prm-sort__button {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px;
  padding: 12px 0; padding-left: 12px; padding-right: 16px;
  list-style: none; cursor: pointer; user-select: none;
  border-radius: 12px; background: #fff; box-shadow: var(--prm-shadow-400);
  font-size: 14px; line-height: 1.6; color: var(--prm-text);
}
#prm-mag .prm-sort__button::-webkit-details-marker { display: none; }
#prm-mag .prm-sort__label { white-space: nowrap; }
#prm-mag .prm-sort .prm-i-arrow-down { transition: transform .15s ease; }
#prm-mag .prm-sort[open] .prm-i-arrow-down { transform: rotate(180deg); }
#prm-mag .prm-sort[open] .prm-sort__button { border-radius: 12px 12px 0 0; }
#prm-mag .prm-sort__menu {
  position: absolute; z-index: 20; top: 100%; left: 0; width: 100%; min-width: max-content; overflow: hidden;
  border-radius: 0 0 12px 12px; background: #fff; box-shadow: var(--prm-shadow-400);
}
#prm-mag .prm-sort__menu a { display: flex; align-items: center; height: 32px; padding: 0 12px; white-space: nowrap; font-size: 14px; line-height: 1.6; text-align: right; color: var(--prm-text); }
#prm-mag .prm-sort__menu a:hover { background: var(--prm-tertiary); }
#prm-mag .prm-sort__menu a.is-active { background: var(--prm-primary-subdued); color: var(--prm-primary); font-weight: 700; }
#prm-mag .prm-sort__sheet-head { display: none; }

/* Tags: two right-aligned rows that bleed to the left viewport edge and fade out (120px) */
#prm-mag .prm-tags { position: relative; margin-left: calc(50% - 50vw); }
#prm-mag .prm-tags::before {
  content: ""; position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: 120px; pointer-events: none;
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}
#prm-mag .prm-tags__scroll {
  display: flex; flex-direction: column; gap: 12px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior-x: contain;
}
#prm-mag .prm-tags__scroll::-webkit-scrollbar { display: none; }
#prm-mag .prm-tags__row { display: flex; flex: none; gap: 12px; width: max-content; }
#prm-mag .prm-chip {
  flex: none; display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px;
  border-radius: 50px; background: #fff; box-shadow: inset 0 0 0 1px var(--prm-border); /* inside stroke: widths match the design */
  font-size: 14px; line-height: 1.6; white-space: nowrap; color: var(--prm-text-2);
  transition: box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
#prm-mag .prm-chip:hover { box-shadow: inset 0 0 0 1px var(--prm-primary); color: var(--prm-primary); }
#prm-mag .prm-chip.is-active, #prm-mag .prm-chip.is-active:hover {
  background: var(--prm-primary); box-shadow: none; color: #fff; font-weight: 500;
}

/* ---------- Article list: rows of two, 32px padding, 1px #D6D6D6 rules, 40px column gap ---------- */
#prm-mag .prm-list { margin-top: 40px; }
#prm-mag .prm-rows { transition: opacity .15s ease; }
#prm-mag .prm-rows[aria-busy="true"] { opacity: .5; pointer-events: none; }
#prm-mag .prm-row {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; padding-block: 32px;
}
#prm-mag .prm-row::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 1px; background: var(--prm-border); }
#prm-mag .prm-row:last-child::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: var(--prm-border); }

/* Card: image 235×140 (radius 12) · 20px gap · text column */
#prm-mag .prm-card { display: flex; align-items: center; gap: 20px; min-width: 0; }
#prm-mag .prm-card__media { position: relative; flex: none; display: block; width: 235px; height: 140px; border-radius: 12px; background: var(--prm-tertiary); }
#prm-mag .prm-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
#prm-mag .prm-rate {
  position: absolute; z-index: 1; top: 4px; inset-inline-start: 4px; display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px;
  border-radius: 8px; background: #fff; color: var(--prm-warning); font-size: 14px; line-height: 1.6;
  filter: drop-shadow(0 6px 6px rgba(24, 39, 75, .12)) drop-shadow(0 8px 12px rgba(24, 39, 75, .08));
}
#prm-mag .prm-card__body {
  flex: 1 1 0; min-width: 0; min-height: 140px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 16px;
}
#prm-mag .prm-card__tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 8px; max-width: 100%;
  background: var(--prm-primary-subdued); color: var(--prm-primary); font-size: 12px; line-height: 1.6; white-space: nowrap;
}
#prm-mag .prm-card__title {
  width: 100%; font-size: 16px; font-weight: 700; line-height: 1.6; text-align: right; color: var(--prm-text);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
#prm-mag .prm-card__title a:hover { color: var(--prm-primary); }
#prm-mag .prm-meta { display: flex; align-items: center; gap: 12px; width: 100%; }
#prm-mag .prm-meta > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#prm-mag .prm-meta__read { font-size: 12px; color: var(--prm-primary); }
#prm-mag .prm-meta__views { font-size: 12px; color: var(--prm-text-2); }
#prm-mag .prm-meta__date { font-size: 14px; color: var(--prm-text-2); }

/* Empty state (not in the design; uses the same tokens) */
#prm-mag .prm-empty { padding: 64px 0; text-align: center; border-block: 1px solid var(--prm-border); }
#prm-mag .prm-empty h3 { font-size: 16px; font-weight: 700; }
#prm-mag .prm-empty p { margin-top: 8px; color: var(--prm-text-2); }
#prm-mag .prm-empty__reset {
  display: inline-flex; align-items: center; height: 40px; margin-top: 24px; padding: 0 16px; border-radius: 50px;
  background: var(--prm-primary); color: #fff; font-weight: 500;
}

/* ---------- Pagination: 520px, left-to-right exactly as drawn ---------- */
#prm-mag .prm-pagination-wrap { display: flex; justify-content: center; margin-top: 40px; }
#prm-mag .prm-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; direction: ltr; }
#prm-mag .prm-pagination__pages { display: flex; align-items: center; gap: 8px; }
#prm-mag .prm-pagination__bar { flex: none; width: 4px; height: 16px; border-radius: 8px; background: var(--prm-disabled); }
#prm-mag .prm-pagination__dots { width: 32px; text-align: center; color: var(--prm-text); }
#prm-mag .prm-page {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px;
  background: var(--prm-tertiary); color: var(--prm-text); font-size: 14px; line-height: 1.6; text-align: center;
  transition: background-color .15s ease, color .15s ease;
}
#prm-mag a.prm-page:hover { background: var(--prm-primary-subdued); }
#prm-mag .prm-page.is-current { background: var(--prm-primary); color: #fff; }
#prm-mag .prm-page--arrow { background: transparent; border: 1px solid var(--prm-primary); }
#prm-mag a.prm-page--arrow:hover { background: var(--prm-primary-subdued); }
#prm-mag .prm-page--arrow.is-disabled { opacity: .4; }

/* ---------- Responsive (the design is 1440px; these steps keep it usable below that) ---------- */
@media (max-width: 1100px) {
  #prm-mag .prm-row { column-gap: 24px; }
  #prm-mag .prm-card { gap: 16px; }
  #prm-mag .prm-card__media { width: 180px; height: 140px; }
}
@media (max-width: 860px) {
  #prm-mag .prm-head { flex-wrap: wrap; }
  #prm-mag .prm-head__title { flex-wrap: wrap; gap: 16px; width: 100%; }
  #prm-mag .prm-search { width: 100%; }
  #prm-mag .prm-row { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  #prm-mag .prm-row > .prm-card + .prm-card { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--prm-border); }
  #prm-mag .prm-card__media { width: 235px; }
}
@media (max-width: 560px) {
  #prm-mag h1 { font-size: 26px; }
  #prm-mag .prm-card { gap: 12px; align-items: flex-start; }
  #prm-mag .prm-card__media { width: 120px; height: 120px; }
  #prm-mag .prm-card__body { min-height: 120px; gap: 10px; }
  #prm-mag .prm-card__title { font-size: 15px; }
  #prm-mag .prm-meta { flex-wrap: wrap; gap: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #prm-mag *, #prm-mag *::before, #prm-mag *::after { transition: none !important; }
}
@media print {
  #prm-mag .prm-tags, #prm-mag .prm-pagination-wrap, #prm-mag .prm-sort, #prm-mag .prm-search { display: none; }
}

/* =====================================================================
   Page chrome from the Figma page "Weblog Desktop 2"
   ===================================================================== */

/* Site header (96px): logo + menu on the right, phone + consult buttons on the left */
#prm-mag .prm-site-header__inner { width: min(100% - 48px, 1280px); margin-inline: auto; padding-block: 24px; display: flex; align-items: center; justify-content: space-between; gap: 48px; }
#prm-mag .prm-site-header__nav { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 32px; }
#prm-mag .prm-logo { flex: none; display: block; width: 48px; height: 48px; }
#prm-mag .prm-menu { flex: 1 1 0; min-width: 0; }
#prm-mag .prm-menu__list { display: flex; align-items: center; gap: 20px; }
#prm-mag .prm-menu__list li { flex: none; }
#prm-mag .prm-menu__list a { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; line-height: 1.6; white-space: nowrap; color: var(--prm-text); transition: color .15s ease; }
#prm-mag .prm-menu__list a:hover { color: var(--prm-primary); }
#prm-mag .prm-menu__list .menu-item-has-children > a::after { content: ""; width: 16px; height: 16px; background: url('icons/chevron.svg') center / 16px 16px no-repeat; }
#prm-mag .prm-menu__list .current-menu-item > a { color: var(--prm-primary); font-weight: 500; }
/* Dropdowns (desktop): open on hover / keyboard focus; a 12px transparent bridge keeps hover from dropping */
#prm-mag .prm-menu__list .menu-item { position: relative; }
#prm-mag .prm-menu__list .sub-menu { display: none; position: absolute; z-index: 30; top: 100%; right: 0; min-width: 260px; padding: 12px 0 0; isolation: isolate; }
#prm-mag .prm-menu__list .sub-menu::before { content: ""; position: absolute; z-index: -1; inset: 12px 0 0; border-radius: 12px; background: #fff; box-shadow: var(--prm-shadow-400); }
#prm-mag .prm-menu__list .sub-menu > li { padding-inline: 8px; }
#prm-mag .prm-menu__list .sub-menu > li:first-child { padding-top: 8px; }
#prm-mag .prm-menu__list .sub-menu > li:last-child { padding-bottom: 8px; }
#prm-mag .prm-menu__list .sub-menu a { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
#prm-mag .prm-menu__list .sub-menu a:hover { background: var(--prm-tertiary); }
#prm-mag .prm-menu__list .sub-menu .sub-menu { top: 0; right: 100%; padding-top: 0; }
#prm-mag .prm-menu__list .sub-menu .sub-menu::before { inset: 0; }
#prm-mag .prm-menu__list .sub-menu .menu-item-has-children > a::after { transform: rotate(90deg); }
#prm-mag .prm-menu__list .menu-item:hover > .sub-menu, #prm-mag .prm-menu__list .menu-item:focus-within > .sub-menu { display: block; }
#prm-mag .prm-site-header__actions { flex: none; display: flex; align-items: center; gap: 12px; }
#prm-mag .prm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 500; line-height: 1.6; white-space: nowrap; transition: background-color .15s ease; }
#prm-mag .prm-btn--solid { background: var(--prm-primary); color: #fff; }
#prm-mag .prm-btn--solid:hover { background: #52277a; }
#prm-mag .prm-btn--outline { color: var(--prm-primary); box-shadow: inset 0 0 0 1px var(--prm-primary); }
#prm-mag .prm-btn--outline:hover { background: var(--prm-primary-subdued); }
#prm-mag .prm-burger, #prm-mag .prm-mobile-menu { display: none; }

/* Suggested articles: title 32/900, 32px gap, big card 737px + four compact cards */
#prm-mag .prm-suggest { margin-top: 64px; }
#prm-mag .prm-suggest .prm-wrap { padding-block: 0; }
#prm-mag .prm-suggest h2 { margin: 0 0 32px; font-size: 32px; font-weight: 900; line-height: 1.6; text-align: right; color: var(--prm-text); }
#prm-mag .prm-suggest__grid { display: grid; grid-template-columns: 737px minmax(0, 1fr); gap: 24px; align-items: stretch; }
#prm-mag .prm-suggest__list { display: flex; flex-direction: column; gap: 16px; }
#prm-mag .prm-suggest .prm-meta__read { font-weight: 500; }
#prm-mag .prm-rate--lg { height: 32px; }

#prm-mag .prm-big { display: flex; flex-direction: column; gap: 24px; padding: 24px; border-radius: 24px; background: #fff; min-width: 0; }
#prm-mag .prm-big__media { position: relative; display: block; aspect-ratio: 696 / 420; border-radius: 16px; background: var(--prm-tertiary); }
#prm-mag .prm-big__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
#prm-mag .prm-big__media .prm-rate { top: 8px; inset-inline-start: 8px; }
#prm-mag .prm-big__text { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
#prm-mag .prm-big__top { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
#prm-mag .prm-card__tag--lg { height: 28px; font-size: 14px; }
#prm-mag .prm-big__copy { display: flex; flex-direction: column; gap: 12px; width: 100%; }
#prm-mag .prm-big__copy h3 { font-size: 20px; font-weight: 900; line-height: 1.6; color: var(--prm-text); }
#prm-mag .prm-big__copy h3 a:hover { color: var(--prm-primary); }
#prm-mag .prm-big__copy p { font-size: 14px; line-height: 1.6; color: var(--prm-text-2); }
#prm-mag .prm-big__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#prm-mag .prm-meta--big { width: auto; gap: 16px; }
#prm-mag .prm-meta--big > span { font-size: 14px; }
#prm-mag .prm-share { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; background: transparent; }

#prm-mag .prm-mini { display: flex; align-items: center; gap: 20px; padding: 16px; border-radius: 16px; background: #fff; min-width: 0; }
#prm-mag .prm-mini__media { position: relative; flex: none; display: block; width: 215px; height: 128px; border-radius: 12px; background: var(--prm-tertiary); }
#prm-mag .prm-mini__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
#prm-mag .prm-mini__media .prm-rate { top: 4px; inset-inline-start: 4px; }
#prm-mag .prm-mini__body { flex: 1 1 0; min-width: 0; align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; }
#prm-mag .prm-mini__body h3 { width: 100%; font-size: 14px; font-weight: 700; line-height: 1.6; color: var(--prm-text); }
#prm-mag .prm-mini__body h3 a:hover { color: var(--prm-primary); }
#prm-mag .prm-meta--mini { justify-content: space-between; }
#prm-mag .prm-meta__group { display: inline-flex; align-items: center; gap: 12px; }
#prm-mag .prm-meta__group > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; color: var(--prm-text-2); }

/* Footer (white band) */
#prm-mag .prm-footer { margin-top: 71px; background: #fff; }
#prm-mag .prm-footer .prm-wrap { padding-block: 40px; }
#prm-mag .prm-footer__about { display: flex; align-items: flex-start; gap: 48px; }
#prm-mag .prm-footer__logo { flex: none; display: block; }
#prm-mag .prm-footer__logo img { height: 96px; width: auto; }
#prm-mag .prm-footer__about p { flex: 1 1 0; min-width: 0; font-size: 14px; line-height: 2; color: #1d1d1d; text-align: right; }
#prm-mag .prm-footer__about p a, #prm-mag .prm-footer__list a:hover { color: var(--prm-primary); }
#prm-mag .prm-footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 32px; }
#prm-mag .prm-footer__col strong { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; line-height: 1.6; color: var(--prm-text); }
#prm-mag .prm-footer__list li { padding-block: 8px; }
#prm-mag .prm-footer__list a { font-size: 14px; line-height: 1.6; color: var(--prm-text-2); }
#prm-mag .prm-footer__col.is-accent .prm-footer__list a { color: var(--prm-primary); }
#prm-mag .prm-footer__apps { display: flex; gap: 12px; margin-top: 16px; }
#prm-mag .prm-footer__apps a { display: block; }
#prm-mag .prm-footer__apps img { width: 40px; height: auto; border-radius: 8px; }
#prm-mag .prm-footer__badges { display: flex; gap: 24px; margin-top: 24px; }
#prm-mag .prm-footer__badges a { display: block; }
#prm-mag .prm-footer__badges img { width: 85px; height: auto; border-radius: 8px; }
#prm-mag .prm-footer__address { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 32px; font-size: 14px; color: var(--prm-text-2); }
#prm-mag .prm-footer__copy { margin-top: 24px; text-align: center; font-size: 13px; line-height: 1.9; color: var(--prm-text-2); }
#prm-mag .prm-footer__copy strong { color: var(--prm-primary); }

/* Floating consult button (216×48 pill, photo overlaps the corner) */
#prm-mag .prm-contact {
  position: fixed; z-index: 50; right: 48px; bottom: 32px; display: inline-flex; align-items: center; height: 48px; padding: 0 16px;
  border-radius: 50px; background: var(--prm-primary); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.6; white-space: nowrap;
  filter: drop-shadow(0 6px 6px rgba(24, 39, 75, .12)) drop-shadow(0 8px 12px rgba(24, 39, 75, .08));
}
#prm-mag .prm-contact.has-avatar { padding-right: 78px; }
#prm-mag .prm-contact img { position: absolute; right: 0; bottom: 0; width: 62px; height: 66px; object-fit: cover; border-bottom-right-radius: 24px; box-shadow: 0 0 15px rgba(0, 0, 0, .2); }

@media (max-width: 1100px) {
  #prm-mag .prm-suggest__grid { grid-template-columns: minmax(0, 1fr); }
  #prm-mag .prm-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  #prm-mag .prm-suggest h2 { font-size: 26px; }
  #prm-mag .prm-mini { flex-direction: column; align-items: stretch; }
  #prm-mag .prm-mini__media { width: 100%; height: auto; aspect-ratio: 215 / 128; }
  #prm-mag .prm-footer__about { flex-direction: column; }
  #prm-mag .prm-footer__cols { grid-template-columns: minmax(0, 1fr); }
  #prm-mag .prm-contact { right: 16px; bottom: 16px; }
}
@media print { #prm-mag .prm-contact, #prm-mag .prm-site-header { display: none; } }

/* Sort as a bottom sheet on phones (design: "Weblog - Sort Mobile") */
@media (max-width: 640px) {
  #prm-mag .prm-sort[open]::before { content: ""; position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); }
  #prm-mag .prm-sort[open] .prm-sort__button { border-radius: 12px; }
  #prm-mag .prm-sort__menu {
    position: fixed; z-index: 61; top: auto; right: 0; bottom: 0; left: 0; width: auto; min-width: 0; max-height: 80vh; overflow: auto;
    display: flex; flex-direction: column; gap: 8px; padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0; box-shadow: none;
  }
  #prm-mag .prm-sort__sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; padding-inline: 4px; }
  #prm-mag .prm-sort__sheet-head strong { font-size: 16px; font-weight: 700; line-height: 1.6; color: var(--prm-text); }
  #prm-mag .prm-sort__close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--prm-disabled); }
  #prm-mag .prm-sort__menu li:not(.prm-sort__sheet-head) a { height: 36px; border-radius: 8px; background: var(--prm-tertiary); }
  #prm-mag .prm-sort__menu li:not(.prm-sort__sheet-head) a.is-active { background: var(--prm-primary-subdued); font-weight: 400; }
  #prm-mag .prm-head { flex-direction: column; align-items: stretch; }
}

/* Mobile header (design: "Old Mobile Header", 72px): logo on the right, menu button on the left; the menu opens full screen */
@media (max-width: 1200px) {
  #prm-mag .prm-site-header__inner { width: auto; height: 72px; padding: 16px; gap: 16px; flex-wrap: nowrap; }
  #prm-mag .prm-site-header__nav { flex: 1 1 auto; }
  #prm-mag .prm-site-header__nav .prm-logo { width: 40px; height: 40px; }
  #prm-mag .prm-site-header__nav .prm-logo img { width: 40px; height: 40px; }
  #prm-mag .prm-menu, #prm-mag .prm-site-header__inner > .prm-site-header__actions { display: none; }
  #prm-mag .prm-burger { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--prm-border); }
  #prm-mag .prm-mobile-menu:not([hidden]) { position: fixed; z-index: 80; inset: 0; display: flex; flex-direction: column; overflow-y: auto; background: #fff; }
  #prm-mag .prm-mobile-menu__bar { flex: none; display: flex; align-items: center; justify-content: space-between; height: 72px; padding: 16px; }
  #prm-mag .prm-mobile-menu__bar .prm-logo { width: 40px; height: 40px; }
  #prm-mag .prm-mobile-menu__close { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--prm-border); }
  #prm-mag .prm-mobile-menu__nav { flex: 1 1 auto; padding: 8px 16px; }
  #prm-mag .prm-mobile-menu__list > li { border-bottom: 1px solid var(--prm-disabled); }
  #prm-mag .prm-mobile-menu__list li { display: flex; flex-wrap: wrap; align-items: center; }
  #prm-mag .prm-mobile-menu__list li > a { flex: 1 1 0; }
  #prm-mag .prm-mobile-menu__list .menu-item-has-children > a::after { display: none; }
  #prm-mag .prm-sub-toggle { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: url('icons/chevron.svg') center / 16px 16px no-repeat; transition: transform .15s ease; }
  #prm-mag .is-open > .prm-sub-toggle { transform: rotate(180deg); }
  #prm-mag .prm-mobile-menu__list .sub-menu { display: none; flex: 1 0 100%; padding-inline-start: 12px; }
  #prm-mag .prm-mobile-menu__list .is-open > .sub-menu { display: block; }
  #prm-mag .prm-mobile-menu__list .sub-menu a { min-height: 44px; color: var(--prm-text-2); }
  #prm-mag .prm-mobile-menu__list a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; font-size: 14px; line-height: 1.6; color: var(--prm-text); }
  #prm-mag .prm-mobile-menu__list .current-menu-item > a { color: var(--prm-primary); font-weight: 500; }
  #prm-mag .prm-mobile-menu__actions { flex: none; display: flex; flex-direction: column; gap: 12px; padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
  #prm-mag .prm-mobile-menu__actions .prm-btn { width: 100%; height: 44px; }
}

/* =====================================================================
   Single article (Figma "Single Blog Desktop", 1440px): 845px article column on the right, 371px sticky contents card on the left
   ===================================================================== */
#prm-mag .prm-crumbs { width: min(100% - 48px, 1280px); height: 54px; margin-inline: auto; display: flex; align-items: center; }
#prm-mag .prm-crumbs ol { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
#prm-mag .prm-crumbs li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.6; color: var(--prm-text-2); }
#prm-mag .prm-crumbs a:hover { color: var(--prm-primary); }
#prm-mag .prm-crumbs__sep img { transform: rotate(-90deg); }
#prm-mag .prm-article-wrap { margin-top: 32px; }
#prm-mag .prm-article-layout { display: grid; grid-template-columns: minmax(0, 845px) 371px; column-gap: 64px; align-items: start; padding-block: 0 64px; }
#prm-mag .prm-article-layout.has-no-toc { grid-template-columns: minmax(0, 845px); justify-content: center; }

#prm-mag .prm-article { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
#prm-mag .prm-article__hero { margin: 0; aspect-ratio: 845 / 510; border-radius: 20px; overflow: hidden; background: var(--prm-tertiary); }
#prm-mag .prm-article__hero img { width: 100%; height: 100%; object-fit: cover; }
#prm-mag .prm-article__head { display: flex; flex-direction: column; gap: 16px; }
#prm-mag .prm-article__tags { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; }
#prm-mag .prm-article__terms { display: flex; align-items: center; gap: 16px; min-width: 0; }
#prm-mag .prm-article__cat { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.6; color: var(--prm-text-2); white-space: nowrap; }
#prm-mag .prm-article__rating { display: flex; align-items: center; gap: 16px; }
#prm-mag .prm-rate-box { display: inline-flex; align-items: center; gap: 4px; height: 28px; }
#prm-mag .prm-rate-box__avg { font-size: 14px; font-weight: 500; color: var(--prm-warning); }
#prm-mag .prm-rate-box__count { font-size: 12px; color: var(--prm-text-2); }
#prm-mag .prm-rate-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; background: #fff; box-shadow: var(--prm-shadow-400); font-size: 14px; line-height: 1.6; color: var(--prm-text); white-space: nowrap; }
#prm-mag .prm-rate-btn:hover { color: var(--prm-primary); }
#prm-mag .prm-article__title { font-size: 32px; font-weight: 900; line-height: 1.6; color: var(--prm-text); }

#prm-mag .prm-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; border-block: 1px solid var(--prm-border); }
#prm-mag .prm-article__head .prm-bar { margin-top: -4px; }
#prm-mag .prm-bar__meta { display: flex; align-items: center; gap: 20px; min-width: 0; }
#prm-mag .prm-bar__meta > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 14px; line-height: 1.6; color: var(--prm-text-2); }
#prm-mag .prm-bar__meta .prm-meta__read { font-weight: 500; color: var(--prm-primary); }
#prm-mag .prm-bar__actions { display: flex; align-items: center; gap: 12px; }
#prm-mag .prm-act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 8px; background: #fff; font-size: 14px; line-height: 1.6; white-space: nowrap; cursor: pointer; transition: background-color .15s ease; border: 0; }
#prm-mag .prm-act--pdf { color: var(--prm-text-2); box-shadow: inset 0 0 0 1px var(--prm-border); }
#prm-mag .prm-act--share { color: var(--prm-primary); box-shadow: inset 0 0 0 1px var(--prm-primary-100); }
#prm-mag .prm-act:hover { background: var(--prm-tertiary); }
#prm-mag .prm-article__foot .prm-bar { border-top-color: var(--prm-border); }

/* Contents card */
#prm-mag .prm-toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; padding: 20px 0; border-radius: 16px; background: #fff; scrollbar-width: thin; }
#prm-mag .prm-toc h2 { margin: 0 24px 16px; font-size: 16px; font-weight: 700; line-height: 1.6; color: var(--prm-text); }
#prm-mag .prm-toc__body { position: relative; padding: 0 34px 0 24px; }
#prm-mag .prm-toc__track { position: absolute; top: 0; bottom: 0; right: 0; width: 6px; border-radius: 3px; background: var(--prm-disabled); }
#prm-mag .prm-toc__thumb { position: absolute; top: 0; right: 0; width: 6px; height: 52px; border-radius: 3px; background: var(--prm-primary); transition: transform .2s ease, height .2s ease; }
#prm-mag .prm-toc__list { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
#prm-mag .prm-toc__list a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: 14px; line-height: 1.6; color: var(--prm-text-2); transition: color .15s ease; }
#prm-mag .prm-toc__list a:hover { color: var(--prm-primary); }
#prm-mag .prm-toc__list a.is-active { color: var(--prm-primary); font-weight: 500; }

/* Article body */
#prm-mag .prm-prose { font-size: 14px; line-height: 1.6; color: var(--prm-text-2); display: flow-root; }
#prm-mag .prm-prose > * { margin-block: 0 12px; }
#prm-mag .prm-prose > :last-child { margin-bottom: 0; }
#prm-mag .prm-prose h2, #prm-mag .prm-prose h3, #prm-mag .prm-prose h4 { margin-top: 32px; scroll-margin-top: 24px; color: var(--prm-text); }
#prm-mag .prm-prose > :first-child { margin-top: 0; }
#prm-mag .prm-prose h2 { position: relative; padding-inline-start: 18px; font-size: 24px; font-weight: 900; line-height: 1.6; color: var(--prm-primary); }
#prm-mag .prm-prose h2::before { content: ""; position: absolute; inset-inline-start: 0; top: 3px; width: 6px; height: 32px; border-radius: 3px; background: var(--prm-primary); }
#prm-mag .prm-prose h3 { font-size: 16px; font-weight: 700; line-height: 1.6; }
#prm-mag .prm-prose h4 { font-size: 14px; font-weight: 700; }
#prm-mag .prm-prose a { color: #2a62c9; }
#prm-mag .prm-prose a:hover { text-decoration: underline; }
#prm-mag .prm-prose strong { font-weight: 700; color: var(--prm-text); }
#prm-mag .prm-prose img, #prm-mag .prm-prose video, #prm-mag .prm-prose iframe { max-width: 100%; border-radius: 16px; }
#prm-mag .prm-prose img { height: auto; }
#prm-mag .prm-prose figure { margin-inline: 0; }
#prm-mag .prm-prose figure, #prm-mag .prm-prose .wp-block-image, #prm-mag .prm-prose .wp-block-embed, #prm-mag .prm-prose table { margin-block: 32px; }
#prm-mag .prm-prose figcaption { margin-top: 8px; text-align: center; font-size: 12px; color: var(--prm-text-2); }
#prm-mag .prm-prose ul, #prm-mag .prm-prose ol { padding: 0; list-style: none; counter-reset: prm-n; }
#prm-mag .prm-prose li { position: relative; padding-inline-start: 24px; margin-bottom: 12px; }
#prm-mag .prm-prose ul > li::before { content: ""; position: absolute; inset-inline-start: 4px; top: .55em; width: 8px; height: 8px; border-radius: 2px; background: var(--prm-primary); transform: rotate(45deg); }
#prm-mag .prm-prose ol > li { counter-increment: prm-n; }
#prm-mag .prm-prose ol > li::before { content: counter(prm-n, persian) "."; position: absolute; inset-inline-start: 0; font-weight: 700; color: var(--prm-primary); }
#prm-mag .prm-prose table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: 16px; background: #fff; text-align: right; }
#prm-mag .prm-prose th { padding: 12px 16px; background: var(--prm-tertiary); font-weight: 500; color: var(--prm-text); }
#prm-mag .prm-prose td { padding: 16px; border-top: 1px solid var(--prm-disabled); vertical-align: middle; }
#prm-mag .prm-prose blockquote { margin-inline: 0; padding: 16px 20px; border-radius: 16px; background: var(--prm-primary-subdued); }

@media (max-width: 1100px) {
  #prm-mag .prm-article-layout { grid-template-columns: minmax(0, 1fr); }
  #prm-mag .prm-toc { display: none; }
}
@media (max-width: 640px) {
  #prm-mag .prm-article__title { font-size: 24px; }
  #prm-mag .prm-article__hero { border-radius: 16px; }
  #prm-mag .prm-article__tags { flex-wrap: wrap; }
  #prm-mag .prm-bar { flex-wrap: wrap; }
  #prm-mag .prm-bar__meta { flex-wrap: wrap; gap: 8px 16px; }
  #prm-mag .prm-prose h2 { font-size: 20px; }
}
@media print {
  #prm-mag .prm-site-header, #prm-mag .prm-crumbs, #prm-mag .prm-toc, #prm-mag .prm-footer, #prm-mag .prm-contact, #prm-mag .prm-bar__actions, #prm-mag .prm-rate-btn { display: none !important; }
  #prm-mag { background: #fff; }
  #prm-mag .prm-article-layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 0; }
}
