/* TripXFun 故事頁面樣式 - 補充樣式文件 */

/* 與主題色彩系統保持一致 */
:root {
    --story-primary: #0080FF;
    --story-secondary: #00A8E8;
    --story-accent: #FFD700;
    --story-text: #1a1a1a;
    --story-text-light: #6b7280;
    --story-bg: #ffffff;
    --story-bg-light: #f8fafc;
    --story-shadow: 0 4px 15px rgba(0, 128, 255, 0.1);
    --story-border-radius: 12px;
    --story-transition: all 0.3s ease;
}

/* 確保與TripXFun主題的一致性 */
.story-page-container {
    background: var(--story-bg);
    color: var(--story-text);
}

/* 圖標字體支持 */
.icon-location::before { content: "📍"; }
.icon-user::before { content: "👤"; }
.icon-calendar::before { content: "📅"; }
.icon-book::before { content: "📖"; }
.icon-star::before { content: "⭐"; }
.icon-lightbulb::before { content: "💡"; }

/* 響應式圖片 */
.story-page-container img {
    max-width: 100%;
    height: auto;
    border-radius: var(--story-border-radius);
}

/* 文字排版優化 */
.story-text h2,
.story-text h3,
.story-text h4 {
    color: var(--story-primary);
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

.story-text h2 {
    font-size: 24px;
    border-bottom: 2px solid var(--story-accent);
    padding-bottom: 10px;
}

.story-text h3 {
    font-size: 20px;
}

.story-text h4 {
    font-size: 18px;
}

/* 引用樣式 */
.story-text blockquote {
    background: var(--story-bg-light);
    border-left: 4px solid var(--story-primary);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 var(--story-border-radius) var(--story-border-radius) 0;
    font-style: italic;
    color: var(--story-text-light);
}

/* 列表樣式 */
.story-text ul,
.story-text ol {
    padding-left: 30px;
    margin: 20px 0;
}

.story-text li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* 代碼樣式 */
.story-text code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.story-text pre {
    background: #f1f1f1;
    padding: 15px;
    border-radius: var(--story-border-radius);
    overflow-x: auto;
    margin: 20px 0;
}

/* 表格樣式 */
.story-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: white;
    border-radius: var(--story-border-radius);
    overflow: hidden;
    box-shadow: var(--story-shadow);
}

.story-text th,
.story-text td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.story-text th {
    background: var(--story-primary);
    color: white;
    font-weight: 600;
}

.story-text tr:hover {
    background: var(--story-bg-light);
}

/* 圖片畫廊樣式 */
.wp-block-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.wp-block-image {
    border-radius: var(--story-border-radius);
    overflow: hidden;
    box-shadow: var(--story-shadow);
    transition: var(--story-transition);
}

.wp-block-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 128, 255, 0.15);
}

/* 按鈕樣式 */
.wp-block-button .wp-block-button__link,
.story-text .button {
    background: var(--story-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: var(--story-transition);
    border: 2px solid var(--story-primary);
}

.wp-block-button .wp-block-button__link:hover,
.story-text .button:hover {
    background: transparent;
    color: var(--story-primary);
    transform: translateY(-2px);
}

/* 注意事項樣式 */
.story-text .notice,
.story-text .warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #fdcb6e;
    padding: 15px;
    border-radius: var(--story-border-radius);
    margin: 20px 0;
}

.story-text .notice::before {
    content: "⚠️ ";
    font-weight: bold;
}

/* 成功提示樣式 */
.story-text .success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    padding: 15px;
    border-radius: var(--story-border-radius);
    margin: 20px 0;
}

.story-text .success::before {
    content: "✅ ";
    font-weight: bold;
}

/* 載入動畫 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 128, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--story-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 滾動條樣式 */
.story-page-container *::-webkit-scrollbar {
    width: 8px;
}

.story-page-container *::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.story-page-container *::-webkit-scrollbar-thumb {
    background: var(--story-primary);
    border-radius: 4px;
}

.story-page-container *::-webkit-scrollbar-thumb:hover {
    background: var(--story-secondary);
}

/* 打印樣式 */
@media print {
    .story-hero,
    .content-tabs,
    .related-stories {
        display: none;
    }
    
    .story-content-section {
        padding: 0;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .story-page-container {
        background: white;
        color: black;
    }
}

/* 高對比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --story-primary: #0066cc;
        --story-text: #000000;
        --story-bg: #ffffff;
    }
    
    .story-card,
    .highlight-card {
        border: 2px solid #000;
    }
}

/* 影片容器樣式 */
.story-videos {
    margin: 30px 0;
}

.story-video-container {
    position: relative;
    margin-bottom: 20px;
    border-radius: var(--story-border-radius);
    overflow: hidden;
    box-shadow: var(--story-shadow);
    transition: var(--story-transition);
}

.story-video-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 128, 255, 0.15);
}

.story-video-container iframe,
.story-video-container video {
    border-radius: var(--story-border-radius);
}

.story-video-link {
    margin-bottom: 20px;
    transition: var(--story-transition);
}

.story-video-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--story-shadow);
}

/* 響應式影片 */
@media (max-width: 768px) {
    .story-videos {
        grid-template-columns: 1fr;
    }
    
    .story-video-container {
        margin-bottom: 15px;
    }
}

/* 影片載入狀態 */
.story-video-container iframe[loading="lazy"],
.story-video-container video[preload="metadata"] {
    background: var(--story-bg-light);
}

/* 影片控制項樣式 */
.story-video-container video::-webkit-media-controls {
    border-radius: 0 0 var(--story-border-radius) var(--story-border-radius);
}

/* 減少動畫模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .story-video-container {
        transition: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .story-page-container {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .story-card,
    .highlight-card,
    .tips-list {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .story-excerpt {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .tab-link {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .tab-link:hover,
    .tab-link.active {
        background: var(--story-primary);
    }
}