/**
 * Yufum 主題自定義樣式
 * Impeccable 優化版 — 移除 gradient-text / glassmorphism / hero-metric 模板
 * @since 1.1.0
 */

/* ===== CSS 變量定義 ===== */
:root {
    --surface-1: #ffffff;
    --surface-2: #f8f8f8;
    --surface-3: #f0f0f0;
    --text-primary: #111111;
    --text-secondary: #444444;
    --text-muted: #767676;
    --accent-orange: #e07b3c;
    --accent-orange-dark: #c46a32;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-bg: #f8f8f8;
}

.dark {
    --surface-1: #0a0a0a;
    --surface-2: #121212;
    --surface-3: #1c1c1c;
    --text-primary: #fafafa;
    --text-secondary: #b0b0b0;
    --text-muted: #909090;
    --accent-orange: #e07b3c;
    --accent-orange-dark: #c46a32;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --card-bg: #141414;
}

/* ===== 基礎樣式 ===== */
* {
    border-color: var(--border-color);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--surface-1);
    color: var(--text-primary);
    font-feature-settings: "rlig" 1, "calt" 1;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface-1); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-orange); }

::selection {
    background: rgba(224, 123, 60, 0.25);
    color: #fff;
}

/* ===== 組件樣式 ===== */

/* 強調色文字 — 替代 gradient-text，使用純色 + 字重 */
.accent-text {
    color: var(--accent-orange);
    font-weight: 600;
}

.accent-heading {
    color: var(--accent-orange);
}

/* 卡片 — 實色背景 + 細邊框，替代 glassmorphism */
.card-base {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
}

.card-featured {
    background: var(--surface-3);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
}

/* 兼容舊引用 */
.glass {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.glass-strong {
    background: var(--surface-3);
    border: 1px solid var(--border-color);
}

/* 橙色輝光 — 僅用於推薦卡片 */
.glow-orange {
    box-shadow: 0 0 0 1px rgba(224, 123, 60, 0.2), 0 8px 32px rgba(224, 123, 60, 0.06);
}

/* 網格背景圖案 */
.grid-pattern {
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.4;
}

/* 區塊內邊距 */
.section-padding {
    padding: 5rem 1.5rem;
}

@media (min-width: 768px) {
    .section-padding { padding: 6rem 3rem; }
}

@media (min-width: 1024px) {
    .section-padding { padding: 7rem 5rem; }
}

/* 容器 */
.container-wide {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .container-wide { padding: 0 3rem; }
}

.container-custom {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .container-custom { padding: 0 3rem; }
}

/* 卡片懸浮 */
.card-luxury {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.3s ease;
}

.card-luxury:hover {
    transform: translateY(-2px);
    border-color: rgba(224, 123, 60, 0.25);
}

/* 主按鈕 — 移除 shine effect */
.btn-primary {
    background: var(--accent-orange);
    color: white;
    font-weight: 600;
    padding: 0.875rem 1.75rem;
    border-radius: 0.75rem;
    transition: background 0.2s ease, transform 0.15s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--accent-orange-dark);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* 描邊按鈕 */
.btn-outline-luxury {
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.875rem 1.75rem;
    border-radius: 0.75rem;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-outline-luxury:hover {
    border-color: var(--accent-orange);
    background: rgba(224, 123, 60, 0.06);
}

.btn-outline-luxury:active {
    transform: scale(0.98);
}

/* 導航鏈接下劃線動畫 — 純色 */
.animated-border {
    position: relative;
}

.animated-border::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-orange);
    transition: width 0.3s ease-out;
}

.animated-border:hover::after {
    width: 100%;
}

/* 統計數字 — 純色，移除 gradient */
.stat-number {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

@media (min-width: 768px) {
    .stat-number { font-size: 2.5rem; }
}

@media (min-width: 1024px) {
    .stat-number { font-size: 3rem; }
}

/* 標籤 — 移除 backdrop-filter */
.tag-luxury {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    background: rgba(224, 123, 60, 0.08);
    color: var(--accent-orange);
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid rgba(224, 123, 60, 0.12);
}

/* 分隔線 — 純色 */
.section-divider {
    width: 100%;
    height: 1px;
    background: var(--border-color);
}

/* 主題切換按鈕 */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-2);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-orange);
}

/* ===== 工具類 ===== */
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.gpu { transform: translateZ(0); will-change: transform; }

/* ===== 動畫 ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.animate-float { animation: float 6s ease-in-out infinite; }

@keyframes pulse-soft {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.animate-pulse-soft { animation: pulse-soft 5s ease-in-out infinite; }

/* 滾動入場 */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 響應式動畫降級 ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 焦點樣式 ===== */
*:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== WordPress 兼容 ===== */
.alignnone { margin: 0; }
.aligncenter { display: block; margin: 0 auto; }
.alignleft { float: left; margin-right: 1.5rem; }
.alignright { float: right; margin-left: 1.5rem; }
.wp-caption { max-width: 100%; }
.wp-caption-text { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.5rem; }
.screen-reader-text {
    border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0;
    position: absolute; width: 1px; word-wrap: normal !important;
}

/* 移動端菜單 */
.mobile-menu { display: none; }
.mobile-menu.active { display: flex; }

/* ===== 排版 ===== */
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ===== 語言切換器 ===== */
.lang-switcher {
    cursor: pointer;
}

.lang-switcher > a {
    cursor: pointer;
    user-select: none;
}

.lang-dropdown {
    z-index: 100;
    animation: langDropdown 0.2s ease-out;
}

@keyframes langDropdown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-dropdown a {
    border-bottom: 1px solid var(--border-color);
}

.lang-dropdown a:last-child {
    border-bottom: none;
}

/* 移動端語言切換器 */
.mobile-menu .lang-switcher {
    width: 100%;
}

.mobile-menu .lang-dropdown {
    position: relative;
    top: auto;
    right: auto;
    margin-top: 0.5rem;
    width: 100%;
}
