/**
 * Bento Grid - The NatureCredits Theme
 * 12 Slots Mosaic Layout
 */

/* ==========================================================================
   Bento Section
   ========================================================================== */
.bento-section {
    background-color: #ffffff;
    padding: 32px 0 48px;
    border-bottom: 1px solid #e5e5e5;
}

/* ==========================================================================
   Bento Grid Layout - 4 Column Mosaic
   ========================================================================== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: minmax(200px, auto) minmax(200px, auto) auto auto auto;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Bento Card Base
   ========================================================================== */
.bento-card {
    position: relative;
    background-color: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.bento-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
}

.bento-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.bento-card:hover .bento-card__title {
    color: #0d7377;
}

.bento-card__thumbnail {
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
}

.bento-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bento-card:hover .bento-card__image {
    transform: scale(1.03);
}

.bento-card__content {
    padding: 12px 14px;
}

.bento-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
    margin-bottom: 6px;
    transition: color 0.15s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bento-card__excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: #6b6b6b;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bento-card__date {
    font-size: 12px;
    color: #999999;
}

/* ==========================================================================
   Category Badge
   ========================================================================== */
.bento-card__category {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-block;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    color: #1a1a1a;
    background-color: #ffffff;
    border: 1px solid #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Slot 1 - Large (2x2)
   ========================================================================== */
.bento-card--slot-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.bento-card--slot-1 .bento-card__link {
    height: 100%;
}

.bento-card--slot-1 .bento-card__thumbnail {
    height: 220px;
}

.bento-card--slot-1 .bento-card__content {
    flex: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
}

.bento-card--slot-1 .bento-card__title {
    font-size: 20px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    margin-bottom: 12px;
}

.bento-card--slot-1 .bento-card__excerpt {
    flex: 1;
    font-size: 14px;
    line-height: 1.7;
    -webkit-line-clamp: 6;
    margin-bottom: 12px;
}

.bento-card--slot-1 .bento-card__date {
    font-size: 13px;
    margin-top: auto;
}

/* ==========================================================================
   Slots 2-5 - Small (1x1) - Right Side Top
   ========================================================================== */
.bento-card--slot-2 {
    grid-column: 3;
    grid-row: 1;
}

.bento-card--slot-3 {
    grid-column: 4;
    grid-row: 1;
}

.bento-card--slot-4 {
    grid-column: 3;
    grid-row: 2;
}

.bento-card--slot-5 {
    grid-column: 4;
    grid-row: 2;
}

.bento-card--small .bento-card__thumbnail {
    height: 120px;
}

.bento-card--small .bento-card__title {
    font-size: 14px;
    -webkit-line-clamp: 2;
}

.bento-card--small .bento-card__content {
    padding: 10px 12px;
}

/* ==========================================================================
   Slot 6 - Wide (2x1)
   ========================================================================== */
.bento-card--slot-6 {
    grid-column: 1 / 3;
    grid-row: 3;
}

/* ==========================================================================
   Slots 7-8 - Small (1x1)
   ========================================================================== */
.bento-card--slot-7 {
    grid-column: 3;
    grid-row: 3;
}

.bento-card--slot-8 {
    grid-column: 4;
    grid-row: 3;
}

/* ==========================================================================
   Slots 9-10 - Small (1x1)
   ========================================================================== */
.bento-card--slot-9 {
    grid-column: 1;
    grid-row: 4;
}

.bento-card--slot-10 {
    grid-column: 2;
    grid-row: 4;
}

/* ==========================================================================
   Slot 11 - Wide (2x1)
   ========================================================================== */
.bento-card--slot-11 {
    grid-column: 3 / 5;
    grid-row: 4;
}

/* ==========================================================================
   Slot 12 - Wide (2x1) - Bottom
   ========================================================================== */
.bento-card--slot-12 {
    grid-column: 1 / 3;
    grid-row: 5;
}

/* ==========================================================================
   Wide Card Styles
   ========================================================================== */
.bento-card--wide {
    min-height: 160px;
}

.bento-card--wide .bento-card__link {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    height: 100%;
}

.bento-card--wide .bento-card__thumbnail {
    flex-shrink: 0;
    width: 220px;
    height: auto;
    min-height: 160px;
    border-radius: 6px 0 0 6px;
}

.bento-card--wide .bento-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 20px;
}

.bento-card--wide .bento-card__title {
    font-size: 16px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    margin-bottom: 8px;
}

.bento-card--wide .bento-card__excerpt {
    font-size: 13px;
    line-height: 1.6;
    -webkit-line-clamp: 3;
    margin-bottom: 8px;
}

.bento-card--wide .bento-card__date {
    font-size: 12px;
}

.bento-card--wide .bento-card__category {
    position: absolute;
    top: 10px;
    left: 10px;
}

/* ==========================================================================
   Large Card Specific
   ========================================================================== */
.bento-card--large .bento-card__category {
    top: 12px;
    left: 12px;
}

/* ==========================================================================
   Placeholder
   ========================================================================== */
.bento-card__placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    background-color: #e5e5e5;
}

/* ==========================================================================
   Responsive - Tablet
   ========================================================================== */
@media (max-width: 1023px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 16px;
    }

    /* 大きいカード */
    .bento-card--slot-1 {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    .bento-card--slot-1 .bento-card__thumbnail {
        min-height: 220px;
    }

    .bento-card--slot-1 .bento-card__title {
        font-size: 20px;
    }

    /* 小さいカード2つずつ */
    .bento-card--slot-2,
    .bento-card--slot-3,
    .bento-card--slot-4,
    .bento-card--slot-5,
    .bento-card--slot-7,
    .bento-card--slot-8,
    .bento-card--slot-9,
    .bento-card--slot-10 {
        grid-column: auto;
        grid-row: auto;
    }

    /* 横長カード */
    .bento-card--slot-6,
    .bento-card--slot-11,
    .bento-card--slot-12 {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    .bento-card--wide {
        min-height: 140px;
    }

    .bento-card--wide .bento-card__thumbnail {
        width: 180px;
        min-height: 140px;
    }

    .bento-card--wide .bento-card__excerpt {
        -webkit-line-clamp: 2;
    }

    .bento-card--slot-1 .bento-card__excerpt {
        -webkit-line-clamp: 4;
    }
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */
@media (max-width: 767px) {
    .bento-section {
        padding: 24px 0 32px;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        padding: 0 16px;
        gap: 16px;
    }

    /* 全スロット1カラム */
    .bento-card--slot-1,
    .bento-card--slot-2,
    .bento-card--slot-3,
    .bento-card--slot-4,
    .bento-card--slot-5,
    .bento-card--slot-6,
    .bento-card--slot-7,
    .bento-card--slot-8,
    .bento-card--slot-9,
    .bento-card--slot-10,
    .bento-card--slot-11,
    .bento-card--slot-12 {
        grid-column: 1;
        grid-row: auto;
    }

    .bento-card--slot-1 .bento-card__thumbnail {
        min-height: 180px;
    }

    .bento-card--slot-1 .bento-card__title {
        font-size: 18px;
    }

    .bento-card--slot-1 .bento-card__excerpt {
        -webkit-line-clamp: 2;
    }

    /* 小さいカードをリスト形式に */
    .bento-card--small .bento-card__link {
        flex-direction: row;
        gap: 12px;
    }

    .bento-card--small .bento-card__thumbnail {
        width: 100px;
        height: 70px;
        aspect-ratio: auto;
    }

    .bento-card--small .bento-card__content {
        flex: 1;
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .bento-card--small .bento-card__title {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .bento-card--small .bento-card__category {
        position: static;
        display: inline-block;
        margin-bottom: 4px;
        font-size: 9px;
        padding: 2px 6px;
    }

    /* 横長カードもリスト形式 */
    .bento-card--wide .bento-card__thumbnail {
        width: 100px;
        height: 70px;
    }

    .bento-card--wide .bento-card__title {
        font-size: 14px;
    }

    .bento-card--wide .bento-card__excerpt {
        display: none;
    }

    /* 6件だけ表示 */
    .bento-card--slot-7,
    .bento-card--slot-8,
    .bento-card--slot-9,
    .bento-card--slot-10,
    .bento-card--slot-11,
    .bento-card--slot-12 {
        display: none;
    }
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.bento-grid__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: #6b6b6b;
}
