/* ── Sneaker of the Day — Plugin Styles ────────────────────────────────────── */
/*
 * This stylesheet intentionally does NOT set a font-family or a color
 * palette — both are left to inherit from the active theme so the
 * [sneaker_of_the_day] and [sneaker_archive] output matches the rest of
 * the site automatically. Only structural/layout rules (grid, flex,
 * spacing, radius, motion) live here.
 *
 * Borders, subtle fills and "muted" text use `currentColor` mixed with
 * transparency (via color-mix, with a plain rgba fallback for older
 * browsers) so they stay legible in both light and dark themes without
 * hardcoding a specific hue.
 */

:root {
    --sotd-radius:     0x;
    --sotd-transition: 0.22s cubic-bezier(0.4,0,0.2,1);

    /* Neutral, theme-agnostic fallbacks (overridden by color-mix() below
       where supported) */
    --sotd-border:      rgba(128,128,128,0.2);
    --sotd-border-soft: rgba(128,128,128,0.1);
    --sotd-fill-soft:   rgba(128,128,128,0.05);
    --sotd-fill-strong: rgba(128,128,128,0.10);
    --sotd-muted:       rgba(128,128,128,0.7);
}

@supports (color: color-mix(in srgb, currentColor 10%, transparent)) {
    :root {
        --sotd-border:      color-mix(in srgb, currentColor 30%, transparent);
        --sotd-border-soft: color-mix(in srgb, currentColor 16%, transparent);
        --sotd-fill-soft:   color-mix(in srgb, currentColor 4%,  transparent);
        --sotd-fill-strong: color-mix(in srgb, currentColor 16%, transparent);
        --sotd-muted:       color-mix(in srgb, currentColor 65%, transparent);
    }
}

/* ── Daily Card ───────────────────────────────────────────────────────────── */

.sotd-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    min-height: 540px;
    transition: opacity var(--sotd-transition);
}

.sotd-card.sotd--fading { opacity: 0; }

/* Image panel */
.sotd-card__image-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    overflow: hidden;
}

.sotd-drop-label {
    position: absolute;
    top: 20px;
    left: 20px;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: var(--sotd-fill-soft);
    border: 1px solid var(--sotd-border-soft);
    padding: 5px 10px;
    border-radius: var(--sotd-radius);
    animation: sotdFadeDown 0.5s ease both;
}

.sotd-image-wrap {
    width: 100%;
    padding: 36px;
    animation: sotdFadeUp 0.55s ease both 0.1s;
}

.sotd-image-wrap img {
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.sotd-image-wrap img:hover {
    transform: scale(1.04) rotate(-1deg);
}

/* Info panel */
.sotd-card__info-panel {
    padding: 80px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid var(--sotd-border-soft);
    animation: sotdFadeUp 0.55s ease both 0.2s;
    background: var(--sotd-fill-soft);
}

.sotd-brand {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.75;
    margin: 0 0 12px;
}

.sotd-name {
    font-weight: 800;
    font-size: clamp(22px, 2.5vw, 36px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}

.sotd-colorway {
    font-size: 13px;
    color: var(--sotd-muted);
    font-style: italic;
    margin: 0 0 28px;
}

/* Meta grid */
.sotd-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--sotd-fill-soft);
    border: 1px solid var(--sotd-border-soft);
    border-radius: var(--sotd-radius);
    overflow: hidden;
    margin: 0 0 28px;
}

.sotd-meta-item {
    background: var(--sotd-fill-soft);
    padding: 12px 14px;
}

.sotd-meta-item dt {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sotd-muted);
    margin: 0 0 3px;
}

.sotd-meta-item dd {
    font-weight: 700;
    font-size: 15px;
    margin: 0;
}

.sotd-price { font-weight: 800; }

/* Buttons */
.sotd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 20px;
    border-radius: var(--sotd-radius);
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    color: inherit;
    transition: background var(--sotd-transition), border-color var(--sotd-transition), opacity var(--sotd-transition), transform var(--sotd-transition);
    line-height: 1;
}

.sotd-btn:active { transform: scale(0.98); }
.sotd-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.sotd-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Primary = the affiliate "buy" button. Distinguished by weight + a
   solid-ish fill rather than a hardcoded brand color. */
.sotd-btn--primary {
    background: var(--sotd-fill-strong);
    border-color: var(--sotd-border);
    font-weight: 800;
}
.sotd-btn--primary:hover { background: var(--sotd-fill-strong); border-color: currentColor; }

/* Secondary = "See Details" / other links to the sneaker's own page. */
.sotd-btn--secondary {
    background: transparent;
    border-color: var(--sotd-border-soft);
}
.sotd-btn--secondary:hover { border-color: var(--sotd-border); background: var(--sotd-fill-soft); }

.sotd-btn--ghost {
    background: transparent;
    border-color: var(--sotd-border-soft);
    opacity: 0.75;
    width: 100%;
}
.sotd-btn--ghost:hover { opacity: 1; border-color: var(--sotd-border); }
.sotd-btn--ghost.sotd--loading { opacity: 0.5; pointer-events: none; }

.sotd-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.sotd-shuffle-wrap {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--sotd-border-soft);
}

.sotd-hint {
    font-size: 11px;
    color: var(--sotd-muted);
    margin: 8px 0 0;
}

/* Spinner */
.sotd-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid var(--sotd-border-soft);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: sotdSpin 0.7s linear infinite;
    flex-shrink: 0;
}

/* Empty state */
.sotd-empty {
    padding: 40px;
    text-align: center;
    color: var(--sotd-muted);
    font-size: 15px;
}

/* ── Archive ──────────────────────────────────────────────────────────────── */

.sotd-archive {
    /* inherits color/font from theme */
}

.sotd-archive__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 24px;
}

.sotd-search-input,
.sotd-select {
    background: transparent;
    color: inherit;
    font-family: inherit;
    border: 1px solid var(--sotd-border-soft);
    border-radius: var(--sotd-radius);
    padding: 9px 14px;
    font-size: 13px;
    outline: none;
    transition: border-color var(--sotd-transition);
}

.sotd-search-input { flex: 1; min-width: 200px; }
.sotd-search-input:focus,
.sotd-select:focus { border-color: currentColor; }

.sotd-count {
    font-size: 12px;
    color: var(--sotd-muted);
    margin-left: auto;
    white-space: nowrap;
}

/* Catalog grid */
.sotd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.sotd-tile {
    background: var(--sotd-fill-soft);
    border: 1px solid var(--sotd-border-soft);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color var(--sotd-transition), transform var(--sotd-transition);
}

.sotd-tile:hover {
    border-color: var(--sotd-border);
    transform: translateY(-2px);
}

.sotd-tile__link-wrap {
    display: block;
    color: inherit;
    text-decoration: none;
}

.sotd-tile__img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: contain;
    background: var(--sotd-fill-soft);
    display: block;
    padding: 16px;
}

.sotd-tile__body {
    padding: 12px 14px;
    border-top: 1px solid var(--sotd-border-soft);
}

.sotd-tile__brand {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.75;
    margin: 0 0 4px;
}

.sotd-tile__name {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    margin: 0 0 6px;
}

.sotd-tile__colorway {
    font-size: 11px;
    color: var(--sotd-muted);
    margin: 0 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sotd-tile__foot {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sotd-tile__price {
    font-weight: 800;
    font-size: 13px;
}

.sotd-tile__links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.sotd-tile__link {
    font-size: 10px;
    font-weight: 700;
    padding: 5px 9px;
    border-radius: 3px;
    text-decoration: none;
    border: 1px solid var(--sotd-border-soft);
    color: inherit;
    transition: color var(--sotd-transition), border-color var(--sotd-transition), background var(--sotd-transition);
}

.sotd-tile__link:hover { border-color: var(--sotd-border); background: var(--sotd-fill-soft); }

.sotd-tile__link--buy {
    border-color: var(--sotd-border);
    font-weight: 800;
}

/* Pagination */
.sotd-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

.sotd-page-btn {
    background: transparent;
    color: inherit;
    font-family: inherit;
    border: 1px solid var(--sotd-border-soft);
    border-radius: var(--sotd-radius);
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background var(--sotd-transition), border-color var(--sotd-transition);
}

.sotd-page-btn:hover { border-color: var(--sotd-border); }
.sotd-page-btn.sotd--active { background: var(--sotd-fill-strong); border-color: currentColor; font-weight: 700; }
.sotd-page-btn:disabled { opacity: 0.4; cursor: default; }

/* Loading */
.sotd-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: var(--sotd-muted);
    font-size: 14px;
}

/* ── Animations ──────────────────────────────────────────────────────────── */

@keyframes sotdFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes sotdFadeDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes sotdSpin {
    to { transform: rotate(360deg); }
}

/* ── Color swatches ──────────────────────────────────────────────────────────
   These dots render actual sneaker colorways for filtering — the hex values
   come from SOTD_Colors::palette() and are functional data, not theme
   branding, so they are left as-is. Only the "active/selected" indicator
   ring below uses currentColor instead of a fixed accent hue. */

.sotd-color-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.sotd-swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--sotd-transition), border-color var(--sotd-transition), box-shadow var(--sotd-transition);
    padding: 0;
    flex-shrink: 0;
}

.sotd-swatch:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 2px var(--sotd-fill-strong);
}

.sotd-swatch--all {
    background: var(--sotd-fill-soft);
    border-color: var(--sotd-border-soft);
    color: var(--sotd-muted);
}

.sotd-swatch--all:hover,
.sotd-swatch--all.sotd--active {
    border-color: currentColor;
    color: inherit;
}

.sotd-swatch.sotd--active {
    border-color: currentColor !important;
    box-shadow: 0 0 0 2px var(--sotd-fill-strong);
    transform: scale(1.1);
}

/* Color dots on tiles */
.sotd-tile__colors {
    display: flex;
    gap: 3px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.sotd-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(128,128,128,0.25);
    flex-shrink: 0;
    display: inline-block;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
    .sotd-card {
        grid-template-columns: 1fr;
    }
    .sotd-card__info-panel {
        border-left: none;
        border-top: 1px solid var(--sotd-border-soft);
        padding: 28px 20px;
    }
    .sotd-card__image-panel { min-height: 260px; }
    .sotd-image-wrap { max-width: 280px; padding: 20px; }
    .sotd-archive__filters { flex-direction: column; }
    .sotd-search-input { width: 100%; }
    .sotd-count { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
