/* AVE Design Studio — «Сертификаты и партнёрства»: блок #certificates на странице «О компании»
   и короткая лента .us-certs на страницах услуг. Разметка — php-helpers/certificates/lib.php */

.ave-cert__issuer { display: block; color: #6f7380; font-size: 11px; font-weight: 700; line-height: 1.35; letter-spacing: .08em; text-transform: uppercase; }
.ave-cert__meta { display: inline-flex; align-items: center; gap: 7px; color: #6f7380; font-size: 12px; line-height: 1.4; }
.ave-cert__meta.is-active { color: #138a4b; font-weight: 700; }
.ave-cert__meta.is-active::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #1fbf6a; box-shadow: 0 0 0 3px rgba(31, 191, 106, .18); }

/* ---------- Блок на странице «О компании» ---------- */

.ave-ab.ave-cert {
    position: relative;
    overflow: hidden;
    background: #15161b;
    background-image: radial-gradient(900px 420px at 88% -10%, rgba(200, 0, 0, .22), transparent 70%), radial-gradient(700px 380px at -5% 105%, rgba(70, 90, 255, .12), transparent 70%);
    color: rgba(255, 255, 255, .72);
}
#certificates { scroll-margin-top: 70px; }
.ave-ab-founder__facts a { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(255, 255, 255, .35); transition: color .15s ease, border-color .15s ease; }
.ave-ab-founder__facts a:hover { color: #fff; text-decoration: none; border-bottom-color: #fff; }
.ave-cert .ave-ab__kicker { color: #ff5a52; }
.ave-cert .ave-ab__title { color: #fff; }
.ave-cert .ave-ab__lead { color: rgba(255, 255, 255, .62); }
.ave-cert .ave-cert__issuer { color: rgba(255, 255, 255, .5); }
.ave-cert .ave-cert__meta { color: rgba(255, 255, 255, .6); }
.ave-cert .ave-cert__meta.is-active { color: #5ee39a; }
.ave-cert .ave-cert__meta.is-active::before { background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .2), 0 0 12px rgba(61, 220, 132, .6); }

.ave-cert-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px); gap: 24px 48px; align-items: center; margin-bottom: 40px; }
.ave-cert-intro .ave-ab__head { margin: 0; }
.ave-cert-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 30px 0 0; padding: 22px 0 0; list-style: none; border-top: 1px solid rgba(255, 255, 255, .1); }
.ave-cert-facts li { display: flex; flex-direction: column; gap: 6px; }
.ave-cert-facts b { color: #fff; font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.ave-cert-facts span { color: rgba(255, 255, 255, .6); font-size: 13px; line-height: 1.45; }
.ave-cert-intro__cover { display: block; position: relative; margin: -20px -12px -28px 0; }
.ave-cert-intro__cover::before { content: ''; position: absolute; inset: 12% 8% 4%; z-index: 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(70, 90, 255, .32), rgba(200, 0, 0, .12) 60%, transparent); filter: blur(30px); pointer-events: none; }
.ave-cert-intro__cover img { position: relative; z-index: 1; display: block; width: 100%; height: auto; }

.ave-cert-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ave-cert-top > li { display: block; }
.ave-cert-top__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    background: rgba(255, 255, 255, .045);
    color: inherit;
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}
.ave-cert-top__card:hover,
.ave-cert-top__card:focus { color: inherit; text-decoration: none; }
.ave-cert-top__card:focus-visible { outline: 2px solid #ff5a52; outline-offset: 3px; }
.ave-cert-top__img,
.ave-cert-card__img { position: relative; display: block; overflow: hidden; background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02)); }
.ave-cert-top__img { aspect-ratio: 4 / 3; }
.ave-cert-top__img img,
.ave-cert-card__img img {
    position: absolute;
    top: 16px;
    left: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
    object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .45));
    transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.ave-cert-top__body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 18px 20px 20px; }
.ave-cert-top__title { color: #fff; font-size: 17px; font-weight: 800; line-height: 1.3; letter-spacing: -.005em; }
.ave-cert-top__text { color: rgba(255, 255, 255, .62); font-size: 13px; line-height: 1.5; }
.ave-cert-top__foot { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.ave-cert__num { color: rgba(255, 255, 255, .45); font-size: 12px; font-variant-numeric: tabular-nums; }

.ave-cert-all { margin-top: 56px; }
.ave-cert-all__bar { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.ave-cert-all__title { margin: 0; padding: 0; color: #fff; font: 800 20px/1.3 'Open Sans', Arial, sans-serif; letter-spacing: 0; text-transform: none; }
.ave-cert-all__title span { margin-left: 4px; color: rgba(255, 255, 255, .45); font-weight: 700; }

.ave-cert-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.ave-cert-tabs[hidden] { display: none; }
.ave-cert-tabs__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: 600 13px/1.3 'Open Sans', Arial, sans-serif;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.ave-cert-tabs__chip span { color: rgba(255, 255, 255, .5); font-size: 12px; font-weight: 700; }
.ave-cert-tabs__chip:hover { border-color: rgba(255, 255, 255, .4); }
.ave-cert-tabs__chip:focus-visible { outline: 2px solid #ff5a52; outline-offset: 2px; }
.ave-cert-tabs__chip.is-active { border-color: #fff; background: #fff; color: #15161b; }
.ave-cert-tabs__chip.is-active span { color: rgba(21, 22, 27, .55); }

.ave-cert-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.ave-cert-item { display: block; }
.ave-cert-item.is-featured { display: none; }
.ave-cert-grid.is-group .ave-cert-item.is-featured { display: block; }
.ave-cert-grid .ave-cert-item[hidden] { display: none !important; }
.ave-cert-card { display: flex; flex-direction: column; gap: 5px; height: 100%; color: inherit; text-decoration: none; }
.ave-cert-card:hover,
.ave-cert-card:focus { color: inherit; text-decoration: none; }
.ave-cert-card:focus-visible { outline: 2px solid #ff5a52; outline-offset: 4px; border-radius: 12px; }
.ave-cert-card__img { margin-bottom: 8px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; aspect-ratio: 3 / 4; }
.ave-cert-card__img img { top: 12px; left: 12px; width: calc(100% - 24px); height: calc(100% - 24px); filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .45)); }
.ave-cert-card__title { color: #fff; font-size: 14px; font-weight: 700; line-height: 1.35; }
.ave-cert-card .ave-cert__meta { margin-top: auto; padding-top: 2px; }

.ave-cert-more { margin: 26px 0 0; text-align: center; }
.ave-cert-more[hidden] { display: none; }
.ave-cert-more__btn {
    margin: 0;
    padding: 12px 26px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: 700 14px/1.3 'Open Sans', Arial, sans-serif;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.ave-cert-more__btn:hover { border-color: #fff; background: rgba(255, 255, 255, .06); }
.ave-cert-more__btn:focus-visible { outline: 2px solid #ff5a52; outline-offset: 3px; }

@media (hover: hover) {
    .ave-cert-top__card:hover { border-color: rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .07); transform: translateY(-3px); }
    .ave-cert-top__card:hover .ave-cert-top__img img,
    .ave-cert-card:hover .ave-cert-card__img img { transform: scale(1.04); }
    .ave-cert-card:hover .ave-cert-card__img { border-color: rgba(255, 255, 255, .22); }
}
@media (prefers-reduced-motion: reduce) {
    .ave-cert-top__card,
    .ave-cert-top__img img,
    .ave-cert-card__img img { transition: none; }
    .ave-cert-top__card:hover,
    .ave-cert-top__card:hover .ave-cert-top__img img,
    .ave-cert-card:hover .ave-cert-card__img img { transform: none; }
}

/* окно просмотра: своё затемнение — .mfp-fade на сайте почти прозрачный (custom.css, для форм) */
.mfp-cert.mfp-bg { background: #0c0d11; opacity: 0; transition: opacity .2s ease-out; }
.mfp-cert.mfp-bg.mfp-ready { opacity: .92; }
.mfp-cert.mfp-bg.mfp-removing { opacity: 0; }
.mfp-cert.mfp-wrap .mfp-content { opacity: 0; transition: opacity .2s ease-out; }
.mfp-cert.mfp-wrap.mfp-ready .mfp-content { opacity: 1; }
.mfp-cert.mfp-wrap.mfp-removing .mfp-content { opacity: 0; }
.mfp-cert .mfp-title { padding-right: 70px; color: #f3f3f5; font-size: 14px; line-height: 1.45; }
.mfp-cert .mfp-counter { color: rgba(255, 255, 255, .6); }
@media (prefers-reduced-motion: reduce) {
    .mfp-cert.mfp-bg,
    .mfp-cert.mfp-wrap .mfp-content { transition: none; }
}

@media (max-width: 1199px) {
    .ave-cert-intro { grid-template-columns: minmax(0, 1fr) minmax(0, 46%); gap: 24px 28px; }
    .ave-cert-facts { grid-template-columns: 1fr; gap: 12px; }
    .ave-cert-facts li { flex-direction: row; align-items: baseline; gap: 12px; }
    .ave-cert-facts b { flex: none; min-width: 44px; font-size: 26px; }
    .ave-cert-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ave-cert-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .ave-cert-intro { grid-template-columns: 1fr; gap: 8px; margin-bottom: 24px; }
    .ave-cert-facts { margin-top: 22px; padding-top: 18px; }
    .ave-cert-intro__cover { width: calc(100% + 16px); max-width: 520px; margin: 0 -8px; justify-self: center; }
    .ave-cert-top { grid-template-columns: 1fr; gap: 10px; }
    .ave-cert-top__card { flex-direction: row; border-radius: 14px; }
    .ave-cert-top__img { flex: none; width: 116px; aspect-ratio: auto; }
    .ave-cert-top__img img { top: 10px; left: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
    .ave-cert-top__body { gap: 4px; padding: 14px 14px 14px 12px; }
    .ave-cert-top__title { font-size: 15px; }
    .ave-cert-top__text { display: none; }
    .ave-cert-top__foot { padding-top: 8px; }
    .ave-cert-all { margin-top: 40px; }
    .ave-cert-all__bar { margin-bottom: 16px; }
    .ave-cert-all__title { font-size: 18px; }
    .ave-cert-tabs { flex-wrap: nowrap; width: calc(100% + 30px); margin: 0 -15px; padding: 0 15px 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .ave-cert-tabs::-webkit-scrollbar { display: none; }
    .ave-cert-tabs__chip { flex: none; }
    .ave-cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
    .ave-cert-card__title { font-size: 13px; }
    .ave-cert-card .ave-cert__meta { font-size: 11px; }
}

/* ---------- Лента на страницах услуг ---------- */

.us-certs { margin-top: 48px; padding-top: 32px; border-top: 1px solid #e3e5ea; }
.us-certs__head { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.us-certs__head .bl-kicker { margin: 0; }
.us-certs__all { color: #c80000; font-size: 14px; font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(200, 0, 0, .3); }
.us-certs__all:hover { color: #a90000; text-decoration: none; border-bottom-color: currentColor; }
.us-certs__list { display: grid; grid-template-columns: repeat(var(--us-certs-n, 4), minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.us-certs__list > li { margin: 0; padding: 0; }
.us-certs__list > li::before { content: none; }
.us-cert { display: flex; gap: 14px; align-items: center; height: 100%; padding: 12px 14px 12px 12px; border: 1px solid #e3e5ea; border-radius: 12px; background: #fff; color: inherit; text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease; }
.us-cert:hover,
.us-cert:focus { color: inherit; text-decoration: none; }
.us-cert:focus-visible { outline: 2px solid #c80000; outline-offset: 3px; }
.us-cert__img { position: relative; flex: none; width: 64px; height: 76px; overflow: hidden; border-radius: 8px; background: #f1f2f5; }
.us-cert__img img { position: absolute; top: 6px; left: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; filter: drop-shadow(0 3px 6px rgba(23, 24, 29, .18)); }
.us-cert__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.us-cert__body b { color: #17181d; font-size: 14px; line-height: 1.3; }
@media (hover: hover) {
    .us-cert:hover { border-color: rgba(200, 0, 0, .3); box-shadow: 0 10px 26px rgba(23, 24, 29, .08); }
}
@media (max-width: 1199px) {
    .us-certs__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .us-certs { margin-top: 36px; padding-top: 24px; }
    .us-certs__list { grid-template-columns: 1fr; gap: 8px; }
}
