/* ==========================================================================
   Cinema Bartar — main stylesheet
   Palette: night indigo + marquee gold + ruby. Display type: Lalezar.
   ========================================================================== */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn.woff2") format("woff2-variations"), url("../fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lalezar";
  src: url("../fonts/Lalezar.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --cb-accent: #d42a4c;
  --cb-gold: #f3b53f;
  --cb-night: #1d1a3a;
  --cb-night-2: #29254f;
  --cb-bg: #ffffff;
  --cb-surface: #ffffff;
  --cb-mist: #f4f3f9;
  --cb-text: #211e36;
  --cb-muted: #6b6784;
  --cb-line: #e6e4ef;
  --cb-link: var(--cb-accent);
  --cb-on-night: #ffffff;
  --cb-perf: #ffffff;
  --cb-shadow: 0 18px 40px -18px rgba(29, 26, 58, .35);
  --cb-radius: 14px;
  --cb-radius-sm: 10px;
  --cb-container: 1240px;
  --cb-header-h: 68px;
  --cb-font: "Vazirmatn", Tahoma, Arial, sans-serif;
  --cb-display: "Lalezar", "Vazirmatn", Tahoma, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --cb-night: #0e0c20;
  --cb-night-2: #1f1c40;
  --cb-bg: #131127;
  --cb-surface: #1b1935;
  --cb-mist: #1a1833;
  --cb-text: #ecebf6;
  --cb-muted: #a7a3c4;
  --cb-line: #2e2b52;
  --cb-link: #ff7d95;
  --cb-perf: #4a4580;
  --cb-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { direction: rtl; scroll-behavior: smooth; scroll-padding-top: calc(var(--cb-header-h) + 16px); }
body {
  margin: 0;
  direction: rtl;
  text-align: right;
  background: var(--cb-bg);
  color: var(--cb-text);
  font-family: var(--cb-font);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--cb-link); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; }
:focus-visible { outline: 2px solid var(--cb-gold); outline-offset: 2px; border-radius: 4px; }

.container { width: min(calc(100% - 32px), var(--cb-container)); margin-inline: auto; }
.container--article-head { width: min(calc(100% - 32px), 820px); }
.container--hero { width: min(calc(100% - 32px), 1100px); }

.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 { top: 10px; right: 10px; z-index: 99999; width: auto; height: auto; padding: 12px 16px; clip: auto; background: #fff; color: #111; border-radius: 8px; }

.cb-icon { display: inline-block; flex: 0 0 auto; width: 22px; height: 22px; }
.cb-ticket { display: inline-block; flex: 0 0 auto; }

.button, .comment-form .submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--cb-accent);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}
.button:hover, .comment-form .submit:hover { color: #fff; filter: brightness(.92); }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
}
.icon-button:hover { background: rgba(255, 255, 255, .1); }

/* Reading progress ------------------------------------------------------ */
.reading-progress { position: fixed; inset: 0 0 auto; z-index: 9999; height: 3px; pointer-events: none; }
.reading-progress span { display: block; width: 0; height: 100%; background: var(--cb-gold); }

/* Header ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cb-night);
  color: var(--cb-on-night);
  transition: box-shadow .2s ease;
}
.admin-bar .site-header { top: 32px; }
.site-header.is-scrolled { box-shadow: 0 10px 30px -12px rgba(14, 12, 32, .6); }

.masthead { display: flex; align-items: center; gap: 22px; min-height: var(--cb-header-h); }
.masthead__menu { display: none; }
.site-branding { flex: 0 0 auto; display: flex; align-items: center; }
.custom-logo-link { display: inline-flex; }
.custom-logo { width: auto; max-width: 200px; max-height: 46px; object-fit: contain; }

.text-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.text-logo:hover { color: #fff; }
.text-logo__mark { width: 36px; height: 36px; transform: rotate(-8deg); }
.text-logo__name { font-family: var(--cb-display); font-weight: 400; font-synthesis: none; font-size: 30px; line-height: 1; padding-top: 6px; }

.primary-navigation { flex: 1 1 auto; min-width: 0; }
.primary-navigation .menu { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
.primary-navigation .menu > li { position: relative; }
.primary-navigation .menu > li > a {
  position: relative;
  display: block;
  padding: 0 13px;
  line-height: var(--cb-header-h);
  color: rgba(255, 255, 255, .82);
  font-size: 15px;
  font-weight: 700;
}
.primary-navigation .menu > li > a:hover,
.primary-navigation .menu > .current-menu-item > a,
.primary-navigation .menu > .current-menu-ancestor > a,
.primary-navigation .menu > .current-post-ancestor > a { color: var(--cb-gold); }
.primary-navigation .menu > .current-menu-item > a::after,
.primary-navigation .menu > .current-post-ancestor > a::after {
  content: "";
  position: absolute;
  inset: auto 13px 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--cb-gold);
}
.primary-navigation .sub-menu {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  z-index: 20;
  display: none;
  min-width: 220px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--cb-surface);
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  white-space: normal;
}
.primary-navigation li:hover > .sub-menu,
.primary-navigation li:focus-within > .sub-menu { display: block; }
.primary-navigation .sub-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--cb-text); font-size: 14.5px; font-weight: 600; }
.primary-navigation .sub-menu a:hover { background: var(--cb-mist); color: var(--cb-link); }

.masthead__actions { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: inline-block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }

/* Search */
.search-panel { background: var(--cb-night-2); padding: 14px 0; }
.search-panel__inner { display: flex; align-items: center; gap: 10px; }
.search-panel .search-form { flex: 1; }

.search-form { position: relative; display: flex; gap: 8px; }
.search-form .search-field {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--cb-line);
  border-radius: 12px;
  background: var(--cb-surface);
  color: var(--cb-text);
  font-size: 15px;
}
.search-form .search-field:focus { outline: none; border-color: var(--cb-gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cb-gold) 30%, transparent); }
.search-form .search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--cb-accent);
  color: #fff;
}

/* Mobile panel */
.mobile-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 1000;
  width: min(86vw, 360px);
  padding: 16px 18px 28px;
  overflow-y: auto;
  background: var(--cb-bg);
  color: var(--cb-text);
  box-shadow: -20px 0 50px rgba(14, 12, 32, .3);
}
.mobile-panel:not([hidden]) { animation: panelIn .22s ease-out; }
@keyframes panelIn { from { transform: translateX(100%); } to { transform: none; } }
.mobile-panel__header { display: flex; align-items: center; justify-content: space-between; margin: -16px -18px 18px; padding: 12px 18px; background: var(--cb-night); }
.mobile-panel__header .icon-button { color: #fff; }
.mobile-panel .search-form { margin-bottom: 14px; }
.mobile-navigation .menu, .mobile-navigation .sub-menu { margin: 0; padding: 0; list-style: none; }
.mobile-navigation a { display: block; padding: 12px 2px; border-bottom: 1px solid var(--cb-line); font-size: 16px; font-weight: 700; }
.mobile-navigation .sub-menu a { padding-inline-start: 18px; font-size: 15px; font-weight: 500; color: var(--cb-muted); }
.mobile-navigation .current-menu-item > a { color: var(--cb-link); }
.site-overlay { position: fixed; inset: 0; z-index: 999; background: rgba(14, 12, 32, .55); }

/* Ticker ---------------------------------------------------------------- */
.ticker { border-bottom: 1px solid var(--cb-line); background: var(--cb-surface); }
.ticker__inner { display: flex; align-items: center; gap: 14px; height: 44px; }
.ticker__label {
  flex: 0 0 auto;
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--cb-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.ticker__viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to left, transparent, #000 24px, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(to left, transparent, #000 24px, #000 calc(100% - 48px), transparent);
}
.ticker__track { display: flex; width: max-content; animation: tickerMove 55s linear infinite; }
.ticker__track:hover, .ticker__track:focus-within { animation-play-state: paused; }
.ticker__group { display: flex; gap: 36px; padding-inline-end: 36px; }
.ticker__group a { position: relative; font-size: 14px; font-weight: 600; white-space: nowrap; }
.ticker__group a::before {
  content: "";
  position: absolute;
  inset-inline-start: -21px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--cb-gold);
}
@keyframes tickerMove { to { transform: translateX(50%); } }

/* Film strip (the signature) -------------------------------------------- */
.film-band,
.lead-story::before,
.lead-story__media::after,
.film-frame::before,
.film-frame::after {
  background-color: var(--cb-night);
  background-image: linear-gradient(90deg, transparent 0 8px, var(--cb-perf) 8px 18px, transparent 18px);
  background-size: 28px 8px;
  background-repeat: repeat-x;
  background-position: 6px 50%;
}

/* Section headings ------------------------------------------------------ */
.section-heading { display: flex; align-items: center; gap: 18px; margin: 52px 0 22px; }
.section-heading h2 { font-family: var(--cb-display); font-weight: 400; font-synthesis: none; font-size: 30px; line-height: 1.4; }
.section-heading h2 a:hover { color: var(--cb-link); }
.section-heading::after { content: ""; order: 1; flex: 1; height: 1px; background: var(--cb-line); }
.section-heading__more { order: 2; flex: 0 0 auto; color: var(--cb-link); font-size: 14px; font-weight: 700; }

/* Homepage lead --------------------------------------------------------- */
.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 28px;
  margin-top: 28px;
  align-items: start;
}
.lead-story {
  position: relative;
  padding-top: 18px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--cb-night);
  color: #fff;
}
[data-theme="dark"] .lead-story { box-shadow: inset 0 0 0 1px var(--cb-line); }
.lead-story::before { content: ""; position: absolute; inset: 0 0 auto; height: 18px; }
.lead-story__media { position: relative; display: block; aspect-ratio: 16 / 9; margin-bottom: 18px; background: var(--cb-night-2); }
.lead-story__media::after { content: ""; position: absolute; inset: 100% 0 auto; height: 18px; }
.lead-story__media img { width: 100%; height: 100%; object-fit: cover; }
.lead-story__body { padding: 8px 28px 28px; }
.lead-story .category-badge { color: var(--cb-gold); }
.lead-story__title {
  margin: 6px 0 10px;
  font-family: var(--cb-display);
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.55;
}
.lead-story__title a:hover { color: var(--cb-gold); }
.lead-story__excerpt { margin: 0 0 12px; color: rgba(255, 255, 255, .78); font-size: 16px; line-height: 2; max-width: 64ch; }
.lead-story .post-meta { color: rgba(255, 255, 255, .6); }
.lead-side { display: grid; gap: 26px; }

/* Grids ----------------------------------------------------------------- */
.posts-grid { display: grid; gap: 34px 24px; }
.posts-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.posts-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.posts-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Cards ----------------------------------------------------------------- */
.post-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.post-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--cb-radius);
  background: var(--cb-mist);
}
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.media-placeholder { display: grid; place-items: center; width: 100%; height: 100%; background: var(--cb-night); }
.media-placeholder .cb-ticket { width: 30%; max-width: 72px; height: auto; opacity: .9; }
.post-card__body { padding-top: 12px; }
.category-badge { display: inline-block; color: var(--cb-link); font-size: 13px; font-weight: 800; line-height: 1.6; }
.category-badge:hover { text-decoration: underline; text-underline-offset: 4px; }
.post-card__title {
  margin: 3px 0 6px;
  font-size: 17.5px;
  font-weight: 800;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__excerpt { margin: 0 0 10px; color: var(--cb-muted); font-size: 15.5px; line-height: 1.95; }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; color: var(--cb-muted); font-size: 13.5px; }
.post-meta > * + *::before { content: ""; display: inline-block; width: 1px; height: 12px; margin: 0 10px; vertical-align: -1px; background: currentColor; opacity: .4; }
.post-meta__author { color: var(--cb-text); font-weight: 800; }
.post-meta--compact { font-size: 13px; }

/* Compact card: horizontal list item */
.post-card--compact { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; align-items: start; }
.post-card--compact .post-card__media { border-radius: var(--cb-radius-sm); }
.post-card--compact .post-card__body { padding-top: 0; }
.post-card--compact .post-card__title { margin-top: 0; font-size: 15px; line-height: 1.8; }

/* Featured card */
.post-card--featured { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: center; }
.post-card--featured .post-card__body { padding-top: 0; }
.post-card--featured .post-card__title { font-size: clamp(21px, 2.3vw, 28px); font-weight: 900; line-height: 1.65; -webkit-line-clamp: 4; }
.post-card--featured .post-card__media { border-radius: 18px; }

/* Category blocks ------------------------------------------------------- */
.cat-block { padding: 2px 0 50px; }
.cat-block--tinted { background: var(--cb-mist); }
.cat-block .section-heading { margin-top: 46px; }
.cat-block__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.cat-block__grid--solo { grid-template-columns: minmax(0, 760px); }
.cat-block .post-card--featured { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.cat-block .post-card--featured .post-card__body { padding-top: 14px; }
.cat-block__list { display: grid; }
.cat-block__list .post-card--compact { padding: 14px 0; border-bottom: 1px solid var(--cb-line); }
.cat-block__list .post-card--compact:first-child { padding-top: 0; }
.cat-block__list .post-card--compact:last-child { border-bottom: 0; }

/* Pagination ------------------------------------------------------------ */
.pagination { margin-top: 40px; }
.pagination ul.page-numbers { border: 0; background: none; }
.pagination ul, .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.page-numbers:not(ul) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--cb-line);
  border-radius: 12px;
  background: var(--cb-surface);
  font-weight: 700;
}
.page-numbers.current { border-color: var(--cb-night); background: var(--cb-night); color: #fff; }
[data-theme="dark"] .page-numbers.current { border-color: var(--cb-accent); background: var(--cb-accent); }
.page-numbers.dots { border: 0; background: none; }

/* Breadcrumbs ----------------------------------------------------------- */
.breadcrumbs { padding-top: 22px; color: var(--cb-muted); font-size: 13px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "‹"; margin: 0 8px; opacity: .6; }
.breadcrumbs a:hover { color: var(--cb-link); }

/* Archives -------------------------------------------------------------- */
.archive-header { padding: 18px 0 30px; }
.archive-header__title { font-family: var(--cb-display); font-weight: 400; font-synthesis: none; font-size: clamp(32px, 4vw, 46px); line-height: 1.45; }
.archive-header__desc { max-width: 70ch; margin: 8px 0 0; color: var(--cb-muted); font-size: 16px; }
.archive-header__desc p { margin: 0; }
.archive-featured { margin-bottom: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--cb-line); }
.archive-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; }

/* Sidebar --------------------------------------------------------------- */
.archive-sidebar { position: sticky; top: calc(var(--cb-header-h) + 20px); }
.widget { margin-bottom: 34px; }
.widget-title { margin-bottom: 14px; font-family: var(--cb-display); font-weight: 400; font-synthesis: none; font-size: 22px; line-height: 1.5; }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget .post-card--compact { grid-template-columns: 104px minmax(0, 1fr); padding: 12px 0; border-bottom: 1px solid var(--cb-line); }
.widget .post-card--compact:first-of-type { padding-top: 0; }
.widget .post-card--compact:last-child { border-bottom: 0; }
.ranked-list { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.ranked-list li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--cb-line); counter-increment: rank; font-size: 15px; font-weight: 700; line-height: 1.8; }
.ranked-list li:last-child { border-bottom: 0; }
.ranked-list li::before { content: counter(rank, persian); font-family: var(--cb-display); font-size: 28px; line-height: 1.2; color: var(--cb-gold); }
.category-list li a { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--cb-line); font-weight: 600; }

/* Block widgets (search, latest posts, latest comments…) */
.widget h2, .widget .wp-block-heading { margin: 0 0 14px; font-family: var(--cb-display); font-weight: 400; font-synthesis: none; font-size: 22px; line-height: 1.5; }
.site-footer .widget h2, .site-footer .widget .wp-block-heading { font-size: 20px; color: #fff; }
.wp-block-search__label { display: block; margin-bottom: 10px; font-family: var(--cb-display); font-size: 22px; font-weight: 400; }
.wp-block-search__inside-wrapper { display: flex; gap: 8px; border: 0 !important; padding: 0 !important; }
.wp-block-search__input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 1px solid var(--cb-line); border-radius: 12px; background: var(--cb-surface); color: var(--cb-text); }
.wp-block-search__button { height: 48px; margin: 0; padding: 0 18px; border: 0; border-radius: 12px; background: var(--cb-accent); color: #fff; font-weight: 800; }
.wp-block-latest-posts, .wp-block-latest-comments { margin: 0; padding: 0; list-style: none; }
.wp-block-latest-posts li, .wp-block-latest-comments__comment { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--cb-line); font-size: 15px; font-weight: 600; line-height: 1.8; }
.site-footer .wp-block-latest-posts li, .site-footer .wp-block-latest-comments__comment { border-color: rgba(255, 255, 255, .1); }
.wp-block-latest-posts li:last-child, .wp-block-latest-comments__comment:last-child { border-bottom: 0; }
.wp-block-latest-comments__comment-excerpt p { margin: 4px 0 0; color: var(--cb-muted); font-weight: 400; }
.wp-block-latest-comments__comment-date, .wp-block-latest-posts__post-date { display: block; color: var(--cb-muted); font-size: 12.5px; font-weight: 400; }
.wp-block-archives-list, .wp-block-categories-list { margin: 0; padding: 0; list-style: none; }
.wp-block-archives-list li a, .wp-block-categories-list li a { display: inline-block; padding: 6px 0; font-weight: 600; }

/* Single ---------------------------------------------------------------- */
.article-header { padding: 12px 0 26px; }
.article-title { margin: 8px 0 14px; font-size: clamp(26px, 3.6vw, 40px); font-weight: 900; line-height: 1.6; }
.article-deck {
  margin: 0 0 18px;
  padding-inline-start: 16px;
  border-inline-start: 3px solid var(--cb-gold);
  color: var(--cb-muted);
  font-size: 18px;
  line-height: 2;
}
.article-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.article-meta-row .post-meta { font-size: 14px; }
.updated-label { color: var(--cb-muted); font-size: 13px; }

.article-hero { margin-top: 0; margin-bottom: 0; }
.film-frame { position: relative; padding: 16px 0; overflow: hidden; border-radius: 16px; background: var(--cb-night); }
.film-frame::before, .film-frame::after { content: ""; position: absolute; inset-inline: 0; height: 16px; }
.film-frame::before { top: 0; }
.film-frame::after { bottom: 0; }
.article-hero__image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-hero figcaption { margin-top: 10px; color: var(--cb-muted); font-size: 13px; text-align: center; }

.article-shell {
  display: grid;
  grid-template-columns: 48px minmax(0, 720px);
  justify-content: center;
  gap: 36px;
  margin-top: 36px;
}
.share-rail { position: sticky; top: calc(var(--cb-header-h) + 24px); align-self: start; display: flex; flex-direction: column; gap: 10px; }
.share-rail a, .share-rail button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--cb-line);
  border-radius: 50%;
  background: var(--cb-surface);
  color: var(--cb-text);
}
.share-rail a:hover, .share-rail button:hover, .share-rail .is-copied { border-color: var(--cb-night); background: var(--cb-night); color: #fff; }

.article-toc { margin-bottom: 30px; padding: 14px 20px; border-radius: var(--cb-radius); background: var(--cb-mist); }
.article-toc__toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 4px 0; border: 0; background: none; font-size: 16px; font-weight: 800; }
.article-toc ol { margin: 8px 0 4px; padding: 0; list-style: none; counter-reset: toc; }
.article-toc li { display: flex; gap: 8px; padding: 3px 0; font-size: 15px; line-height: 1.8; }
.article-toc .toc-h2 { counter-increment: toc; }
.article-toc .toc-h2::before { content: counter(toc, persian) "."; flex: 0 0 auto; min-width: 18px; color: var(--cb-accent); font-weight: 800; }
.article-toc .toc-h3 { padding-inline-start: 26px; color: var(--cb-muted); font-size: 14px; }
.article-toc a:hover { color: var(--cb-link); }
.article-toc.is-collapsed nav { display: none; }

.entry-content { font-size: 18px; line-height: 2.15; overflow-wrap: break-word; }
.entry-content > * { margin-top: 0; margin-bottom: 1.35em; }
.entry-content h2 { margin: 1.9em 0 .7em; font-size: 24px; font-weight: 900; line-height: 1.7; }
.entry-content h3 { margin: 1.6em 0 .6em; font-size: 20px; font-weight: 800; line-height: 1.7; }
.entry-content h4 { margin: 1.4em 0 .5em; font-size: 18px; font-weight: 800; }
.entry-content a { color: var(--cb-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.entry-content strong { font-weight: 800; }
.entry-content img { border-radius: 12px; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption, .entry-content .wp-element-caption { margin-top: 8px; color: var(--cb-muted); font-size: 13.5px; line-height: 1.8; text-align: center; }
.entry-content .aligncenter { margin-inline: auto; }
.entry-content .alignwide { margin-inline: -60px; max-width: calc(100% + 120px); }
.entry-content .alignfull { width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); }
.entry-content .alignfull img { border-radius: 0; }
.entry-content ul, .entry-content ol { padding-inline-start: 1.4em; }
.entry-content li { margin-bottom: .4em; }
.entry-content li::marker { color: var(--cb-accent); }
.entry-content blockquote {
  position: relative;
  margin-inline: 0;
  padding: 22px 26px;
  border-inline-start: 4px solid var(--cb-gold);
  border-radius: 12px;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  background: var(--cb-mist);
  font-size: 19px;
  font-weight: 600;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote cite { display: block; margin-top: 8px; color: var(--cb-muted); font-size: 14px; font-style: normal; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--cb-line); text-align: start; }
.entry-content th { background: var(--cb-mist); font-weight: 800; }
.entry-content iframe, .entry-content video { max-width: 100%; border-radius: 12px; }
.entry-content .wp-block-embed__wrapper iframe { width: 100%; }
.entry-content hr { border: 0; height: 1px; background: var(--cb-line); }
.page-links { font-weight: 700; }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 26px; }
.article-tags a { padding: 4px 14px; border: 1px solid var(--cb-line); border-radius: 999px; font-size: 13.5px; font-weight: 600; }
.article-tags a::before { content: "#"; margin-inline-end: 2px; color: var(--cb-accent); }
.article-tags a:hover { border-color: var(--cb-accent); }

.share-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 0; border-block: 1px solid var(--cb-line); }
.share-bar strong { font-size: 15px; font-weight: 800; }
.share-bar__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 15px;
  border: 1px solid var(--cb-line);
  border-radius: 999px;
  background: var(--cb-surface);
  font-size: 14px;
  font-weight: 700;
}
.share-bar__btn .cb-icon { width: 19px; height: 19px; }
.share-bar__btn:hover, .share-bar__btn.is-copied { border-color: var(--cb-night); background: var(--cb-night); color: #fff; }

.author-box { margin: 30px 0; padding: 22px 24px; border-radius: 16px; background: var(--cb-mist); }
.author-box__label { color: var(--cb-muted); font-size: 13px; }
.author-box__name { margin: 2px 0 6px; font-size: 20px; font-weight: 900; }
.author-box p { margin: 0 0 8px; color: var(--cb-muted); font-size: 15px; }
.author-box__more { color: var(--cb-link); font-size: 14px; font-weight: 800; }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.post-nav__card { display: block; padding: 16px 18px; border: 1px solid var(--cb-line); border-radius: var(--cb-radius); }
.post-nav__card--next { grid-column: 2; text-align: left; }
.post-nav__card span { display: block; color: var(--cb-muted); font-size: 13px; }
.post-nav__card strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; font-weight: 800; line-height: 1.8; }
.post-nav__card:hover { border-color: var(--cb-accent); }

.related-posts { margin-top: 60px; padding: 4px 0 52px; background: var(--cb-mist); }
.related-posts .section-heading { margin-top: 44px; }

/* Comments -------------------------------------------------------------- */
.comments-container { margin-top: 48px; }
.comments-title { margin-bottom: 18px; font-family: var(--cb-display); font-weight: 400; font-synthesis: none; font-size: 26px; }
.comment-list, .comment-list .children { margin: 0; padding: 0; list-style: none; }
.comment-list .children { padding-inline-start: 26px; border-inline-start: 2px solid var(--cb-line); }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--cb-line); }
.comment-author { font-weight: 800; }
.comment-author .says { display: none; }
.comment-metadata { color: var(--cb-muted); font-size: 12.5px; }
.comment-content p { margin: 8px 0; }
.comment-reply-link { color: var(--cb-link); font-size: 13.5px; font-weight: 800; }
.comment-respond { margin-top: 26px; }
.comment-reply-title { margin-bottom: 8px; font-size: 20px; font-weight: 900; }
.comment-notes, .logged-in-as { color: var(--cb-muted); font-size: 14px; }
.comment-form label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 700; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--cb-line);
  border-radius: 12px;
  background: var(--cb-surface);
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--cb-gold); }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: center; }
.comment-form-cookies-consent label { margin: 0; font-weight: 500; }

/* Page, 404, empty ------------------------------------------------------ */
.page-featured { margin: 0 0 28px; }
.page-featured img { border-radius: 16px; }
.error-404, .empty-state { max-width: 560px; margin: 56px auto; text-align: center; }
.error-404__code { font-family: var(--cb-display); font-size: clamp(96px, 16vw, 150px); line-height: 1.1; color: var(--cb-accent); }
.error-404 h1, .empty-state h2 { margin-bottom: 8px; font-size: 26px; font-weight: 900; }
.error-404 p, .empty-state p { color: var(--cb-muted); }
.error-404 .search-form, .empty-state .search-form { margin: 22px 0 18px; }
.empty-state__mark { width: 64px; height: 64px; margin-bottom: 8px; }

/* Footer ---------------------------------------------------------------- */
.site-footer { margin-top: 72px; background: var(--cb-night); color: rgba(255, 255, 255, .72); font-size: 15px; }
.home-main + .site-footer, .single-main + .site-footer { margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding: 54px 0 42px; }
.site-footer h2, .site-footer .widget-title { margin-bottom: 14px; color: #fff; font-family: var(--cb-display); font-weight: 400; font-synthesis: none; font-size: 20px; }
.site-footer a:hover { color: var(--cb-gold); }
.footer-about p { margin: 14px 0 18px; line-height: 2; }
.footer-socials { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-socials a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; color: #fff; }
.footer-socials .cb-icon { width: 19px; height: 19px; }
.footer-column ul { margin: 0; padding: 0; list-style: none; }
.footer-column li a { display: inline-block; padding: 4px 0; }
.footer-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-tags a { padding: 3px 12px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; }
.footer-feed { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--cb-gold); font-weight: 800; }
.footer-feed .cb-icon { width: 18px; height: 18px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); }
.footer-bottom__inner { padding: 16px 0; font-size: 13px; }
.footer-bottom p { margin: 0; }

/* Back to top ----------------------------------------------------------- */
.back-to-top {
  position: fixed;
  inset-inline-end: 18px;
  bottom: 18px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--cb-night);
  color: #fff;
  box-shadow: var(--cb-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 1100px) {
  .posts-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-content .alignwide { margin-inline: 0; max-width: 100%; }
}

@media (max-width: 1024px) {
  .masthead { gap: 8px; }
  .masthead__menu { display: inline-flex; }
  .primary-navigation { display: none; }
  .site-branding { flex: 1; justify-content: center; }
  .masthead__actions { margin-inline-start: 0; }
  .lead { grid-template-columns: 1fr; }
  .lead-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .posts-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-block__grid { grid-template-columns: 1fr; }
  .archive-layout { grid-template-columns: 1fr; }
  .archive-sidebar { position: static; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .article-shell { grid-template-columns: minmax(0, 1fr); }
  .share-rail { display: none; }
}

@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}
@media (max-width: 600px) {
  .admin-bar .site-header { top: 0; }
}

@media (max-width: 640px) {
  :root { --cb-header-h: 60px; }
  body { font-size: 15.5px; }
  .text-logo__name { font-size: 26px; }
  .text-logo__mark { width: 30px; height: 30px; }
  .ticker__inner { height: 40px; }

  .lead { width: 100%; margin-top: 0; gap: 0; }
  .lead-story { border-radius: 0; }
  .lead-story__body { padding: 4px 16px 22px; }
  .lead-story__title { font-size: 26px; }
  .lead-story__excerpt { font-size: 15px; }
  .lead-side { grid-template-columns: 1fr; gap: 0; padding: 4px 16px 0; }
  .lead-side .post-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--cb-line); }
  .lead-side .post-card__media { border-radius: var(--cb-radius-sm); }
  .lead-side .post-card__body { padding-top: 0; }
  .lead-side .post-card__title { font-size: 15px; }

  .section-heading { margin: 36px 0 18px; gap: 12px; }
  .section-heading h2 { font-size: 26px; }
  .posts-grid--two, .posts-grid--three { grid-template-columns: 1fr; gap: 28px; }
  .posts-grid--four { grid-template-columns: 1fr; gap: 0; }
  .posts-grid--four .post-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--cb-line); }
  .posts-grid--four .post-card__media { border-radius: var(--cb-radius-sm); }
  .posts-grid--four .post-card__body { padding-top: 0; }
  .posts-grid--four .post-card__title { font-size: 15px; }
  .post-card--compact { grid-template-columns: 120px minmax(0, 1fr); }
  .post-card--featured { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .post-card--featured .post-card__body { padding-top: 14px; }
  .cat-block .section-heading__more { font-size: 13px; }

  .container--hero { width: 100%; }
  .film-frame { padding: 10px 0; border-radius: 0; }
  .film-frame::before, .film-frame::after { height: 10px; background-size: 20px 6px; }
  .article-title { font-size: 26px; }
  .article-deck { font-size: 16.5px; }
  .article-shell { margin-top: 24px; }
  .entry-content { font-size: 17px; line-height: 2.1; }
  .entry-content h2 { font-size: 21px; }
  .entry-content h3 { font-size: 18.5px; }
  .share-bar__btn span { display: none; }
  .share-bar__btn { width: 44px; padding: 0; justify-content: center; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__card--next { grid-column: auto; text-align: right; }

  .footer-grid { grid-template-columns: 1fr; gap: 30px; padding: 40px 0 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker__track { animation: none; }
  .ticker__viewport { overflow-x: auto; scrollbar-width: none; }
  .ticker__group[aria-hidden="true"] { display: none; }
  .mobile-panel:not([hidden]) { animation: none; }
  .back-to-top { transition: none; }
}

@media print {
  .site-header, .ticker, .share-rail, .share-bar, .related-posts, .comments-container, .site-footer, .back-to-top, .reading-progress { display: none !important; }
}
