/* ============================================================
   Live Grid – kortit, skeleton, virheet, "lataa lisää"
   Osa 4/6
============================================================ */

.lg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    width: 100%;
}

.lg-card {
    background: linear-gradient(180deg, #181818, #101010);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;

    animation: lg-fade-up .38s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 35ms);

    transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease);
}

.lg-card:hover {
    transform: translateY(-6px);
    border-color: rgba(221,199,109,.3);
    box-shadow: 0 18px 40px rgba(0,0,0,.4);
}

.lg-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: #141414;
    transition: transform .38s var(--ease);
    margin-bottom: 0;
}

.lg-card:hover img {
    transform: scale(1.04);
}

.lg-card-content {
    padding: 18px;
}

.lg-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.lg-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.lg-card h3 a:hover {
    color: var(--gold);
}

.lg-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Skeleton-latausindikaattori ---- */

.lg-skeleton-wrap {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.lg-skeleton {
    height: 260px;
    border-radius: var(--radius-card);
    background: linear-gradient(90deg, #181818 25%, #222 50%, #181818 75%);
    background-size: 200% 100%;
    animation: lg-shimmer 1.4s infinite;
}

@keyframes lg-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Virheviesti ---- */

.lg-error {
    color: var(--muted);
    padding: 40px;
    text-align: center;
    grid-column: 1 / -1;
}

.lg-retry-btn {
    display: inline-flex;
    margin-top: 14px;
    padding: 10px 22px;
    border-radius: var(--radius-btn);
    border: 1px solid var(--border);
    background: #171717;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .2s var(--ease), transform .2s var(--ease);
}

.lg-retry-btn:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

/* ============================================================
   LATAA LISÄÄ
============================================================ */

.lg-load-wrap {
    text-align: center;
    margin-top: 40px;
}

.lg-load-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 15px 34px;
    border-radius: var(--radius-btn);

    background: linear-gradient(135deg, var(--red), var(--red-dark));

    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;

    border: 1px solid rgba(214,17,30,.4);
    box-shadow: 0 10px 24px rgba(214,17,30,.22);

    transition: transform .22s var(--ease), background .22s var(--ease), box-shadow .22s var(--ease), color .22s var(--ease);
}

.lg-load-btn::after {
    content: "→";
    margin-left: 8px;
    display: inline-block;
    transition: transform .22s var(--ease);
}

.lg-load-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    border-color: var(--gold);
    box-shadow: 0 14px 30px rgba(221,199,109,.22);
}

.lg-load-btn:hover::after {
    transform: translateX(5px);
}

.lg-load-btn[disabled] {
    opacity: .6;
    cursor: default;
    transform: none;
}
