/* ==========================================================================
   Mr.Bundle 前台樣式
   - 不依賴主題預設，所有樣式都明確設定
   - 圓角透過 --mrb-radius CSS 變數控制（後台「啟用圓角」on/off）
   ========================================================================== */

.mrb-tag-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mrb-tag-list li {
    margin: 0 0 .5em;
}

.mrb-tag-list a {
    text-decoration: none;
}

/* ==========================================================================
   共用：所有版型基礎
   ========================================================================== */

.mrb-tag-list-items {
    --mrb-radius: 8px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2c2c2c;
}
.mrb-tag-list-items.mrb-no-rounded { --mrb-radius: 0; }
.mrb-tag-list-items *,
.mrb-tag-list-items *::before,
.mrb-tag-list-items *::after { box-sizing: border-box; }
.mrb-tag-list-items a { color: #0073aa; }

.mrb-tag-thumb { margin: 0; padding: 0; }
.mrb-tag-thumb img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--mrb-radius);
}

.mrb-tag-title a { text-decoration: none; color: #0073aa; }
.mrb-tag-title a:hover { text-decoration: underline; }

/* 所有摘要：左右兩端對齊 */
.mrb-tag-excerpt {
    text-align: justify;
    text-justify: inter-character;
}

/* 繼續閱讀：小按鈕（桌機/手機統一） */
.mrb-tag-readmore { margin: 0; padding: 0; }
.mrb-tag-readmore a {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #0073aa;
    border-radius: 4px;
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    transition: background .15s, color .15s;
}
.mrb-tag-readmore a:hover {
    background: #0073aa;
    color: #fff;
}

/* ==========================================================================
   版型 v1：目前直式（大圖 / 標題 / 引言 / 店家資訊 / 繼續閱讀）
   ========================================================================== */

.mrb-v1 .mrb-tag-item { margin-bottom: 2.5em; }
.mrb-v1 .mrb-tag-thumb { margin-bottom: 1em; }
.mrb-v1 .mrb-tag-title {
    margin: 0 0 .75em;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}
.mrb-v1 .mrb-tag-excerpt {
    margin: 0 0 1em;
    padding: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #2c2c2c;
}
.mrb-v1 .mrb-tag-readmore {
    margin: 12px 0 0;
    text-align: right;
}

/* ==========================================================================
   版型 v2：A 線條分隔（左圖右文，文章間細線分隔）
   ========================================================================== */

.mrb-v2 .mrb-tag-item {
    display: grid;
    grid-template-columns: 240px 1fr;
    column-gap: 24px;
    row-gap: 0;
    align-items: start;
    padding: 22px 0;
    border-bottom: 1px solid #e2e4e8;
}
.mrb-v2 .mrb-tag-item:first-child { padding-top: 0; }
.mrb-v2 .mrb-tag-item:last-child { border-bottom: none; padding-bottom: 0; }
.mrb-v2 .mrb-tag-thumb { grid-column: 1; grid-row: 1; }
.mrb-v2 .mrb-tag-thumb img {
    height: auto;
}
.mrb-v2 .mrb-tag-body {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mrb-v2 .mrb-tag-title {
    margin: 0 0 .5em;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 0 0 auto;
}
.mrb-v2 .mrb-tag-excerpt {
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #5a6270;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
}
.mrb-v2 .mrb-tag-extra-shortcode { grid-column: 1 / -1; }
.mrb-v2 .mrb-tag-readmore {
    grid-column: 1 / -1;
    margin: 12px 0 0;
    text-align: right;
}

/* ==========================================================================
   版型 v3：B 框框卡片（左圖右文，每篇包進有邊框圓角的卡片）
   ========================================================================== */

.mrb-v3 .mrb-tag-list-items,
.mrb-tag-list-items.mrb-v3 {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.mrb-v3 .mrb-tag-item {
    display: grid;
    grid-template-columns: 240px 1fr;
    column-gap: 24px;
    row-gap: 0;
    align-items: start;
    padding: 18px;
    border: 1px solid #e2e4e8;
    border-radius: var(--mrb-radius);
    background: #fff;
}
.mrb-v3 .mrb-tag-thumb { grid-column: 1; grid-row: 1; }
.mrb-v3 .mrb-tag-thumb img {
    height: auto;
}
.mrb-v3 .mrb-tag-body {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mrb-v3 .mrb-tag-title {
    margin: 0 0 .5em;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 0 0 auto;
}
.mrb-v3 .mrb-tag-excerpt {
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #5a6270;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
}
.mrb-v3 .mrb-tag-extra-shortcode { grid-column: 1 / -1; }
.mrb-v3 .mrb-tag-readmore {
    grid-column: 1 / -1;
    margin: 12px 0 0;
    text-align: right;
}

/* ==========================================================================
   版型 v4：C 網格 2 欄
   ========================================================================== */

.mrb-tag-list-items.mrb-v4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.mrb-v4 .mrb-tag-item {
    border: 1px solid #e2e4e8;
    border-radius: var(--mrb-radius);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.mrb-v4 .mrb-tag-thumb img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0;
}
.mrb-v4 .mrb-tag-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.mrb-v4 .mrb-tag-title {
    margin: 0 0 .5em;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mrb-v4 .mrb-tag-excerpt {
    margin: 0 0 1em;
    padding: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #5a6270;
    min-height: 6.4em;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* 店家資訊容器固定高度（兩行地址 + 一行電話 + padding），讓兩張卡片對齊 */
.mrb-v4 .mrb-tag-extra-shortcode {
    min-height: 96px;
}
/* C 卡片裡的地址限 1 行，超出 ... 處理（避免行數差影響對齊） */
.mrb-v4 .mrb-tag-store-info .mrb-store-text,
.mrb-v4 .mrb-tag-store-info > a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mrb-v4 .mrb-tag-readmore {
    margin: auto 0 0;
    text-align: right;
}

/* ==========================================================================
   店家資訊（地址 / 電話 / 評分）— 精簡融入文章內容
   ========================================================================== */

.mrb-tag-extra-shortcode {
    margin: 1em 0 1.2em;
    padding: 0.9em 0 0;
    border-top: 1px solid #eef0f3;
    color: #5a6270;
    font-size: 14px;
    line-height: 1.7;
}
.mrb-tag-store-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
}
.mrb-tag-store-row .mrb-store-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #c8a97e;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mrb-tag-store-row .mrb-store-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
}
.mrb-tag-store-row .mrb-store-text { flex: 1; min-width: 0; }
.mrb-tag-store-row a {
    color: #0073aa;
    text-decoration: none;
}
.mrb-tag-store-row a:hover { text-decoration: underline; }
.mrb-tag-store-rating {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.mrb-tag-store-rating .mrb-tag-store-num {
    font-weight: 600;
    color: #2c2c2c;
}

/* 星星 — 用 background-clip: text 填色，前後背景永遠對齊 */
.mr-stars {
    display: inline-flex;
    gap: 1px;
    --mrb-star-size: 14px;
}
.mrb-star {
    display: inline-block;
    font-size: var(--mrb-star-size);
    line-height: 1;
    background: linear-gradient(90deg,
        #ffc83d 0,
        #ffc83d var(--mrb-fill, 0%),
        #e6e0d4 var(--mrb-fill, 0%),
        #e6e0d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ==========================================================================
   桌機（≥ 601px）：店家資訊左右二欄、評分大字、繼續閱讀按鈕
   ========================================================================== */

@media (min-width: 601px) {
    .mrb-tag-extra-shortcode {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        column-gap: 24px;
        padding: 1em 0;
        border-bottom: 1px solid #eef0f3;
    }
    .mrb-tag-store-info { grid-column: 1; }
    .mrb-tag-store-rate {
        grid-column: 2;
        grid-row: 1 / span 2;
        padding-left: 24px;
        border-left: 1px solid #eef0f3;
        align-self: stretch;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 110px;
    }
    .mrb-tag-store-rate .mrb-store-icon { display: none; }
    .mrb-tag-store-rate .mrb-tag-store-rating {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
    .mrb-tag-store-rate .mrb-tag-store-num {
        font-size: 2.4em;
        font-weight: 600;
        font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
        letter-spacing: 1px;
        line-height: 1;
        color: #2c2c2c;
    }
    .mrb-tag-store-rate .mr-stars {
        --mrb-star-size: 18px;
        gap: 2px;
    }

}

/* ==========================================================================
   平板 (601 ~ 900px)：A/B 圖片縮成 200×150
   ========================================================================== */

@media (max-width: 900px) and (min-width: 601px) {
    .mrb-v2 .mrb-tag-item,
    .mrb-v3 .mrb-tag-item {
        grid-template-columns: 200px 1fr;
        gap: 18px;
    }
    .mrb-v2 .mrb-tag-excerpt,
    .mrb-v3 .mrb-tag-excerpt { -webkit-line-clamp: 4; }
}

/* ==========================================================================
   手機（≤ 600px）：A/B 轉直式單欄、店家資訊變回 3 行緊湊、繼續閱讀文字連結
   ========================================================================== */

@media (max-width: 600px) {
    /* A/B reset grid，全部變單欄堆疊 */
    .mrb-v2 .mrb-tag-item,
    .mrb-v3 .mrb-tag-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .mrb-v2 .mrb-tag-thumb,
    .mrb-v3 .mrb-tag-thumb,
    .mrb-v2 .mrb-tag-body,
    .mrb-v3 .mrb-tag-body {
        grid-column: 1;
        grid-row: auto;
    }
    .mrb-v2 .mrb-tag-thumb img,
    .mrb-v3 .mrb-tag-thumb img {
        aspect-ratio: 16 / 9;
    }
    .mrb-v2 .mrb-tag-readmore,
    .mrb-v3 .mrb-tag-readmore {
        margin-top: 12px;
    }
    .mrb-v2 .mrb-tag-excerpt,
    .mrb-v3 .mrb-tag-excerpt {
        -webkit-line-clamp: 4;
    }

    /* C 網格手機變單欄 */
    .mrb-tag-list-items.mrb-v4 {
        grid-template-columns: 1fr;
    }

    /* 手機 A/B/C 標題：取消行數截斷、允許換行 */
    .mrb-v2 .mrb-tag-title,
    .mrb-v3 .mrb-tag-title,
    .mrb-v4 .mrb-tag-title {
        white-space: normal;
        -webkit-line-clamp: unset;
        display: block;
        min-height: 0;
    }
}
