/* =========================================================
   HALAMAN KATEGORI BERITA
========================================================= */

.category-page {
    width: 100%;
    min-height: 100vh;
    padding: 30px 0 70px;
    overflow: clip;
    background: var(--page);
    color: var(--text);
}

.category-page-container {
    width: min(var(--container-width), calc(100% - 32px));
    margin-inline: auto;
}

.category-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.category-page-kicker,
.category-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.category-page-kicker i {
    color: #ff9f00;
}

.category-page-heading h1 {
    margin: 7px 0 5px;
    color: var(--text);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.05;
    font-weight: 850;
    letter-spacing: -.05em;
}

.category-page-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.category-page-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.category-page-more:hover {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.category-top-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

.category-top-main,
.category-popular-panel,
.category-spotlight-layout > *,
.category-feed-layout > * {
    min-width: 0;
}

.category-featured-card,
.category-featured-link {
    position: relative;
    display: block;
    height: 418px;
    overflow: hidden;
    border-radius: 20px;
    background: #101626;
}

.category-featured-link {
    color: #fff;
    text-decoration: none;
}

.category-featured-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.category-featured-card:hover .category-featured-image {
    transform: scale(1.035);
}

.category-featured-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .04) 28%, rgba(0, 0, 0, .88) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, .22), transparent 70%);
}

.category-featured-content {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 25px;
}

.category-featured-label {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    margin-bottom: 10px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.category-featured-content h2 {
    max-width: 750px;
    margin: 0;
    color: #fff;
    font-size: clamp(25px, 3vw, 36px);
    line-height: 1.12;
    font-weight: 850;
    letter-spacing: -.04em;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}

.category-featured-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
    color: rgba(255, 255, 255, .86);
    font-size: 10px;
    font-weight: 650;
    text-transform: uppercase;
}

.category-featured-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.category-mini-card {
    min-width: 0;
}

.category-mini-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.category-mini-link img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 11px;
    object-fit: cover;
    background: #e8ebf2;
    transition: transform .35s ease;
}

.category-mini-link:hover img {
    transform: scale(1.035);
}

.category-mini-category,
.category-spotlight-category {
    display: block;
    margin-top: 9px;
    color: #2563eb;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.category-mini-link h3 {
    display: -webkit-box;
    margin: 6px 0 0;
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    line-height: 1.38;
    font-weight: 800;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.category-mini-meta,
.category-spotlight-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 9px;
}

.category-mini-meta span,
.category-spotlight-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.category-popular-panel {
    position: sticky;
    top: calc(96px + var(--nav-height) + 18px);
    padding: 18px;
    border: 1px solid rgba(99, 102, 241, .14);
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0, rgba(124, 58, 237, .13), transparent 35%),
        var(--surface);
    box-shadow: 0 16px 44px rgba(15, 23, 42, .09);
}

.category-popular-heading h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 12px;
    color: var(--text);
    font-size: 23px;
    line-height: 1.1;
    font-weight: 850;
    letter-spacing: -.035em;
}

.category-popular-heading h2 i {
    color: #ff6b00;
}

.category-popular-list {
    display: grid;
    gap: 7px;
}

.category-popular-item {
    display: grid;
    grid-template-columns: 39px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 9px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: inherit;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.category-popular-item:hover {
    border-color: rgba(99, 102, 241, .14);
    background: var(--blue-soft);
    transform: translateX(2px);
}

.category-popular-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #f1f3f8;
    color: #8a91a1;
    font-size: 14px;
    font-weight: 850;
}

.category-popular-item:first-child .category-popular-number {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .25);
}

.category-popular-copy {
    display: block;
    min-width: 0;
}

.category-popular-copy strong {
    display: block;
    margin-bottom: 4px;
    color: #4f46e5;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.category-popular-copy b {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    line-height: 1.38;
    font-weight: 800;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.category-popular-copy small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 9px;
}

.category-spotlight-section,
.category-follow-section,
.category-feed-section {
    margin-top: 38px;
}

.category-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.category-section-heading h2 {
    position: relative;
    margin: 5px 0 0;
    padding-left: 10px;
    color: var(--text);
    font-size: 25px;
    line-height: 1.1;
    font-weight: 850;
    letter-spacing: -.04em;
}

.category-section-heading h2::before {
    position: absolute;
    top: 1px;
    bottom: 1px;
    left: 0;
    width: 4px;
    border-radius: 2px;
    background: #ff9f00;
    content: "";
}

.category-section-heading > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #4f46e5;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .05em;
    text-decoration: none;
    text-transform: uppercase;
}

.category-section-heading > a:hover {
    color: var(--blue);
}

.category-spotlight-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: stretch;
}

.category-spotlight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 14px;
}

.category-spotlight-card,
.category-spotlight-link {
    min-width: 0;
}

.category-spotlight-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.category-spotlight-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 12px;
    background: #e8ebf2;
}

.category-spotlight-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.category-spotlight-link:hover .category-spotlight-image img {
    transform: scale(1.04);
}

.category-spotlight-link h3 {
    display: -webkit-box;
    margin: 6px 0 0;
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 800;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.category-spotlight-meta time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.category-spotlight-ad {
    min-width: 0;
    height: 100%;
    min-height: 455px;
    overflow: hidden;
    background: #e8ebf2;
}

.category-spotlight-ad a,
.category-spotlight-ad img {
    display: block;
    width: 100%;
    height: 100%;
}

.category-spotlight-ad img {
    object-fit: cover;
}

.category-follow-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: stretch;
}

.category-wide-banner {
    display: block;
    height: 170px;
    overflow: hidden;
    background: #e8ebf2;
    line-height: 0;
}

.category-wide-banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease, opacity .2s ease;
}

.category-wide-banner:hover img {
    opacity: .95;
    transform: scale(1.012);
}

.category-follow-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background:
        radial-gradient(circle at 100% 0, rgba(37, 99, 235, .10), transparent 38%),
        var(--surface);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

.category-follow-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.category-follow-heading span {
    display: block;
    margin-bottom: 3px;
    color: #2563eb;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .1em;
}

.category-follow-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
    line-height: 1.1;
    font-weight: 850;
    letter-spacing: -.035em;
}

.category-follow-heading > i {
    color: #ffb900;
    font-size: 20px;
}

.category-follow-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.category-follow-grid a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 42px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 9px;
    font-weight: 750;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.category-follow-grid a:hover {
    background: var(--blue);
    color: #fff;
    transform: translateY(-2px);
}

.category-follow-grid a i {
    font-size: 14px;
}

.category-feed-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
}

.category-feed-heading {
    align-items: flex-start;
    margin-bottom: 13px;
}

.category-feed-list {
    border-top: 1px solid var(--border);
}

.category-horizontal-card {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.category-horizontal-link {
    display: grid;
    grid-template-columns: 185px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.category-horizontal-link > img {
    display: block;
    width: 185px;
    height: 112px;
    border-radius: 10px;
    object-fit: cover;
    background: #e8ebf2;
}

.category-horizontal-copy {
    min-width: 0;
}

.category-horizontal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 9px;
}

.category-horizontal-meta span {
    color: #2563eb;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.category-horizontal-copy h3 {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 17px;
    line-height: 1.35;
    font-weight: 820;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.category-horizontal-copy p {
    display: -webkit-box;
    margin: 6px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.category-horizontal-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px 15px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 9px;
}

.category-horizontal-footer span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.category-horizontal-link:hover h3 {
    color: var(--blue);
}

.category-feed-sidebar {
    min-width: 0;
}

.category-feed-sticky {
    position: sticky;
    top: calc(96px + var(--nav-height) + 18px);
    overflow: hidden;
    line-height: 0;
}

.category-feed-sticky a,
.category-feed-sticky img {
    display: block;
    width: 100%;
}

.category-feed-sticky img {
    height: auto;
    max-height: 550px;
    object-fit: cover;
}

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

.category-feed-loading,
.category-feed-end {
    padding: 18px 0;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.category-feed-loading {
    color: var(--blue);
    font-weight: 700;
}

.category-feed-loading i {
    margin-right: 5px;
}

.category-empty-state {
    display: grid;
    place-items: center;
    min-height: 170px;
    padding: 25px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    text-align: center;
}

.category-empty-state i {
    margin-bottom: 9px;
    color: #9aa9c7;
    font-size: 28px;
}

.category-empty-state strong {
    color: var(--text);
    font-size: 15px;
}

.category-empty-state span {
    margin-top: 4px;
    font-size: 11px;
}

body.dark-mode .category-mini-link img,
body.dark-mode .category-spotlight-image,
body.dark-mode .category-spotlight-ad,
body.dark-mode .category-wide-banner,
body.dark-mode .category-horizontal-link > img {
    background: #20263a;
}

body.dark-mode .category-popular-number {
    background: #252c42;
}

body.dark-mode .category-follow-card {
    box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
}

@media (max-width: 1100px) {
    .category-top-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 16px;
    }

    .category-featured-card,
    .category-featured-link {
        height: 365px;
    }

    .category-featured-content {
        padding: 20px;
    }

    .category-featured-content h2 {
        font-size: 28px;
    }

    .category-mini-grid {
        gap: 10px;
    }

    .category-spotlight-layout,
    .category-follow-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 16px;
    }

    .category-spotlight-ad {
        min-height: 420px;
    }

    .category-follow-card {
        padding: 14px;
    }

    .category-feed-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 18px;
    }
}

@media (max-width: 850px) {
    .category-page {
        padding-top: 22px;
    }

    .category-page-container {
        width: calc(100% - 24px);
    }

    .category-page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .category-top-layout,
    .category-spotlight-layout,
    .category-follow-layout,
    .category-feed-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-popular-panel,
    .category-feed-sticky {
        position: relative;
        top: auto;
    }

    .category-featured-card,
    .category-featured-link {
        height: 350px;
    }

    .category-spotlight-grid {
        gap: 15px 12px;
    }

    .category-spotlight-ad {
        height: 500px;
        min-height: 0;
    }

    .category-wide-banner {
        height: auto;
        aspect-ratio: 1940 / 500;
    }

    .category-feed-sidebar {
        order: -1;
    }

    .category-feed-sticky {
        max-width: 340px;
        margin-inline: auto;
    }
}

@media (max-width: 620px) {
    .category-page-container {
        width: calc(100% - 20px);
    }

    .category-page-heading h1 {
        font-size: 30px;
    }

    .category-page-heading p {
        font-size: 11px;
    }

    .category-page-more {
        width: 100%;
        justify-content: center;
    }

    .category-featured-card,
    .category-featured-link {
        height: 280px;
        border-radius: 14px;
    }

    .category-featured-content {
        padding: 15px;
    }

    .category-featured-label {
        min-height: 23px;
        margin-bottom: 7px;
        padding-inline: 8px;
        border-radius: 7px;
        font-size: 8px;
    }

    .category-featured-content h2 {
        font-size: 21px;
    }

    .category-featured-meta {
        gap: 8px;
        margin-top: 9px;
        font-size: 8px;
    }

    .category-mini-grid,
    .category-spotlight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px 10px;
    }

    .category-mini-link img,
    .category-spotlight-image {
        border-radius: 9px;
    }

    .category-mini-category,
    .category-spotlight-category {
        margin-top: 7px;
        font-size: 7px;
    }

    .category-mini-link h3,
    .category-spotlight-link h3 {
        font-size: 11px;
        line-height: 1.35;
    }

    .category-mini-meta,
    .category-spotlight-meta {
        margin-top: 6px;
        font-size: 7px;
    }

    .category-popular-panel {
        padding: 14px;
        border-radius: 16px;
    }

    .category-popular-heading h2 {
        font-size: 20px;
    }

    .category-section-heading h2 {
        font-size: 22px;
    }

    .category-section-heading > a {
        font-size: 8px;
    }

    .category-spotlight-ad {
        height: auto;
        max-height: 500px;
        aspect-ratio: 375 / 599;
    }

    .category-wide-banner {
        aspect-ratio: 4 / 1;
    }

    .category-follow-card {
        border-radius: 14px;
    }

    .category-follow-grid {
        gap: 7px;
    }

    .category-follow-grid a {
        min-height: 40px;
        font-size: 8px;
    }

    .category-horizontal-card {
        padding: 12px 0;
    }

    .category-horizontal-link {
        grid-template-columns: 105px minmax(0, 1fr);
        gap: 10px;
    }

    .category-horizontal-link > img {
        width: 105px;
        height: 76px;
        border-radius: 8px;
    }

    .category-horizontal-meta {
        margin-bottom: 4px;
        font-size: 7px;
    }

    .category-horizontal-copy h3 {
        font-size: 11px;
        line-height: 1.35;
        -webkit-line-clamp: 3;
    }

    .category-horizontal-copy p {
        display: none;
    }

    .category-horizontal-footer {
        margin-top: 6px;
        font-size: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-featured-image,
    .category-mini-link img,
    .category-spotlight-image img,
    .category-wide-banner img,
    .category-popular-item,
    .category-follow-grid a {
        transition: none;
    }
}
