/**
 * Directory badge (spd/directory-badge): each version of the "Find us on"
 * badge on the background it is for, with its embed code, a Copy button
 * and the size buttons; and a listing's badge in My Account → My Listings.
 * Colours come from the Kadence palette (light and dark mode); buttons and
 * fields take the theme's button corners (--spd-button-radius).
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: 2026 Marcus Quinn
 * Additional terms (GPL-3.0 section 7(b)): ATTRIBUTION.txt
 * Provenance: wpas-11fc97ca9348a13b. Copies, even of part, keep these lines.
 */

.spd-findus {
    display: grid;
    gap: 1.25rem;
    margin-block: 1.5rem;
    color: var(--global-palette3, #1a202c);
    font-size: var(--spd-text-small, 1.125rem);
}

.spd-findus__items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: clamp(1.25rem, 3vw, 2rem);
}

.spd-findus__item {
    display: grid;
    align-content: start;
    gap: 0.6rem;
    min-width: 0;
    margin: 0;
}

/* Each version on the background it is for: white, or the dark page. */
.spd-findus__preview {
    display: grid;
    place-items: center;
    min-height: 240px;
    padding: 1.5rem;
    border: 1px solid rgb(127 127 127 / 24%);
    border-radius: var(--spd-radius, 18px);
    background: #fff;
}

.spd-findus__item--dark .spd-findus__preview {
    border-color: rgb(255 255 255 / 16%);
    background: var(--spd-findus-dark, #1a202c);
}

.spd-findus__preview a {
    display: inline-block;
    line-height: 0;
    border-radius: 50%;
}

.spd-findus__preview img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0;
    transition: width 160ms ease, height 160ms ease;
}

.spd-findus__caption {
    margin: 0;
    font-weight: 700;
    text-align: center;
}

.spd-findus__label {
    display: block;
    margin: 0.4rem 0 0;
    color: var(--global-palette5, #5c6877);
    font-weight: 600;
}

.spd-findus .spd-findus__code {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 7.5rem;
    margin: 0;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgb(127 127 127 / 35%);
    border-radius: var(--spd-button-radius, 10px);
    background: var(--global-palette8, rgb(127 127 127 / 8%));
    color: var(--global-palette3, #1a202c);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: var(--spd-text-compact, 1rem);
    line-height: 1.5;
    overflow-wrap: anywhere;
    resize: vertical;
}

.spd-findus .spd-findus__code:focus {
    border-color: var(--global-palette1, #2b6cb0);
    outline: 2px solid var(--global-palette1, #2b6cb0);
    outline-offset: 1px;
}

.spd-findus__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    margin: 0;
}

/* Copy: the theme's own button, so it matches every other one. */
.spd-findus .spd-findus__copy {
    min-height: 48px;
    margin: 0;
    font-size: var(--spd-text-small, 1.125rem);
    line-height: 1.2;
}

.spd-findus__status {
    color: var(--global-palette5, #5c6877);
    font-weight: 600;
}

.spd-findus__status:empty {
    display: none;
}

/* The sizes: outline buttons, the chosen one filled. */
.spd-findus__sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.spd-findus .spd-findus__size {
    display: inline-flex;
    gap: 0.4rem;
    align-items: baseline;
    min-height: 44px;
    margin: 0;
    padding: 0.55rem 1rem;
    border: 1px solid rgb(127 127 127 / 45%);
    border-radius: var(--spd-button-radius, 10px);
    background: transparent;
    box-shadow: none;
    color: var(--global-palette3, #1a202c);
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.spd-findus .spd-findus__size:hover,
.spd-findus .spd-findus__size:focus-visible {
    border-color: var(--global-palette1, #2b6cb0);
    background: transparent;
    color: var(--global-palette3, #1a202c);
}

.spd-findus .spd-findus__size[aria-pressed="true"] {
    border-color: var(--global-palette1, #2b6cb0);
    background: var(--global-palette1, #2b6cb0);
    color: var(--global-palette-btn, #fff);
}

.spd-findus__pixels {
    font-weight: 500;
    opacity: 0.8;
}

.spd-findus .spd-findus__size:focus-visible,
.spd-findus .spd-findus__copy:focus-visible {
    outline: 3px solid var(--global-palette1, #2b6cb0);
    outline-offset: 3px;
}

/* My Account → My Listings: folded under the listing's actions. */
.spd-account-badge {
    margin-top: 0.5rem;
}

.spd-account-badge > summary {
    width: fit-content;
    color: var(--spd-accent-text, var(--global-palette1, #2b6cb0));
    font-weight: 700;
    cursor: pointer;
}

.spd-account-badge[open] > summary {
    margin-bottom: 0.5rem;
}

.spd-findus--account {
    margin-block: 0.75rem 0;
}

.spd-findus--account .spd-findus__preview {
    min-height: 170px;
    padding: 1rem;
}

/* Dark mode (Kadence's palette switch): the text colours follow the
   palette; the light version keeps its white background. */
body.color-switch-dark .spd-findus__item--light .spd-findus__preview {
    border-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .spd-findus__preview img {
        transition: none;
    }
}
