/* =========================================================
   WallpaperHub — Home Categories
   Compact cards + dedicated SVG background per category
   ========================================================= */

.home-categories {
    width: 100%;
    margin: 20px 0 28px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
}

.home-categories-header {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 18px;
    margin-bottom: 12px;
}

.home-categories-heading { min-width: 0; }

.home-categories-kicker {
    display: block;
    margin-bottom: 3px;
    color: #98a0b2;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 2px;
    line-height: 1;
    text-transform: uppercase;
}

.home-categories-header h3 {
    margin: 0;
    color: #111827;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.home-categories-header .see-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    color: #7c3aed;
    font-size: 13.5px;
    font-weight: 750;
    text-decoration: none;
}

.home-categories-header .see-all span {
    font-size: 20px;
    line-height: 1;
}

/* Horizontal rail */
.home-category-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 10px;
    padding: 4px 18px 10px;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    direction: rtl;
}

.home-category-grid::-webkit-scrollbar { display: none; }

/* Compact cards */
.home-category-grid > .home-category {
    position: relative;
    flex: 0 0 112px;
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    height: 142px;
    min-height: 142px;
    margin: 0;
    padding: 0;
    display: block;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 16px;
    overflow: hidden;
    background: #101827;
    cursor: pointer;
    scroll-snap-align: start;
    outline: none;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.home-category-grid > .home-category.active {
    border: 2px solid #a855f7;
}

/* Category SVG background */
.home-category-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #111827;
}

.home-category-media img { display: none !important; }

.home-category-fallback {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Dedicated SVG for every category */
.home-category[data-category="all"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/all.svg");
}
.home-category[data-category="nature"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/nature.svg");
}
.home-category[data-category="cars"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/cars.svg");
}
.home-category[data-category="anime"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/anime.svg");
}
.home-category[data-category="space"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/space.svg");
}
.home-category[data-category="ai"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/ai.svg");
}
.home-category[data-category="animals"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/animals.svg");
}
.home-category[data-category="city"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/city.svg");
}
.home-category[data-category="amoled"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/amoled.svg");
}
.home-category[data-category="minimal"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/minimal.svg");
}
.home-category[data-category="games"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/games.svg");
}
.home-category[data-category="dark"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/dark.svg");
}
.home-category[data-category="4k"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/4k.svg");
}
.home-category[data-category="sports"] .home-category-fallback {
    background-image: url("assets/category-backgrounds/sports.svg");
}

.home-category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, .02) 0%,
        rgba(0, 0, 0, .08) 42%,
        rgba(0, 0, 0, .64) 72%,
        rgba(0, 0, 0, .92) 100%
    );
}

/* Icon */
.home-category-icon {
    position: absolute;
    left: 50%;
    bottom: 43px;
    transform: translateX(-50%);
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .65));
}

/* Text */
.home-category-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    min-height: 48px;
    padding: 6px 5px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
}

.home-cat-title {
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

.home-cat-count {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, .78);
    font-size: 9px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

.home-categories-state {
    flex: 0 0 auto;
    width: 100%;
    padding: 24px 18px;
    box-sizing: border-box;
    color: #8a92a3;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 480px) {
    .home-categories {
        margin: 16px 0 24px;
    }

    .home-categories-header {
        padding: 0 18px;
        margin-bottom: 10px;
    }

    .home-category-grid {
        gap: 9px;
        padding: 3px 18px 8px;
    }

    .home-category-grid > .home-category {
        flex-basis: 108px;
        width: 108px;
        min-width: 108px;
        max-width: 108px;
        height: 132px;
        min-height: 132px;
        border-radius: 15px;
    }

    .home-category-icon { bottom: 39px; }
    .home-category-bottom {
        min-height: 44px;
        padding-bottom: 7px;
    }
}

@media (min-width: 700px) {
    .home-category-grid > .home-category {
        flex-basis: 118px;
        width: 118px;
        min-width: 118px;
        max-width: 118px;
        height: 148px;
        min-height: 148px;
    }
}


/* Inline SVG category icons — embedded in the card, no icon font or external file needed */
.home-category-icon svg {
    display: block;
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.home-category[data-category="snow"] .home-category-fallback {
    background-image: radial-gradient(circle at 72% 18%, rgba(210,245,255,.65), transparent 22%), linear-gradient(145deg, #102b4b, #2677a6 52%, #d8f5ff);
}
.home-category[data-category="aurora"] .home-category-fallback {
    background-image: radial-gradient(ellipse at 30% 25%, rgba(70,255,197,.75), transparent 38%), radial-gradient(ellipse at 72% 38%, rgba(146,88,255,.72), transparent 40%), linear-gradient(160deg, #071b35, #123e5a 58%, #080e27);
}
.home-category[data-category="cyberpunk"] .home-category-fallback {
    background-image: linear-gradient(160deg, transparent 40%, rgba(255,0,160,.25)), repeating-linear-gradient(90deg, transparent 0 14px, rgba(0,240,255,.10) 14px 16px), linear-gradient(145deg, #100b2d, #4b176d 54%, #071a36);
}
.home-category[data-category="gradients"] .home-category-fallback {
    background-image: radial-gradient(circle at 25% 25%, #ff8a9b, transparent 38%), radial-gradient(circle at 78% 25%, #ffd36b, transparent 34%), radial-gradient(circle at 45% 82%, #6c6bff, transparent 48%), linear-gradient(145deg, #311b68, #102b52);
}


/* Dedicated Categories directory card — first item before All */
.home-category-grid > .home-category-directory{
    border:1px solid rgba(255,255,255,.42);
    background:#29205e;
    box-shadow:0 8px 22px rgba(75,52,145,.2);
    text-decoration:none;
    isolation:isolate;
}
.home-category-directory .directory-card-art{
    position:absolute;
    inset:0;
    z-index:0;
    display:block;
    overflow:hidden;
}
.home-category-directory .directory-card-art svg{
    display:block;
    width:100%;
    height:100%;
}
.home-category-directory .home-category-overlay{
    z-index:1;
    background:linear-gradient(to bottom,rgba(12,12,42,.02) 0%,rgba(12,12,42,.12) 42%,rgba(12,12,42,.72) 75%,rgba(12,12,42,.96) 100%);
}
.home-category-directory .home-category-icon{
    z-index:2;
    bottom:47px;
    width:32px;
    height:32px;
    filter:drop-shadow(0 3px 8px rgba(0,0,0,.35));
}
.home-category-directory .home-category-icon svg{
    width:30px;
    height:30px;
    stroke-width:1.8;
}
.home-category-directory .home-category-bottom{
    z-index:3;
    min-height:50px;
}
.home-category-directory .home-cat-title{
    font-size:13px;
    font-weight:900;
}
.home-category-directory .home-cat-count{
    color:rgba(255,255,255,.82);
    font-size:9px;
    letter-spacing:.6px;
    direction:ltr;
}
.home-category-directory .directory-card-sparkle{
    position:absolute;
    z-index:2;
    top:10px;
    left:12px;
    color:rgba(255,255,255,.85);
    font-size:17px;
    text-shadow:0 0 12px rgba(255,255,255,.7);
}
.home-category-directory:active{
    transform:scale(.97);
}
@media(max-width:480px){
    .home-category-directory .home-category-icon{bottom:39px}
}
