/* =========================
   1. 基本設定
========================= */

:root {
    --navy: #292520;
    --navy-dark: #15120f;
    --orange: #d8bb86;
    --green: #087f46;

    --text: #302b25;
    --muted: #6c6257;
    --border: #e3ddd3;
    --background: #f7f5f1;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--white);

    font-family:
        "Microsoft JhengHei",
        "PingFang TC",
        sans-serif;

    line-height: 1.8;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.4;
}

h2 {
    margin-bottom: 16px;
    font-size: clamp(1.7rem, 3vw, 2.3rem);
}

h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

p {
    margin-bottom: 16px;
}

.container {
    width: min(1120px, calc(100% - 48px));
    margin-inline: auto;
}

a:focus-visible {
    outline: 3px solid #d66b00;
    outline-offset: 5px;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 100;

    padding: 12px 20px;
    color: white;
    background: var(--navy);
}

.skip-link:focus {
    top: 12px;
}


/* =========================
   2. 頁首與導覽
========================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;

    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;

    min-height: 86px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    flex-shrink: 0;
    text-decoration: none;
}

.brand-icon {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    color: var(--orange);
    background: var(--navy);
    border-radius: 12px;

    font-size: 1.4rem;
    font-weight: 700;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text strong {
    font-size: 1.1rem;
}

.brand-text small {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.navigation {
    display: flex;
    gap: 28px;
}

.navigation a {
    padding-block: 10px;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
}

.navigation a:hover {
    text-decoration: underline;
    text-underline-offset: 6px;
}


/* =========================
   3. 首頁主視覺
========================= */

.hero {
    padding: 76px 0;

    /* 文字維持白色 */
    color: var(--white);

    /* 背景：右上角暖色漸層＋炭黑底色 */
    background:
        radial-gradient(
            circle at top right,
            #463b2b 0,
            transparent 55%
        ),
        var(--navy-dark);
}

.hero-layout {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    align-items: center;
    gap: 64px;
}

.eyebrow {
    margin-bottom: 16px;

    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.hero .eyebrow {
    color: var(--orange);
}

.hero h1 {
    margin-bottom: 24px;
    font-size: clamp(2rem, 3.6vw, 3rem);
    letter-spacing: -0.02em;
}

.hero h1 span {
    display: block;
    margin-top: 10px;
    color: var(--orange);
}

.hero-description {
    max-width: 560px;
    margin-bottom: 28px;

    color: #d4e0e8;
    font-size: 1.05rem;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    min-height: 54px;
    padding: 14px 26px;
    border: 1px solid transparent;
    border-radius: 10px;

    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;

    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgb(0 0 0 / 16%);
}

.button-line {
    color: var(--white);
    background: var(--green);
    border-color: #60c38f;
}

.button-orange {
    color: var(--navy-dark);
    background: var(--orange);
}

.hero-phone {
    margin-top: 20px;
    margin-bottom: 12px;
    color: #d4e0e8;
}

.hero-phone a {
    color: var(--white);
    text-underline-offset: 4px;
}

.hero-promise {
    margin-bottom: 0;
    padding-left: 14px;
    border-left: 3px solid var(--orange);

    color: #d4e0e8;
    font-size: 0.9rem;
}


/* =========================
   4. 首頁右側資訊卡
========================= */

.hero-card {
    padding: 32px;

    color: var(--text);
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgb(0 0 0 / 15%);
}

.card-label {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.85rem;
}

.hero-card h2 {
    font-size: 1.5rem;
}

.hero-card > p {
    color: var(--muted);
}

.prepare-list {
    margin: 24px 0;
    padding-left: 24px;
}

.prepare-list li {
    padding-left: 8px;
    margin-bottom: 18px;
}

.prepare-list li::marker {
    color: #925000;
    font-weight: 700;
}

.prepare-list strong,
.prepare-list span {
    display: block;
}

.prepare-list span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.9rem;
}

.text-link {
    color: var(--navy);
    font-size: 0.9rem;
    font-weight: 700;
    text-underline-offset: 5px;
}


/* =========================
   5. 共用區塊樣式
========================= */

.section {
    padding: 80px 0;
}

.section-tinted {
    background: var(--background);
}

.section-heading {
    max-width: 660px;
    margin-bottom: 36px;
}

.section-heading .eyebrow {
    color: #875000;
    margin-bottom: 10px;
}

.section-heading > p:last-child {
    color: var(--muted);
    margin-bottom: 0;
}


/* =========================
   6. 維修項目
========================= */

.service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.service-card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
}

.service-number {
    display: inline-block;
    margin-bottom: 22px;

    color: #8b5000;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.service-card h3 {
    color: var(--navy);
}

.service-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.95rem;
}


/* =========================
   7. 收費說明
========================= */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.price-card {
    padding: 36px;

    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--white);
}

.price-label {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.price {
    margin: 16px 0;
    color: var(--navy);
}

.price strong {
    font-size: 3rem;
    line-height: 1.2;
}

.price-card > p:last-child {
    margin-bottom: 0;
}

.price-card-night {
    color: var(--white);
    background: var(--navy);
    border-color: var(--navy);
}

.price-card-night .price-label {
    color: #d4e0e8;
}

.night-price {
    margin: 22px 0;
    color: var(--orange);

    font-size: 1.6rem;
    font-weight: 700;
}

.pricing-note {
    margin: 24px 0 0;
    text-align: center;
    font-weight: 700;
}


/* =========================
   8. 地區與流程
========================= */

.area-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 64px;
}

.area-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.area-tags span {
    padding: 8px 20px;
    border-radius: 8px;

    color: var(--navy);
    background: #edf2f5;
    font-weight: 700;
}

.area-description {
    color: var(--muted);
}

.process-panel {
    padding: 32px;
    border-left: 4px solid var(--orange);
    background: var(--background);
    border-radius: 0 14px 14px 0;
}

.process-list {
    margin-bottom: 0;
    padding-left: 24px;
}

.process-list li {
    padding-left: 6px;
    margin-bottom: 14px;
}

.process-list li:last-child {
    margin-bottom: 0;
}


/* =========================
   9. 底部聯絡區
========================= */

/* 聯絡區背景 */
.contact-section {
    padding: 72px 0;
    color: var(--white);
    background: var(--navy-dark);
}

/* 左右兩欄，垂直對齊中心 */
.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
}

/* 左欄內的文字置中 */
.contact-info {
    min-width: 0;
    text-align: center;
}

.contact-info .eyebrow {
    color: var(--orange);
}

.contact-description,
.contact-area {
    color: #e0d8cd;
}

/* 兩個按鈕在左欄內置中 */
.contact-info .contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.contact-number {
    margin: 22px 0 0;
    font-size: 1.3rem;
}

.contact-number a {
    color: var(--orange);
    text-underline-offset: 4px;
}

/* 右欄名片 */
.business-card-link {
    display: block;
    width: 100%;
    max-width: 480px;
    min-width: 0;
    margin-inline: auto;
    text-decoration: none;
}

.business-card-image {
    display: block;
    width: 100%;
    height: auto;

    border: 1px solid rgb(216 187 134 / 35%);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgb(0 0 0 / 25%);
}

.business-card-hint {
    display: block;
    margin-top: 12px;

    color: var(--orange);
    font-size: 0.85rem;
    text-align: center;
}

/* =========================
   10. 頁尾
========================= */

.site-footer {
    padding: 24px 0;
    background: var(--background);
    color: var(--muted);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.footer-inner p {
    margin: 0;
    font-size: 0.85rem;
}


/* 電腦版先隱藏底部聯絡列 */
.mobile-contact {
    display: none;
}


/* =========================
   11. 平板排版
========================= */

@media (max-width: 960px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .hero {
        padding: 56px 0;
    }

    .hero-card {
        max-width: 680px;
    }

    .service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .area-layout {
        gap: 32px;
    }

    .navigation {
        gap: 16px;
    }
}


/* =========================
   12. 手機排版
========================= */

@media (max-width: 640px) {
    html {
        scroll-padding-top: 135px;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    body {
        /* 避免底部內容被固定聯絡列遮住 */
        padding-bottom: calc(
            80px + env(safe-area-inset-bottom, 0px)
        );
    }

    .container {
        width: calc(100% - 36px);
    }

    .header-inner {
        min-height: auto;
        padding: 12px 0;

        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .brand-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .brand-text strong {
        font-size: 1rem;
    }

    .brand-text small {
        font-size: 0.7rem;
    }

    .navigation {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .navigation a {
        padding: 4px 0;
        font-size: 0.8rem;
    }

    .hero {
        padding: 36px 0;
    }

    .hero h1 {
        font-size: 1.85rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .hero .eyebrow {
        font-size: 0.75rem;
    }

    .contact-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .button {
        padding: 12px 8px;
        font-size: 0.92rem;
    }

    .hero-card {
        padding: 24px;
    }

    .section {
        padding: 52px 0;
    }

    .section-heading {
        margin-bottom: 28px;
    }

    .service-grid,
    .pricing-grid,
    .area-layout {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 24px;
    }

    .service-number {
        margin-bottom: 12px;
    }

    .price-card {
        padding: 28px;
    }

    .process-panel {
        padding: 24px;
    }

    .contact-section {
        padding: 48px 0;
    }

    .footer-inner {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    /* 手機固定聯絡列 */
    .mobile-contact {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 50;

        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;

        padding: 10px 16px;
        padding-bottom: calc(
            10px + env(safe-area-inset-bottom, 0px)
        );

        background: var(--white);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 20px rgb(0 0 0 / 8%);
    }

    .mobile-contact a {
        display: flex;
        align-items: center;
        justify-content: center;

        min-height: 48px;
        border-radius: 8px;

        text-decoration: none;
        font-weight: 700;
        font-size: 0.95rem;
    }

    .mobile-line {
        color: var(--white);
        background: var(--green);
    }

    .mobile-phone {
        color: var(--navy-dark);
        background: var(--orange);
    }
}


/* 減少動畫的使用者設定 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .button {
        transition: none;
    }

    .button:hover {
        transform: none;
    }
}

/* ===== 照片預覽卡片 ===== */

.photo-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

/* 圖片與遮罩不會占用排版空間 */
.card-photo,
.card-shade {
    position: absolute;
    pointer-events: none;
    opacity: 0;

    transition: opacity 0.25s ease;
}

.card-photo {
    /* 向外延伸，避免模糊後邊緣露白 */
    inset: -8px;
    width: calc(100% + 16px);
    height: calc(100% + 16px);
    max-width: none;

    object-fit: cover;
    filter: blur(2px);
    z-index: -2;
}

.card-shade {
    inset: 0;
    background: rgb(12 34 51 / 82%);
    z-index: -1;
}

/* 不設定 position，讓按鈕的透明點擊範圍對齊整張卡片 */
.card-content {
    color: var(--text);
}

.photo-card .service-number,
.photo-card h3,
.photo-card p,
.photo-open {
    transition: color 0.25s ease;
}

/* 看照片按鈕 */
.photo-open {
    margin-top: 20px;
    padding: 0;
    border: 0;

    color: var(--navy);
    background: transparent;

    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;

    text-decoration: underline;
    text-underline-offset: 5px;
    cursor: pointer;
}

/* 將按鈕可點擊範圍延伸到整張卡片 */
.photo-open::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* 鍵盤選到按鈕時，也提供預覽 */
.photo-card:focus-within {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgb(21 50 72 / 14%);
}

.photo-card:focus-within .card-photo,
.photo-card:focus-within .card-shade {
    opacity: 1;
}

.photo-card:focus-within h3,
.photo-card:focus-within p {
    color: white;
}

.photo-card:focus-within .service-number,
.photo-card:focus-within .photo-open {
    color: var(--orange);
}

.photo-open:focus-visible {
    outline: none;
}

.photo-open:focus-visible::after {
    outline: 3px solid var(--orange);
    outline-offset: -5px;
    border-radius: 14px;
}

/* 只有支援滑鼠懸停的裝置才套用 hover */
@media (hover: hover) and (pointer: fine) {
    .photo-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 24px rgb(21 50 72 / 14%);
    }

    .photo-card:hover .card-photo,
    .photo-card:hover .card-shade {
        opacity: 1;
    }

    .photo-card:hover h3,
    .photo-card:hover p {
        color: white;
    }

    .photo-card:hover .service-number,
    .photo-card:hover .photo-open {
        color: var(--orange);
    }
}


/* ===== 點開後的大圖視窗 ===== */

#photo-dialog {
    width: min(860px, calc(100% - 32px));
    max-height: 90vh;
    max-height: 90dvh;
    margin: auto;
    padding: 0;
    overflow-y: auto;

    border: none;
    border-radius: 16px;

    color: var(--text);
    background: white;
    box-shadow: 0 24px 80px rgb(0 0 0 / 30%);
}

/* 視窗後方的整個網頁變暗 */
#photo-dialog::backdrop {
    background: rgb(0 0 0 / 65%);
}

.photo-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;

    /* 捲動時，標題與關閉按鈕留在視窗頂端 */
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.photo-dialog-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.photo-dialog-header form {
    margin: 0;
    flex-shrink: 0;
}

.photo-close {
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;

    color: var(--navy);
    background: var(--background);

    font: inherit;
    cursor: pointer;
}

.photo-close:focus-visible {
    outline: 3px solid #d66b00;
    outline-offset: 3px;
}

/* 相簿：照片上下排列 */
.photo-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 0 20px;
    min-width: 0;
}

/* 控制每張照片的尺寸 */
.photo-gallery img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 60vh;

    margin-inline: auto;
    object-fit: contain;
    border-radius: 8px;
}

.photo-caption {
    margin: 0;
    padding: 20px;
    color: var(--muted);
    font-size: 0.9rem;
}

/* 開啟視窗時，暫停底層頁面捲動 */
html.photo-modal-open {
    overflow: hidden;
}

/* 尊重減少動畫設定 */
@media (prefers-reduced-motion: reduce) {
    .photo-card,
    .card-photo,
    .card-shade,
    .photo-card .service-number,
    .photo-card h3,
    .photo-card p,
    .photo-open {
        transition: none;
    }

    .photo-card:hover,
    .photo-card:focus-within {
        transform: none;
    }
}