/* ==================== 1. Layout System ==================== */
.ohio-portfolio-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

.ohio-layout-has-sidebar {
    display: flex;
    flex-wrap: nowrap;
    gap: 40px;
    align-items: flex-start;
}

.ohio-content-area {
    flex: 1;
    min-width: 0;
}

/* ==================== 2. Section Headers (配色更新) ==================== */
.ohio-term-section {
    margin-bottom: 60px;
    scroll-margin-top: 120px;
}

.ohio-section-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.ohio-section-title {
    margin: 0 0 10px 0;
    font-weight: 700;
}

.ohio-section-desc {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* ==================== 3. Sidebar Navigation (配色與定位更新) ==================== */

.ohio-sidebar-nav-wrapper {
    transition: all 0.3s ease;
}

/* 全域移除列表樣式 */
.ohio-nav-list {
    list-style: none !important; 
    margin: 0 !important;
    padding: 0 !important;
}

/* --- 桌機版 (1024px+) --- */
@media (min-width: 1024px) {
    .ohio-sidebar-nav-wrapper {
        position: -webkit-sticky;
        position: sticky;
        top: 100px;
        width: 240px;
        z-index: 99;
        display: block;
    }

    .ohio-sidebar-nav {
        background: #fff;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    }

    .ohio-nav-list { display: block; }
    .ohio-nav-list li { margin-bottom: 10px; }

    .ohio-nav-link {
        display: block;
        padding: 10px 15px;
        color: #555;
        text-decoration: none;
        border-radius: 6px;
        transition: all 0.3s ease;
        font-weight: 500;
        border-left: 3px solid transparent;
    }

    /* Hover: 淺橘底 + 橘字 */
    .ohio-nav-link:hover {
        background-color: #FFF8F0; 
        color: #EF821D;
    }

    /* Active: 淺橘底 + 橘字 + 橘邊 */
    .ohio-nav-link.active {
        background-color: #FFF8F0; 
        color: #EF821D; 
        border-left-color: #EF821D;
        font-weight: 700;
    }
}

/* --- 手機版 (1023px-) --- */
@media (max-width: 1023px) {
    .ohio-layout-has-sidebar {
        display: flex;
        flex-direction: column;
        padding-bottom: 100px; /* 預留底部空間 */
    }

    .ohio-sidebar-nav-wrapper {
        position: fixed !important; 
        bottom: 0 !important;       
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        top: auto !important;
        
        z-index: 999999 !important; /* 強制最上層 */
        
        background: #fff;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        border-top: 1px solid #e5e5e5;
        
        padding-top: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important; 
        display: block !important;
    }

    .ohio-sidebar-nav {
        background: transparent; border: none; padding: 0 15px;
        box-shadow: none; border-radius: 0; width: 100%; overflow: hidden;
    }

    .ohio-nav-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 10px;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 5px;
        align-items: center;
    }
    
    .ohio-nav-list::-webkit-scrollbar { display: none; }
    .ohio-nav-list li { margin: 0; flex-shrink: 0; }

    .ohio-nav-link {
        display: inline-block;
        padding: 8px 16px;
        background: #f2f2f2;
        border-radius: 20px;
        font-size: 14px;
        color: #555;
        border: 1px solid transparent;
        white-space: nowrap;
        text-decoration: none;
        line-height: 1.4;
    }

    /* Active: 實心橘色 */
    .ohio-nav-link.active {
        background-color: #EF821D;
        color: #fff;
        font-weight: normal;
        border-color: #EF821D;
        box-shadow: 0 2px 8px rgba(239, 130, 29, 0.4);
    }
}

/* ==================== 4. Grid & Card (配色更新) ==================== */
.ohio-portfolio-grid { display: grid; gap: 30px; width: 100%; }
.ohio-portfolio-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ohio-portfolio-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ohio-portfolio-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .ohio-portfolio-grid.cols-3,
    .ohio-portfolio-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .ohio-portfolio-grid.cols-2,
    .ohio-portfolio-grid.cols-3,
    .ohio-portfolio-grid.cols-4 { grid-template-columns: 1fr; }
}

/* Card */
.ohio-card {
    background-color: #fff;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid #ddd;
    border-top: 4px solid #000; /* 維持黑色頂線，很搭 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    display: flex; flex-direction: column; height: 100%;
}

.ohio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
    border-color: #ddd;
}

.ohio-card-body {
    padding: 24px;
    display: flex; flex-direction: column; flex: 1;
}

.ohio-cat-badge {
    display: inline-block;
    font-size: 12px;
    color: #000;
    background-color: #ECFEFF; /* 淺藍，保留 */
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 15px;
    align-self: flex-start;
    font-weight: 600;
}

.ohio-card-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 700;
    color: #333;
}

.ohio-card-title a {
    text-decoration: underline !important;
    color: inherit;
    transition: color 0.2s;
}

.ohio-card-title a:hover { color: #EF821D; } /* 橘色 */

.ohio-card-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Buttons */
.ohio-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f5f5f5;
}

.ohio-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 6px; font-size: 0.9rem; font-weight: 500;
    text-decoration: none; cursor: pointer; transition: all 0.3s ease;
    border: none; line-height: 1.2;
}

.ohio-btn svg { width: 16px; height: 16px; }

.ohio-btn-view { background: #f0f0f0; color: #333; }
.ohio-btn-view:hover { background: #e0e0e0; transform: translateY(-1px); color: #333; }

.ohio-btn-link { background: #000; color: #fff; }
.ohio-btn-link:hover { background: #EF821D; transform: translateY(-1px); color: #fff; } /* 橘色 */

/* Modal */
.ohio-modal {
    display: none; position: fixed; z-index: 99999; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6); backdrop-filter: blur(3px); animation: ohioFadeIn 0.3s;
}
.ohio-modal-content {
    background-color: #fefefe; margin: 10px auto; padding: 20px; border-radius: 12px;
    width: 90%; max-width: 800px; max-height: 90vh; overflow-y: auto; position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25); animation: ohioSlideUp 0.3s;
}
.ohio-modal-content h2{font-size: 1.2rem;}
.ohio-modal-content h4, .ohio-modal-content h3{font-size: 1.1rem !important;}
.ohio-modal-content h2.ohio-modal-title{font-size: 2rem !important;}

.ohio-modal-close {
    color: #EF821D; position: sticky; top: 0px; right: 0px;
    font-size: 32px; font-weight: bold; cursor: pointer; transition: color 0.2s;
    line-height: 1; z-index: 10; float: right;
}
.ohio-modal-close:hover { color: #EF821D; } /* 橘色 */

.ohio-modal-title {
    color: #000; margin-top: 0; margin-bottom: 25px; padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0; font-size: 24px;
}
.ohio-modal-body { font-size: 16px; line-height: 1.8; color: #333; }
.ohio-modal-body img { max-width: 100%; height: auto; border-radius: 4px; margin: 15px 0; }
@keyframes ohioFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ohioSlideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.ohio-empty-message { text-align: center; padding: 40px; background: #f9f9f9; border-radius: 8px; color: #666; }
