/* ============================================================
   ENTERTAINMENT SECTION
   Prefix: lp-homepage-section-list-*
   ============================================================ */

/* ─── MASTER WRAPPER ─── */
.lp-homepage-section-list {
    width: 100%;
    max-width: var(--max-w);
    margin: 32px auto 40px;
    padding: 0 20px;
}

/* ─── HEADER WITH BADGE ─── */
.lp-homepage-section-list-header {
    border-bottom: 2px solid var(--rule);
    margin-bottom: 24px;
    display: flex;
}

.lp-homepage-section-list-badge {
    background-color: var(--accent);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 18px;
    display: inline-block;
    margin-bottom: -2px;
    border-radius: 2px 2px 0 0;
    transition: background var(--t) var(--ease);
}

[data-theme="dark"] .lp-homepage-section-list-badge {
    background-color: var(--accent);
}

/* ─── GRID ─── */
.lp-homepage-section-list-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 24px;
    margin-bottom: 32px;
}

/* ─── CARD ─── */
.lp-homepage-section-list-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ─── THUMBNAIL ─── */
.lp-homepage-section-list-thumb {
    width: 110px;
    height: 80px;
    flex-shrink: 0;
    background-color: var(--bg-rule);
    overflow: hidden;
    border-radius: 4px;
    transition: background var(--t) var(--ease);
}

.lp-homepage-section-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lp-homepage-section-list-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--ink-faint);
    background-color: var(--bg-rule);
}

/* ─── CONTENT ─── */
.lp-homepage-section-list-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

/* ─── TITLE ─── */
.lp-homepage-section-list-title {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.lp-homepage-section-list-title a {
    color: var(--ink);
    text-decoration: none;
    transition: color var(--t) var(--ease);
}

.lp-homepage-section-list-title a:hover {
    color: var(--accent);
}

[data-theme="dark"] .lp-homepage-section-list-title a {
    color: var(--ink);
}

[data-theme="dark"] .lp-homepage-section-list-title a:hover {
    color: var(--accent);
}

/* ─── TIME ─── */
.lp-homepage-section-list-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-soft);
}

.lp-homepage-section-list-clock {
    width: 11px;
    height: 11px;
    stroke: var(--ink-soft);
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

[data-theme="dark"] .lp-homepage-section-list-time {
    color: var(--ink-mid);
}

[data-theme="dark"] .lp-homepage-section-list-clock {
    stroke: var(--ink-mid);
}

/* ─── FOOTER / LOAD MORE BUTTON ─── */
.lp-homepage-section-list-footer {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--rule);
    padding-top: 24px;
}

[data-theme="dark"] .lp-homepage-section-list-footer {
    border-top-color: var(--rule);
}

.lp-homepage-section-list-loadmore {
    background-color: transparent;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 48px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--t) var(--ease);
    text-decoration: none;
    display: inline-block;
    min-width: 160px;
    text-align: center;
    max-width: 100%;
    width: auto;
}

.lp-homepage-section-list-loadmore:hover:not(:disabled) {
    background-color: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

.lp-homepage-section-list-loadmore:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

[data-theme="dark"] .lp-homepage-section-list-loadmore {
    color: var(--ink);
    border-color: var(--rule);
}

[data-theme="dark"] .lp-homepage-section-list-loadmore:hover:not(:disabled) {
    background-color: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

/* ─── LOADING SPINNER ─── */
.lp-homepage-section-list-loadmore.loading {
    position: relative;
    color: transparent;
}

.lp-homepage-section-list-loadmore.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--rule);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: lp-spin 0.7s linear infinite;
}

@keyframes lp-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ─── NEW POSTS ANIMATION ─── */
.lp-homepage-section-list-card-loaded {
    opacity: 0;
    transform: translateY(20px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: 2 columns */
@media (max-width: 960px) {
    .lp-homepage-section-list {
        padding: 0 16px;
        margin: 28px auto 32px;
    }

    .lp-homepage-section-list-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 18px;
    }

    .lp-homepage-section-list-card {
        gap: 12px;
    }

    .lp-homepage-section-list-thumb {
        width: 100px;
        height: 74px;
    }

    .lp-homepage-section-list-title {
        font-size: 13.5px;
    }

    .lp-homepage-section-list-loadmore {
        padding: 10px 36px;
        min-width: 140px;
    }
}

/* ============================================================
   MOBILE: 1 column (Optimized)
   ============================================================ */
@media (max-width: 640px) {
    .lp-homepage-section-list {
        padding: 0 16px;
        margin: 16px auto 24px;
    }

    .lp-homepage-section-list-header {
        margin-bottom: 16px;
        border-bottom-width: 2px;
    }

    .lp-homepage-section-list-badge {
        font-size: 11px;
        padding: 5px 14px;
        letter-spacing: 0.06em;
    }

    .lp-homepage-section-list-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 24px;
    }

    .lp-homepage-section-list-card {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 6px 0;
        border-bottom: 1px solid var(--rule);
        padding-bottom: 14px;
    }

    .lp-homepage-section-list-card:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    [data-theme="dark"] .lp-homepage-section-list-card {
        border-bottom-color: var(--rule);
    }

    .lp-homepage-section-list-thumb {
        width: 90px;
        height: 68px;
        flex-shrink: 0;
        border-radius: 4px;
    }

    .lp-homepage-section-list-placeholder {
        font-size: 22px;
    }

    .lp-homepage-section-list-content {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
        min-width: 0;
        padding-top: 2px;
    }

    .lp-homepage-section-list-title {
        font-size: 14px;
        line-height: 1.35;
        font-weight: 600;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        word-break: break-word;
    }

    .lp-homepage-section-list-time {
        font-size: 10px;
        gap: 3px;
        color: var(--ink-soft);
    }

    .lp-homepage-section-list-clock {
        width: 10px;
        height: 10px;
        stroke: var(--ink-soft);
    }

    [data-theme="dark"] .lp-homepage-section-list-time {
        color: var(--ink-mid);
    }

    [data-theme="dark"] .lp-homepage-section-list-clock {
        stroke: var(--ink-mid);
    }

    .lp-homepage-section-list-footer {
        padding-top: 16px;
        border-top: 1px solid var(--rule);
    }

    [data-theme="dark"] .lp-homepage-section-list-footer {
        border-top-color: var(--rule);
    }

    .lp-homepage-section-list-loadmore {
        padding: 10px 32px;
        font-size: 11px;
        min-width: 140px;
        width: 100%;
        max-width: 280px;
        border-radius: 4px;
        letter-spacing: 0.08em;
        /* Better touch target */
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .lp-homepage-section-list-loadmore.loading::after {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }
}

/* ============================================================
   SMALL MOBILE (Phones under 400px)
   ============================================================ */
@media (max-width: 400px) {
    .lp-homepage-section-list {
        padding: 0 12px;
        margin: 12px auto 20px;
    }

    .lp-homepage-section-list-header {
        margin-bottom: 12px;
    }

    .lp-homepage-section-list-badge {
        font-size: 10px;
        padding: 4px 12px;
        letter-spacing: 0.08em;
    }

    .lp-homepage-section-list-grid {
        gap: 10px;
        margin-bottom: 18px;
    }

    .lp-homepage-section-list-card {
        gap: 10px;
        padding: 4px 0;
        padding-bottom: 10px;
    }

    .lp-homepage-section-list-thumb {
        width: 76px;
        height: 58px;
        border-radius: 3px;
    }

    .lp-homepage-section-list-placeholder {
        font-size: 18px;
    }

    .lp-homepage-section-list-title {
        font-size: 13px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .lp-homepage-section-list-time {
        font-size: 9px;
        gap: 2px;
    }

    .lp-homepage-section-list-clock {
        width: 9px;
        height: 9px;
    }

    .lp-homepage-section-list-footer {
        padding-top: 12px;
    }

    .lp-homepage-section-list-loadmore {
        padding: 8px 20px;
        font-size: 10px;
        min-width: 100px;
        max-width: 220px;
        min-height: 38px;
        letter-spacing: 0.1em;
    }

    .lp-homepage-section-list-loadmore.loading::after {
        width: 14px;
        height: 14px;
        border-width: 1.5px;
    }
}

/* ============================================================
   TOUCH OPTIMIZATION (for all mobile)
   ============================================================ */
@media (hover: none) and (max-width: 640px) {
    .lp-homepage-section-list-loadmore {
        /* Active state for touch devices */
        -webkit-tap-highlight-color: transparent;
    }

    .lp-homepage-section-list-loadmore:active:not(:disabled) {
        background-color: var(--ink);
        color: var(--bg);
        border-color: var(--ink);
        transform: scale(0.97);
    }

    [data-theme="dark"] .lp-homepage-section-list-loadmore:active:not(:disabled) {
        background-color: var(--ink);
        border-color: var(--ink);
        color: var(--bg);
    }

    .lp-homepage-section-list-title a {
        /* Larger tap area for titles */
        display: block;
        padding: 2px 0;
    }
}

/* ============================================================
   DARK MODE OVERRIDES (Mobile)
   ============================================================ */
@media (max-width: 640px) {
    [data-theme="dark"] .lp-homepage-section-list-card {
        border-bottom-color: var(--rule);
    }

    [data-theme="dark"] .lp-homepage-section-list-card:last-child {
        border-bottom-color: transparent;
    }
}