/* Newspaperex 首頁自定義樣式 */

/* 隱藏指定的舊區塊 */
.mg-breadcrumb-section > .overlay,
div.mg-card-box,
div#block-8,
div#nav_menu-2 {
    display: none !important;
}

/* 主要容器樣式 */
.newspaperex-news-sections {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 新聞分類區塊樣式 */
.news-category-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.news-category-section .category-title {
    background: linear-gradient(135deg, #006666, #008080);
    color: #ffffff;
    padding: 12px 20px;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.news-category-section .category-title i {
    margin-right: 10px;
    font-size: 16px;
}

/* 新聞項目樣式 */
.news-item {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 102, 102, 0.15);
    border-color: #008080;
}

.news-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-item:hover .news-image img {
    transform: scale(1.05);
}

.news-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 128, 128, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-item:hover .news-image::after {
    opacity: 1;
}

.news-content {
    padding: 15px;
}

.news-content h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.news-content h5 a {
    color: #006666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-content h5 a:hover {
    color: #008080;
}

.news-excerpt {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 0;
}

/* 右側邊欄樣式 */
.sidebar-content {
    padding-left: 20px;
}

/* 首頁廣告區域 */
.homepage-ads-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.homepage-ads-section .section-title {
    margin-bottom: 15px;
}

.homepage-ads-section .homepage-ad,
.homepage-ads-section .homepage-ad-placeholder {
    margin-top: 0;
}

.homepage-ad-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

.homepage-ad-image:hover {
    transform: scale(1.02);
}

.homepage-ad-placeholder {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px dashed #008080;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.ad-placeholder-content {
    text-align: center;
    color: #008080;
    font-weight: 600;
}

/* 分類按鈕區域 */
.category-buttons-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.section-title {
    background: linear-gradient(135deg, #006666, #008080);
    color: #ffffff;
    padding: 10px 15px;
    margin: -20px -20px 15px -20px;
    border-radius: 8px 8px 0 0;
    font-size: 16px;
    font-weight: bold;
}

.category-buttons {
    margin: 0 -5px;
}

.category-btn {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #006666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    margin: 0 5px;
}

.category-btn:hover {
    background: linear-gradient(135deg, #006666, #008080);
    color: #ffffff;
    border-color: #008080;
    transform: translateY(-2px);
    text-decoration: none;
}

.category-btn i {
    margin-right: 10px;
    font-size: 14px;
    width: 18px;
    text-align: center;
}

/* 分類廣告區域 */
.category-ads-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.category-ads {
    margin: 0 -10px;
}

.category-ad-item {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.category-ad-item:hover {
    border-color: #008080;
    box-shadow: 0 2px 8px rgba(0, 128, 128, 0.1);
}

.category-ad-item a {
    display: flex;
    align-items: center;
    padding: 12px;
    text-decoration: none;
    color: inherit;
}

.ad-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-content {
    flex: 1;
}

.ad-content h6 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #006666;
    line-height: 1.3;
}

.ad-category {
    font-size: 12px;
    color: #666;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
}

.category-ad-item.placeholder {
    background: #f8f9fa;
    border-style: dashed;
}

.category-ad-item.placeholder a {
    display: block;
    padding: 12px;
    text-decoration: none;
    color: inherit;
}

.ad-placeholder {
    text-align: center;
}

.ad-placeholder h6 {
    color: #008080;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
}

.ad-placeholder .ad-category {
    font-size: 12px;
    color: #666;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .sidebar-content {
        padding-left: 0;
        margin-top: 30px;
    }
    
    .news-image {
        height: 150px;
    }
    
    .homepage-ad-image,
    .homepage-ad-placeholder {
        width: 100%;
        max-width: 300px;
        height: 250px;
    }
    
    .news-content h5 {
        font-size: 13px;
    }
    
    .news-excerpt {
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .newspaperex-news-sections,
    .sidebar-content > div {
        padding: 15px;
    }
    
    .news-category-section .category-title {
        font-size: 16px;
        padding: 10px 15px;
        margin: -15px -15px 15px -15px;
    }
    
    .news-image {
        height: 100px;
    }
    
    .news-content {
        padding: 12px;
    }
    
    .category-btn {
        padding: 10px 12px;
    }
    
    .homepage-ad-image,
    .homepage-ad-placeholder {
        height: 200px;
    }
}

/* 增強深綠色主題 */
body.home {
    background-color: #f8f9fa;
}

.home #content {
    background: transparent;
}

/* 滾動條樣式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #008080;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #006666;
}

/* 側邊欄分類按鈕樣式 */
.category-buttons-widget {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.category-buttons-widget .mg-wid-title h6 {
    background: linear-gradient(135deg, #006666, #008080);
    color: #ffffff;
    margin: 0;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: bold;
}

.category-buttons-widget .mg-wid-title h6::before {
    border-left-color: #008080;
    border-color: transparent transparent transparent #008080;
}

.category-buttons-widget .mg-wid-title h6::after {
    background-color: #008080;
}

.category-buttons-content {
    padding: 15px;
}

.sidebar-category-btn {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    color: #006666;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s ease;
    width: 100%;
    margin: 0 2px;
}

.sidebar-category-btn:hover {
    background: linear-gradient(135deg, #006666, #008080);
    color: #ffffff;
    border-color: #008080;
    transform: translateY(-1px);
    text-decoration: none;
}

.sidebar-category-btn i {
    margin-right: 8px;
    font-size: 12px;
    width: 15px;
    text-align: center;
}

/* 響應式設計調整 */
@media (max-width: 768px) {
    .category-buttons-content .row {
        margin: 0 -5px;
    }
    
    .sidebar-category-btn {
        padding: 6px 10px;
        font-size: 12px;
        margin: 0 5px;
    }
}