/*----------CARD SKELETON----------*/

.ti-card-skeleton {
    pointer-events: none;
    user-select: none;
}

.ti-card-skeleton-img {
    width: 100%;
    height: 200px;
    border-bottom: var(--ti-ldm-border);
    background: var(--ti-ldm-gradient-skeleton);
    background-size: 200% 100%;
    animation: var(--ti-shimmer);
}

.ti-card-skeleton-bar {
    border-radius: var(--ti-border-radius-sm);
    background: var(--ti-ldm-gradient-skeleton);
    background-size: 200% 100%;
    animation: var(--ti-shimmer);
    flex-shrink: 0;
}

.ti-card-skeleton-bar--icon {
    width: 16px;
    height: 16px;
    border-radius: var(--ti-border-radius-sm);
}

.ti-card-skeleton-bar--category {
    width: 90px;
    height: 14px;
}

.ti-card-skeleton-bar--title {
    width: 75%;
    height: 22px;
}

.ti-card-skeleton-bar--text {
    width: 100%;
    height: 14px;
}

.ti-card-skeleton-bar--text-short {
    width: 80%;
    height: 14px;
}

.ti-card-skeleton-bar--name {
    width: 100px;
    height: 14px;
}

.ti-card-skeleton-bar--date {
    width: 70px;
    height: 12px;
}

.ti-card-skeleton-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--ti-ldm-gradient-skeleton);
    background-size: 200% 100%;
    animation: var(--ti-shimmer);
}

@media (prefers-reduced-motion: reduce) {
    .ti-card-skeleton-img,
    .ti-card-skeleton-bar,
    .ti-card-skeleton-avatar,
    .ti-card-footer::before,
    .ti-post-author-img-wrapper::after {
        animation: none;
        background: var(--ti-color-grey-accent);
    }
}

/*----------CARD----------*/

.ti-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    width: 100%;
}

.ti-card {
    display: flex;
    flex-direction: column;
    border: var(--ti-ldm-border);
    border-radius: var(--ti-border-radius-md);
    overflow: hidden;
    background-color: var(--ti-ldm-color-element);
    box-shadow: var(--ti-box-shadow);
    max-width: 350px;
    min-height: 475px;
    height: 100%;
    position: relative;
}

.ti-card:has(.ti-card-img:not(.ti-card-img-loaded))::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: var(--ti-ldm-gradient-skeleton);
    background-size: 200% 100%;
    animation: var(--ti-shimmer);
    z-index: 1;
}

.ti-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-bottom: var(--ti-ldm-border);
    border-radius: 0;
}

.ti-card-img:not(.ti-card-img-loaded) {
    opacity: 0;
}

.ti-card-img.ti-card-img-loaded {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.ti-card-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.ti-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 20px 40px 20px;
    width: 100%;
    height: 100%;
}

.ti-card-body h3 {
    font-size: var(--ti-font-size-md);
    margin: 0;
}

.ti-card-footer {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: auto;
    align-items: center;
    border-top: var(--ti-ldm-border);
    padding: 10px 20px;
    position: relative;
}

.ti-card-footer:has(.ti-post-author-img:not(.ti-card-img-loaded))::before {
    content: '';
    position: absolute;
    left: 20px;
    top: calc(50% - 22.5px);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--ti-ldm-gradient-skeleton);
    background-size: 200% 100%;
    animation: var(--ti-shimmer);
    pointer-events: none;
    z-index: 2;
}

/*---------- MEDIA QUERIES ----------*/

@media (max-width: 360px) {
    .ti-card {
        max-width: 100%;
        width: 100%;
    }

    .ti-card-img {
        height: 180px;
    }
}
