/**
 * Ana sayfa kitap / dergi / makale grid (static kopya — asil kaynak: templates/legacy/partials/home_grid_styles.php)
 * Masaustu (>=768px): kitap 5x5=25, dergi 5x2=10, makale 5
 * Mobil (<=767px): kitap 3x5=15, dergi 3x2=6, makale 2
 */
.content .home-page-section {
    width: 100%;
    clear: both;
    float: none;
}

.home-books-stage {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0 0 28px;
    position: relative;
}

.home-books-side {
    flex: 0 0 clamp(48px, 11vw, 150px);
    min-height: 120px;
    align-self: stretch;
    pointer-events: none;
    background-color: #ebebeb;
    background-image:
        var(--home-logo-url, none),
        linear-gradient(165deg, #f7f7f7 0%, #e8e8e8 38%, #d8d8d8 72%, #ececec 100%);
    background-size: 72% auto, cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.home-books-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--home-logo-url, none);
    background-size: 72% auto;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.28;
}

.home-books-side::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow:
        inset 2px 0 5px rgba(255, 255, 255, 0.85),
        inset -4px 0 10px rgba(0, 0, 0, 0.14),
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        inset 0 -3px 8px rgba(0, 0, 0, 0.1);
}

.home-books-side-left {
    border-radius: 10px 0 0 10px;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.06), inset 3px 0 0 rgba(255, 255, 255, 0.65);
}

.home-books-side-right {
    border-radius: 0 10px 10px 0;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.06), inset -3px 0 0 rgba(0, 0, 0, 0.08);
}

.home-books-stage .home-books-grid {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
    padding: 14px 10px;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 4px 18px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.06);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.home-grid {
    display: grid !important;
    gap: 14px 12px;
    margin: 0 0 24px !important;
    padding: 0;
    width: 100%;
    float: none !important;
    box-sizing: border-box;
}

.home-grid::before,
.home-grid::after {
    display: none !important;
    content: none !important;
}

.home-item-col {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0;
    box-sizing: border-box;
}

.content .row.home-grid {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.content .home-grid > a,
.content .home-grid > .home-item-col,
.content .home-grid > [class*="col-"],
.content .home-grid a > [class*="col-"] {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
    min-width: 0;
    box-sizing: border-box;
}

.content .home-grid > a,
.content .home-grid > .home-item-col {
    display: block;
    color: inherit;
    text-decoration: none;
}

.content .home-grid > a > .thumbnail.cover-w,
.content .home-grid > .home-item-col .thumbnail.cover-w {
    width: 100%;
}

.home-books-grid,
.home-journals-grid,
.home-articles-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (min-width: 992px) {
    .home-books-grid,
    .home-journals-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.home-books-grid .thumbnail.cover-w,
.home-journals-grid .thumbnail.cover-w {
    aspect-ratio: 2 / 3;
    background-size: cover !important;
    background-position: center center !important;
    overflow: hidden;
    margin-bottom: 0 !important;
}

.home-books-grid .caption,
.home-journals-grid .caption {
    font-size: 13px !important;
    line-height: 1.25 !important;
    padding: 5px 4px !important;
    margin-top: 0 !important;
    max-height: 2.6em !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal !important;
    word-break: break-word;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

@media (min-width: 768px) {
    .home-books-grid .home-book-col:nth-child(n + 26) {
        display: none !important;
    }
    .home-journals-grid .home-journal-col:nth-child(n + 11) {
        display: none !important;
    }
    .home-articles-grid .home-article-col:nth-child(n + 6) {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .home-books-side {
        flex: 0 0 14px;
    }
    .home-books-side::before {
        opacity: 0;
    }
    .home-books-stage .home-books-grid {
        padding: 8px 4px;
    }
    .home-books-grid,
    .home-journals-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px 6px;
    }
    .home-articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .home-books-grid .home-book-col:nth-child(n + 16) {
        display: none !important;
    }
    .home-journals-grid .home-journal-col:nth-child(n + 7) {
        display: none !important;
    }
    .home-articles-grid .home-article-col:nth-child(n + 3) {
        display: none !important;
    }
    .home-books-grid .caption,
    .home-journals-grid .caption {
        font-size: 9px !important;
        line-height: 1.15 !important;
        padding: 3px 2px !important;
        max-height: 2.3em !important;
    }
    .home-books-grid .book-likes,
    .home-books-grid .book-hits,
    .home-journals-grid .book-hits {
        right: 3px !important;
        font-size: 8px !important;
        padding: 1px 3px !important;
        border-radius: 4px;
    }
    .home-books-grid .book-likes,
    .home-journals-grid .book-hits {
        top: 3px !important;
    }
    .home-books-grid .book-hits {
        top: 20px !important;
    }
    .home-books-grid .book-likes i,
    .home-books-grid .book-hits i,
    .home-journals-grid .book-hits i {
        font-size: 7px !important;
        padding-left: 2px !important;
    }
    .home-articles-grid .article-title {
        font-size: 11px !important;
        line-height: 1.2 !important;
        padding: 0 3px !important;
    }
    .home-articles-grid .article-content {
        font-size: 9px !important;
        line-height: 1.25 !important;
        padding: 0 3px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
    }
}
