/*
Theme Name: Platform Theme
Theme URI: https://semnanplatform.ir
Author: Semnan Platform
Description: Minimal classic theme shell for Elementor Pro. The whole display layer lives in Elementor (Theme Builder header/footer + Elementor page content); this theme only provides the template shell that renders the Theme Builder locations via elementor_theme_do_location(). See Platform/AGENTS.md §7.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: platform
Tags: rtl-language-support, custom-menu, translation-ready
*/

/*
 * Deliberately tiny. The reference design (§4: assets/css/style.css, 106 KB) is
 * carried per-section inside the Elementor documents, NOT here, so this file
 * must never fight those rules. Only structural safety nets live here.
 */

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
}

.semnan-skip-link {
	position: absolute;
	right: -9999px;
	top: 0;
	z-index: 100000;
	background: #fff;
	color: #102a71;
	padding: 10px 16px;
	border-radius: 0 0 8px 8px;
}

.semnan-skip-link:focus {
	right: 0;
}

/* Standalone login / registration screen (no site header, no site footer).
   index.php renders a minimal document for these screens; this only centres the
   Elementor content and gives the page the reference cream ground. */
.semnan-standalone-body {
	background: var(--cream, #fffdf0);
}

.semnan-standalone {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 20px;
	box-sizing: border-box;
	color: var(--sp-ink, #16224a);
}

.semnan-standalone > .elementor-widget-shortcode,
.semnan-standalone > .semnan-account {
	width: 100%;
	max-width: 440px;
}

/* Fallback header/footer, used only when no Elementor Theme Builder part exists. */
.semnan-fallback-header,
.semnan-fallback-footer {
	padding: 16px;
	text-align: center;
}

.semnan-fallback-footer {
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	font-size: 0.9rem;
}

/* Full-width header (user request 2026-10-13): the reference constrains the
   header content to a max-width container; the WP site spans it edge-to-edge.
   Scoped to .site-header only — other pages keep the reference container. */
.site-header .container {
	width: 100%;
	padding-inline: 20px;
	max-width: none;
}

/* Burger: the reference sizes it 42×42; the WP icon widget collapses it. */
.site-header .burger {
	display: none;
	width: 42px;
	height: 42px;
	border-radius: 10px;
	background: var(--navy-dark, #001840);
	color: var(--gold, #F5C400);
	place-items: center;
	flex-shrink: 0;
}
.site-header .burger svg {
	width: 20px;
	height: 20px;
}

/* The header is STICKY and matches «مرجع» exactly (user request 2026-10-18:
   «اون هدرش متحرکه و منم دقیقا همین ویژگی را میخام» — the header must stay
   visible at the top while the page scrolls).

   ⚠ THE STICKY ELEMENT IS THE WRAPPER, NOT `.site-header`.
   `position: sticky` has no range outside its containing block (its parent).
   Our header is nested: `<body> > <header class="elementor-location-header"> >
   <div class="… site-header">`. The Theme Builder wrapper is only as tall as the
   bar (~92px), so a sticky `.site-header` is clamped to those 92px and scrolls
   away immediately — the exact "does not stick" the user kept hitting, while
   `getComputedStyle().position` still read `sticky`. Making the WRAPPER sticky
   fixes it: its containing block is `<body>` (the whole document), so it pins
   just like the reference's own body-level `.site-header`.

   `.site-header` keeps the reference's visual values:
     background rgba(255,253,240,.9) · backdrop-filter blur(12px)
     · border-bottom 1px solid var(--line) · transition box-shadow .25s
   The `.site-header.scrolled { box-shadow … }` rule that pairs with it arrives
   inside header part 41's html widget (page BODY) and is toggled by `main.js`
   on `window.scrollY > 8`, exactly as on the reference.

   The `body` prefix is REQUIRED, not decoration: the reference's own
   `.site-header { position: sticky }` lives in the page BODY, so it is parsed
   AFTER this theme stylesheet; `body .site-header` (0,1,1) beats it (0,1,0).

   ⚠ MIRRORED BY AN INLINE GUARD — change ONE, change the OTHER.
   `wp-content/mu-plugins/semnan-header-scroll.php` prints the SAME declarations
   inline in `wp_head` with `!important`. Why duplicate it: a `<link>` stylesheet
   is cached SEPARATELY from the HTML, so a stale `style.css` can serve the old
   position while the HTML is fresh — which is exactly what the user hit (new
   icons, old position = mixed state). An inline `<style>` is part of the
   document and cannot be cached apart from it. Because the guard's declarations
   carry `!important` they always win over this block, so if you change a value
   HERE and nothing happens on the page, edit the mu-plugin too (or delete it). */
header.elementor-location-header {
	position: sticky;
	top: 0;
	z-index: 1000;
}
body .site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: rgba(255, 253, 240, .9);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
	transition: box-shadow .25s;
}

/* Match the reference mobile behaviour: hide the CTA (it lives inside the
   drawer instead) and show the burger. The reference CSS does this at
   max-width:900px; this site's breakpoint is 1009px because the header carries
   one control the reference does not (the login pill), so the desktop row needs
   ~1010px before it fits — see the ladder comment further down. */
@media (max-width: 985px) {
	.site-header .nav-cta {
		display: none;
	}
	/* The reference only hides .nav-links at ≤900px, so between 901 and 1009 it
	   would sit in the row as a half-squeezed second line — hide it here too and
	   let the burger carry the navigation. */
	.site-header .nav-links {
		display: none;
	}
	.site-header .burger {
		display: grid;
	}
	/* The row gains the auth icon on mobile (user-approved), so the 20px inset
	   would squeeze .brand and wrap its name to 3 lines (header 86 → 128px).
	   Zeroing the inset keeps all five items on one row. */
	.site-header .nav {
		padding-inline: 0;
	}
	/* Cluster the row instead of spreading it: the reference's
	   `justify-content: space-between` would push the five items apart across
	   the whole width (measured 487px of dead space between the brand and the
	   search icon at a 1005px viewport). The brand is pinned right with an auto
	   margin and the four controls sit together at the left, 8px apart —
	   measured at 375px: brand 160 + 4×42 + 4×8 = 360, exactly the viewport. */
	.site-header .nav {
		justify-content: flex-start;
		gap: 0;
	}
	.site-header .nav .brand {
		/* NOT `flex: none` here: at 375px the natural brand (174px) plus four
		   42px icons plus four 8px gaps is 374px in a 360px box, so the brand
		   must be allowed to give up 14px. It does so by narrowing its name
		   column, which stays on two lines (measured: 119 → 105px wide, the
		   strong still 48px tall) — the header stays at the reference's 86px. */
		flex: 0 1 auto;
		min-width: 0;
		margin-inline-end: auto;
	}
	.site-header .nav-search,
	.site-header .nav-bell,
	.site-header .nav .semnan-auth-btn {
		margin-inline-end: 8px;
	}
	.site-header .nav-search {
		margin-inline-start: 8px; /* keeps the nav text off the icon cluster */
	}
	/* The cart and the login pill are Elementor WIDGET wrappers, so the gap has
	   to sit on the wrapper (the actual flex item). A margin on the inner
	   `.semnan-auth-btn` sits *inside* that wrapper and never reaches the row —
	   measured: auth wrapper 42px wide with `margin-inline-end: 8px` on its
	   child, and 0px of real gap to the burger. */
	.site-header .nav .elementor-element-cart0001,
	.site-header .nav .elementor-element-9b45ff5 {
		display: flex;
		align-items: center;
		flex: 0 0 auto;
		margin-inline-end: 8px;
	}
}

/* Header icons (user request 2026-10-15): simplified BLACK icons on a modern
   gray pill that turns gold on hover. The reference used navy icons on
   gold-soft / light-blue / navy pills; the user asked for black + gray + a gold
   hover. Scoped to the header so nothing else changes. */
.site-header .nav-search,
.site-header .nav-bell,
.site-header .burger {
	background: #eef0f3;
	color: #000;
}
.site-header .nav-search:hover,
.site-header .nav-bell:hover,
.site-header .burger:hover {
	background: var(--gold, #f5c400);
	color: #000;
}
/* Burger: the hamburger SHAPE is kept — the user corrected me 2026-10-15
   («فقط استایل را از آیکون حساب کاربری الگو بگیره نه که طرحش رو»): only the
   STYLE comes from the account icon, not its shape. So the FA bars SVG is replaced
   by a 3-line hamburger drawn with the account icon's stroke (2px, round caps). */
.site-header .burger svg { display: none; }
.site-header .burger::before {
	content: '';
	display: block;
	width: 20px; height: 20px;
	background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%3E%3Cpath%20d='M4%207h16'/%3E%3Cpath%20d='M4%2012h16'/%3E%3Cpath%20d='M4%2017h16'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Membership (auth) icon — larger, per the user's request. */
.semnan-auth-btn .semnan-auth-ico svg { width: 22px; height: 22px; }

/* Replace Elementor's default accent #6ec1e4 with the palette navy-dark #001840
   (user request 2026-10-15). #6ec1e4 is NOT part of the site palette — it is
   Elementor's default accent, used by the Kit's global colors (primary/accent) and
   by the jet-elements carousel. The `!important` on the custom properties is required
   because post-5.css (generated from the Kit) sets the same variables at the same
   specificity and is enqueued after the theme stylesheet. */
.elementor-kit-5 {
	--e-global-color-primary: #001840 !important;
	--e-global-color-accent: #001840 !important;
}
.jet-carousel .jet-carousel__item .jet-carousel__item-button { background-color: #001840 !important; }
.jet-carousel .jet-slick-dots li:hover span { background-color: #001840 !important; }

/* Agent 5's account button ([semnan_auth_button], widget 9b45ff5) is an EXTRA item
   the reference header does not have. The user approved keeping it as an
   intentional deviation (2026-10-15): it stays in the header, and on mobile it
   collapses to an icon-only pill so the row still fits — measured at 375px:
   brand 166 + search 40 + bell 42 + burger 42 + icon 28 + 4×10 gap = 358 ≤ 360.
   /login/ and /my-account/ stay reachable directly and from the mobile drawer. */
@media (max-width: 985px) {
	/* Every header icon button is the SAME square and centers its glyph with
	   grid place-items (not inline-flex/flex-centering, which lets the glyph sit
	   off-centre vertically). No `align-items: unset` here — it would override the
	   shorthand's align-items and leave the glyph un-centred. */
	.site-header .nav-search,
	.site-header .nav-bell,
	.site-header .nav .semnan-auth-btn {
		width: 42px;
		height: 42px;
		display: grid;
		place-items: center;
	}
	.site-header .nav .semnan-auth-btn {
		background: #eef0f3;
		color: #000;
		border-radius: 12px;
		padding: 6px;
		gap: 0;
	}
	.site-header .nav .semnan-auth-btn:hover {
		background: var(--gold, #f5c400);
		color: #000;
	}
	.site-header .nav .semnan-auth-btn .semnan-auth-label {
		display: none;
	}
}

/* Dynamic auth button (logged out: "ورود / ثبت‌نام", logged in: account link). */
.semnan-auth-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var(--navy-dark, #001840);
	color: #fff;
	padding: 8px 18px;
	border-radius: 999px;
	font-size: 0.86rem;
	font-weight: 700;
	white-space: nowrap;
	text-decoration: none;
	transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.semnan-auth-btn:hover {
	background: var(--navy, #102a71);
	transform: translateY(-2px);
	box-shadow: 0 12px 26px -12px rgba(0, 24, 64, 0.5);
}
.semnan-auth-btn .semnan-auth-ico {
	display: inline-flex;
	font-size: 0.9rem;
	line-height: 1;
}
/* On mobile the icon-only pill must centre its glyph exactly: the span's
   line-height made it 30px tall (vs the 22px SVG), pushing the glyph up. */
@media (max-width: 985px) {
	.site-header .nav .semnan-auth-btn .semnan-auth-ico {
		width: 22px;
		height: 22px;
		line-height: 22px;
	}
}

/* Mobile drawer — the reference's own rules (style.css 154-173 + 1470-1481),
   kept in the theme so pages without the reference stylesheet still get the
   correct drawer. ONE user-approved deviation (2026-10-15): the panel background
   is solid #FFFFFF instead of «مرجع»'s cream — the cream panel read as "no
   background" against the cream page. Everything else matches «مرجع». */
/* Header cart button ([semnan_cart_button], added 2026-10-19): standard
   WooCommerce cart affordance in the header — gray pill turning gold on
   hover, matching the search/bell icons, with a live item-count badge.
   Count is kept in sync by WooCommerce's wc-cart-fragments (standard). */
.site-header .nav .semnan-cart-btn {
  display: block;
  width: 42px;
  height: 42px;
  padding: 0;
  background: #eef0f3;
  color: #000;
  border-radius: 12px;
  text-decoration: none;
  position: relative;
  transition: background 0.2s, color 0.2s;
}
.site-header .nav .semnan-cart-btn:hover {
  background: var(--gold, #f5c400);
  color: #000;
}
.site-header .nav .semnan-cart-btn svg {
  width: 20px;
  height: 20px;
}
/* Centre the cart glyph exactly, using the same technique as the search/bell
   pills: those are Elementor icon widgets whose own CSS leaves the SVG a few
   px off centre, so the deterministic fix is an absolutely positioned layer
   that fills the square and centres its child with grid (measured dx/dy 12/12). */
.site-header .nav .semnan-cart-ico {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  line-height: 0;
}
.site-header .nav .semnan-cart-ico svg { display: block; }
.site-header .nav .semnan-cart-count {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--navy-dark, #001840);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.site-header .nav .semnan-cart-count:empty {
  display: none;
}

/* Mini-cart popup ([semnan_cart_button]) — dropdown on desktop,
   bottom sheet on mobile. Theme-aligned: cream ground, navy text, gold accent. */
.semnan-cart-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.semnan-mini-cart {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 70vh;
  overflow: auto;
  background: #fffdf0;
  border: 1px solid rgba(16, 42, 113, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px -20px rgba(0, 24, 64, 0.35);
  z-index: 1001;
  padding: 0;
  font-family: inherit;
}
.semnan-mini-cart[hidden] { display: none; }
.semnan-mini-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(16, 42, 113, 0.08);
}
.semnan-mini-cart__title {
  font-size: 15px;
  font-weight: 700;
  color: #001840;
}
.semnan-mini-cart__close {
  width: 28px;
  height: 28px;
  border: 0;
  background: #eef0f3;
  color: #000;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.semnan-mini-cart__close:hover { background: var(--gold, #f5c400); }
.semnan-mini-cart__body {
  padding: 8px 12px;
  max-height: 46vh;
  overflow: auto;
}
.semnan-mini-cart__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.semnan-mini-cart__item {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(16, 42, 113, 0.06);
}
.semnan-mini-cart__item:last-child { border-bottom: 0; }
.semnan-mini-cart__thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  background: #eef0f3;
}
.semnan-mini-cart__name {
  font-size: 13px;
  font-weight: 600;
  color: #001840;
  text-decoration: none;
  display: block;
  line-height: 1.4;
}
.semnan-mini-cart__name:hover { color: var(--gold, #f5c400); }
.semnan-mini-cart__meta {
  font-size: 12px;
  color: #5c6575;
  margin-top: 2px;
}
.semnan-mini-cart__line {
  font-size: 13px;
  font-weight: 700;
  color: #001840;
  white-space: nowrap;
}
.semnan-mini-cart__remove {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #5c6575;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.semnan-mini-cart__remove:hover { background: #fdecea; color: #b81c23; }
.semnan-mini-cart__foot {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(16, 42, 113, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.semnan-mini-cart__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: #001840;
}
.semnan-mini-cart__row b { font-size: 16px; }
.semnan-mini-cart__btn {
  display: block;
  text-align: center;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.semnan-mini-cart__btn--open {
  background: #eef0f3;
  color: #001840;
}
.semnan-mini-cart__btn--open:hover { background: var(--gold, #f5c400); }
.semnan-mini-cart__btn--checkout {
  background: var(--navy-dark, #001840);
  color: #fff;
}
.semnan-mini-cart__btn--checkout:hover { background: var(--navy, #102a71); }
.semnan-mini-cart__empty {
  padding: 24px 16px;
  text-align: center;
  color: #5c6575;
  font-size: 14px;
}
@media (max-width: 640px) {
  .semnan-mini-cart {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: 75vh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px -10px rgba(0, 24, 64, 0.3);
  }
}
@media (max-width: 985px) {
  .site-header .nav .semnan-cart-btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
  }
}
/* Account page cart button (added 2026-10-19): quick access to the cart
   from the My Account dashboard. */
.semnan-account-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: #eef0f3;
  color: #001840;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s, transform 0.2s;
  margin: 8px 0 16px;
}
.semnan-account-cart-btn:hover {
  background: var(--gold, #f5c400);
  transform: translateY(-2px);
}
.semnan-account-cart-btn svg {
  width: 18px;
  height: 18px;
}
.semnan-account-cart-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--navy-dark, #001840);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.mobile-menu { position: fixed; inset: 0; z-index: 2000; pointer-events: none; }
.mobile-menu.open { pointer-events: auto; }
/* `.mobile-menu` prefix (NOT `.site-header`): the drawer is reparented to <body> by
   mu-plugins/semnan-mobile-menu.php, so a `.site-header`-scoped rule no longer matches.
   The specificity is still needed — the reference's drawer CSS is embedded in the page
   body, so a plain `.mm-backdrop` rule loses on source order. */
.mobile-menu .mm-backdrop { position: absolute; inset: 0; background: rgb(0, 24, 64); opacity: 0; transition: opacity .25s; }
.mobile-menu.open .mm-backdrop { opacity: 1; }
.mobile-menu .mm-panel {
	position: absolute; top: 0; right: 0; bottom: 0; width: min(300px, 85%);
	background: #FFFFFF; box-shadow: -16px 0 40px rgba(0, 24, 64, .25);
	transform: translateX(105%); transition: transform .3s;
	display: flex; flex-direction: column; padding: 18px;
}
.mobile-menu.open .mm-panel { transform: translateX(0); }
.mm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mm-close { width: 38px; height: 38px; border-radius: 10px; background: rgba(16, 42, 113, .08); color: var(--navy, #102a71); display: grid; place-items: center; font-size: 1rem; }
.mm-links a {
	display: flex; align-items: center;
	padding: 13px 10px; border-bottom: 1px solid rgba(16, 42, 113, .08);
	font-weight: 700; color: var(--ink, #102a71); font-size: 1rem;
}
.mm-links a:hover { color: var(--navy, #102a71); background: rgba(245, 196, 0, .12); }
/* Login entry appended to the drawer by mu-plugins/semnan-auth-menu.php — scoped
   so the reference's five drawer links stay byte-identical. */
.mm-links a[data-semnan-auth] { gap: 10px; }
.mm-links a[data-semnan-auth] .mm-auth-ico { display: inline-flex; flex-shrink: 0; }
.mm-notif {
	display: flex; align-items: center; gap: 10px;
	width: 100%;
	margin-bottom: 6px; padding: 12px 14px;
	border-radius: 12px;
	background: rgba(245, 196, 0, .2);
	color: var(--navy-dark, #001840);
	font-weight: 800; font-size: .9rem;
	transition: background .2s;
}
.mm-notif svg { width: 18px; height: 18px; }
.mm-notif.on { background: var(--gold, #f5c400); }

/* ---------------------------------------------------------------------------
   Header icon buttons — ONE size, glyph exactly centred inside the square
   (user request 2026-10-15: «تمام آیکون های هدر را یک اندازه کن، طرح وسط مربع
   های خاکستری هم تماما وسط در وسط مربع باشند»).
   Why absolute: these are Elementor icon widgets whose own CSS leaves the SVG
   a few px off the centre of the box (measured dy 7 vs the expected 12 for a
   19px glyph in a 42px square). Grid/flex centering could not fix it — the
   glyph's own `position: relative` and the widget's row metrics shift it.
   `position: absolute; top/left: 50%; translate(-50%,-50%)` is deterministic
   and needs no knowledge of the widget's internals.
   Scoped to `.site-header` so nothing else changes.
--------------------------------------------------------------------------- */
.site-header .nav-search,
.site-header .nav-bell,
.site-header .burger,
.site-header .nav .semnan-auth-btn {
	position: relative;
}
.site-header .nav-search,
.site-header .nav-bell,
.site-header .burger {
	width: 42px;
	height: 42px;
	padding: 0;
}
.site-header .nav-search svg,
.site-header .nav-bell svg,
.site-header .burger svg,
.site-header .burger::before {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	margin: 0;
}
/* The desktop auth pill is an inline icon+label pill, NOT a square — centring its
   glyph absolutely there pulls it out of the flow and it lands on top of the label.
   So the auth glyph is centred absolutely ONLY where the pill is a 42×42 square
   (see the media queries above); at ≥1100px it keeps its natural inline flow. */
@media (max-width: 985px) {
	.site-header .nav .semnan-auth-btn .semnan-auth-ico {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		width: 22px;
		height: 22px;
	}
}

/* ---------------------------------------------------------------------------
   Desktop header row — grouped by FUNCTION instead of spread evenly
   (user request 2026-10-16: «در حالت سیستم دکمه های هدر خیلی پخش و نامرتبن …
   فاصله های بینشون رو بچینی و خیلی تمیز با توجه به ماهیت و عملکرد دکمه»).

   Two real defects were measured at a 985px viewport, not eyeballed:
   (1) the row is `justify-content: space-between` with six children, so every
       pair of unrelated controls ended up exactly 16px apart — brand, nav,
       two utility icons and two action pills all at the same distance, which
       reads as random. On a wider screen space-between then pushes the gaps
       apart further still.
   (2) the login pill's wrapper is `flex: 0 1 auto`, so it was ALLOWED TO
       SHRINK: the row needed 989px of content in a 945px box, the wrapper
       collapsed 140 → 96 and the pill itself hung 23px off the LEFT EDGE of
       the viewport (measured `documentElement.scrollWidth - clientWidth = 23`,
       pill x = -23). That is the overflow the user could see.

   Fix — one tidy row, RTL right → left:
       brand ·10· nav-links ·—— flexible space ——— search ·8· bell ·18· CTA ·10· auth
   The navigation stays beside the brand (one group); the utility icons pair up
   tightly (one group); the two action pills pair up tightly (one group). The
   gaps between groups are bigger than the gaps inside them, so the grouping is
   legible instead of uniform.
   `gap: 0` is deliberate — the reference's own `gap: 16px` must not re-apply
   on top of these margins, hence every pair is set explicitly below.
   Desktop only (min-width: 986px); the ≤985px row is the mobile/drawer layout.
--------------------------------------------------------------------------- */
/* The brand tagline «فعالیت‌های دانشجویی» must stay on ONE line, like «مرجع».
   Measured: with it wrapping, `.brand-name` is 83px tall instead of 65, which
   pushed the whole header to 110px instead of the reference's 92px. A runtime
   probe of `white-space: nowrap` on that one span gave brand 65 / header 92 /
   overflow 0, so this is the reference geometry, restored — not a redesign. */
.site-header .brand-name span {
	white-space: nowrap;
}

@media (min-width: 986px) {
	.site-header .nav {
		justify-content: flex-start;
		gap: 0;
	}
	/* Group 1 — identity + navigation, together on the right. The brand may
	   shrink (its name then wraps to two lines exactly like «مرجع»: measured
	   there brand 161.3 with a 48px two-line name at 985px, and 195.9 with a
	   one-line name at 1296px) but NOT past the two-line floor — at a natural
	   142.6px the name needed THREE lines and the header grew 92 -> 116px. */
	.site-header .nav .brand {
		flex: 0 1 auto;
		min-width: 161px;
		margin-inline-end: 10px;
	}
	.site-header .nav-links {
		margin-inline-end: auto; /* absorbs the free space: pushes the controls left */
	}
	/* Group 2 — utility icons: search · 8 · bell · 8 · cart, one tight cluster. */
	.site-header .nav-search {
		margin-inline-start: 8px; /* separates the nav from the icon cluster */
		margin-inline-end: 8px;
	}
	.site-header .nav-bell { margin-inline-end: 8px; }
	.site-header .nav .elementor-element-cart0001 { margin-inline-end: 18px; }
	/* Group 3 — actions: the reference CTA pill and the login pill, paired. */
	.site-header .nav-cta { margin-inline-end: 10px; }
	/* The cart widget and the login pill must never be squeezed. A squeezed
	   cart measured 31.45px wide while its 40px inner box still overflowed the
	   pill, and the widget wrapper's baseline box was 51.59px tall instead of
	   42 — `display:flex` fixes both. */
	.site-header .nav .elementor-element-cart0001,
	.site-header .nav .elementor-element-9b45ff5 {
		display: flex;
		align-items: center;
		flex: 0 0 auto;
	}
}

/* Nav links MAY wrap onto two lines — that is exactly what «مرجع» does, and it
   is the reason its header fits at 985px. Measured there at a 985px viewport:
   `.nav-links` 456.2 x 59.2, the three long labels 72.9 / 78.5 / 66.2px wide and
   69.6px tall (two lines each), and `scrollWidth == width` — nothing spills.

   Forcing `nowrap` (what used to be here) did the opposite: the ul kept a
   448.9px box while its five nowrap links measured 571px, so 122px of link text
   escaped to the LEFT and slid under the search / bell pills. That overflow —
   not the cart icon — is the "messy header" the user reported on 2026-10-19. */
.site-header .nav-links li { min-width: 0; }
.site-header .nav-links a {
	white-space: normal;
	text-align: center;
}

/* ONE line above 1185px, two below it — never a ragged mix.
   Measured at a 1281px client width: five SINGLE-line labels need 560.7px with an
   11px inline padding (the reference's own 14px pushes that to 594px, which does
   not fit), and the nav-links box has 578.9px there. So the reference's 14px
   padding is what forced only the three long labels to wrap while «خانه» and
   «اطلاعیهها» stayed on one line — the uneven row the user called «بهم ریخته».
   Dropping 3px per side per link is invisible next to that, and buys a single
   clean line whenever the width allows it. Below 1185px the nav genuinely has
   no room for one line and the reference's two-line wrap returns (that is what
   «مرجع» itself does at 985px).
   NOTE: do NOT switch these <a> to `display:flex` to centre a mixed wrap — it
   was measured and it grows each label by 2px (42 -> 44.1, two-line 71.6 ->
   72.3), which pushes the header 92.3 -> 99.3px. */
@media (min-width: 1185px) {
	/* `!important` is required twice over: the reference's own
	   `.site-header .nav-links a` rule lives inside header part 41's html widget
	   (page BODY), so it is parsed AFTER this stylesheet and wins at equal
	   specificity.
	   1185px is measured, not guessed. Five SINGLE-line labels need 560.7px at
	   an 11px inline padding; 10px is used instead so there is ~10px of slack on
	   both sides of every band edge, and the numbers below are client widths
	   (the viewport minus the 15px scrollbar) straight out of the DOM:
	     needed  ~550.7px   brand 195.9 + six gaps 62 + three pills 126
	                        + CTA 142.6 + icon login 42 + inset 40
	     fits from innerWidth 1185 (client 1170 -> 565px available)
	     and at      innerWidth 1281 (client 1266 -> 559.9px available)
	     and with the login LABEL shown, innerWidth 1282 (client 1267 -> 560.9px).
	   Below 1185px the labels must wrap; that wrap is what «مرجع» does at 985px.
	   NOTE: do NOT switch these <a> to `display:flex` to centre a mixed wrap — it
	   was measured and it grows each label by 2px (42 -> 44.1, two-line 71.6 ->
	   72.3), which pushes the header 92.3 -> 99.3px. */
	.site-header .nav-links a { padding-inline: 10px !important; }
}

/* ---- The desktop ladder -------------------------------------------------------
   Seven items now share the row: brand · nav-links · search · bell · cart ·
   CTA · login. Measured natural content (Kalameh loaded):
     brand 195.9 (one-line name; 161 when the name wraps to two lines, like
     «مرجع») + 10 + nav-links 571 at the reference's own 14px link padding +
     8 + search 42 + 8 + bell 42 + 8 + cart 42 + 18 + CTA 142.6 + 10 + login 42
     = 1023 fixed + 40px of nav padding.
   The nav is the only elastic part, and letting it wrap (rule above) means the
   row degrades by re-flowing text instead of spilling — that is what keeps
   widths in the high 900s workable.
     >=1185px    : every label fits on ONE line (10px link padding, measured
                   560.7px needed) — the login pill stays the icon square.
     >=1282px    : the login shows its LABEL (+97.6) and there is still room.
     986-1184px  : the labels wrap to two lines, exactly like «مرجع» at 985px;
                   the login pill is the 42x42 icon square (user-approved).
   Below 986px the seven-item row does not exist at all: «مرجع» itself needs
   906px for its FIVE items and this header carries two more, so the
   mobile/drawer layout runs to 985px instead of the reference's 900px.
--------------------------------------------------------------------------- */
/* Tight desktop band: the five nav labels are the only elastic part of the row,
   and their summed min-content width (412px at the reference's own 14px link
   padding) plus the brand's 161px floor is what sets the lowest workable width.
   Dropping the link padding to 10px costs 4px per side per link — 40px in total
   — and buys 4px of headroom per link, which keeps the row clean from about
   930px up instead of exactly 985px. Measured at a simulated 971px client
   width: with 14px the ul spilled 15px past its own box (still 35px clear of the
   search pill, but sloppy); with 10px it fits inside.
   Above 1080px the reference's full 14px padding is used again. */
@media (min-width: 986px) and (max-width: 1080px) {
	.site-header .nav-links a { padding-inline: 10px !important; }
}

@media (min-width: 986px) and (max-width: 1281px) {
	.site-header .nav .semnan-auth-btn {
		width: 42px;
		height: 42px;
		padding: 0;
		justify-content: center;
		background: #eef0f3;
		color: #000;
		border-radius: 12px;
	}
	.site-header .nav .semnan-auth-btn:hover {
		background: var(--gold, #f5c400);
		color: #000;
	}
	.site-header .nav .semnan-auth-btn .semnan-auth-label { display: none; }
	.site-header .nav .semnan-auth-btn .semnan-auth-ico {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		width: 22px;
		height: 22px;
	}
}

/* ---- Small-screen header ladder (added 2026-10-19, with the cart icon) --------
   The mobile row now carries FIVE controls (search · bell · cart · login ·
   burger) plus the brand. Measured at a 360px client width with the desktop
   42px/8px metrics: 5x42 + 5x8 = 250, which left the brand only 110px — its
   name broke to THREE lines and the header grew 86 -> 110px. The pills and gaps
   therefore step down in two bands so the brand always keeps the ~161px it needs
   for «مرجع»'s two-line name:
     inner <=379px : 34px pills, 5px gaps -> brand 165px at client 360 (2 lines)
     inner 380-428px : 36px pills, 6px gaps -> brand 164px at client 413 (2 lines)
     inner >=429px : 42px pills, 8px gaps (unchanged; brand 164px at client 414)
-------------------------------------------------------------------------------- */
@media (max-width: 428px) {
	.site-header .nav-search,
	.site-header .nav-bell,
	.site-header .burger,
	.site-header .nav .semnan-auth-btn,
	.site-header .nav .semnan-cart-btn {
		width: 36px;
		height: 36px;
	}
	.site-header .nav-search { margin-inline-start: 6px; margin-inline-end: 6px; }
	.site-header .nav-bell { margin-inline-end: 6px; }
	.site-header .nav .elementor-element-cart0001 { margin-inline-end: 6px; }
	.site-header .nav .elementor-element-9b45ff5 { margin-inline-end: 6px; }
	.site-header .nav .semnan-cart-ico svg { width: 18px; height: 18px; }
	.site-header .nav .semnan-cart-count {
		top: -5px;
		inset-inline-end: -5px;
		min-width: 16px;
		height: 16px;
		line-height: 16px;
		font-size: 10px;
	}
}
@media (max-width: 379px) {
	.site-header .nav-search,
	.site-header .nav-bell,
	.site-header .burger,
	.site-header .nav .semnan-auth-btn,
	.site-header .nav .semnan-cart-btn {
		width: 34px;
		height: 34px;
	}
	.site-header .nav-search { margin-inline-start: 5px; margin-inline-end: 5px; }
	.site-header .nav-bell { margin-inline-end: 5px; }
	.site-header .nav .elementor-element-cart0001 { margin-inline-end: 5px; }
	.site-header .nav .elementor-element-9b45ff5 { margin-inline-end: 5px; }
}
/* ===== mobile brand lockup, 2026-11-01 ===== ==============================================
   THE FULL NAME DOES NOT FIT NEXT TO THE LOGO ON A PHONE. Measured in Kalameh:
   «پلتفرم دانشگاه سمنان» is 140.9px @16px while the brand column is 102-106px on
   a phone and on a narrow desktop (986-1184px) — so it wrapped to a second line
   («دو خطی», reported twice).

   The name is now TWO REAL ELEMENTS, added by `mu-plugins/semnan-brand-short.php`
   (an `elementor/widget/render_content` filter on the header heading widget):
     <strong><span class="bn bn-short">سمنان پلتفرم</span>
             <span class="bn bn-full">پلتفرم دانشگاه سمنان</span></strong>
   Reasons it is two elements and NOT a `::before` with `font-size:0` (the first
   attempt): a real inline span cannot break mid-word, cannot inherit a zero
   line-height, and keeps the full name as real text for screen readers and
   search engines at every width. Short name = 86.8px @16px, i.e. 38% narrower.

   The tagline «فعالیت‌های دانشجویی» is the widest child (103.4px @11.52), so it
   steps down to 10px (89.8px) — that is what actually buys the row its room:
   at client 345 the total goes 353.4 -> 339.8 in a 345px box, i.e. from 8px of
   overflow to 5px of slack. Header height stays the reference's 86px
   (44px mark + 2x21 block padding). */
.bn-short {
	display: none;
}
/* the two variants are <span>s inside <strong>, so the header's
   `.brand-name span { font-size: .72rem }` (the TAGLINE rule) would otherwise
   shrink the brand name itself — measured 11.52px instead of 16px. They take
   the strong's size instead. */
.site-header .brand-name .bn {
	font-size: inherit;
	line-height: inherit;
}

@media (max-width: 1184px) {
	.site-header .brand-name .bn-full {
		display: none;
	}
	.site-header .brand-name .bn-short {
		display: inline;
	}
	.site-header .brand-name strong,
	.site-header .brand-name span {
		white-space: nowrap;
	}
	/* never let the row squeeze the name into a second line */
	.site-header .nav .brand {
		flex: 0 0 auto;
	}
}

@media (max-width: 640px) {
	/* the login pill's BUTTON carries its own `margin-inline-end:8px` from an
	   earlier round; inside the wrapper (the actual flex item) it inflated the
	   login slot to 38px for a 30px pill. The wrapper already carries the gap. */
	.site-header .nav .semnan-auth-btn {
		margin-inline-end: 0;
	}
	.site-header .nav .elementor-element-9b45ff5 {
		width: auto;
		height: auto;
		flex: 0 0 auto;
	}
	/* the tagline is what sets the column's width — one small step here is what
	   gives the whole row its room */
	.site-header .brand-name span {
		font-size: 10px;
	}
	.site-header .nav {
		padding-block: 21px;
	}
}


@media (max-width: 339px) {
	/* 5x28 + 4x4 gaps + brand(44+11+81.4) = 302 in a 320px client */
	.site-header .nav-search,
	.site-header .nav-bell,
	.site-header .burger,
	.site-header .nav .semnan-auth-btn,
	.site-header .nav .semnan-cart-btn {
		width: 28px;
		height: 28px;
	}
	.site-header .nav-search {
		margin-inline-start: 4px;
		margin-inline-end: 4px;
	}
	.site-header .nav-bell,
	.site-header .nav .elementor-element-cart0001,
	.site-header .nav .elementor-element-9b45ff5 {
		margin-inline-end: 4px;
	}
	.site-header .nav .semnan-cart-ico svg {
		width: 16px;
		height: 16px;
	}
}


/* ===== .ntf-toast (Web Push toast) ===== ==============================
/* reference: assets/css/style.css — the notification toast shown by main.js
   and by assets/push.js. It was never ported into the WP split stylesheet, so
   the toast was created in the DOM and was invisible. */
.ntf-toast {
  position: fixed; left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(10px);
  z-index: 4000;
  background: var(--navy-dark); color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: .85rem; font-weight: 600;
  box-shadow: 0 18px 40px -18px rgba(0, 24, 64, .5);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.ntf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================================
   Reveal = decoration, never a visibility gate
   ----------------------------------------------------------------------------
   `assets/css/style.css` ships
       .reveal { opacity: 0; transform: translateY(18px) }
   and relies on `main.js` adding `.in` from an IntersectionObserver. The
   listing pages (/ettelaieh/, /amoozesh/, /blogha/) mark EVERY card
   `.reveal`, so if the observer never fires the whole list is invisible —
   a blank page under the hero (measured: 16/16 cards at opacity 0 on
   /ettelaieh/ with `.in` absent).

   Fix: the base state is VISIBLE and no animation is required. An animation
   that starts at opacity 0 would reproduce the same failure whenever the
   compositor is paused (background tab, throttled device) — so it is
   deliberately not used here. `main.js` still adds `.in` (harmless), and a
   safety net there reveals anything left hidden. Scoped to `.lp-page`;
   (0,2,0) beats the (0,1,0) `.reveal` rule these pages carry inline.
   ========================================================================== */
.lp-page .reveal,
body .lp-page .reveal {
	opacity: 1;
	transform: none;
	animation: none;
	transition: none;
}

/* ==========================================================================
   کاور اطلاعیه در صفحهٔ مجزا — کادر دقیقاً دور خود کاور
   --------------------------------------------------------------------------
   PHP نسبت واقعی تصویر را در متغیر `--ap-ratio` می‌گذارد (کلاس `has-ratio`).
   با آن، عرض جعبه = `min(ستون, ۵۶۰ × نسبت)` و ارتفاع از همان نسبت می‌آید؛
   یعنی **قاب دقیقاً اندازهٔ خود عکس است، نه یک باند پهن‌تر**. عکس‌های کوچک
   هم تا ارتفاع مرجع ۵۶۰px بزرگ می‌شوند (بدون کشیدگی، بدون برش).

   اگر نسبت معلوم نباشد (مثلاً تصویر بیرونی در دسترس نباشد) کلاس `has-ratio`
   ست نمی‌شود و قاعدهٔ امن اجرا می‌شود: باند ۵۶۰px با `object-fit: contain`.
   هیچ‌وقت تصویر کشیده یا بریده نمی‌شود.

   ارتفاع مرجع: ۵۶۰px سیستم · ۳۶۰px موبایل (`--ap-cover-h`).
   چرا این‌جا و نه در ann.css؟ چون `ann.css` نسخهٔ «مرجع» است و باید
   دست‌نخورده بماند؛ این قاعده با اختصاصی‌بودن بالاتر روی آن می‌نشیند.
   ========================================================================== */
body .ap-topcover .ap-cover,
body .ap-cover.is-tall {
	--ap-cover-h: 560px;
	max-inline-size: 100%;
	margin-inline: auto;
}

/* --- ۱) نسبت معلوم: قاب = خود عکس -------------------------------------- */
body .ap-topcover .ap-cover.has-ratio {
	inline-size: min(100%, calc(var(--ap-cover-h) * var(--ap-ratio)));
}
body .ap-topcover .ap-cover.has-ratio .ap-cover-btn {
	display: block;
	inline-size: 100%;
	block-size: auto;
	padding: 0;
	overflow: hidden;
	background: none;
}
body .ap-topcover .ap-cover.has-ratio .ap-cover-img {
	display: block;
	inline-size: 100%;
	block-size: auto;
	aspect-ratio: var(--ap-ratio);
	max-inline-size: 100%;
	max-block-size: none;
	object-fit: cover; /* نسبت جعبه = نسبت تصویر، پس برشی رخ نمی‌دهد */
	object-position: center;
	margin: 0;
}

/* --- ۲) نسبت نامعلوم: باند امن ----------------------------------------- */
body .ap-topcover .ap-cover:not(.has-ratio) {
	inline-size: 100%;
}
body .ap-topcover .ap-cover:not(.has-ratio) .ap-cover-btn {
	display: grid;
	place-items: center;
	inline-size: 100%;
	block-size: var(--ap-cover-h);
	padding: 0;
	overflow: hidden;
	background: none;
}
body .ap-topcover .ap-cover:not(.has-ratio) .ap-cover-img {
	inline-size: 100%;
	block-size: var(--ap-cover-h);
	max-inline-size: 100%;
	max-block-size: none;
	object-fit: contain;
	object-position: center;
	margin: 0;
}

@media (max-width: 640px) {
	body .ap-topcover .ap-cover,
	body .ap-cover.is-tall {
		/* روی موبایل ارتفاع مرجع بزرگ‌تر است تا عرضِ ستون گلوگاه شود و کاور
		   تمام‌عرض دیده شود؛ قاب باز هم دور خود عکس می‌ماند. */
		--ap-cover-h: 520px;
	}
}

/* لایت‌باکس: تصویر با ابعاد اصلی خودش (۱:۱) نمایش داده می‌شود؛ اگر از صفحه
   بزرگ‌تر بود، خودِ استیج اسکرول می‌خورد. هیچ کوچک‌سازی‌ای انجام نمی‌شود. */
body .ap-lightbox .ap-lb-stage {
	max-block-size: 88vh;
	overflow: auto;
}
body .ap-lightbox .ap-lb-stage img {
	inline-size: auto;
	block-size: auto;
	max-inline-size: none;
	max-block-size: none;
}
/* ==========================================================================
   تبلیغات «چیدمان مدیر تشکل»
   --------------------------------------------------------------------------
   نسخهٔ `.ap-ads--side` در «مرجع» فقط برای دسکتاپ است (`@media (max-width:900px)
   { display:none }`) و نسخهٔ `--inline` فقط موبایل. چیدمان مدیر تشکل هر دو را
   لازم دارد: در سیستم زیر فهرست مطالب سایدبار، در موبایل بالاترین بلوک. پس
   همان مارک‌آپ ساید را در موبایل هم نشان می‌دهیم؛ ترتیبش را خود رندرر با
   `order:-1` می‌دهد.
   ========================================================================== */
@media (max-width: 900px) {
	body .ap-ads.ap-ads--org {
		display: grid;
		grid-template-columns: 1fr;
		gap: 10px;
		margin-block: 0 14px;
	}
}
