/* ============================================================
   DG KNITTING — PARTNERS / TRUSTED BY
   A self-scrolling row of partner plates. Each card carries the partner's
   own logo when there is artwork on file, and reads as a name plate when
   there is not — so the row never breaks on a missing image.
   Upload a logo in the admin panel and the plate swaps to it.
   ============================================================ */

.dg-partners {
    padding: clamp(56px, 7vw, 96px) 0;
    background: var(--paper-2, #faf7f5);
    border-top: 1px solid var(--line-2, #f2ede9);
    border-bottom: 1px solid var(--line-2, #f2ede9);
}

.dg-partners__head {
    max-width: 62ch;
    margin: 0 auto clamp(32px, 4vw, 52px);
    text-align: center;
}

.dg-partners__eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--crimson-soft, #fdf2f1);
    color: var(--crimson, #df2229);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.dg-partners__title {
    margin: 0 0 12px;
    color: var(--ink, #1f1c1b);
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.dg-partners__title .highlight { color: var(--crimson, #df2229); }

.dg-partners__sub {
    margin: 0;
    color: var(--ink-3, #6b625e);
    font-size: clamp(.94rem, .9rem + .18vw, 1.04rem);
    line-height: 1.7;
}

/* --------------------------------------------------- marquee */
/* The viewport. Edge masks fade the cards out instead of letting them
   guillotine at the container edge. */
.dg-partners__marquee {
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.dg-partners__track {
    display: flex;
    width: max-content;
    padding: 4px 0;
}

/* Spacing lives on the card, not as a flex `gap`: the loop travels -50% of
   the track, and only an even card+gutter unit makes that land on a seam. */
.dg-partners__track > .dg-partner,
.dg-partners__track [data-marquee-clone] > .dg-partner {
    margin-right: 18px;
}

/* Animation only switches on once js/partners.js has cloned the row —
   otherwise a single set would scroll off and leave a gap. */
.dg-partners__marquee.is-marquee .dg-partners__track {
    animation: dg-partners-scroll var(--dg-marquee-duration, 36s) linear infinite;
}

.dg-partners__marquee.is-marquee:hover .dg-partners__track,
.dg-partners__marquee.is-marquee:focus-within .dg-partners__track {
    animation-play-state: paused;
}

@keyframes dg-partners-scroll {
    /* the clone is exactly half the track, so -50% lands on a seam */
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-50%, 0, 0); }
}

/* No JS, or motion turned down: a plain row the reader drives themselves. */
.dg-partners__marquee:not(.is-marquee) {
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.dg-partners__marquee:not(.is-marquee)::-webkit-scrollbar { display: none; }
.dg-partners__marquee:not(.is-marquee) .dg-partner { scroll-snap-align: start; }

@media (prefers-reduced-motion: reduce) {
    .dg-partners__marquee.is-marquee { overflow-x: auto; }
    .dg-partners__marquee.is-marquee .dg-partners__track { animation: none; }
}

.dg-partner {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 268px;
    min-height: 150px;
    padding: 26px 24px;
    border: 1px solid var(--line, #e9e3df);
    border-radius: 16px;
    background: var(--paper, #fff);
    text-decoration: none;
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

a.dg-partner:hover {
    border-color: rgba(223, 34, 41, .35);
    box-shadow: 0 2px 4px rgba(31, 28, 27, .04), 0 14px 30px -14px rgba(31, 28, 27, .18);
    transform: translateY(-2px);
}

/* the accent rule that reads as a "shelf" for the name */
.dg-partner::before {
    content: "";
    position: absolute;
    top: 26px;
    left: 0;
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: var(--crimson, #df2229);
    opacity: .85;
}

/* Logo band: a fixed-height row so wildly different artwork (a wide
   wordmark, a square emblem, a dark tile) all line up on one baseline. */
.dg-partner__logo-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 52px;
    margin-bottom: 4px;
}

.dg-partner__logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
}

/* Stand-in mark for a partner saved without a logo, so the plate keeps the
   same 52px band and the row stays even. */
.dg-partner__initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    background: rgba(223, 34, 41, .07);
    color: var(--crimson, #df2229);
    font-weight: 700;
    letter-spacing: .04em;
}

/* A bare <img class="dg-partner__logo"> (the shape js/partners.js renders
   from the admin panel) gets the same band without needing the wrapper. */
img.dg-partner__logo {
    max-width: 150px;
    max-height: 52px;
    margin-bottom: 4px;
}

/* Cards that lead with a logo push the accent rule down to the name, so the
   rule never crashes into the artwork. */
.dg-partner:has(.dg-partner__logo)::before,
.dg-partner:has(.dg-partner__initials)::before { top: 78px; }

.dg-partner__name {
    margin: 0;
    color: var(--ink, #1f1c1b);
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
}

.dg-partner__meta {
    margin: 0;
    color: var(--ink-3, #6b625e);
    font-size: .84rem;
    line-height: 1.55;
}

.dg-partner__tag {
    margin-top: auto;
    padding-top: 12px;
    color: var(--ink-4, #9a908b);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* ------------------------------------------------------- note */
.dg-partners__note {
    margin: 26px 0 0;
    text-align: center;
    color: var(--ink-4, #9a908b);
    font-size: .82rem;
    line-height: 1.6;
}

/* --------------------------------------------------- quotes */
.dg-quotes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: clamp(28px, 4vw, 44px);
}

.dg-quote {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px 26px;
    border: 1px solid var(--line, #e9e3df);
    border-radius: 16px;
    background: var(--paper, #fff);
}

.dg-quote__mark {
    color: var(--crimson, #df2229);
    font-size: 1.6rem;
    line-height: 1;
    opacity: .5;
}

.dg-quote__text {
    margin: 0;
    color: var(--ink-2, #3d3836);
    font-size: .98rem;
    line-height: 1.7;
}

.dg-quote__by {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line-2, #f2ede9);
}

.dg-quote__avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--crimson-soft, #fdf2f1);
    color: var(--crimson, #df2229);
    font-size: .82rem;
    font-weight: 700;
}

.dg-quote__who { display: flex; flex-direction: column; gap: 1px; }

.dg-quote__who strong {
    color: var(--ink, #1f1c1b);
    font-size: .9rem;
    font-weight: 600;
}

.dg-quote__who span {
    color: var(--ink-3, #6b625e);
    font-size: .78rem;
}

@media (max-width: 575.98px) {
    .dg-partner { width: 232px; min-height: 0; padding: 22px 20px; }
    .dg-partner:has(.dg-partner__logo)::before { top: 74px; }
}
