/*
Theme Name: Charity Foundation Child
Theme URI: http://www.nicdarkthemes.com
Description: 這是 Charity Foundation 的子主題，用於自訂網站樣式和功能
Author: Your Name
Author URI: https://yourwebsite.com
Template: charityfoundation
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: charityfoundation-child
*/

/* =================================================
   在這裡添加你的自訂樣式
   ================================================= */

/* 自定義活動列表樣式 */
.custom-event-style {
    background-color: #f9f9f9;
    border-left: 3px solid #007cba;
    padding: 15px;
    transition: all 0.3s ease;
}

.custom-event-style:hover {
    background-color: #f0f0f0;
    transform: translateX(5px);
}

/* 過期活動樣式 */
.event-past {
    opacity: 0.6;
    filter: grayscale(30%);
}

/* 精選活動樣式 */
.tribe-events-calendar-list__event-row--featured {
    background: linear-gradient(to right, #fff8dc, #ffffff);
    border-left: 4px solid #ffd700;
    padding-left: 20px;
}

/* 有分類的活動 */
.has-category {
    border-bottom: 2px solid #eeeeee;
    margin-bottom: 20px;
}

/* 有縮圖的活動 */
.has-thumbnail {
    position: relative;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .custom-event-style {
        padding: 10px;
    }
    
    .tribe-events-calendar-list__event-row--featured {
        padding-left: 15px;
    }
}

/* =================================================
   Events Calendar 標題字體大小
   確保這些樣式能夠正確顯示
   ================================================= */

/* 字體大小 - 20px */
.nd_options_font_size_20 {
    font-size: 20px !important;
    line-height: 1.4 !important;
}

/* 字體大小 - 40px */
.nd_options_font_size_40 {
    font-size: 40px !important;
    line-height: 1.2 !important;
}

/* 字體大小 - 50px */
.nd_options_font_size_50 {
    font-size: 50px !important;
    line-height: 1.2 !important;
}

/* 響應式：手機版調整 */
@media (max-width: 767px) {
    .nd_options_font_size_40_all_iphone {
        font-size: 40px !important;
    }
    
    .nd_options_font_size_50 {
        font-size: 40px !important;
    }
}

/* 確保顏色正確顯示 */
.nd_options_color_white {
    color: #ffffff !important;
}

/* 文字對齊 */
.nd_options_text_align_center {
    text-align: center !important;
}

/* Margin 設定 */
.nd_options_margin_0 {
    margin: 0 !important;
}

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

.nd_options_margin_bottom_0 {
    margin-bottom: 0 !important;
}

/* 行高 */
.nd_options_line_height_normal {
    line-height: normal !important;
}

.nd_options_line_height_40_all_iphone {
    line-height: 40px !important;
}

/* =================================================
   防止 The Events Calendar 跑版 (FOUC)
   確保頁面載入時樣式平順
   ================================================= */

/* 確保 SVG icons 正確顯示 */
.tribe-common .tribe-common-c-svgicon,
.tribe-common svg {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: middle;
}

/* 預設容器樣式 - 防止閃爍 */
.tribe-events-header,
.tribe-events-c-top-bar,
.tribe-events-c-events-bar {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 活動列表項目 - 平滑顯示 */
.tribe-events-calendar-list__event-row {
    opacity: 1;
    transition: none;
}

/* Icon 按鈕預設大小 */
.tribe-events-c-top-bar__datepicker-button-icon,
.tribe-events-c-search__button-icon,
.tribe-events-c-view-selector__button-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 日期選擇器 icons */
.tribe-events-c-top-bar__datepicker-nav-icon-svg {
    width: 16px;
    height: 16px;
}

/* 確保容器有基本高度 */
.tribe-events-header {
    min-height: 50px;
}

.tribe-events-c-top-bar {
    min-height: 60px;
}

/* 視圖切換按鈕 */
.tribe-events-c-view-selector__list-item-link {
    display: inline-flex;
    align-items: center;
}

/* 搜尋按鈕 */
.tribe-events-c-search__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =================================================
   🔥 防止活動頁面 SVG Icons 造成的跑版問題
   ⚠️ 只針對活動頁面，不影響其他正常頁面
   ================================================= */

/* 只針對活動頁面的 SVG 限制 */
body.tribe-events svg,
body.post-type-archive-tribe_events svg {
    max-width: 24px !important;
    max-height: 24px !important;
}

/* The Events Calendar 特定 icons（只在活動頁面） */
body.tribe-events .tribe-common-c-svgicon,
body.post-type-archive-tribe_events .tribe-common-c-svgicon,
body.tribe-events .tribe-common-c-svgicon svg,
body.post-type-archive-tribe_events .tribe-common-c-svgicon svg {
    max-width: 24px !important;
    max-height: 24px !important;
    width: 1em !important;
    height: 1em !important;
}

/* 按鈕內的 icons（只在活動頁面） */
body.tribe-events .tribe-events-c-search__button svg,
body.post-type-archive-tribe_events .tribe-events-c-search__button svg,
body.tribe-events .tribe-events-c-view-selector__button svg,
body.post-type-archive-tribe_events .tribe-events-c-view-selector__button svg,
body.tribe-events .tribe-events-c-top-bar__datepicker-button svg,
body.post-type-archive-tribe_events .tribe-events-c-top-bar__datepicker-button svg {
    max-width: 20px !important;
    max-height: 20px !important;
}

/* 確保按鈕本身不會被撐大（只在活動頁面） */
body.tribe-events .tribe-events-c-search__button,
body.post-type-archive-tribe_events .tribe-events-c-search__button,
body.tribe-events .tribe-events-c-view-selector__button,
body.post-type-archive-tribe_events .tribe-events-c-view-selector__button,
body.tribe-events .tribe-events-c-top-bar__datepicker-button,
body.post-type-archive-tribe_events .tribe-events-c-top-bar__datepicker-button {
    overflow: hidden !important;
}

/* Banner 區域（只在活動頁面） */
body.tribe-events #nd_options_eventscalendar_header_img,
body.post-type-archive-tribe_events #nd_options_eventscalendar_header_img {
    min-height: 390px !important;
}

