/* Cover gallery for the Sage main page.
   Goes in: public_html/webseries/sage/assets/css/gallery.css
   Separate file so style.css stays untouched. */

.sage-gallery {
    max-width: 1100px;
    margin: 2.5rem auto 1rem;
    padding: 0 16px;
}

.sage-shelf-title {
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-align: center;
    color: #f1ede4;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.sage-shelf {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 18px;
}

.sage-shelf-item {
    min-width: 0;
}

.sage-shelf-item a {
    /* Keep padding and borders inside the grid row's full height. */
    box-sizing: border-box;
    display: block;
    height: 100%;
    padding: 10px 10px 12px;
    text-decoration: none;
    color: #f1ede4;
    background: rgba(24, 30, 42, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sage-shelf-item a:hover,
.sage-shelf-item a:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(24, 30, 42, 0.85);
}

.sage-shelf-item a:focus-visible {
    outline: 2px solid #f1ede4;
    outline-offset: 2px;
}

.sage-shelf-cover {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.sage-shelf-label {
    display: block;
    margin-top: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.8;
}

.sage-shelf-title-text {
    display: block;
    margin-top: 2px;
    font-size: 1.05rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.sage-shelf-item .sage-episode-views {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* Specials get a soft gold edge so readers can spot them */
.sage-shelf-special a {
    border-color: rgba(214, 170, 90, 0.7);
}
.sage-shelf-special .sage-shelf-label {
    color: #e6c27a;
    opacity: 1;
}

@media (max-width: 480px) {
    .sage-shelf {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sage-shelf-item a {
        transition: none;
    }
    .sage-shelf-item a:hover,
    .sage-shelf-item a:focus-visible {
        transform: none;
    }
}
