/* Komponen status dan feed dinamis beranda. Struktur visual utama tetap memakai
   style.css agar tampilan beranda yang sudah ada tetap konsisten. */
.homepage-empty-panel {
    min-height: 170px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 28px 18px;
    border: 1px dashed rgba(37, 99, 235, .22);
    border-radius: 18px;
    background: rgba(255, 255, 255, .72);
    color: #75829b;
    text-align: center;
}

.homepage-empty-panel i {
    color: #2563eb;
    font-size: 25px;
}

.homepage-empty-panel strong {
    color: #16233e;
    font-size: 15px;
}

.homepage-empty-panel span {
    max-width: 420px;
    font-size: 12px;
    line-height: 1.55;
}

.homepage-empty-state {
    display: grid;
    gap: 5px;
    padding: 24px 12px;
    color: #77849d;
    text-align: center;
}

.homepage-empty-state strong {
    color: #1b2843;
    font-size: 13px;
}

.homepage-empty-state span {
    font-size: 11px;
}

.home-feed-sentinel {
    width: 100%;
    height: 1px;
}

.home-feed-loading,
.home-feed-end {
    margin: 18px 0 0;
    color: #74819a;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.home-feed-loading i {
    margin-right: 5px;
    color: #2563eb;
}

body.dark-mode .homepage-empty-panel {
    border-color: rgba(126, 157, 255, .25);
    background: rgba(18, 28, 55, .72);
}

body.dark-mode .homepage-empty-panel strong,
body.dark-mode .homepage-empty-state strong {
    color: #f4f7ff;
}

@media (max-width: 640px) {
    .homepage-empty-panel {
        min-height: 135px;
        border-radius: 14px;
    }

    .homepage-empty-panel strong {
        font-size: 14px;
    }

    .home-feed-loading,
    .home-feed-end {
        font-size: 11px;
    }
}

/* Penyempurnaan blok interaksi homepage. */
.recommendation-featured-link {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.recommendation-featured-image-wrap {
    aspect-ratio: 4 / 3;
    border-radius: 12px;
}

.recommendation-featured-copy {
    min-width: 0;
}

.recommendation-featured-copy h3 {
    display: -webkit-box;
    margin: 6px 0 7px;
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    line-height: 1.35;
    font-weight: 800;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.recommendation-featured-copy p {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.recommendation-featured-category {
    display: inline-flex;
    color: var(--blue);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.polling-track {
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(37, 99, 235, .25) transparent;
}

.polling-card {
    flex-basis: calc((100% - 16px) / 2);
}

.polling-status-row {
    min-height: 20px;
    margin-bottom: 6px;
}

.polling-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
}

.polling-status.is-open {
    background: #e9fbf3;
    color: #15915e;
}

.polling-status.is-closed {
    background: #fff4e4;
    color: #c76b00;
}

.polling-description {
    display: -webkit-box;
    margin: 7px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.polling-option:disabled {
    cursor: not-allowed;
    opacity: .78;
}

.polling-card.is-expired {
    border-color: rgba(234, 136, 0, .32);
}

.polling-closed-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 9px;
    border-radius: 8px;
    background: #fff8eb;
    color: #a76100;
    font-size: 9px;
    line-height: 1.4;
}

.polling-closed-note i {
    margin-top: 2px;
}

body.dark-mode .polling-status.is-open {
    background: rgba(21, 145, 94, .18);
}

body.dark-mode .polling-status.is-closed,
body.dark-mode .polling-closed-note {
    background: rgba(199, 107, 0, .18);
    color: #ffc978;
}

@media (max-width: 1000px) {
    .recommendation-featured-link {
        grid-template-columns: 200px minmax(0, 1fr);
    }
}

@media (max-width: 650px) {
    .recommendation-featured-link {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 11px;
    }

    .recommendation-featured-image-wrap {
        border-radius: 10px;
    }

    .recommendation-featured-copy h3 {
        margin: 5px 0 4px;
        font-size: 13px;
        -webkit-line-clamp: 4;
    }

    .recommendation-featured-copy p {
        font-size: 9px;
        -webkit-line-clamp: 2;
    }

    .polling-card {
        flex-basis: 86%;
    }
}

/*
 * Final beranda polish.
 * Keep the existing data flow and interactions, but make the polling cards
 * more compact and keep every recommendation title beside its thumbnail.
 */
.engagement-section {
    overflow: hidden;
}

.polling-track {
    align-items: stretch;
}

.polling-card {
    min-height: 0;
    height: auto;
}

.polling-image {
    aspect-ratio: 16 / 7.5;
    max-height: 150px;
}

.polling-body {
    padding: 11px 13px 13px;
}

.polling-status-row {
    min-height: 0;
    margin-bottom: 5px;
}

.polling-status {
    padding: 4px 7px;
    font-size: 8px;
}

.polling-body h3 {
    min-height: 0;
    font-size: 14px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
}

.polling-description {
    margin-top: 5px;
    -webkit-line-clamp: 1;
}

.polling-author {
    margin: 7px 0 9px;
    font-size: 10px;
}

.polling-options {
    gap: 6px;
}

.polling-option {
    min-height: 35px;
    padding: 6px 10px;
    font-size: 11px;
}

.polling-info {
    margin-top: 7px;
    font-size: 9px;
    line-height: 1.35;
}

.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.recommendation-horizontal {
    min-width: 0;
}

.recommendation-horizontal > a {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.recommendation-horizontal > a > img {
    display: block;
    width: 96px;
    height: 70px;
    aspect-ratio: 96 / 70;
    object-fit: cover;
    border-radius: 9px;
}

.recommendation-horizontal-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recommendation-horizontal-copy > span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    margin: 0;
}

.recommendation-horizontal-copy > span strong {
    display: block;
    overflow: hidden;
    color: var(--blue);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .06em;
    line-height: 1.2;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.recommendation-horizontal-copy > span time {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 8px;
    line-height: 1.2;
}

.recommendation-horizontal-copy > h3 {
    display: -webkit-box;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    line-height: 1.35;
    font-weight: 780;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

@media (max-width: 1000px) {
    .recommendation-list {
        grid-template-columns: 1fr;
    }

    .recommendation-horizontal > a {
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .recommendation-horizontal > a > img {
        width: 112px;
        height: 78px;
    }
}

@media (max-width: 650px) {
    .polling-image {
        max-height: none;
        aspect-ratio: 16 / 8.5;
    }

    .polling-body h3 {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .polling-option {
        min-height: 36px;
        padding: 6px 9px;
        font-size: 11px;
    }

    .recommendation-horizontal > a {
        grid-template-columns: 94px minmax(0, 1fr);
        gap: 10px;
    }

    .recommendation-horizontal > a > img {
        width: 94px;
        height: 68px;
    }

    .recommendation-horizontal-copy > h3 {
        font-size: 11px;
        -webkit-line-clamp: 3;
    }
}

@media (max-width: 350px) {
    .recommendation-horizontal > a {
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 8px;
    }

    .recommendation-horizontal > a > img {
        width: 86px;
        height: 64px;
    }
}
