/* ==========================================
   WALLPAPER WAVES 2.0
   CINEMATIC HYBRID — SHARED WALLPAPER GRID
   Homepage / Category / Tag / Resolution
   ========================================== */

.ww2-wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    min-width: 0;
    padding-bottom: 20px;
}

/* CARD SURFACE — CINEMATIC HYBRID */

.ww2-wallpaper-grid .ww2-wallpaper-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;

    border: 1px solid var(--ww2-border-subtle, #28313D);
    border-radius: 15px;
    background: #11151C;

    box-shadow: 0 4px 18px rgba(0, 0, 0, .12);

transition:
    border-color 0.25s ease-in-out,
    box-shadow 0.25s ease-in-out,
    transform 0.15s ease;
}
.ww2-wallpaper-grid .ww2-wallpaper-card:hover {
    transform: translateY(-2px);

    border-color: rgba(7, 139, 250, 0.75);

    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.24),
        0 0 0 1px rgba(7, 139, 250, 0.35),
        0 0 18px rgba(7, 139, 250, 0.12);
}

.ww2-wallpaper-grid .ww2-wallpaper-card:focus-within {
    border-color: var(--ww2-border-active, #078BFA);
}

/* IMAGE */

.ww2-wallpaper-grid .ww2-card-link {
    display: block;
    height: auto;
    flex: 0 0 auto;
    text-decoration: none;
}

.ww2-wallpaper-grid .ww2-card-media,
.ww2-wallpaper-grid .ww2-card-image-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 0;
}


.ww2-wallpaper-grid .ww2-card-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 0;
    border-radius: 0;

    transform: scale(1);
    transform-origin: center center;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    transition: transform 0.3s ease-out;
}

/* Zoom image when hovering ANYWHERE on the card */

.ww2-wallpaper-grid .ww2-wallpaper-card:hover .ww2-card-image {
    transform: scale(1.045);
}


/* TITLE */

.ww2-wallpaper-grid .ww2-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;

    min-height: calc(1.4em * 2);
    max-height: calc(1.4em * 2);

    margin: 0;
    padding: 0;
    overflow: hidden;

color: #F1F4F8;
font-size: 14px;
font-weight: 650;
line-height: 1.4;
}

.ww2-wallpaper-grid .ww2-card-link > .ww2-card-title {
    margin: 10px 12px 8px;
}

/* Support cards with a separate details wrapper */

.ww2-wallpaper-grid .ww2-card-details {
    padding: 10px 12px 12px;
}

.ww2-wallpaper-grid .ww2-card-details .ww2-card-title {
    margin: 0 0 8px;
}

/* BADGE ROW */

.ww2-wallpaper-grid .ww2-card-badges {
    position: static;
    inset: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;

    width: auto;
    max-width: calc(100% - 24px);
    margin: auto 12px 12px;
    padding: 0;
    overflow: visible;
}

.ww2-wallpaper-grid .ww2-card-details .ww2-card-badges {
    max-width: 100%;
    margin: 0;
}

.ww2-wallpaper-grid .ww2-card-badges a {
    position: static;
    inset: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    height: 23px;
    min-height: 23px;
    margin: 0;
    padding: 0 9px;

    border-radius: 6px;
    font-size: 10px;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;

    transform: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    transition:
        color .2s ease,
        background .2s ease,
        border-color .2s ease;
}

/* CATEGORY — PREMIUM NEUTRAL */

.ww2-wallpaper-grid .ww2-card-badges a.ww2-card-category {
    color: #BFCAD8;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(173, 190, 214, .16);
}

/* RESOLUTION — SUBTLE CYAN GLASS */

.ww2-wallpaper-grid .ww2-card-badges a.ww2-card-resolution {
    color: #7CCFFF;
    background: rgba(7, 139, 250, .075);
    border: 1px solid rgba(7, 139, 250, .25);
}

/* INDIVIDUAL BADGE INTERACTIONS */

.ww2-wallpaper-grid .ww2-card-badges a.ww2-card-category:hover,
.ww2-wallpaper-grid .ww2-card-badges a.ww2-card-category:focus-visible {
    color: #fff;
    background: rgba(36, 126, 208, .22);
    border-color: rgba(75, 168, 247, .65);
}

.ww2-wallpaper-grid .ww2-card-badges a.ww2-card-resolution:hover,
.ww2-wallpaper-grid .ww2-card-badges a.ww2-card-resolution:focus-visible {
    color: #fff;
    background: rgba(0, 133, 225, .30);
    border-color: #36b8ff;
}

/* KEYBOARD ACCESSIBILITY */

.ww2-wallpaper-grid .ww2-card-link:focus-visible,
.ww2-wallpaper-grid .ww2-card-badges a:focus-visible {
    outline: 2px solid #35b8ff;
    outline-offset: -2px;
}

/* RESPONSIVE GRID */

@media (max-width: 1100px) {
    .ww2-wallpaper-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .ww2-wallpaper-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .ww2-wallpaper-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ww2-wallpaper-grid .ww2-card-title {
        font-size: 15px;
    }
}

/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
    .ww2-wallpaper-grid .ww2-wallpaper-card,
    .ww2-wallpaper-grid .ww2-card-image,
    .ww2-wallpaper-grid .ww2-card-badges a {
        transition: none;
    }

    .ww2-wallpaper-grid .ww2-wallpaper-card:hover .ww2-card-image {
        transform: none;
    }
}

/* FIREFOX RENDERING STABILITY */

@supports (-moz-appearance: none) {
    .ww2-home-layout .ww2-wallpaper-card {
        isolation: isolate;
        transform: translateZ(0);
    }

    .ww2-home-layout .ww2-card-media {
        position: relative;
        overflow: hidden;
        isolation: isolate;
    }

    .ww2-home-layout .ww2-card-image {
        backface-visibility: hidden;
    }

    .ww2-home-layout .ww2-card-resolution,
    .ww2-home-layout .ww2-card-category {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}


/* WW2 — Admin-only Edit Post hover shortcut */

.ww2-wallpaper-card {
    position: relative;
}

.ww2-card-admin-edit {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 20;

    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 6px;

    background: rgba(8, 13, 22, .92);
    color: #fff;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);

    transition:
        opacity .2s ease,
        visibility .2s ease,
        transform .2s ease,
        background .2s ease,
        color .2s ease;
}

.ww2-wallpaper-card:hover .ww2-card-admin-edit,
.ww2-card-admin-edit:focus-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ww2-card-admin-edit:hover {
    background: #168dff;
    color: #fff;
}

@media (hover: none) {
    .ww2-card-admin-edit {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ww2-card-admin-edit {
        transition: none;
    }
}

