/* ═══════════════════════════════════════════════════════════════════════════
   قالب آریا – footer-layouts.css
   Three footers: cards · columns · centered. Shapes follow the Qarn style
   (rounded cards, pill buttons, icon tiles, soft lines); colours come from the
   site: the theme accent and a light / dark / accent palette.
   Variables: --af-* (radius, padding, width from the Customizer; optional
   colour overrides as --af-*-user).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --af-radius: 28px;
    --af-pad: 64px;
    --af-maxw: 1240px;
}

/* ── palette ─────────────────────────────────────────────────────────────── */
.arya-ft--light  { --af-bg-s: var(--bg-card, #ffffff); --af-text-s: #1f2937; }
body.dark-mode .arya-ft--light { --af-bg-s: var(--bg-header, #242424); --af-text-s: var(--text-main, #e8e8e8); }
.arya-ft--dark   { --af-bg-s: #0f172a; --af-text-s: #e2e8f0; }
.arya-ft--accent { --af-bg-s: color-mix(in srgb, var(--accent, #00b894) 86%, #000); --af-text-s: #ffffff; }

.arya-ft {
    --af-accent: var(--af-accent-user, var(--accent, #00b894));
    --af-on-accent: #ffffff;
    --af-bg: var(--af-bg-user, var(--af-bg-s, #ffffff));
    --af-text: var(--af-text-user, var(--af-text-s, #1f2937));
    --af-muted: color-mix(in srgb, var(--af-text) 66%, transparent);
    --af-line: color-mix(in srgb, var(--af-text) 11%, transparent);
    --af-card: color-mix(in srgb, var(--af-text) 4%, var(--af-bg));
    --af-soft: color-mix(in srgb, var(--af-accent) 14%, transparent);
    --af-ico-line: color-mix(in srgb, var(--af-accent) 26%, transparent);
    --af-shadow: 0 18px 50px rgba(15, 23, 42, .08);
    --af-ease: cubic-bezier(.4, 0, .2, 1);
}
/* on an accent background, the accent itself turns white so icons and buttons stay visible */
.arya-ft--accent { --af-accent: var(--af-accent-user, #ffffff); --af-on-accent: var(--accent, #00b894); }
body.dark-mode .arya-ft { --af-shadow: 0 18px 50px rgba(0, 0, 0, .4); }

/* ── shared parts ────────────────────────────────────────────────────────── */
.arya-ft, .arya-ft * { box-sizing: border-box; }
.arya-ft {
    margin-top: 64px;
    color: var(--af-text);
    font-size: .92rem;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
/* nicer line breaks: no lonely last word in paragraphs, even lines in titles */
.arya-ft p { text-wrap: pretty; }
.arya-ft strong, .arya-ft__name, .arya-ft__col-title, .arya-ft__mini-title { text-wrap: balance; letter-spacing: 0; }
.arya-ft a { color: inherit; text-decoration: none; }
.arya-ft :focus-visible { outline: 2px solid var(--af-accent); outline-offset: 2px; border-radius: 8px; }
.arya-ft__wrap { max-width: var(--af-maxw); margin-inline: auto; padding-inline: 20px; }

/* icon tile */
.arya-ft__ico {
    --s: 36px;
    width: var(--s);
    height: var(--s);
    flex: none;
    display: grid;
    place-items: center;
    border: 1px solid var(--af-ico-line);
    border-radius: 10px;
    background: var(--af-soft);
    color: var(--af-accent);
    font-size: .9rem;
}
.arya-ft__ico--lg { --s: 52px; border-radius: 16px; font-size: 1.25rem; }

/* brand */
.arya-ft__brand { min-width: 0; }
.arya-ft__logo { display: inline-flex; align-items: center; gap: 12px; }
.arya-ft__logo img { height: 48px; width: auto; max-width: 180px; object-fit: contain; display: block; }
.arya-ft__name { font-size: 1.15rem; font-weight: 800; line-height: 1.4; }
.arya-ft__about { margin: 14px 0 0; max-width: 42ch; color: var(--af-muted); }
.arya-ft__socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.arya-ft__socials a {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--af-line);
    border-radius: 12px;
    color: var(--af-text);
    transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--af-ease);
}
.arya-ft__socials a:hover { border-color: transparent; background: var(--af-accent); color: var(--af-on-accent); transform: translateY(-2px); }
.arya-ft__mini-title { margin: 22px 0 10px; color: var(--af-text); font-size: .95rem; font-weight: 800; }

/* contact list */
.arya-ft__contact { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.arya-ft__contact li { display: flex; align-items: center; gap: 10px; color: var(--af-muted); }
.arya-ft__contact .arya-ft__ico { --s: 32px; border-radius: 9px; font-size: .8rem; }
.arya-ft__contact a:hover { color: var(--af-accent); }

/* link columns: each one opens and closes on its own (a <details>). Open columns all
   have the same height (--af-col-h); longer content scrolls inside, scrollbar hidden. */
:root { --af-col-h: 260px; --af-head-h: 44px; }
.arya-ft__col { min-width: 0; }
.arya-ft__col-head {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--af-head-h);        /* fixed, so every card lines up exactly */
    color: var(--af-text);
    font-size: .95rem;
    font-weight: 800;
    list-style: none;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s;
}
.arya-ft__col-head::-webkit-details-marker { display: none; }
.arya-ft__col-head::marker { content: ""; }
.arya-ft__col-head:hover { color: var(--af-accent); }
.arya-ft__col[open] > .arya-ft__col-head { margin-bottom: 12px; }
/* one line; a title too long for a narrow column ends in … (full text in the tooltip) */
.arya-ft__col-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-wrap: nowrap; }
.arya-ft__chev {
    width: 26px;
    height: 26px;
    flex: none;
    display: grid;
    place-items: center;
    border: 1px solid var(--af-line);
    border-radius: 50%;
    color: var(--af-muted);
    font-size: .7rem;
    transition: transform .25s var(--af-ease), color .2s, border-color .2s;
}
.arya-ft__col-head:hover .arya-ft__chev { border-color: var(--af-ico-line); color: var(--af-accent); }
.arya-ft__col[open] .arya-ft__chev { transform: rotate(180deg); }

.arya-ft__col-body {
    height: var(--af-col-h);
    margin-inline: -10px;            /* room for the links' hover background inside the scroll box */
    padding-inline: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    animation: arya-ft-in .25s var(--af-ease);
}
.arya-ft__col-body::-webkit-scrollbar { display: none; }
/* soft fade at the edge where more content is waiting (classes set by the script) */
.arya-ft__col-body.is-scrollable { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
.arya-ft__col-body.is-scrollable.is-scrolled { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 36px), transparent); }
.arya-ft__col-body.is-scrollable.is-scrolled.at-end { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px); mask-image: linear-gradient(to bottom, transparent, #000 28px); }
.arya-ft__col-body.is-scrollable.at-end:not(.is-scrolled) { -webkit-mask-image: none; mask-image: none; }
.arya-ft__links { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.arya-ft__links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-inline: -10px;
    padding: 7px 10px;
    border-radius: 10px;
    color: var(--af-muted);
    transition: color .2s, background-color .2s;
}
.arya-ft__links a > span::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-inline-end: 10px;
    border-radius: 50%;
    background: var(--af-line);
    vertical-align: middle;
    transition: background-color .2s, transform .2s;
}
.arya-ft__links a:hover { background: var(--af-soft); color: var(--af-text); }
.arya-ft__links a:hover > span::before { background: var(--af-accent); transform: scale(1.3); }
.arya-ft__links small {
    flex: none;
    padding: 0 8px;
    border: 1px solid var(--af-line);
    border-radius: 999px;
    color: var(--af-muted);
    font-size: .72rem;
    line-height: 1.8;
}
/* latest posts: title (two lines at most) with its date under it, rows divided by a hairline */
.arya-ft__links--posts { gap: 0; }
.arya-ft__links--posts li + li { border-top: 1px solid var(--af-line); }
.arya-ft__links--posts a { flex-direction: column; align-items: stretch; gap: 3px; padding-block: 10px; }
.arya-ft__links--posts a > span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--af-text);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.75;
    text-wrap: pretty;
}
.arya-ft__links--posts a > span::before { display: none; }
.arya-ft__links--posts a:hover > span { color: var(--af-accent); }
.arya-ft__links--posts small { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 0; border: 0; font-size: .74rem; }
.arya-ft__links--posts small i { font-size: .7rem; opacity: .8; }
.arya-ft__widgets { color: var(--af-muted); }
.arya-ft__widgets a:hover { color: var(--af-accent); }
.arya-ft__widgets ul { margin: 0; padding: 0; list-style: none; }

/* banner */
.arya-ft__cta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--af-line);
    border-radius: var(--af-radius);
    background: var(--af-bg);
    box-shadow: var(--af-shadow);
}
.arya-ft__cta-text { flex: 1; min-width: 0; }
.arya-ft__cta-text strong { display: block; font-size: 1.08rem; font-weight: 800; line-height: 1.5; }
.arya-ft__cta-text p { margin: 2px 0 0; color: var(--af-muted); }
.arya-ft__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    background: var(--af-accent);
    color: var(--af-on-accent) !important;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--af-accent) 35%, transparent);
    transition: transform .2s var(--af-ease), box-shadow .2s var(--af-ease);
}
.arya-ft__btn i { transition: transform .2s var(--af-ease); }
.arya-ft__btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px color-mix(in srgb, var(--af-accent) 45%, transparent); }
.arya-ft__btn:hover i { transform: translateX(-3px); }

/* bottom bar: one centred stack – back-to-top on the divider, designer credit,
   copyright last. Nothing is ever placed after the copyright line. */
.arya-ft__bottom {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 44px;
    padding: 30px 0 calc(var(--af-pad) * .35);
    border-top: 1px solid var(--af-line);
    color: var(--af-muted);
    font-size: .85rem;
    line-height: 1.8;
    text-align: center;
}
.arya-ft__credit { margin: 0; font-size: .78rem; letter-spacing: .01em; opacity: .85; }
.arya-ft__credit a:hover { color: var(--af-accent); }
.arya-ft__copy { margin: 0; }
.arya-ft__top {
    position: absolute;
    top: -21px;
    left: 50%;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--af-line);
    border-radius: 50%;
    background: var(--af-bg);
    color: var(--af-text);
    cursor: pointer;
    transform: translateX(-50%);
    transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--af-ease);
}
.arya-ft__top:hover { border-color: transparent; background: var(--af-accent); color: var(--af-on-accent); transform: translate(-50%, -2px); }

/* grid shared by cards and columns: brand is wider, columns share the rest, however many there are */
.arya-ft__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr);
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    align-items: start;              /* opening or closing one column never stretches its neighbours */
    gap: 40px;
}
/* wide screens: the brand box is as tall as an open column, and scrolls the same way */
@media (min-width: 1025px) {
    .arya-ft--columns .arya-ft__brand { height: calc(var(--af-head-h) + 12px + var(--af-col-h)); }
    .arya-ft--cards .arya-ft__brand { height: calc(var(--af-head-h) + 12px + var(--af-col-h) + 44px + 2px); } /* + padding + border */
    .arya-ft--cards .arya-ft__brand,
    .arya-ft--columns .arya-ft__brand { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
    .arya-ft--cards .arya-ft__brand::-webkit-scrollbar,
    .arya-ft--columns .arya-ft__brand::-webkit-scrollbar { display: none; }
}

/* ═══ 1 · cards ════════════════════════════════════════════════════════════ */
.arya-ft--cards .arya-ft__cta { margin-bottom: 16px; }
.arya-ft--cards .arya-ft__panel {
    padding: calc(var(--af-pad) * .5) clamp(14px, 2.4vw, 28px) 0;
    border: 1px solid var(--af-line);
    border-radius: var(--af-radius);
    background: var(--af-bg);
    box-shadow: var(--af-shadow);
}
.arya-ft--cards .arya-ft__grid { gap: 14px; }
.arya-ft--cards .arya-ft__brand,
.arya-ft--cards .arya-ft__col {
    padding: 22px 18px;
    border: 1px solid var(--af-line);
    border-radius: calc(var(--af-radius) * .7);
    background: var(--af-card);
    transition: border-color .2s, transform .25s var(--af-ease);
}
.arya-ft--cards .arya-ft__col:hover { border-color: var(--af-ico-line); transform: translateY(-2px); }
.arya-ft--cards .arya-ft__bottom {
    margin: 36px 0 18px;
    padding: 28px 16px 14px;
    border: 1px solid var(--af-line);
    border-radius: calc(var(--af-radius) * .7);
    background: var(--af-card);
}
.arya-ft--cards { padding-bottom: 8px; }

/* ═══ 2 · columns ══════════════════════════════════════════════════════════ */
.arya-ft--columns {
    margin-top: 80px;
    padding-top: var(--af-pad);
    border-radius: var(--af-radius) var(--af-radius) 0 0;
    background:
        radial-gradient(60% 70% at 100% 0%, var(--af-soft), transparent 60%),
        var(--af-bg);
}
.arya-ft--columns.has-cta { margin-top: 130px; }
.arya-ft--columns .arya-ft__cta {
    position: relative;
    margin-top: calc(var(--af-pad) * -1 - 46px);
    margin-bottom: calc(var(--af-pad) * .75);
    border: 0;
    background: linear-gradient(135deg, var(--af-accent), color-mix(in srgb, var(--af-accent) 62%, #000));
    color: #fff;
    box-shadow: 0 22px 44px color-mix(in srgb, var(--af-accent) 30%, transparent);
}
.arya-ft--columns .arya-ft__cta p { color: rgba(255, 255, 255, .85); }
.arya-ft--columns .arya-ft__cta .arya-ft__ico { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .16); color: #fff; }
.arya-ft--columns .arya-ft__cta .arya-ft__btn { background: #fff; color: color-mix(in srgb, var(--af-accent) 70%, #000) !important; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
.arya-ft--accent.arya-ft--columns .arya-ft__cta { background: rgba(255, 255, 255, .12); box-shadow: none; }

/* ═══ 3 · centered ═════════════════════════════════════════════════════════ */
.arya-ft--centered { padding-top: var(--af-pad); border-top: 1px solid var(--af-line); background: var(--af-bg); }
.arya-ft--centered .arya-ft__cta { margin-bottom: calc(var(--af-pad) * .6); }
.arya-ft__center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.arya-ft--centered .arya-ft__logo { flex-direction: column; gap: 8px; }
.arya-ft--centered .arya-ft__logo img { height: 56px; }
.arya-ft--centered .arya-ft__about { margin-inline: auto; max-width: 56ch; }
.arya-ft__pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.arya-ft__pills a {
    padding: 8px 16px;
    border: 1px solid var(--af-line);
    border-radius: 999px;
    color: var(--af-text);
    font-size: .88rem;
    font-weight: 600;
    transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--af-ease);
}
.arya-ft__pills a:hover { border-color: var(--af-ico-line); background: var(--af-soft); color: var(--af-accent); transform: translateY(-2px); }
.arya-ft--centered .arya-ft__socials { justify-content: center; }
.arya-ft--centered .arya-ft__contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 22px; }

/* ═══ tablets ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .arya-ft__grid { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
    .arya-ft__brand { grid-column: 1 / -1; }
    .arya-ft--cards .arya-ft__grid { gap: 12px; }
}

/* ═══ phones: one column, link columns fold ════════════════════════════════ */
@media (max-width: 760px) {
    .arya-ft { margin-top: 44px; font-size: .9rem; }
    .arya-ft__wrap { padding-inline: 14px; }
    .arya-ft__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }

    /* brand: centred logo, text and socials */
    .arya-ft__brand { display: flex; flex-direction: column; align-items: center; padding-bottom: 22px; text-align: center; }
    .arya-ft__logo img { height: 42px; }
    .arya-ft__name { font-size: 1.05rem; }
    .arya-ft__about { margin: 10px auto 0; max-width: 34ch; font-size: .88rem; line-height: 1.85; }
    .arya-ft__socials { justify-content: center; gap: 6px; margin-top: 16px; }
    .arya-ft__socials a { width: 38px; height: 38px; border-radius: 11px; }
    .arya-ft__mini-title { margin: 20px 0 8px; font-size: .9rem; }

    /* contact details: one aligned list in a soft box, icons in a single column */
    .arya-ft__brand .arya-ft__contact,
    .arya-ft--centered .arya-ft__contact {
        display: grid;
        gap: 0;
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        padding: 2px 14px;
        border: 1px solid var(--af-line);
        border-radius: 16px;
        background: var(--af-card);
        text-align: start;
        justify-content: stretch;
    }
    .arya-ft--centered .arya-ft__contact { margin-top: 20px; }
    .arya-ft--cards .arya-ft__brand .arya-ft__contact { background: var(--af-bg); }
    .arya-ft__brand .arya-ft__contact li,
    .arya-ft--centered .arya-ft__contact li { gap: 12px; min-height: 48px; padding-block: 2px; font-size: .86rem; line-height: 1.7; }
    /* phone and e-mail: the whole row is the tap target */
    .arya-ft__contact li > span:last-child:has(> a) { align-self: stretch; display: flex; }
    .arya-ft__contact li a { display: flex; align-items: center; flex: 1; min-height: 44px; }
    /* numbers and addresses run left-to-right but line up with the Persian rows on the right */
    .arya-ft__contact li a[dir="ltr"] { justify-content: flex-end; }
    .arya-ft__brand .arya-ft__contact li + li,
    .arya-ft--centered .arya-ft__contact li + li { border-top: 1px solid var(--af-line); }
    .arya-ft__contact li > span:last-child { min-width: 0; overflow-wrap: anywhere; }

    /* link columns fold into rows; an open one keeps the same height and scrolls */
    :root { --af-head-h: 56px; }
    .arya-ft__col { border-top: 1px solid var(--af-line); }
    .arya-ft__col-head { font-size: .95rem; }
    .arya-ft__col[open] > .arya-ft__col-head { margin-bottom: 0; }
    .arya-ft__col-head .arya-ft__ico { --s: 32px; border-radius: 9px; font-size: .8rem; }
    .arya-ft__col-body { height: min(var(--af-col-h), 60vh); margin-bottom: 12px; }
    .arya-ft__links a { min-height: 44px; padding-block: 9px; font-size: .88rem; }

    /* cards */
    .arya-ft--cards .arya-ft__panel { padding: 12px 12px 0; border-radius: calc(var(--af-radius) * .8); }
    .arya-ft--cards .arya-ft__grid { gap: 10px; }
    .arya-ft--cards .arya-ft__brand { padding: 22px 16px 18px; }
    .arya-ft--cards .arya-ft__col { padding: 0 14px; }
    .arya-ft--cards .arya-ft__col:hover { transform: none; }

    /* columns */
    .arya-ft--columns { margin-top: 56px; border-radius: calc(var(--af-radius) * .8) calc(var(--af-radius) * .8) 0 0; }
    .arya-ft--columns.has-cta { margin-top: 120px; }

    /* centered: smaller pills, even gaps */
    .arya-ft__pills { gap: 6px; margin-top: 18px; }
    .arya-ft__pills a { padding: 6px 14px; font-size: .84rem; }

    /* banner: icon beside the words, button full width under them */
    .arya-ft__cta { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px 12px; padding: 16px; text-align: start; }
    .arya-ft__cta .arya-ft__ico--lg { --s: 44px; border-radius: 14px; font-size: 1.05rem; }
    .arya-ft__cta-text strong { font-size: 1rem; }
    .arya-ft__cta-text p { font-size: .84rem; line-height: 1.75; }
    .arya-ft__btn { grid-column: 1 / -1; width: 100%; height: 48px; }
    .arya-ft--columns .arya-ft__cta { margin-top: calc(var(--af-pad) * -1 - 70px); }

    /* bottom: same centred stack, a little smaller */
    .arya-ft__bottom { margin-top: 32px; padding: 28px 8px calc(var(--af-pad) * .3); font-size: .8rem; line-height: 1.75; }
    .arya-ft__credit { font-size: .74rem; }
    .arya-ft__top { top: -20px; width: 40px; height: 40px; }
    .arya-ft--cards .arya-ft__bottom { margin: 30px 0 12px; padding: 26px 14px 12px; border-radius: 20px; }
}
/* the theme's floating back-to-top steps aside while the footer (which has its own) is on screen */
body.arya-ft-inview .back-to-top { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }

@keyframes arya-ft-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .arya-ft *, .arya-ft *::before { transition-duration: .01ms !important; animation: none !important; }
}
