/**
 * Post Card — Pure CSS Component
 * Mobile: horizontal compact | Tablet+: vertical card
 */

/* ── Card Container ── */
.sh-card {
    background: var(--pi-bg-card, #ffffff);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--pi-border-light, #f1f5f9);
    display: flex;
    flex-direction: row;
    height: auto;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
}

@media (min-width: 768px) {
    .sh-card {
        flex-direction: column;
        height: 100%;
        border-radius: 1.5rem;
    }
}

.sh-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px color-mix(in srgb, var(--pi-primary, #007d3d) 15%, transparent);
}

/* ── Thumbnail ── */
.sh-card__thumb {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    width: 130px;
    aspect-ratio: 1;
}

@media (min-width: 640px) { .sh-card__thumb { width: 160px; } }

@media (min-width: 768px) {
    .sh-card__thumb {
        width: 100%;
        aspect-ratio: 4 / 3;
    }
}

.sh-card__thumb-link {
    position: absolute;
    inset: 0;
    display: block;
    background: var(--pi-bg-alt, #f3f4f6);
}

.sh-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: none;
    transition: transform 0.5s ease-out;
}

.sh-card:hover .sh-card__img {
    transform: scale(1.05);
}

/* Placeholder */
.sh-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pi-bg-alt, #f3f4f6), var(--pi-bg, #f9fafb));
}

.sh-card__placeholder-logo {
    height: 2rem;
    width: auto;
    opacity: 0.3;
    filter: grayscale(1);
}

@media (min-width: 768px) { .sh-card__placeholder-logo { height: 3rem; } }

.sh-card__placeholder-text {
    display: none;
    font-size: 0.5625rem;
    font-weight: 700;
    color: var(--pi-text-muted, #64748b);
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@media (min-width: 768px) { .sh-card__placeholder-text { display: block; } }

/* ── Date Badge (desktop) ── */
.sh-card__date-badge {
    display: none;
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

@media (min-width: 768px) { .sh-card__date-badge { display: block; } }
@media (min-width: 1024px) { .sh-card__date-badge { top: 1rem; left: 1rem; padding: 0.5rem 1rem; } }

.sh-card__date-day {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--pi-primary, #007d3d);
    line-height: 1;
    text-align: center;
}

@media (min-width: 1024px) { .sh-card__date-day { font-size: 1.25rem; } }

.sh-card__date-month {
    display: block;
    font-size: 0.625rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--pi-text-3, #94a3b8);
    line-height: 1;
    text-align: center;
    margin-top: 0.125rem;
}

@media (min-width: 1024px) { .sh-card__date-month { font-size: 0.75rem; } }

/* ── Body ── */
.sh-card__body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

@media (min-width: 640px) { .sh-card__body { padding: 1rem; } }
@media (min-width: 768px) { .sh-card__body { padding: 1.25rem; } }
@media (min-width: 1024px) { .sh-card__body { padding: 1.5rem; } }

/* ── Meta (date + category) ── */
.sh-card__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

@media (min-width: 768px) { .sh-card__meta { margin-bottom: 0.75rem; } }

.sh-card__date-mobile {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--pi-primary, #007d3d);
    background: color-mix(in srgb, var(--pi-primary, #007d3d) 10%, transparent);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

@media (min-width: 768px) { .sh-card__date-mobile { display: none; } }

.sh-card__cat {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--pi-primary, #007d3d);
    background: color-mix(in srgb, var(--pi-primary, #007d3d) 10%, transparent);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.2s;
}

@media (min-width: 768px) { .sh-card__cat { font-size: 0.75rem; padding: 0.25rem 0.75rem; } }

.sh-card__cat:hover {
    background: var(--pi-primary, #007d3d);
    color: #fff;
}

/* ── Content ── */
.sh-card__content { flex-grow: 1; }

.sh-card__title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--pi-text, #1e293b);
    margin: 0 0 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

@media (min-width: 640px) { .sh-card__title { font-size: 1rem; } }
@media (min-width: 768px) { .sh-card__title { font-size: 1.125rem; margin-bottom: 0.75rem; } }
@media (min-width: 1024px) { .sh-card__title { font-size: 1.25rem; } }

.sh-card__title a { color: inherit; text-decoration: none; }
.sh-card:hover .sh-card__title { color: var(--pi-primary, #007d3d); }

.sh-card__excerpt {
    display: none;
    color: var(--pi-text-3, #94a3b8);
    font-size: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 639px) { .sh-card__excerpt { display: none; } }
@media (min-width: 768px) { .sh-card__excerpt { font-size: 0.875rem; } }

/* ── Footer ── */
.sh-card__footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--pi-border-light, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 768px) { .sh-card__footer { margin-top: 1rem; padding-top: 1rem; } }
@media (min-width: 1024px) { .sh-card__footer { margin-top: 1.5rem; padding-top: 1.25rem; } }

.sh-card__author {
    font-size: 0.75rem;
    color: var(--pi-text-3, #94a3b8);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) { .sh-card__author { font-size: 0.875rem; } }

.sh-card__author-icon { width: 0.75rem; height: 0.75rem; flex-shrink: 0; }
@media (min-width: 768px) { .sh-card__author-icon { width: 1rem; height: 1rem; } }

.sh-card__author-name { overflow: hidden; text-overflow: ellipsis; }

.sh-card__readmore {
    color: var(--pi-secondary, #ffb703);
    font-weight: 700;
    font-size: 0.75rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

@media (min-width: 768px) { .sh-card__readmore { font-size: 0.875rem; } }

.sh-card__readmore:hover { color: var(--pi-secondary-dark, #fb8500); }

.sh-card__readmore-text { display: none; }
@media (min-width: 640px) { .sh-card__readmore-text { display: inline; } }

.sh-card__readmore-icon { width: 0.875rem; height: 0.875rem; }
@media (min-width: 768px) { .sh-card__readmore-icon { width: 1rem; height: 1rem; } }

/* ── Dark Mode ── */
.dark .sh-card { background: var(--pi-bg-card, #1e293b); border-color: var(--pi-border, #334155); }
.dark .sh-card__thumb-link { background: var(--pi-bg-elevated, #334155); }
.dark .sh-card__date-badge { background: rgba(30, 41, 59, 0.9); }
.dark .sh-card__title { color: var(--pi-text, #f1f5f9); }
.dark .sh-card__excerpt { color: var(--pi-text-muted, #64748b); }
.dark .sh-card__footer { border-top-color: var(--pi-border, #334155); }
.dark .sh-card__date-month { color: var(--pi-text-muted, #64748b); }
