/* Resource card (global): template-parts/components/resource-card/resource-card.php,
   Figma UI Kit "resource-card" node 2817:722. Shared by Integrations, the Competitors
   hub and Partners, so it carries its own values instead of page variables. Type sizes
   come from the global sd-type-* classes in the markup; frame/hover from the
   --sd-card-* tokens (css/style.min.css :root). Hosts own only the grid around it. */

.sd-resource-card,
.sd-resource-card * {
    box-sizing: border-box;
}

.sd-resource-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 0;
    border-radius: var(--sd-card-radius, 16px);
    background: #fff;
    color: #262626;
    text-decoration: none;
    transition: box-shadow var(--sd-card-transition, 0.2s ease);
}

.sd-resource-card[hidden] {
    display: none;
}

/* Figma INSIDE stroke: the frame is painted on top of the content, so a full-bleed
   cover reaches the card edge and the translucent border sits over it. */
.sd-resource-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border: 1px solid var(--sd-card-border, rgba(0, 0, 0, 0.1));
    border-radius: inherit;
    pointer-events: none;
    transition: border-color var(--sd-card-transition, 0.2s ease);
}

/* Cover variant: 2:1 image on sand above the content. */
.sd-resource-card__cover {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: #faf7f5;
}

.sd-resource-card__cover img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

/* No dedicated cover yet: the item's own logo, centred on sand. */
.sd-resource-card__cover--contain img {
    width: auto;
    height: auto;
    max-width: 62%;
    max-height: 55%;
    object-fit: contain;
}

.sd-resource-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 20px;
    padding: 24px;
}

.sd-resource-card__logo {
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: contain;
}

.sd-resource-card__content {
    display: flex;
    width: 100%;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

/* Cards in a row stretch to the tallest one; the link stays pinned to the bottom so
   the links line up (16px from the copy is the minimum). */
.sd-resource-card__content > .sd-link-button {
    margin-top: auto;
}

.sd-resource-card__copy {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.sd-resource-card .sd-resource-card__title,
.sd-resource-card .sd-resource-card__text {
    display: block;
    margin: 0;
}

.sd-resource-card .sd-resource-card__title {
    color: #262626;
}

.sd-resource-card .sd-resource-card__text {
    color: rgba(0, 0, 0, 0.75);
}

/* Hover: frame and the link highlight together (the link-button is a <span> inside
   the card link, so it mirrors the global .sd-link-button hover). */
a.sd-resource-card--linked:hover,
a.sd-resource-card--linked:focus-visible {
    box-shadow: var(--sd-card-shadow-hover, 0 1px 2px rgba(0, 0, 0, 0.1));
    color: #262626;
    text-decoration: none;
}

a.sd-resource-card--linked:hover::after,
a.sd-resource-card--linked:focus-visible::after {
    border-color: var(--sd-card-border-hover, rgba(0, 0, 0, 0.2));
}

a.sd-resource-card--linked:focus-visible {
    outline: 2px solid #262626;
    outline-offset: 2px;
}

a.sd-resource-card--linked:hover .sd-link-button__label,
a.sd-resource-card--linked:focus-visible .sd-link-button__label {
    color: currentColor;
    text-decoration-color: currentColor;
}

a.sd-resource-card--linked:hover .sd-link-button__icon,
a.sd-resource-card--linked:focus-visible .sd-link-button__icon {
    transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
    .sd-resource-card,
    .sd-resource-card::after {
        transition: none;
    }
}
