/*
===============================================================================
 gallery.css
 特富畫廊｜前台線上作品藝廊樣式
-------------------------------------------------------------------------------
 整理重點：
 1. 依「變數 → 全域 → Header → Hero → 篩選搜尋 → 作品卡片 → Modal → Footer → RWD」分區。
 2. 保留目前 HTML / JS 會用到的 class 名稱，避免前台功能壞掉。
 3. 補上註解，之後維護比較不會像在迷宮找出口。
===============================================================================
*/


/* ==========================================================================
   01. 色彩與共用變數
   ========================================================================== */

:root {
    --bg: #f7f3ee;
    --card: #ffffff;
    --text: #1e1e1e;
    --muted: #777777;
    --line: #e6dfd7;
    --accent: #9a6b3f;
    --accent-dark: #6d4828;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}


/* ==========================================================================
   02. 全域設定
   ========================================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family:
        "Noto Sans TC",
        "Microsoft JhengHei",
        Arial,
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}


/* ==========================================================================
   03. 頁首 Header / Navigation
   ========================================================================== */

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

    background: rgba(247, 243, 238, 0.92);
    border-bottom: 1px solid var(--line);

    backdrop-filter: blur(12px);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 28px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
    text-decoration: none;
}

.logo span {
    transition: color 0.25s ease;
}

.loA {
	color: #25364f; /* 深靛藍：穩重、專業 */
}
.loB {
	color: #b47a38; /* 暖金棕：行動、溫度 */
}
.main-nav {
    display: flex;
    gap: 28px;
    font-size: 15px;
}

.main-nav a {
    color: #333;
}

.main-nav a:hover {
    color: var(--accent);
}


/* ==========================================================================
   04. Hero 首屏區
   ========================================================================== */

.hero {
    max-width: 1280px;
    margin: 0 auto;
    padding: 72px 28px 48px;
}

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

/* 英文小標 */
.eyebrow {
    margin: 0 0 10px;

    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;

    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero p {
    margin-top: 20px;

    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
}


/* ==========================================================================
   05. 作品區塊標題 / 搜尋 / 分類篩選
   ========================================================================== */

.gallery-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 28px 90px;
}

.section-title {
    margin-bottom: 24px;

    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

.section-title h2 {
    margin: 0;
    font-size: 34px;
}

/* 搜尋框 */
.search-box input {
    width: 280px;
    max-width: 100%;
    padding: 13px 16px;

    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;

    font-size: 15px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent);
}

/* =========================
   分類篩選：柔和圓角框線風
   ========================= */

.filter-group {
    margin-bottom: 20px;
}

.filter-title {
    font-size: 14px;
    font-weight: 700;
    color: #252525;
    margin-bottom: 10px;
}

.filter-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 8px 17px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    color: #675f57;
    background: rgba(255, 255, 255, 0.62);
    box-shadow:
        inset 0 0 0 1px rgba(120, 108, 96, 0.18);
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.filter-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
        inset 0 0 0 1px rgba(120, 108, 96, 0.28),
        0 5px 12px rgba(70, 60, 50, 0.07);
}

/* 第一分類 */
.main-filter .filter-btn.active {
    background: #2b2a2f;
    color: #fff;
    font-weight: 700;
    box-shadow:
        0 7px 16px rgba(43, 42, 47, 0.22);
}

/* 第二分類 */
.sub-filter {
    gap: 8px;
}

.sub-filter .filter-btn {
    font-size: 13px;
    padding: 7px 14px;
    color: #506d80;
    background: rgba(247, 252, 255, 0.72);
    box-shadow:
        inset 0 0 0 1px rgba(90, 140, 170, 0.22);
}

.sub-filter .filter-btn:hover {
    background: #f1f9fd;
    color: #345b72;
    box-shadow:
        inset 0 0 0 1px rgba(90, 140, 170, 0.34),
        0 5px 12px rgba(70, 105, 130, 0.07);
}

.sub-filter .filter-btn.active {
    background: #54778d;
    color: #fff;
    font-weight: 700;
    box-shadow:
        0 7px 16px rgba(84, 119, 141, 0.22);
}



/* ==========================================================================
   06. 作品卡片 Grid / Card
   ========================================================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.art-card {
    overflow: hidden;

    background: var(--card);
    border-radius: 22px;
    box-shadow: var(--shadow);

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

.art-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.13);
}

/* 作品圖片：目前設定為橫式比例 */
.art-image {
    aspect-ratio: 5 / 4;
    background: #ddd;
    overflow: hidden;
}

.art-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    display: block;

    transition: transform 0.5s ease;
}

.art-card:hover .art-image img {
    transform: scale(1.06);
}

/* 作品文字 */
.art-body {
    padding: 18px 18px 20px;
}

.art-artist {
    margin: 0 0 6px;

    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}

.art-title {
    margin: 0;

    font-size: 18px;
    line-height: 1.45;
}

.art-meta {
    margin: 12px 0 0;

    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

/* 若未來有價格、編號或補充資訊，可沿用此樣式 */
.art-price {
    margin-top: 12px;

    color: var(--text);
    font-weight: 800;
    text-align: right;
}


/* ==========================================================================
   07. Modal 圖片放大視窗
   ========================================================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: none;
}

.modal.is-open {
    display: block;
}

/* 背景遮罩 */
.modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(20, 16, 12, 0.78);
}

/* Modal 主內容 */
.modal-content {
    position: relative;
    z-index: 2;

    width: min(1100px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    margin: 16px auto;

    overflow: hidden;

    background: #fff;
    border-radius: 26px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);

    display: grid;
    grid-template-rows: minmax(280px, 68vh) auto;
}

/* 關閉按鈕 */
.modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 5;

    width: 44px;
    height: 44px;

    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);

    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

/* 圖片區 */
.modal-image-wrap {
    position: relative;
    min-height: 280px;

    background: #151515;

    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-wrap img {
    max-width: 100%;
    max-height: 68vh;

    object-fit: contain;
    display: block;
}

/* 上一張 / 下一張按鈕 */
.modal-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;

    width: 48px;
    height: 60px;

    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);

    font-size: 46px;
    line-height: 0;
    cursor: pointer;

    transform: translateY(-50%);
}

.modal-prev {
    left: 18px;
}

.modal-next {
    right: 18px;
}

/* Modal 文字資訊 */
.modal-info {
    padding: 26px 34px 32px;
    overflow-y: auto;
}

.modal-artist {
    margin: 0 0 8px;

    color: var(--accent);
    font-weight: 800;
}

.modal-info h3 {
    margin: 0 0 16px;
    font-size: 30px;
}

.modal-description {
    margin: 0;
    color: #555;
    line-height: 1.5;
}

/* 媒材 / 尺寸 / 年份資訊 */
.info-grid {
    margin-top: 24px;
    margin-bottom: 14px;

    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: start;
    gap: 10px;
}

.info-grid div {
    padding: 6px 10px;

    border: 1px solid var(--line);
    border-radius: 999px;
    background: #faf8f5;

    display: flex;
    align-items: center;
    gap: 6px;

    line-height: 1;
}

.info-grid span {
    display: inline;
    margin-bottom: 0;

    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.info-grid strong {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}


/* ==========================================================================
   08. Footer 前台頁尾
   ========================================================================== */

.gallery-footer {
    margin-top: 60px;
    padding: 36px 20px;

    background: #2f2924;
    color: rgba(255, 255, 255, 0.82);
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;

    font-size: 14px;
    line-height: 1.8;
}

.footer-inner a {
    color: #f0d3a2;
    text-decoration: none;
}

.footer-inner a:hover {
    text-decoration: underline;
}

.footer-inner p {
    margin: 0 0 8px;
}


/* ==========================================================================
   09. RWD：平板
   ========================================================================== */

@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ==========================================================================
   10. RWD：手機
   ========================================================================== */

@media (max-width: 768px) {
    .header-inner {
        padding: 16px 20px;
    }

    .main-nav {
        display: none;
    }

    .hero {
        padding: 48px 20px 32px;
    }

    .gallery-section {
        padding: 10px 20px 70px;
    }

    .section-title {
        display: block;
    }

    .search-box {
        margin-top: 18px;
    }

    .search-box input {
        width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .modal-content {
        grid-template-rows: minmax(260px, 55vh) auto;
    }

    .modal-info {
        padding: 22px;
    }

    .modal-info h3 {
        font-size: 24px;
    }

    .modal-arrow {
        width: 40px;
        height: 50px;
        font-size: 38px;
    }
}


/* ==========================================================================
   11. RWD：小手機
   ========================================================================== */

@media (max-width: 520px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: calc(100% - 18px);
        margin: 9px auto;
        border-radius: 18px;
    }
}

/* ==========================================================================
   12. 填寫密碼欄
   ========================================================================== */

/* 外層置中 */
.password-page-wrap {
    min-height: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 15px;
}

/* 密碼卡片 */
.password-box {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    padding: 36px 32px;
    text-align: center;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee7df;
}

/* 鎖頭 icon */
.password-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px auto;
    border-radius: 50%;
    background: #f5efe7;
    color: #8a6b4f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

/* 標題 */
.password-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
    color: #3b342f;
}

/* 說明文字 */
.password-desc {
    margin: 0 0 24px 0;
    font-size: 15px;
    color: #8a8178;
}

/* 輸入框外層 */
.password-input-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

/* 密碼輸入欄置中 */
.password-input {
    width: 100%;
    max-width: 300px;
    height: 44px;
    text-align: center;
    border-radius: 999px;
    border: 1px solid #d8d0c7;
    font-size: 16px;
    letter-spacing: 2px;
    box-shadow: none;
}

/* focus 效果 */
.password-input:focus {
    border-color: #a88462;
    box-shadow: 0 0 0 3px rgba(168, 132, 98, 0.15);
    outline: none;
}

/* 按鈕 */
.password-btn {
    width: 100%;
    max-width: 300px;
    height: 44px;
    border-radius: 999px;
    background: #8a6b4f;
    border: none;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-top: 4px;
    transition: all 0.25s ease;
}

.password-btn:hover {
    background: #70553d;
    color: #ffffff;
    transform: translateY(-1px);
}

/* 錯誤訊息 */
.password-msg {
    display: block;
    margin-top: 16px;
    font-size: 14px;
    color: #c0392b;
}

/* 手機版 */
@media (max-width: 480px) {
    .password-page-wrap {
        min-height: 360px;
        padding: 30px 15px;
    }

    .password-box {
        padding: 30px 22px;
        border-radius: 16px;
    }

    .password-title {
        font-size: 21px;
    }

    .password-desc {
        font-size: 14px;
    }
}

.modal-description a {
    color: #8a6b4f;
    text-decoration: underline;
    word-break: break-all;
}

.modal-description a:hover {
    color: #5f4936;
}