/*
 * 住火險三頁共用樣式，規則限定於 .fire-ref。
 * 編輯順序：共用／桌機 → 平板（768–1199px）→ 手機（767px 以下）。
 * 常用調整：.fire-copy 內文寬度、--fire-copy-size 字級、各區塊 margin / padding 間距。
 * 配色一律使用 .fire-ref 上的 --fire-* 變數，改色請直接調整該區塊。
 */

/* 共用設定：頁面底色、內文字級、圖片與鍵盤焦點 */
#page-body.fire-ref {
    background: var(--fire-bg-page);
    overflow: visible;
    color: var(--fire-font-color-default);
}

.fire-ref {
    --fire-copy-size: 18px;

    /* 文字色 */
    --fire-font-color-default: #333;
    --fire-font-color-note: #848484;
    --fire-font-color-link: #116977;
    --fire-font-color-invert: #FFF;
    --fire-font-color-highlight: #FFD179;
    --fire-font-color-h2: #ff6600;

    /* 區塊底色 */
    --fire-bg-page: #FFF;
    --fire-bg-hero: #D5F3FB;
    --fire-bg-cta: #DDEAF1;
    --fire-bg-dark: #333;
    --fire-bg-number: #4EC9D2;

    /* 框線與焦點 */
    --fire-border-dark: #333;
    --fire-border-arrow: #454545;
    --fire-color-focus: #006b87;

    /* 主題色：保障方案標籤與相關文章共用
       yellow＝方案①／包租公風險，coral＝方案②／租屋族指南，
       purple＝方案③／屋主保障，green＝方案④ */
    --fire-theme-yellow: #FFD179;
    --fire-theme-coral: #FF7763;
    --fire-theme-purple: #90A4DB;
    --fire-theme-green: #90DBB2;

    font-family: 'Noto Sans CJK TC', sans-serif;
}

.fire-ref *,
.fire-ref *::before,
.fire-ref *::after {
    box-sizing: border-box;
}

.fire-ref img {
    max-width: 100%;
    height: auto;
}

.fire-ref a:focus-visible {
    outline: 3px solid var(--fire-color-focus);
    outline-offset: 5px;
}

/* 主視覺：背景、標題圖與三個主題按鈕 */
.fire-ref .fire-hero {
    background: var(--fire-bg-hero) url(../../img/fire/fire-kv_md.png) center bottom / auto 100% no-repeat;
    height: 799px;
    padding: 83px 24px 0;
    text-align: center;
}

.fire-ref .fire-hero-title {
    width: 1105px;
    display: block;
    margin: 0 auto 77px;
    padding-left: 100px;
}

.fire-ref .fire-topics {
    display: flex;
    justify-content: center;
    gap: 38px;
}

.fire-ref .fire-topics a {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 210px;
}

.fire-ref .fire-topics a > img:first-child {
    width: 100%;
    transform: scale(1);
    transform-origin: center bottom;
}

.fire-ref .fire-topic-arrow {
    position: relative;
    width: 40px;
    margin-top: 9px;
}

.fire-ref .fire-topics a:hover > img:first-child {
    transform: scale(1.1);
    transition-duration: 0.5s;
}

.fire-ref .fire-topics a:hover .fire-topic-arrow {
    animation: fire-topic-down 1.2s infinite ease;
}

@keyframes fire-topic-down {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(20px);
    }
}

.fire-ref .fire-mobile-kv {
    display: none;
}

/* 文章標題：圍籬背景、主題圖示與大標題 */
.fire-ref article {
    background: url(../../img/fire/fire-kv-bottom_md.png) center top / auto 235px no-repeat;
    padding-top: 88px;
}

.fire-ref .fire-title {
    max-width: 1150px;
    padding: 0 20px;
    margin: 0 auto 76px;
    text-align: center;
}

.fire-ref .fire-title > img {
    width: auto;
    height: 161px;
    margin-bottom: 26px;
}

.fire-ref h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

/* 文章內文：容器寬度、段落、列表與章節標題 */
.fire-ref .fire-copy {
    max-width: 900px;
    margin: 0 auto;
    font-size: var(--fire-copy-size);
    line-height: 1.7;
}

.fire-ref p {
    font-size: inherit;
    line-height: inherit;
    margin: 0 0 26px;
}

.fire-ref ul {
    list-style: disc;
    margin: 0 0 30px;
    padding-left: 0;
}

.fire-ref li {
    line-height: inherit;
}

.fire-ref .fire-copy>ul:not(.fire-plans) li {
    list-style: none;
}

.fire-ref .fire-copy>ul:not(.fire-plans) li:before {
    content: '●';
    font-size: 14px;
    line-height: 1;
    margin-right: 8px;
}

.fire-ref h2 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.45;
    margin: 64px 0 20px;
    color: var(--fire-font-color-h2);
}

.fire-ref h3 {
    font-size: inherit;
    font-weight: 700;
    line-height: 1.6;
    margin: 26px 0 6px;
}

.fire-ref .fire-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--fire-bg-number);
    color: var(--fire-font-color-invert);
    width: 1.5em;
    height: 1.5em;
    border-radius: 50%;
    margin-right: 6px;
}

/* 文章照片與圖說 */
.fire-ref figure {
    margin: 56px 0;
}

.fire-ref figure img {
    width: 100%;
    display: block;
}

.fire-ref figcaption,
.fire-ref .img-des {
    margin-top: 12px;
    font-size: 16px;
    line-height: 30px;
    color: var(--fire-font-color-note);
    position: relative;
    padding-left: 24px;
    margin-bottom: 0;
}

.fire-ref figcaption::before,
.fire-ref .img-des::before {
    content: '▲';
    position: absolute;
    top: 0;
    left: 0;
}

/* 內文連結與彩色保障方案標籤 */
.fire-ref .fire-copy a {
    font-size: inherit;
    color: var(--fire-font-color-link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fire-ref .fire-plans {
    list-style: none;
    padding: 0;
}

.fire-ref .fire-plans li {
    display: flex;
    align-items: center;
    margin: 14px 0;
    font-weight: 700;
}

.fire-ref .fire-plans a {
    flex: 0 0 auto;
    display: inline-block;
    border: 4px solid var(--fire-border-dark);
    border-radius: 30px;
    padding: 10px 18px;
    background: var(--fire-theme-yellow);
    text-decoration: none;
    box-shadow: 0px 5px 0px 0px var(--fire-border-dark);

    font-family: 'Noto Sans CJK TC', sans-serif;
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
    color: var(--fire-font-color-default);
    margin-right: 10px;
    transition: transform 0.25s ease;
}

.fire-ref .fire-plans a:hover {
    transform: scale(1.1);
    transition-duration: 0.25s;
    position: relative;
    z-index: 2;
}

.fire-ref span.fire-plans {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 10px;
    padding: 0 2px;
    transition: padding 0.25s ease, gap 0.25s ease;
}

.fire-ref span.fire-plans a {
    margin-right: 0;
}

.fire-ref .fire-plans li:nth-child(2) a,
.fire-ref .fire-plans a:nth-of-type(2) {
    background: var(--fire-theme-coral);
}
.fire-ref .fire-plans li:nth-child(3) a,
.fire-ref .fire-plans a:nth-of-type(3) {
    background: var(--fire-theme-purple);
}
.fire-ref .fire-plans li:nth-child(4) a,
.fire-ref .fire-plans a:nth-of-type(4) {
    background: var(--fire-theme-green);
}

.fire-ref .fire-plans.inline {
    padding: 0 6px;
    gap: 12px;
}
.fire-ref .fire-plans.inline a {
    margin-right: 0;
}

/* 延伸閱讀膠囊按鈕 (自包含樣式，不依賴 travel/car CSS) */
.fire-ref .pill-link {
    margin: 36px 0;
    width: 100%;
}

.fire-ref .pill-link .pill-link__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.fire-ref .pill-link__button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    cursor: pointer;
    width: 100%;
}

.fire-ref .pill-link__button .pill-link__text {
    width: 100%;
    background-color: var(--fire-bg-dark);
    color: var(--fire-font-color-invert);
    padding: 15px 40px 15px 18px;
    border-radius: 999px;
    font-family: 'Noto Sans CJK TC', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 0;
}

/* 填滿層 (跟 travel-pill 一樣的 hover 填滿動畫效果) */
.fire-ref .pill-link__button .pill-link__text::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #ff6666;
    /* hover 填滿顏色 */
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
    z-index: -1;
}

.fire-ref a.pill-link__button:hover .pill-link__text::before {
    transform: scaleX(1);
}

.fire-ref .pill-link__button.pill-arrow .pill-link__icon {
    z-index: 3;
    max-width: 57.5px;
    margin-left: -47.5px;
    margin-bottom: -1.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fire-ref .pill-link__button.pill-arrow .pill-link__icon img {
    width: 100%;
    max-width: 57.5px;
    height: auto;
    display: block;
}

.fire-ref .pill-link__button .pill-link__text span {
    color: var(--fire-font-color-highlight);
}

.fire-ref .pill-link__button .pill-link__text strong {
    color: var(--fire-font-color-highlight);
}

.fire-ref .pill-link__button .pill-link__text .fire-cta-end {
    color: var(--fire-font-color-invert);
}

/* 保費試算卡片：提示文字、膠囊按鈕與箭頭 */
.fire-ref .fire-cta {
    background: var(--fire-bg-cta);
    border-radius: 10px;
    padding: 38px 65px;
    margin: 76px 0 59px;
    text-align: center;
    font-weight: 700;
}

.fire-ref .fire-cta p {
    margin-bottom: 16px;
    font-size: 23px;
}

.fire-ref .fire-cta .pill-link {
    margin: 0;
}

/* 相關文章導覽 (看更多 & 換頁，參考 travel family_onsen 的 another-page 設計) */
.fire-ref .another-page {
    max-width: 900px;
    margin: 50px auto 0;
    padding: 0 24px 35px;
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.fire-ref .another-page > a {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    margin: 0;
    text-decoration: none !important;
}

.fire-ref .another-page > a > img {
    height: 160px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    margin: 0 0 10px;
    display: block;
    transition: transform 0.25s ease;
}

.fire-ref .another-page .pill-link__button {
    width: 275px;
    min-height: auto;
    padding: 0;
    background: transparent;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: none;
    transform: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.fire-ref .another-page .pill-link__button .pill-link__text {
    font-family: 'Noto Sans CJK TC', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.2;
    border-radius: 999px;
    background-color: var(--fire-bg-dark);
    color: var(--fire-font-color-invert);
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    z-index: 0;
}

/* 填滿層 (參考 travel family_onsen 的 another-page hover 動畫效果) */
.fire-ref .another-page .pill-link__button .pill-link__text::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--fire-theme-coral);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
    z-index: -1;
}

.fire-ref .another-page > a:hover .pill-link__button .pill-link__text::before {
    transform: scaleX(1);
}

.fire-ref .another-page .pill-link__button .pill-link__icon {
    position: static;
    transform: none;
    z-index: 2;
    max-width: 53px;
    width: 53px;
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fire-ref .another-page .pill-link__button .pill-link__icon img {
    width: 100%;
    height: auto;
    display: block;
}

.fire-ref .another-page .pill-link__button.pill-prev .pill-link__icon img {
    transform: scaleX(-1);
}

.fire-ref .another-page .pill-link__button.pill-prev .pill-link__text {
    max-width: 275px;
    width: auto;
    padding: 9px 24px 9px 44px;
    margin-left: -40px;
}

.fire-ref .another-page .pill-link__button.pill-next .pill-link__text {
    max-width: 275px;
    width: auto;
    padding: 10px 45px 10px 24px;
    margin-right: -40px;
}

.fire-ref .another-page .pill-link__button.pill-prev .pill-link__icon {
    margin: 0;
}

.fire-ref .another-page .pill-link__button.pill-next .pill-link__icon {
    margin: 0;
}

/* 頁尾房屋裝飾 */
.fire-ref .fire-bottom {
    height: 167px;
    background: url(../../img/fire/fire-bg-bottom_md.png) center bottom / auto 167px repeat-x;
}

/** 間距設定 **/
.mgt-xl {
    margin-top: 69px !important;
}

.mgt-l {
    margin-top: 40px !important;
}

.mgt-md {
    margin-top: 24px !important;
}

.mgt-sm {
    margin-top: 10px !important;
}

.reset-mgt {
    margin-top: 0 !important;
}

.reset-mb {
    margin-bottom: 0 !important;
}


/* 平板覆寫：768–1199px */
@media (min-width: 768px) and (max-width: 1199px) {
    .fire-ref .fire-hero {
        height: 660px;
        padding-top: 70px;
    }

    .fire-ref .fire-hero-title {
        width: 760px;
        margin-bottom: 45px;
        padding-left: 0;
    }

    .fire-ref .fire-topics a {
        width: 175px;
    }

    .fire-ref .fire-copy {
        margin: 0 32px;
    }

    .fire-ref h1 {
        font-size: 40px;
    }

    .fire-ref .another-page {
        margin-left: 32px;
        margin-right: 32px;
    }

}

/* 手機覆寫：767px 以下 */
@media (max-width: 767px) {
    .fire-ref {
        --fire-copy-size: 14px;
    }

    .fire-ref .fire-hero {
        position: relative;
        height: auto;
        padding: 0;
        background: var(--fire-bg-hero);
    }

    .fire-ref .fire-hero-title {
        /* 小屏主視覺已含標題，避免重複顯示。 */
        display: none;
    }

    .fire-ref .fire-topics {
        /* 對齊小屏圖片中標題與房屋之間的留白。 */
        position: absolute;
        top: 26.2%;
        left: 0;
        width: 100%;
        gap: 5%;
        padding: 0 4%;
    }

    .fire-ref .fire-topics a {
        width: 30%;
    }

    .fire-ref .fire-topic-arrow {
        width: 19%;
        margin-top: 4%;
    }

    .fire-ref .fire-mobile-kv {
        display: block;
        width: 100%;
        height: auto;
    }

    .fire-ref article {
        padding-top: 49px;
        background-size: auto 118px;
    }

    .fire-ref .fire-title {
        padding: 0 16px;
        margin-bottom: 40px;
    }

    .fire-ref .fire-title > img {
        height: 81px;
        margin-bottom: 15px;
    }

    .fire-ref h1 {
        font-size: 25px;
        line-height: 1.35;
    }

    .fire-ref .fire-copy {
        margin: 0 16px;
    }

    .fire-ref p {
        margin-bottom: 22px;
    }

    .fire-ref h2 {
        font-size: 22px;
        margin-top: 48px;
    }

    .fire-ref figure {
        margin: 32px 0;
    }

    .fire-ref figcaption,
    .fire-ref .img-des {
        font-size: 14px;
        line-height: 24px;
        padding-left: 20px;
    }

    .fire-ref .fire-plans li {
        align-items: center;
    }

    .fire-ref .fire-plans a {
        font-size: 16px;
        padding: 8px 16px;
        margin-right: 10px;
        border: 3px solid var(--fire-font-color-default);
        box-shadow: 0px 3px 0px 0px var(--fire-font-color-default);
    }

    .fire-ref span.fire-plans {
        gap: 8px;
        padding: 0 2px;
    }

    .fire-ref span.fire-plans:hover {
        padding: 0 10px;
        gap: 12px;
    }

    .fire-ref span.fire-plans a {
        margin-right: 0;
    }

    .fire-ref .pill-link {
        margin: 28px 0;
    }

    .fire-ref .pill-link__button {
        min-height: auto;
        padding: 0;
    }

    .fire-ref .pill-link__button .pill-link__text {
        padding: 8px 60px 8px 16px;
        font-size: 15px;
        line-height: 1.35;
    }

    .fire-ref .pill-link__button.pill-arrow .pill-link__icon {
        max-width: 70px;
        width: 70px;
        margin-left: -58px;
        margin-bottom: 0;
    }

    .fire-ref .pill-link__button.pill-arrow .pill-link__icon img {
        width: 100%;
        max-width: 70px;
    }

    .fire-ref .fire-cta {
        padding: 25px 20px;
        margin-top: 52px;
    }

    .fire-ref .fire-cta p {
        font-size: 17px;
    }

    .fire-ref .fire-cta .pill-link {
        margin: 0;
    }

    .fire-ref .fire-cta-end {
        display: block;
    }

    .fire-ref .another-page {
        margin-top: 30px;
        padding: 8px 16px 8px;
        gap: 16px;
    }

    .fire-ref .another-page > a {
        width: 50%;
        max-width: 165px;
    }

    .fire-ref .another-page > a > img {
        height: 85px;
        max-width: 110px;
        margin-bottom: 6px;
    }

    .fire-ref .another-page .pill-link__button {
        width: 100%;
        min-height: auto;
        padding: 0;
        background: transparent;
    }

    .fire-ref .another-page .pill-link__button .pill-link__icon {
        width: 30px;
        height: 30px;
        max-width: 30px;
    }

    .fire-ref .another-page .pill-link__button .pill-link__icon img {
        width: 100%;
    }

    .fire-ref .another-page .pill-link__button .pill-link__text {
        font-size: 14px;
        line-height: 1.2;
    }

    .fire-ref .another-page .pill-link__button.pill-prev .pill-link__text {
        max-width: 140px;
        padding: 5px 8px 5px 22px;
        margin-left: -20px;
    }

    .fire-ref .another-page .pill-link__button.pill-next .pill-link__text {
        max-width: 140px;
        padding: 5px 22px 5px 8px;
        margin-right: -20px;
    }

    .fire-ref .fire-bottom {
        height: 84px;
        background-image: url(../../img/fire/fire-bg-bottom_sm.png);
        background-size: auto 84px;
    }

    .mgt-xl {
        margin-top: 40px !important;
    }

    .mgt-l {
        margin-top: 30px !important;
    }

    .mgt-md {
        margin-top: 20px !important;
    }

    .mgt-sm {
        margin-top: 10px !important;
    }
}
