/* 共通スタイル */
.business-single-template,
.subsidy-single-template,
.denkicheck-single-case-study {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ヘッダーセクション */
.business-single-header,
.subsidy-single-header,
.case-study-header {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    gap: 2rem;
}

.business-image,
.subsidy-image {
    flex: 0 0 40%;
}

.business-image img,
.subsidy-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.business-header-content,
.subsidy-header-content {
    flex: 1 0 50%;
}

.business-title,
.subsidy-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.business-address,
.subsidy-application-period {
    color: #666;
    margin-bottom: 1rem;
}

/* Case Study Header */
.case-study-header {
    text-align: center;
    margin-bottom: 3rem;
}

.case-study-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #333;
    line-height: 1.2;
}

.case-study-featured-image {
    margin-top: 2rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.case-study-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 企業情報セクション */
.case-study-company-info {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 3rem;
    border-left: 5px solid #17a2b8;
}

.case-study-company-info h2 {
    margin-bottom: 1.5rem;
    color: #17a2b8;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.company-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-label {
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label i {
    color: #17a2b8;
    width: 16px;
}

.info-value {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
}

/* ビジネステンプレート タブ */
.business-tabs-nav {
    border-bottom: 1px solid #ddd;
    margin: 2rem 0;
}

.business-tabs-nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.business-tabs-nav li {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -1px;
    background: #f5f5f5;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
}

.business-tabs-nav li.active {
    background: #fff;
    border-color: #ddd;
    border-bottom-color: #fff;
    font-weight: bold;
}

.business-tabs-content {
    padding: 2rem 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* タブコンテンツ */
.case-study-tabs {
    margin-top: 3rem;
}

.tab-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
}

.tab-nav-item {
    padding: 1rem 2rem;
    cursor: pointer;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-bottom: none;
    margin-right: 5px;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-nav-item:hover {
    background: #e9ecef;
    color: #333;
}

.tab-nav-item.active {
    background: white;
    color: #17a2b8;
    border-color: #17a2b8;
    border-bottom: 2px solid white;
    margin-bottom: -2px;
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 2rem;
    background: white;
    border-radius: 0 8px 8px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #17a2b8;
    font-size: 1.5rem;
}

.tab-content-inner {
    line-height: 1.8;
    color: #555;
}

/* 補助金テンプレート 詳細表 */
.subsidy-details {
    margin-top: 3rem;
}

.subsidy-details h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.subsidy-details-table {
    width: 100%;
    border-collapse: collapse;
}

.subsidy-details-table th,
.subsidy-details-table td {
    padding: 1rem;
    border: 1px solid #ddd;
}

.subsidy-details-table th {
    background-color: #f5f5f5;
    width: 25%;
    text-align: left;
}

/* コンテンツとサイドバーのレイアウト */
.content-sidebar-wrap {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.content-area {
    flex: 1 0 70%;
    flex-grow: 1;
}

.sidebar {
    flex: 0 0 25%;
    border-left: 1px solid #e0e0e0; /* 薄い灰色の境界線を追加 */
}

/* フッターナビゲーション */
.case-study-footer,
.business-footer,
.subsidy-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.case-study-navigation,
.business-navigation,
.subsidy-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.nav-previous,
.nav-next {
    flex: 0 0 48%;
}

.nav-next {
    text-align: right;
}

.nav-previous a,
.nav-next a {
    display: inline-block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.case-study-footer .nav-previous a,
.case-study-footer .nav-next a {
    background: #17a2b8;
}

.case-study-footer .nav-previous a:hover,
.case-study-footer .nav-next a:hover {
    background: #138496;
}

.business-footer .nav-previous a,
.business-footer .nav-next a {
    background: #007cba;
}

.business-footer .nav-previous a:hover,
.business-footer .nav-next a:hover {
    background: #005a87;
}

.subsidy-footer .nav-previous a,
.subsidy-footer .nav-next a {
    background: #28a745;
}

.subsidy-footer .nav-previous a:hover,
.subsidy-footer .nav-next a:hover {
    background: #1e7e34;
}

.back-to-archive {
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    color: white;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .business-single-header,
    .subsidy-single-header {
        flex-direction: column;
    }
    
    .business-image,
    .subsidy-image {
        flex: 0 0 100%;
    }
    
    .business-tabs-nav ul,
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .business-tabs-nav li {
        flex: 0 0 calc(50% - 10px);
        text-align: center;
        margin-bottom: 5px;
    }
    
    .tab-nav-item {
        flex: 0 0 calc(50% - 10px);
        text-align: center;
        margin-bottom: 5px;
        padding: 0.8rem 1rem;
    }
    
    .subsidy-details-table th {
        width: 35%;
    }
    
    .content-sidebar-wrap {
        flex-direction: column;
    }
    
    .content-area,
    .sidebar {
        flex: 0 0 100%;
    }
    
    .sidebar {
        border-left: none; /* モバイル表示では左の境界線を削除 */
        border-top: 1px solid #e0e0e0; /* 代わりに上部に境界線を追加 */
        padding-left: 0;
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
    
    /* Case Study モバイル対応 */
    .case-study-title {
        font-size: 2rem;
    }
    
    .company-info-grid {
        grid-template-columns: 1fr;
    }
    
    .case-study-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-previous,
    .nav-next {
        flex: 0 0 100%;
        text-align: center;
    }
    
    .denkicheck-single-case-study {
        padding: 1rem;
    }
}
