/* =============================================
   KM Bento Grid - Layout
   60/40 top, 50/50 bottom
   ============================================= */

.km-bento {
    display: grid;
    grid-template-columns: 3fr 2fr;
    grid-template-rows: 140px 140px;
    gap: 20px;
    width: 100%;
}

.km-bento__block--main {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

.km-bento__block--top-right {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.km-bento__block--mid-right {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

/* Bottom row: separate 50/50 grid */
.km-bento__bottom {
    display: contents;
}

.km-bento__block--bot-left,
.km-bento__block--bot-right {
    grid-row: 3 / 4;
}

/* Use a wrapper trick: force bottom row to span full width as 50/50.
   Since grid-template-columns is 3fr 2fr, we need to override for row 3.
   Solution: make bot-left start at col 1 and bot-right at col 2,
   then use a 3rd row that's auto and re-lay them with equal sizing. */

/* Actually the cleanest approach: nest bottom row in its own container */
/* But since we can't change HTML structure per-row in grid, we use
   a different approach: make ALL 5 items on a 10-column grid */

.km-bento {
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: minmax(140px, auto) minmax(140px, auto) minmax(140px, auto);
}

.km-bento__block--main {
    grid-column: 1 / 8;
    grid-row: 1 / 3;
}

.km-bento__block--top-right {
    grid-column: 8 / 11;
    grid-row: 1 / 2;
}

.km-bento__block--mid-right {
    grid-column: 8 / 11;
    grid-row: 2 / 3;
}

.km-bento__block--bot-left {
    grid-column: 1 / 6;
    grid-row: 3 / 4;
}

.km-bento__block--bot-right {
    grid-column: 6 / 11;
    grid-row: 3 / 4;
}

/* =============================================
   Block Base
   ============================================= */

.km-bento__block {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none !important;
    color: inherit !important;
    transition: transform 0.25s, box-shadow 0.25s;
    background-size: cover;
    background-position: center;
}

a.km-bento__block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* =============================================
   Block 1 - Main (Hero)
   ============================================= */

.km-bento__block--main {
    align-items: stretch;
}

.km-bento__main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px;
    min-width: 0;
    z-index: 1;
}

/* Tags */
.km-bento__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.km-bento__tag {
    display: inline-block;
    padding: 5px 14px;
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

/* Title H1 — two lines */
.km-bento__title--h1 {
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 10px 0;
}

.km-bento__title-line1 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.km-bento__title-line2 {
    display: block;
    color: #000 !important;
    margin-bottom: 8px;
}

.km-bento__title-icon {
    display: inline-block;
    width: 40px !important;
    height: 40px !important;
    max-width: none !important;
    object-fit: contain;
    vertical-align: middle;
}

/* Desc */
.km-bento__block--main .km-bento__desc {
    font-family: Lato, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0;
    max-width: 250px;
}

/* Main image: diagonal clip, full height */
.km-bento__main-image {
    position: relative;
    flex: 0 0 60%;
    align-self: stretch;
    overflow: hidden;
    transform: skewX(-10deg);
    margin-left: -30px;
    margin-right: -40px;
    padding-right: 40px;
}

.km-bento__main-image img {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    transform: skewX(10deg) scale(1.15);
}

/* =============================================
   Blocks 2-5
   ============================================= */

.km-bento__block-content {
    flex: 1;
    padding: 20px 24px;
    min-width: 0;
    z-index: 1;
}

/* Badge */
.km-bento__badge {
    display: inline-block;
    padding: 4px 12px;
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #BE9E67;
    color: #fff;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Title H2 */
.km-bento__title {
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 8px 0;
    color: inherit;
}

/* Desc */
.km-bento__desc {
    font-family: Lato, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
}

/* Block image: diagonal clip */
.km-bento__block-image {
    flex: 0 0 38%;
    max-width: 38%;
    align-self: stretch;
    position: relative;
    overflow: hidden;
    transform: skewX(-10deg);
    margin-left: -20px;
    margin-right: -40px;
    padding-right: 40px;
}

.km-bento__block-image img {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    transform: skewX(10deg) scale(1.15);
}

/* Bot-left: bigger image */
.km-bento__block--bot-left .km-bento__block-image {
    flex: 0 0 45%;
    max-width: 45%;
}

/* =============================================
   Promo Code (bloc 4)
   ============================================= */

.km-bento__promo-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.km-bento__promo-label {
    font-family: Lato, sans-serif;
    font-size: 14px;
    opacity: 0.7;
}

.km-bento__promo-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px dashed rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.km-bento__promo-code:hover {
    background: rgba(0, 0, 0, 0.1);
}

.km-bento__promo-code-text {
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
}

.km-bento__promo-code-icon {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.km-bento__promo-code:hover .km-bento__promo-code-icon {
    opacity: 0.8;
}

.km-bento__promo-code-copied {
    font-family: Lato, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #2ecc71;
    display: none;
}

.km-bento__promo-code--copied .km-bento__promo-code-copied {
    display: inline;
}

.km-bento__promo-code--copied .km-bento__promo-code-icon {
    display: none;
}

/* =============================================
   Responsive - Small Desktop (1024-1280)
   ============================================= */

@media (max-width: 1280px) {
    .km-bento__block-content {
        padding: 14px 16px;
    }

    .km-bento__title {
        font-size: 16px !important;
    }

    .km-bento__desc {
        font-size: 14px;
    }

    .km-bento__main-content {
        padding: 24px;
    }

    .km-bento__title--h1 {
        font-size: 26px !important;
    }

    .km-bento__block--main .km-bento__desc {
        font-size: 15px;
    }

    .km-bento__block-image {
        flex: 0 0 32%;
        max-width: 32%;
    }

    .km-bento__block--bot-left .km-bento__block-image {
        flex: 0 0 38%;
        max-width: 38%;
    }
}

/* =============================================
   Responsive - Tablet
   ============================================= */

@media (max-width: 1024px) {
    .km-bento {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(200px, auto) minmax(120px, auto) minmax(120px, auto);
        gap: 14px;
    }

    .km-bento__block--main {
        grid-column: 1 / 3;
        grid-row: 1 / 2;
    }

    .km-bento__block--top-right {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }

    .km-bento__block--mid-right {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }

    .km-bento__block--bot-left {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }

    .km-bento__block--bot-right {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
    }

    .km-bento__main-content {
        padding: 20px;
    }

    .km-bento__title--h1 {
        font-size: 22px !important;
    }

    .km-bento__block--main .km-bento__desc {
        font-size: 14px;
    }

    .km-bento__block-content {
        padding: 14px;
    }

    .km-bento__title {
        font-size: 15px !important;
    }

    .km-bento__desc {
        font-size: 13px;
    }
}

/* =============================================
   Responsive - Mobile
   ============================================= */

@media (max-width: 768px) {
    .km-bento {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
    }

    /* Bloc 1 full width */
    .km-bento__block--main {
        grid-column: 1 / 3;
        grid-row: 1 / 2;
        min-height: 200px;
    }

    .km-bento__block--main .km-bento__desc {
        font-size: 14px;
        max-width: 200px;
    }

    /* Hide blocs 2 and 5 */
    .km-bento__block--top-right,
    .km-bento__block--bot-right {
        display: none;
    }

    /* Bloc 4 (promo) and bloc 3: 50/50 */
    .km-bento__block--bot-left {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        min-height: 120px;
    }

    .km-bento__block--mid-right {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        min-height: 120px;
    }

    /* Remove diagonal clip on mobile bottom blocks */
    .km-bento__block--bot-left .km-bento__block-image,
    .km-bento__block--mid-right .km-bento__block-image {
        display: none;
    }

    .km-bento__badge {
        display: none;
    }

    .km-bento__title--h1 {
        font-size: 20px !important;
        margin-bottom: 0;
    }

    .km-bento__title-line2 {
        font-size: 22px !important;
    }

    .km-bento__title-icon {
        display: none !important;
    }

    .km-bento__title {
        font-size: 16px !important;
    }

    .km-bento__main-content {
        padding: 24px;
        padding-right: 8px;
    }

    /* Reduce skew on mobile to avoid clipping issues */
    .km-bento__main-image {
        flex: 0 0 50%;
        transform: skewX(-8deg);
        margin-left: -25px;
        margin-right: -35px;
        padding-right: 35px;
    }

    .km-bento__main-image img {
        transform: skewX(8deg) scale(1.12);
    }

    .km-bento__block-content {
        padding: 16px;
    }

    .km-bento__tag {
        font-size: 10px;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .km-bento__main-image {
        flex: 0 0 45%;
        margin-left: -15px;
    }

    .km-bento__desc {
        font-size: 14px;
    }
}