/* ==========================================================================
   Avadis section — THE rhythm and heading of every section of a page (home page first).
   Render the heading with avadis_section_head_e() (functions/section-head.php); do not hand-build one.

   .av-sec        the section: same vertical rhythm everywhere (40px phone, 56px from 640px). --soft = pale brand wash.
   .av-sec__wrap  the content column (1200px + gutter), same as the blog / portfolio columns.
   .av-sec__head  eyebrow chip + Pinar title + one text line, start-aligned; the link / arrows sit on the far side.
                  --center centres a heading that has no far side.
   Colours, radius and motion come from css/identity.css (--av-*). Logical properties: it follows RTL by itself.
   ========================================================================== */
.av-sec { position: relative; padding-block: 40px; }
.av-sec--soft { background: linear-gradient(180deg, var(--av-purple-50), var(--av-white)); }
.av-sec--flush { padding-block: 0; } /* a section that is only a band (the hero, the logo strip) keeps its own height */
.av-wrap, .av-sec__wrap { width: 100%; max-width: var(--av-wrap, 1200px); margin-inline: auto; padding-inline: var(--av-gutter, 16px); }
.av-wrap--narrow { max-width: var(--av-wrap-narrow, 860px); }

.av-sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-block-end: 18px; }
.av-sec__head--center { justify-content: center; text-align: center; }
.av-sec__head--center .av-sec__text { margin-inline: auto; }
.av-sec__titles { min-width: 0; }

.av-sec__eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-block-end: 8px;
  line-height: 1.8; font-size: var(--av-fs-caption, 13px); font-weight: var(--av-fw-heading, 800); color: var(--av-purple-700);
}
.av-sec__eyebrow::before { content: ""; width: 9px; height: 9px; background: var(--av-grad); transform: rotate(45deg); border-radius: 2px; }

.av-sec__title { margin: 0 0 6px; font-family: Pinar, sans-serif; font-weight: var(--av-fw-heading, 800); font-size: var(--av-fs-h2); line-height: var(--av-lh-h2); color: var(--av-ink); }
.av-sec__text { margin: 0; max-width: 620px; font-size: 13.5px; /* same as the blog post subtitle (blog.css .bl-lede) */ line-height: 2; color: var(--av-muted); }

.av-sec__side { display: none; align-items: center; gap: 14px; flex: none; }
.av-sec__link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: var(--av-fs-small, 14px); font-weight: var(--av-fw-heading, 800); color: var(--av-purple-700); transition: color .2s; }
.av-sec__link:hover { color: var(--av-purple); }
.av-sec__link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform .25s var(--av-ease); }
.av-sec__link:hover svg { transform: translateX(-4px); }
.av-sec :focus-visible { outline: var(--av-focus); outline-offset: 3px; border-radius: 8px; }

/* the "see all" button under a rail / grid on a phone (the far-side link replaces it from 640px) */
.av-sec__foot { margin-block-start: 12px; text-align: center; }

@media (min-width: 640px) {
  .av-sec { padding-block: 56px; }
  .av-sec__head { margin-block-end: 22px; }
  .av-sec__text { font-size: 14.5px; }
  .av-sec__side { display: flex; }
  .av-sec__foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .av-sec__link, .av-sec__link svg { transition-duration: .01ms !important; }
}
@media print { .av-sec__side { display: none !important; } }

/* the "Avadis at the edge of technology" strip (home/technology.php, in the footer of every page): a hairline above it,
   as wide as the content column, separates it from whatever precedes it */
#technologies.tech-static::before { width: min(var(--av-menu-w), 100% - 32px); } /* the still grid is as wide as the header menu */

/* the header menu, from the first word ("ساخت") to the last ("هوش مصنوعی"), sets the width of the footer content: the technology strip, the story, the link columns, the contact lines and the copyright.
   --av-menu-w is the text span of the menu (the links carry 16px of side padding, so the list is 32px wider); on a single post the menu is stretched to the article column (blog.css), so the footer follows it. */
:root { --av-menu-w: 749px; }
@media (min-width: 1200px) { .single-post { --av-menu-w: 700px; } }
.av-menu-w { box-sizing: border-box; width: 100%; max-width: calc(var(--av-menu-w) + 32px); margin-inline: auto; padding-inline: 16px; }
.avadis-chrome.af-light .af-story .af-story-text { max-width: 760px; } /* the footer is as wide as the page column now; the story keeps a readable line */
@media (min-width: 1280px) { /* xl: the menu is shown; fix its width so the footer stays exactly under it whatever the font does (a post overrides this in blog.css) */
  #main-menu { width: calc(var(--av-menu-w) + 32px); }
  #menu-list { justify-content: space-between; }
}
#technologies::before { content: ""; display: block; width: min(1168px, 100% - 32px); margin-inline: auto; border-block-start: 1px solid var(--av-line); }

/* ---------- the technology grid on a phone (<640px), on EVERY page: the look of the solution pages (/website-design/) ----------
   One swipe slider of 3 rows with all the logos: ~4.4 columns show, the next one peeks at the left edge, the rest come in from the left (RTL scroll);
   it runs out to the edge of its box (--tk-pad = the side padding it bleeds over). The grid moves on by itself (avadis_tech_slider_script(), functions/footer.php).
   Covers: #wd-tech (parts/tech-stack.php: solution pages, About, contact, product landings), the home figures band (#home-stats, inside its card)
   and the footer strip of the other pages (#technologies, home/technology.php: still grid, white logo tiles like .hs-tech__logo). */
@media (max-width: 639px) {
  #wd-tech, #technologies { --tk-pad: var(--av-gutter, 16px); }
  #technologies.tech-static > div { padding-inline: var(--tk-pad); } /* the footer strip has no page gutter of its own: the title sits in by it, the logo row bleeds back to the edges */
  #home-stats .hs-tech { --tk-pad: 18px; } /* the padding of the .hs-band card (it clips at its rounded edge) */
  :is(#wd-tech, #home-stats) .hs-tech__grid, #technologies.tech-static ul {
    display: grid; justify-self: stretch; grid-template-columns: none; grid-template-rows: repeat(3, auto); grid-auto-flow: column;
    /* the column is sized so 4 columns show and exactly HALF of the 5th peeks at the screen edge (half its logo; user's call, 2026-11-29):
       4 × col + 4 × 8px gap + col / 2 = the strip from its start padding to the edge = parent + pad + shift, shift = (col - 54px) / 2
       → col = (parent + pad - 4 × 8px - 27px) / 4 */
    grid-auto-columns: calc((100% + var(--tk-pad) - 4 * 8px - 27px) / 4);
    /* --tk-shift: half of (column - 54px logo): the row moves that much toward the start (right) so the first logo's edge lines up with the title
       (user's call, 2026-11-29); the end padding takes it back, so the content box (the 100% above) stays the width of the parent */
    --tk-shift: calc(((100% + var(--tk-pad) - 4 * 8px - 27px) / 4 - 54px) / 2);
    gap: 12px 8px; width: auto; max-width: none; margin: 10px calc(-1 * var(--tk-pad)) 0;
    padding-block: 2px 6px;
    padding-inline: calc(var(--tk-pad) - var(--tk-shift)) calc(var(--tk-pad) + var(--tk-shift));
    /* the same shift for the snap point; a % here is of the strip itself (parent + 2 × pad), hence "- pad" */
    scroll-padding-inline: calc(var(--tk-pad) - ((100% - var(--tk-pad) - 4 * 8px - 27px) / 4 - 54px) / 2) var(--tk-pad);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  :is(#wd-tech, #home-stats) .hs-tech__grid::-webkit-scrollbar, #technologies.tech-static ul::-webkit-scrollbar { display: none; }
  :is(#wd-tech, #home-stats) .hs-tech__item { display: grid; justify-self: auto; scroll-snap-align: start; } /* all of them (the shared rules show 8) */
  /* the logos cut by the screen edge (or past it) are very faint and blurred, sharp again once wholly on screen; .is-out comes from avadis_tech_slider_script() (functions/footer.php) */
  /* on the children, not the item: the item's entrance animation (hm-card, css/site-motion.css, fill both) holds its own opacity at 1 */
  :is(#wd-tech, #home-stats) .hs-tech__item > *, #technologies.tech-static ul > li > * { transition: opacity .4s, filter .4s; }
  :is(#wd-tech, #home-stats) .hs-tech__item.is-out > *, #technologies.tech-static ul > li.is-out > * { opacity: .15; filter: blur(3px); }
  /* the section title «پشته فناوری»: small and right-aligned like the «اعتماد کرده‌اند» title (css/customers.css, 14px; user's call, 2026-11-29);
     the second selector beats the h2 size the solution pages give it in css/webdesign.css; the footer strip in both footer designs */
  /* the home figures band keeps its own sub-title size, but sits at the right too (user's call, 2026-11-29: right-aligned on every page) */
  #home-stats .hs-tech .hs-tech__title { justify-self: stretch; width: 100%; text-align: right; }
  #wd-tech .hs-tech .hs-tech__title, body:has(#service-header) #wd-tech .hs-tech .hs-tech__title, #technologies h2 { justify-self: stretch; width: 100%; font-family: Pinar, sans-serif; font-size: var(--av-fs-h6, 14px); line-height: 1.8; font-variation-settings: var(--av-fv-heading); font-weight: var(--av-fw-heading, 800); color: var(--av-ink); text-align: right; }
  /* the footer strip: its items take the .hs-tech__item look (white rounded tile around the logo, small bold name under it) */
  #technologies.tech-static { padding-block-end: 8px; }
  #technologies.tech-static ul > li { display: grid; justify-items: center; align-content: start; gap: 5px; min-width: 0; scroll-snap-align: start; }
  #technologies.tech-static ul > li > a { display: block; max-width: 100%; min-width: 0; }
  #technologies.tech-static ul img { box-sizing: border-box; width: 54px; height: 54px; padding: 11px; border-radius: 15px; background: #fff; border: 1px solid rgba(63, 11, 121, .12); object-fit: contain; }
  #technologies.tech-static ul li span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; line-height: 1.4; color: #5d5470; }
}

/* ---------- closing quote banner (home/banner.php): one white card, portrait on the start side, the quote and the CTA beside it ---------- */
.qb { position: relative; display: grid; grid-template-columns: 1fr; gap: 0; overflow: hidden; border-radius: 24px; background: var(--av-white); border: 1px solid var(--av-line); box-shadow: 0 18px 48px rgba(63, 11, 121, .12); }
.qb__media { position: relative; margin: 0; min-height: 0; aspect-ratio: 16 / 10; background: var(--av-purple-100); }
.qb__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.qb__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(26, 18, 38, .28)); pointer-events: none; }
.qb__body { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 24px 20px 28px; }
.qb__body .av-sec__title { margin-block-end: 14px; }
/* the theme styles every <blockquote> as a dashed box with a quote icon (style.css): reset all of it, then draw our own bar */
.qb .qb__quote { position: relative; max-width: none; margin: 0; padding: 0; padding-inline-start: 18px; background: none; box-shadow: none; text-align: start; border: 0; border-inline-start: 3px solid transparent; border-image: linear-gradient(180deg, #bd4bf8, #ff5001) 1; }
.qb .qb__quote::before, .qb .qb__quote::after { content: none; display: none; }
.qb__body::after { content: "\201D"; position: absolute; inset-block-start: 6px; inset-inline-end: 22px; font-family: Georgia, serif; font-size: 96px; line-height: 1; color: var(--av-accent); opacity: .18; pointer-events: none; }
.qb .qb__quote p { margin: 0; text-align: start; font-size: var(--av-fs-body, 16px); font-weight: var(--av-fw-regular, 400); line-height: 2; color: var(--av-text); text-wrap: pretty; }
.qb__foot { display: flex; flex-direction: column; align-items: stretch; gap: 18px; width: 100%; margin-block-start: 22px; padding-block-start: 20px; border-top: 1px solid var(--av-line); }
.qb__by { margin: 0; display: flex; align-items: center; gap: 10px; font-size: var(--av-fs-small, 14px); font-weight: var(--av-fw-bold, 700); line-height: 1.8; color: var(--av-purple-700); }
.qb__by::before { content: ""; flex: none; width: 22px; height: 2px; border-radius: 2px; background: var(--av-grad); }
.qb__foot .av-btn { justify-content: center; }
@media (min-width: 640px) {
  .qb__body { padding: 32px 32px 36px; }
  .qb__foot { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; }
  .qb__foot .av-btn { flex: none; }
}
@media (min-width: 960px) {
  .qb { grid-template-columns: minmax(300px, 38%) 1fr; }
  .qb__media { aspect-ratio: auto; min-height: 460px; }
  .qb__media::after { background: linear-gradient(90deg, transparent 60%, rgba(26, 18, 38, .14)); }
  .qb__body { justify-content: center; padding: 48px 48px 48px 44px; }
}
