/* ==========================================================================
   PRODUCTS AND SERVICES («محصولات و خدمات», services.html)
   The four businesses stand still at the corners of a square; in its middle a round window shows the
   pictures of the business in focus, and the dial round it swings to that business. Beside the square
   (under it on a phone) stand that business's own words and the way to its page; under the square, the
   controls. Wide screens: one screen with the footer's band along the bottom. Phones: a short page,
   heading, square, controls, words. (What is in focus is set by the script: fa.js, "PRODUCTS".)
   ========================================================================== */

.hubsec .head { margin-bottom: 0; }
.hubsec .head h1 { font-size: clamp(25px, 6.6vw, 40px); line-height: 1.45; color: var(--navy); }
.hubsec .head p { font-size: 16px; }
.hubsec .crumbs { margin-bottom: 0; color: var(--graphite); }
.hubsec .crumbs a:hover { color: var(--navy); }

.compass { width: 100%; max-width: 1480px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.compass__side { display: contents; }
.compass__stage { display: grid; justify-items: center; gap: 6px; min-width: 0; }
.compass__info { order: 3; }

/* ---------- the square: four businesses at its corners, the circle in its middle ---------- */
.compass__ring { position: relative; width: min(100%, 440px); aspect-ratio: 1; touch-action: pan-y; opacity: 0; transition: opacity 0.7s var(--ease); }
.hubsec.is-on .compass__ring, .no-js .compass__ring { opacity: 1; }
/* the ring of ticks turns slowly, always; the dial (a thin circle, a bright arc and a hand) swings to the business in
   focus: a quarter turn a place, the way the page reads (anticlockwise on a Persian page) */
.compass__ticks, .compass__dial { position: absolute; inset: 9%; width: 82%; height: 82%; overflow: visible; pointer-events: none; }
.compass__ticks { animation: compass-spin 90s linear infinite; }
.compass__ticks line { stroke: var(--blue); stroke-width: 0.7; opacity: 0.55; }
.compass__dial { transform: rotate(calc(45deg - var(--turn, 0) * 90deg)); transition: transform 0.9s var(--ease); }
[dir="ltr"] .compass__dial { transform: rotate(calc(-45deg + var(--turn, 0) * 90deg)); }
.compass__dial circle { fill: none; stroke: rgba(14, 49, 121, 0.22); stroke-width: 0.8; }
.compass__dial .arc { fill: none; stroke: var(--navy); stroke-width: 2.4; stroke-linecap: round; transform-origin: 100px 100px; transform: rotate(-22.5deg); }
.compass__dial .hand { fill: var(--navy); }
@keyframes compass-spin { to { transform: rotate(360deg); } }
[dir="rtl"] .compass__ticks { animation-direction: reverse; }

/* the window: one set of pictures per business in the same place; the set in focus turns into view */
.lens { position: absolute; inset: 22%; border-radius: 50%; overflow: hidden; background: var(--navy); box-shadow: 0 30px 60px -30px rgba(14, 49, 121, 0.75), 0 0 0 6px var(--white); isolation: isolate; }
.lens__set { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; opacity: 0; transform: rotate(-28deg) scale(1.12);
  transition: opacity 0.45s var(--ease), transform 0.9s var(--ease); }
[dir="ltr"] .lens__set { transform: rotate(28deg) scale(1.12); }
.lens__set.is-on { opacity: 1; transform: none; z-index: 1; }
.lens__set img { width: 100%; height: 100%; object-fit: cover; }
.lens__core { position: absolute; left: 50%; top: 50%; z-index: 2; width: 38%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 1px;
  background: var(--white); color: var(--navy); text-align: center; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.22), 0 14px 30px -12px rgba(4, 14, 44, 0.8); }
.lens__core img { width: clamp(15px, 22%, 26px); height: auto; }
.lens__core b { font-size: clamp(13px, 3.6vw, 18px); line-height: 1.3; }
.lens__core span { display: none; max-width: 84%; font-size: 10.5px; line-height: 1.3; color: var(--graphite); text-wrap: balance; }

/* a business: «محصولات و خدمات», its name and its field, at its corner of the square */
.cnode { position: absolute; z-index: 3; width: 31%; min-height: 21%; display: grid; align-content: center; justify-items: start; gap: 1px; padding: 8px 10px; border-radius: 16px; text-align: start;
  background: var(--white); border: 1px solid var(--line-dark); color: var(--navy); box-shadow: 0 18px 34px -24px rgba(14, 49, 121, 0.6);
  transition: background-color 0.4s, color 0.4s, border-color 0.4s, box-shadow 0.4s; }
.cnode[data-pos="0"], .cnode:nth-of-type(1) { top: 0; inset-inline-start: 0; }
.cnode[data-pos="1"], .cnode:nth-of-type(2) { top: 0; inset-inline-end: 0; }
.cnode[data-pos="2"], .cnode:nth-of-type(3) { bottom: 0; inset-inline-end: 0; }
.cnode[data-pos="3"], .cnode:nth-of-type(4) { bottom: 0; inset-inline-start: 0; }
.cnode small { font-size: 10.5px; font-weight: 500; line-height: 1.5; color: var(--graphite); transition: color 0.4s; }
.cnode b { font-size: clamp(17px, 5.2vw, 23px); line-height: 1.3; }
.cnode span { font-size: 11.5px; font-weight: 500; line-height: 1.5; color: var(--blue); transition: color 0.4s; }
.cnode.is-on { background: var(--navy); border-color: var(--navy); color: var(--white); box-shadow: 0 24px 44px -22px rgba(14, 49, 121, 0.85); }
.cnode.is-on small { color: var(--on-navy); }
.cnode.is-on span { color: #a9c1f5; }
.cnode:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 16px; }
.hub__bar { display: flex; justify-content: center; }

/* ---------- the words of the business in focus: one box per business in the same place ---------- */
.compass__info { display: grid; min-width: 0; }
.cinfo { grid-area: 1 / 1; display: grid; gap: 12px; align-content: start; padding: 22px 20px 24px; border-radius: 24px; background: var(--white); border: 1px solid var(--line-dark);
  box-shadow: 0 40px 70px -56px rgba(14, 49, 121, 0.6); opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity 0.35s var(--ease), transform 0.5s var(--ease), visibility 0s 0.35s; }
.cinfo.is-on, .no-js .cinfo:first-child { opacity: 1; visibility: visible; transform: none; transition: opacity 0.45s var(--ease) 0.08s, transform 0.55s var(--ease) 0.08s; }
.cinfo__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cinfo__head small { display: block; font-size: 13.5px; font-weight: 500; color: var(--blue); }
.cinfo__head b { display: block; font-size: clamp(34px, 9vw, 52px); line-height: 1.2; color: var(--navy); }
.cinfo .viz { width: 58px; height: 58px; border-radius: 18px; }
.cinfo .viz svg { width: 37px; height: 37px; }
.cinfo__sub { font-size: 16px; font-weight: 500; line-height: 1.7; color: var(--blue) !important; text-align: start; text-wrap: balance; }
.cinfo .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cinfo .key { font-size: 13px; font-weight: 500; color: var(--navy); background: var(--mist); padding: 3px 13px; border-radius: 99px; white-space: nowrap; }
.cinfo .insight { position: relative; padding-inline-start: 22px; font-size: 16px; font-weight: 500; line-height: 1.85; color: var(--navy) !important; }
.cinfo .insight::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.72em; width: 10px; height: 10px; background: var(--blue); transform: rotate(45deg); }
.cinfo .more { margin-top: 4px; color: var(--navy); }
@media (max-width: 900px) { .cinfo .insight { text-align: start; } }

/* ---------- Wide screens: the page and its band are exactly one screen; the words beside the square ---------- */
@media (min-width: 900.02px) {
  body:has(> .hubfoot) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
  body:has(> .hubfoot) > main { flex: 1 0 auto; display: flex; flex-direction: column; }
  main > .hubsec { flex: 1 0 auto; min-height: 0; padding: calc(var(--header-h) + clamp(0px, 1.2vh, 16px)) var(--gutter) clamp(10px, 2.2vh, 28px); }

  .compass { flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(28px, 5vw, 96px); }
  .compass__side { display: grid; gap: clamp(12px, 2.6vh, 30px); align-content: center; min-width: 0; }
  .compass__info { order: 0; }
  .hubsec .head { gap: clamp(4px, 1vh, 12px); max-width: none; }
  .hubsec .head h1 { font-size: clamp(21px, min(2.1vw, 3.7vh), 34px); text-wrap: balance; }
  .hubsec .head p { font-size: clamp(14px, 1.9vh, 16.5px); max-width: 520px; }
  /* the square is as large as the screen's height leaves it (the header above, the controls and the band below) */
  .compass__ring { width: min(100%, 580px, calc(100vh - var(--header-h) - 250px)); width: min(100%, 580px, calc(100svh - var(--header-h) - 250px)); min-width: 300px; }
  .cinfo { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; gap: clamp(6px, 1.35vh, 14px); }
  .cinfo__head { justify-content: flex-start; gap: 22px; }
  .cinfo__head small { font-size: clamp(13px, 1.8vh, 15px); }
  .cinfo__head b { font-size: clamp(34px, min(3.8vw, 6.4vh), 62px); }
  .cinfo .viz { width: clamp(46px, 7vh, 64px); height: clamp(46px, 7vh, 64px); }
  .cinfo__sub { font-size: clamp(14.5px, 2vh, 19px); }
  .cinfo .key { font-size: clamp(12.5px, 1.65vh, 13.5px); background: var(--white); }
  .cinfo .insight { padding-inline-start: 24px; font-size: clamp(14.5px, 2.05vh, 18px); }
  .cinfo .more { margin-inline-start: 24px; }
  .cnode { padding: clamp(8px, 1.4vh, 14px) clamp(12px, 1.1vw, 18px); border-radius: 18px; }
  .cnode small { font-size: clamp(11px, 1.5vh, 12.5px); }
  .cnode b { font-size: clamp(19px, min(1.9vw, 3.3vh), 29px); }
  .cnode span { font-size: clamp(11.5px, 1.6vh, 13.5px); }
  .lens__core b { font-size: clamp(15px, 2.4vh, 21px); }
  .lens__core span { display: block; }
}
/* a short wide screen: the heading stands alone (no path above it, no line under it), the words sit closer, and
   the circle's badge keeps to the name */
@media (min-width: 900.02px) and (max-height: 900px) { .hubsec .head p { display: none; } }
@media (min-width: 900.02px) and (max-height: 820px) {
  .hubsec .crumbs { display: none; }
  .compass__side { gap: clamp(8px, 1.8vh, 16px); }
}
@media (min-width: 900.02px) and (max-height: 760px) { .lens__core span { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .compass__ticks { animation: none; }
}
