/* ==========================================================================
   Mode6 Custom Styles (整理於 mode6_fycdepaper_web/css/custom.css)
   ========================================================================== */

.medium-3 {
    width: 25%;
    padding: 5px;
    margin: 0px;
    float: left;
}

@media (max-width: 767px) {
    .medium-3 {
        width: 49%;
        float: left;
        padding: 5px;
        margin: 0px;
    }
}

@media (max-width: 467px) {
    .medium-3 {
        width: 100%;
        padding: 5px;
        margin: 0px;
    }
}

/* 基礎重置與字體設定 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'BiauKai', 'Microsoft JhengHei', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    overflow-x: hidden; /* 防止出現水平捲軸 */
}

/* ----- 頂部 Logo 區塊 (縮小上下空白) ----- */
.header-logo-area {
    text-align: center;
    padding: 10px 0;
    width: 100%;
}

.header-logo-area img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.header-logo-area h1 {
    color: #098ad1;
    margin: 0;
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header-logo-area .sub-title {
    color: #098ad1;
    font-size: 16px;
    letter-spacing: 8px;
    margin-top: 8px;
    font-family: Arial, sans-serif;
    font-weight: bold;
}

/* ----- 主導覽列 ----- */
.navbar {
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1040px;
    margin: 0 auto;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar::before,
.navbar::after {
    display: none !important;
    content: none !important;
}

.navbar a {
    color: #666666;
    text-decoration: none;
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 2px;
    white-space: nowrap;
    transition: color 0.2s;
}

.navbar a:hover {
    color: #000000;
}

/* ----- 導覽列下拉選單 (21356 Hover Dropdown Menu) ----- */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown > a,
.nav-dropdown > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #666666;
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 2px;
    white-space: nowrap;
    cursor: default;
    user-select: none;
    transition: color 0.2s;
}

.nav-dropdown > a:hover,
.nav-dropdown > span:hover {
    color: #000000;
}

.nav-dropdown .dropdown-menu-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 8px 0;
    z-index: 1000;
    border: 1px solid #eeeeee;
}

.nav-dropdown:hover .dropdown-menu-list {
    display: flex;
    flex-direction: column;
}

.nav-dropdown .dropdown-menu-list a {
    color: #444444 !important;
    font-size: 18px !important;
    font-weight: bold !important;
    padding: 10px 18px !important;
    text-align: left !important;
    text-decoration: none;
    display: block;
    transition: background 0.2s, color 0.2s;
    letter-spacing: 1px !important;
    white-space: nowrap;
}

.nav-dropdown .dropdown-menu-list a:hover {
    background-color: #f5f5f5;
    color: #000000 !important;
}

/* ----- 主要內容佈局 ----- */
.main-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 10px 0 30px 0;
    gap: 35px;
    box-sizing: border-box;
}

/* 確保主要內容區內部所有元素（圖片、內文、表格、嵌入影片）皆不超出 1040px / navbar 寬度 */
.main-container img,
.main-container iframe,
.main-container video,
.main-container table,
.main-container div,
.main-container section,
.main-container article,
.main-container p {
    max-width: 100% !important;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ----- 左側邊欄 ----- */
.sidebar {
    width: 20% !important;
    max-width: 200px !important;
    min-width: 150px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    position: sticky !important;
    top: 70px !important;
    align-self: flex-start !important;
    margin-top: 0 !important;
    max-height: calc(100vh - 90px) !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    z-index: 90 !important;
    padding: 0 !important; /* 清除 28% 內距 */
}

/* 隱藏 style.css 在側邊欄畫的灰色絕對定位分隔線 */
.sidebar::before {
    display: none !important;
}

/* 隱藏 Chrome/Safari 捲軸 */
.sidebar::-webkit-scrollbar {
    display: none;
}

/* ----- 右側內容區塊 ----- */
.content-area {
    flex: 1;
    min-width: 0;
    max-width: 805px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 25px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.content-area img,
.content-area iframe,
.content-area video,
.content-area table,
.content-area div,
.content-area p {
    max-width: 100% !important;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 1. 搜尋框 */
.search-box {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    border: 2.5px solid #8b1d1d;
    background: #eaeaea;
    padding: 6px 8px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex-grow: 1;
    min-width: 0;
    font-size: clamp(12px, 1.2vw, 15px);
    padding: 6px 4px;
    color: #333;
    font-family: inherit;
}

.search-box button {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.search-box button svg {
    display: block;
    width: 24px;
    height: 24px;
}

/* 2. 音樂網圖片預留區 */
.music-banner {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.music-banner img {
    width: 100%;
    display: block;
    border: none;
}

/* 3. 左側圖片按鈕區塊 */
.desktop-image-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.desktop-image-group a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    transition: filter 0.2s;
}

.desktop-image-group a:hover {
    filter: brightness(0.95);
}

.desktop-image-group a img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
}

/* ----- Sticky Header 預設在電腦版隱藏 ----- */
.sticky-wrapper,
#navMobile {
    display: none;
}

/* ----- 手機版專屬樣式 (768px 以下) ----- */
@media (max-width: 768px) {

    /* 隱藏電腦版頂部 Logo 區與頂部選單 */
    .header-logo-area,
    .navbar {
        display: none !important;
    }

    /* Sticky Wrapper 手機頂部固定欄位 */
    .sticky-wrapper {
        display: block !important;
        position: sticky;
        top: 0;
        left: 0;
        width: 100%;
        height: 80px !important;
        z-index: 1000;
        background-color: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .cento-header {
        width: 100%;
        height: 80px;
        background: #ffffff;
        position: relative;
    }

    .cento-header .nav-wrap {
        height: 100%;
        width: 100%;
    }

    .cento-header .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 80px;
        padding: 0 15px;
        max-width: 100%;
        margin: 0 auto;
        position: relative;
    }

    /* 漢堡選單按鈕 (手機版頂部左側) */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 36px;
        height: 36px;
        cursor: pointer;
        text-decoration: none;
        z-index: 1002;
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
    }

    .hamburger span,
    .hamburger span::before,
    .hamburger span::after {
        display: block;
        width: 22px;
        height: 3px;
        background-color: #333333;
        border-radius: 2px;
        position: relative;
        transition: all 0.3s ease-in-out;
    }

    .hamburger span::before,
    .hamburger span::after {
        content: '';
        position: absolute;
        left: 0;
    }

    .hamburger span::before {
        top: -7px;
    }

    .hamburger span::after {
        top: 7px;
    }

    /* 漢堡開關狀態 - 轉為黑色 X 叉叉 */
    .hamburger.active span {
        background-color: transparent;
    }

    .hamburger.active span::before {
        top: 0;
        transform: rotate(45deg);
        background-color: #000000;
    }

    .hamburger.active span::after {
        top: 0;
        transform: rotate(-45deg);
        background-color: #000000;
    }

    /* Logo 區塊 (手機版絕對居中) */
    .cento-header .logo {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        z-index: 1001;
    }

    .cento-header .wsite-logo {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .cento-header .wsite-logo a {
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    .cento-header .wsite-logo img {
        max-height: 65px;
        width: auto;
        max-width: calc(100vw - 100px);
        display: block;
    }

    /* ----- 手機版展開選單 #navMobile 滑動下拉動畫 ----- */
    #navMobile.nav.mobile-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: #ffffff;
        z-index: 9999;
        overflow-y: auto;
        padding: 15px 20px 40px 20px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;

        /* 向上隱藏並加入平滑下拉過渡動畫 (放慢滑動速度至 0.7s) */
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 2s cubic-bezier(0.25, 1, 0.3, 1), opacity 0.5s ease, visibility 0.7s;
    }

    #navMobile.nav.mobile-nav.active {
        display: flex !important;
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    #navMobile .hamburger {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        align-self: flex-start;
        margin-top: 10px;
        margin-bottom: 20px;
    }

    #navMobile .wsite-menu-default {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    #navMobile .wsite-menu-item-wrap {
        width: 100%;
        border-bottom: none;
    }

    #navMobile .wsite-menu-item {
        display: block;
        padding: 14px 10px;
        color: #666666;
        font-size: 20px;
        font-weight: bold;
        text-align: center;
        text-decoration: none;
        transition: color 0.2s;
    }

    #navMobile .wsite-menu-item:hover,
    #navMobile .wsite-menu-item-wrap#active .wsite-menu-item {
        color: #000000;
        background-color: transparent;
    }

    /* 手機版下拉選單 (箭頭按鈕 + 一行一行列表) */
    #navMobile .mobile-dropdown-toggle {
        position: relative;
        display: block;
        text-align: center;
        cursor: pointer;
    }

    #navMobile .mobile-arrow {
        position: absolute;
        top: 50%;
        margin-left: 8px;
        transform: translateY(-50%);
        font-size: 18px;
        transition: transform 0.3s ease;
    }

    #navMobile .mobile-dropdown-toggle.active .mobile-arrow {
        transform: translateY(-50%) rotate(180deg);
    }

    #navMobile .mobile-sub-list {
        display: none;
        flex-direction: column;
        width: 100%;
        max-width: 280px;
        margin: 8px auto 14px auto;
        background-color: #ffffff;
        border: 1px solid #eeeeee;
        border-radius: 6px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    #navMobile .mobile-sub-item {
        display: block;
        width: 100%;
        padding: 12px 18px;
        font-size: 16px;
        font-weight: bold;
        color: #444444 !important;
        text-decoration: none;
        text-align: center;
        border-bottom: 1px solid #eeeeee;
        box-sizing: border-box;
        transition: background-color 0.2s, color 0.2s;
        letter-spacing: 1px;
    }

    #navMobile .mobile-sub-item:last-child {
        border-bottom: none;
    }

    #navMobile .mobile-sub-item:hover,
    #navMobile .mobile-sub-item:active {
        background-color: #f5f5f5;
        color: #000000 !important;
    }

    /* 手機下拉選單內的 2 欄圖片網格 */
    #navMobile .mobile-btn-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #eeeeee;
        width: 100%;
    }

    #navMobile .mobile-btn-grid>a {
        width: 100%;
        display: block !important;
        box-sizing: border-box;
    }

    #navMobile .mobile-btn-grid>a img {
        width: 100%;
        height: auto;
        object-fit: cover;
        display: block;
        border-radius: 4px;
    }

    /* 手機導覽內嵌選單隱藏 */
    .cento-header .nav.desktop-nav {
        display: none !important;
    }

    /* 手機版主要容器排版調整 */
    .main-container {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
    }

    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        position: static !important;
        height: auto !important;
        overflow-y: visible !important;
    }

    .sidebar .music-banner,
    .sidebar .menu-btn,
    .sidebar .desktop-image-group {
        display: none !important;
    }

    .content-area {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ----- 頁尾 Footer ----- */
.footer {
    background-color: #AA0A15;
    color: #ffffff;
    text-align: center;
    padding: 20px 15px;
    width: 100%;
    margin-top: 0;
    box-sizing: border-box;
}

.footer p {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.6;
}

.footer a {
    color: #ffffff;
    text-decoration: underline;
}

