/* tux.fan Rice archive — image + title card grid
 * Used only on /category/rice/ and /zh/category/zhuti-meihua/
 * Standalone file; enqueued by functions.php. Don't bleed into other archives.
 *
 * Loaded AFTER mynote's style.css so we can override cleanly.
 */

/* === Header === */
.rice-archive-header {
    color: #f1f5f9;
    padding: 60px 0 40px;
    text-align: center;
}
/* Per-category palette. Default (Rice): slate-blue. Others override via data-cat-template. */
.rice-archive-header                          { background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); }
.rice-archive-header[data-cat-template="linux-gaming-zh"]  { background: linear-gradient(180deg, #450a0a 0%, #7f1d1d 100%); }
.rice-archive-header[data-cat-template="linux-gaming"]      { background: linear-gradient(180deg, #450a0a 0%, #7f1d1d 100%); }
.rice-archive-header[data-cat-template="linux-software-zh"] { background: linear-gradient(180deg, #0c4a6e 0%, #075985 100%); }
.rice-archive-header[data-cat-template="linux-software"]    { background: linear-gradient(180deg, #0c4a6e 0%, #075985 100%); }
.rice-archive-header[data-cat-template="linux-faxing-ban"]  { background: linear-gradient(180deg, #064e3b 0%, #065f46 100%); }
.rice-archive-header[data-cat-template="linux-distros"]     { background: linear-gradient(180deg, #064e3b 0%, #065f46 100%); }
.rice-archive-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #fff;
    letter-spacing: -0.02em;
}
.rice-archive-description {
    font-size: 16px;
    line-height: 1.6;
    max-width: 720px;
    margin: 0 auto;
    color: #cbd5e1;
    opacity: 0.9;
}

/* === Grid === */
.rice-archive-main {
    padding: 40px 0 80px;
}
.rice-archive-grid {
    margin: 0 -12px;
}
.rice-card-col {
    padding: 0 12px;
    margin-bottom: 32px;
}

/* === Card === */
.rice-card {
    display: block;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;            /* clip the image inside the rounded card */
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    /* Layout the banner fills the card. Aspect-ratio pinned to banner's natural
     * 1.91:1 (1200×630) so every card on the row has identical image height. */
    aspect-ratio: 1200 / 630;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;         /* small gap before the title below */
}
.rice-card:hover,
.rice-card:focus {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    color: inherit;
    text-decoration: none;
}

.rice-card img {
    /* Fill the entire card. height: 100% makes the banner vertically fill
     * the box. When the banner's natural aspect differs from the card's
     * aspect, width:auto + absolute centering crops the longer dimension. */
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: auto;
    max-width: none;
    transform: translateX(-50%);
    transition: transform 0.4s ease;
}
.rice-card:hover img {
    transform: translateX(-50%) scale(1.04);
}

.rice-card-noimage {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
}

/* Title — now lives OUTSIDE the card as a sibling block. The card itself is
 * just the image; the title sits below the card. */
.rice-card-title {
    padding: 4px 0 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #1e293b;
    text-align: center;

    /* 80% width so long titles ellipsis before running past the card width */
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rice-card-col:hover .rice-card-title {
    color: #0891b2;
}

/* === Pagination === */
.rice-archive-main .pagination {
    margin-top: 48px;
}

/* === Responsive === */
@media (max-width: 575px) {
    .rice-archive-title { font-size: 36px; }
    .rice-card-col { flex: 0 0 100%; max-width: 100%; }
}
@media (min-width: 576px) and (max-width: 767px) {
    /* still 1 col on small tablets — 16:9 image is already wide */
    .rice-card-col { flex: 0 0 100%; max-width: 100%; }
}
@media (min-width: 768px) and (max-width: 991px) {
    .rice-card-col { flex: 0 0 50%; max-width: 50%; }
}
@media (min-width: 992px) {
    /* 4 cols on desktop */
    .rice-card-col { flex: 0 0 25%; max-width: 25%; }
}
