.tdpc-widget {
    --tdpc-card-width: 20rem;
    --tdpc-border-color: #e2c044;
    --tdpc-border-width: 0.5rem;
    --tdpc-border-inset: 1.5rem;
    --tdpc-overlay-opacity: 0.5;
    --tdpc-shadow-opacity: 0.8;
    --tdpc-shadow-blur: 2rem;
    --tdpc-shadow-depth: -2rem;
    --tdpc-border-depth: 2rem;
    --tdpc-cutout-depth: 4rem;
    --tdpc-content-depth: 6rem;
    --tdpc-shadow-y: 2rem;
    --tdpc-cutout-scale: 0.92;
    width: 100%;
}

.tdpc-widget,
.tdpc-widget * {
    box-sizing: border-box;
}

.tdpc-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, var(--tdpc-card-width)));
    align-items: center;
    justify-content: center;
    gap: 3rem;
    width: 100%;
}

.tdpc-card {
    position: relative;
    width: 100%;
    max-width: var(--tdpc-card-width);
    aspect-ratio: 5 / 7;
    color: #ffffff;
    perspective: 50rem;
    --tdpc-rotate-x: 0deg;
    --tdpc-rotate-y: 0deg;
    isolation: isolate;
    container-type: inline-size;
}

.tdpc-shadow,
.tdpc-image,
.tdpc-content,
.tdpc-card::before,
.tdpc-card::after {
    transform-style: preserve-3d;
    will-change: transform;
}

.tdpc-shadow {
    position: absolute;
    inset: 0;
    background-image: var(--tdpc-full-image);
    background-size: cover;
    background-position: center;
    opacity: var(--tdpc-shadow-opacity);
    filter: blur(var(--tdpc-shadow-blur)) saturate(0.9);
    box-shadow: 0 -1.5rem 2rem -0.5rem rgba(0, 0, 0, 0.7);
    transform: rotateX(var(--tdpc-rotate-x)) rotateY(var(--tdpc-rotate-y)) translate3d(0, var(--tdpc-shadow-y), max(var(--tdpc-shadow-depth), -10cqw));
}

.tdpc-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.tdpc-image-background {
    background-image: linear-gradient(to top, rgba(0, 0, 0, var(--tdpc-overlay-opacity)), transparent 40%), var(--tdpc-background-image);
    -webkit-mask-image: var(--tdpc-background-image);
    mask-image: var(--tdpc-background-image);
    transform: rotateX(var(--tdpc-rotate-x)) rotateY(var(--tdpc-rotate-y)) translate3d(0, 0, 0);
}

.tdpc-image-cutout {
    background-image: linear-gradient(to top, rgba(0, 0, 0, var(--tdpc-overlay-opacity)), transparent 40%), var(--tdpc-cutout-image);
    -webkit-mask-image: var(--tdpc-cutout-image);
    mask-image: var(--tdpc-cutout-image);
    transform: rotateX(var(--tdpc-rotate-x)) rotateY(var(--tdpc-rotate-y)) translate3d(0, 0, min(var(--tdpc-cutout-depth), 20cqw)) scale(var(--tdpc-cutout-scale));
    z-index: 3;
}

.tdpc-content {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    inset: 0;
    padding: min(3.5rem, 17.5cqw);
    transform: rotateX(var(--tdpc-rotate-x)) rotateY(var(--tdpc-rotate-y)) translate3d(0, 0, min(var(--tdpc-content-depth), 30cqw));
    z-index: 4;
    pointer-events: none;
}

.tdpc-card::before,
.tdpc-card::after {
    content: "";
    position: absolute;
    inset: var(--tdpc-border-inset);
    border: var(--tdpc-border-width) solid var(--tdpc-border-color);
    transform: rotateX(var(--tdpc-rotate-x)) rotateY(var(--tdpc-rotate-y)) translate3d(0, 0, min(var(--tdpc-border-depth), 10cqw));
    pointer-events: none;
}

.tdpc-card::before {
    z-index: 4;
}

.tdpc-border-left-behind::before {
    border-left-color: transparent;
}

.tdpc-border-right-behind::before {
    border-right-color: transparent;
}

.tdpc-border-bottom-behind::before {
    border-bottom-color: transparent;
}

.tdpc-title {
    color: #ffffff;
    font-size: clamp(0.95rem, 6.25cqw, 1.25rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.5rem;
    text-shadow: 0 0 2rem rgba(0, 0, 0, 0.5);
}

.tdpc-description {
    color: #ffffff;
    font-size: clamp(0.78rem, 5cqw, 1rem);
    font-weight: 300;
    line-height: 1.5;
    margin: 0;
    text-shadow: 0 0 2rem rgba(0, 0, 0, 0.5);
}

@media (max-width: 1024px) {
    .tdpc-cards {
        grid-template-columns: repeat(2, minmax(0, var(--tdpc-card-width)));
    }
}

@media (max-width: 767px) {
    .tdpc-cards {
        grid-template-columns: repeat(1, minmax(0, var(--tdpc-card-width)));
    }
}

@container (max-width: 16rem) {
    .tdpc-content {
        padding-left: min(4.25rem, 22cqw) !important;
        padding-bottom: min(4.1rem, 21cqw) !important;
    }
}
