/* 工會網站前台樣式 */

body {
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    line-height: 1.6;
}

.navbar-brand {
    font-weight: bold;
}

.jumbotron {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

.news-image {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

.youtube-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 10px 0;
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.photo-item:hover .photo-overlay {
    transform: translateY(0);
}

.form-download-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.form-download-item:hover {
    border-color: #007bff;
}

.pagination {
    justify-content: center;
}

footer {
    margin-top: auto;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem 1rem;
    }
    
    .jumbotron h1 {
        font-size: 2rem;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .photo-item img {
        height: 150px;
    }
}

/* 表單樣式 */
.contact-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* 按鈕樣式 */
.btn {
    border-radius: 25px;
    padding: 8px 20px;
}

.btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
}

/* 載入動畫 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 警告訊息樣式 */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.alert-danger {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
}

.alert-info {
    background: linear-gradient(45deg, #17a2b8, #138496);
    color: white;
}

/* 子選單位置調整 */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
   /* margin-left: .1rem;
    margin-right: .1rem; */
    margin-top: -1px;
}

/* 滑鼠 hover 時展開（桌機） */
@media (min-width: 992px) {
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }
}


/* 避免 hover 模式與點擊模式衝突 */
.dropdown-menu.show {
    display: block;
}

/* 首頁輪播圖 */
.slider-img {
    height: 60vh;
    object-fit: cover;
}

@media (max-width: 768px) {
    .slider-img {
        height: 35vh;
    }
}

/* ===========================
   首頁輪播美化
=========================== */

.custom-carousel img {
    max-height: 480px;
    object-fit: cover;
}

/* 左右箭頭樣式 */
.custom-carousel .carousel-control-prev-icon,
.custom-carousel .carousel-control-next-icon {
    background-color: rgba(173, 216, 230, 0.85); /* 淺藍色 */
    border: 2px solid #ffffff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    background-size: 60% 60%;
}

/* 箭頭 hover */
.custom-carousel .carousel-control-prev-icon:hover,
.custom-carousel .carousel-control-next-icon:hover {
    background-color: rgba(135, 206, 235, 0.95);
}

/* 下方換頁圓點 */
.custom-carousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(173, 216, 230, 0.85);
    border: 2px solid #ffffff;
    margin: 0 6px;
}

/* 當前圓點 */
.custom-carousel .carousel-indicators .active {
    background-color: rgba(135, 206, 235, 1);
}

/* 標題區塊美化 */
.custom-caption {
    background: rgba(0, 0, 0, 0.55);
    padding: 12px 20px;
    border-radius: 8px;
}

/*MENU選單浮動在網頁頂部 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;          /* 一定要高，避免被蓋住 */
    background: #fff;      /* 必須有背景，否則會透 */
}

/* 最新消息內容內的圖片自適應 */
.news-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 避免圖片貼齊邊緣 */
.news-content {
    overflow-wrap: break-word;
}

/* 如果 TinyMCE 有設定寬度，強制覆蓋 */
.news-content img[width],
.news-content img[height] {
    max-width: 100%;
    height: auto;
}

page-content
/* 關於工會與會員內容內的圖片自適應 */
.page-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 避免圖片貼齊邊緣 */
.page-content {
    overflow-wrap: break-word;
}

/* 如果 TinyMCE 有設定寬度，強制覆蓋 */
.page-content img[width],
.page-content img[height] {
    max-width: 100%;
    height: auto;
}