.komplex-item [hidden] {
    display: none !important;
}

.komplex-item__loading {
    padding: 40px 20px;
    text-align: center;
}

.komplex-item__content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    gap: 22px;
}

.komplex-item__title {
    margin: 0;
    text-align: center;
    color: var(--wp--preset--color--primary, #16ddff);
}

.komplex-item__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 22px;
    padding: 22px;
    box-sizing: border-box;
    border-radius: 12px;
    overflow: hidden;
    background: var(--wp--preset--color--secondary-bg, rgba(127, 127, 127, 0.10));
    border-color: color-mix(
        in srgb,
        var(--wp--preset--color--primary, #16ddff) 55%,
        transparent
    );
    box-shadow:
        0 18px 44px rgba(0, 0, 0, .30),
        0 0 24px color-mix(in srgb, var(--wp--preset--color--primary, #16ddff) 12%, transparent),
        0 0 30px color-mix(in srgb, var(--wp--preset--color--accent, #39ff14) 8%, transparent);
}

.komplex-item__thumbnail-wrap {
    position: relative;
    width: calc(100% + 44px);
    margin: -22px -22px 0;
}

.komplex-item__thumbnail {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 0;
}

.komplex-item__featured-star {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 32px;
    height: 32px;
    fill: var(--wp--preset--color--accent);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
    opacity: 0;
    transform: scale(0.72) rotate(-8deg);
    transform-origin: center;
    pointer-events: none;
    transition:
        opacity 0.22s ease,
        transform 0.22s cubic-bezier(.2,.8,.2,1);
}

.komplex-item__featured-star--visible {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.komplex-item__meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
}

.komplex-item__author {
    margin: 0;
    text-align: left;
}

.komplex-item__author-label {
    margin-right: 4px;
    font-weight: 600;
}

.komplex-item__downloads {
    display: block;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

.komplex-item__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 12px;
}

.komplex-item__primary-action {
    margin-left: 0;
}

.komplex-item__supplementary {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.komplex-item__description {
    display: block;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    white-space: pre-wrap;
}

.komplex-item__description a {
    text-decoration: underline;
}

.komplex-item__description blockquote {
    margin: 0.75em 0;
    padding: 0.65em 1em;
    border-left: 4px solid currentColor;
    opacity: 0.9;
}

.komplex-item__description code {
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: color-mix(in srgb, currentColor 9%, transparent);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.komplex-item__description ul,
.komplex-item__description ol {
    margin: 0.65em 0;
    padding-left: 1.6em;
}

.komplex-item__bbcode-center { text-align: center; }
.komplex-item__bbcode-left { text-align: left; }
.komplex-item__bbcode-right { text-align: right; }

.komplex-item__price {
    font-size: 1.25rem;
    font-weight: 600;
}

.komplex-item__featured-button,
.komplex-item__purchase-button,
.komplex-item__download-button,
.komplex-item__alert-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.6em 1.1em;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #ffffff;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        opacity 0.15s ease,
        transform 0.15s ease;
}

.komplex-item__featured-button {
    border-color: var(--wp--preset--color--accent, #2271b1);
    background: var(--wp--preset--color--accent, #2271b1);
    color: var(--wp--preset--color--base, #ffffff);
}

.komplex-item__purchase-button {
    border-color: #238636;
    background: #238636;
}

.komplex-item__download-button,
.komplex-item__alert-ok {
    border-color: #2271b1;
    background: #2271b1;
}

.komplex-item__featured-button:hover,
.komplex-item__purchase-button:hover,
.komplex-item__download-button:hover,
.komplex-item__alert-ok:hover {
    opacity: 0.9;
}

.komplex-item__featured-button:active,
.komplex-item__purchase-button:active,
.komplex-item__download-button:active,
.komplex-item__alert-ok:active {
    transform: translateY(1px);
}

.komplex-item__featured-button:focus-visible,
.komplex-item__purchase-button:focus-visible,
.komplex-item__download-button:focus-visible,
.komplex-item__alert-ok:focus-visible,
.komplex-item__alert-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.komplex-item__featured-button:disabled,
.komplex-item__purchase-button:disabled,
.komplex-item__download-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Load-in animation: 150ms slower than the previous 420ms animation. */
.komplex-item__content.komplex-item__content--loaded > .komplex-item__title,
.komplex-item__content.komplex-item__content--loaded > .komplex-item__card,
.komplex-item__content.komplex-item__content--loaded > .komplex-item__actions,
.komplex-item__content.komplex-item__content--loaded > .komplex-item__supplementary {
    animation: komplex-item-fade-up 0.57s cubic-bezier(.2,.7,.2,1) both;
}

.komplex-item__content.komplex-item__content--loaded > .komplex-item__title { animation-delay: 0ms; }
.komplex-item__content.komplex-item__content--loaded > .komplex-item__card { animation-delay: 75ms; }
.komplex-item__content.komplex-item__content--loaded > .komplex-item__actions { animation-delay: 150ms; }
.komplex-item__content.komplex-item__content--loaded > .komplex-item__supplementary { animation-delay: 225ms; }

@keyframes komplex-item-fade-up {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error / alert modal. */
.komplex-item__alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(3px);
    animation: komplex-item-overlay-in 0.18s ease-out both;
}

.komplex-item__alert {
    position: relative;
    width: min(460px, 100%);
    padding: 32px;
    border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast, #111111) 18%, transparent);
    border-radius: 16px;
    background: var(--wp--preset--color--accent, #ffffff);
    color: var(--wp--preset--color--contrast, #1d2327);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    text-align: center;
    animation: komplex-item-alert-in 0.22s cubic-bezier(.2,.8,.2,1) both;
}

.komplex-item__alert-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.65;
}

.komplex-item__alert-close:hover {
    background: rgba(127, 127, 127, 0.12);
    opacity: 1;
}

.komplex-item__alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #d63638;
    color: #ffffff;
    font-size: 30px;
    font-weight: 700;
}

.komplex-item__alert-title {
    margin: 0 0 10px;
    font-size: 1.35rem;
}

.komplex-item__alert-message {
    margin: 0 0 24px;
    line-height: 1.55;
    opacity: 0.82;
}

@keyframes komplex-item-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes komplex-item-alert-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 640px) {
    .komplex-item__meta-row {
        align-items: flex-start;
        gap: 16px;
    }

    .komplex-item__actions {
        flex-wrap: wrap;
    }

    .komplex-item__primary-action {
        margin-left: 0;
    }

    .komplex-item__alert {
        padding: 28px 22px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .komplex-item__content.komplex-item__content--loaded > *,
    .komplex-item__featured-star,
    .komplex-item__alert-overlay,
    .komplex-item__alert {
        animation: none !important;
        transition: none !important;
    }
}
