/* アーカイブ・検索結果表示用スタイル - 2カラムレイアウト（サイドコラム付き） */

/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}

body {
    line-height: 1;
}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

body {
    font-family: "Helvetica Neue", "Helvetica", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Arial", "Yu Gothic", "Meiryo", sans-serif;
    line-height: 1.6; 
    letter-spacing: 0.05rem;
    color: #333;
}

img {
    vertical-align: bottom;
}

/* ========================================
 * 2カラムレイアウトの基本設定（column_two.phpと同様）
 * ======================================== */

/* コンテンツ全体の設定 */
.content {
    padding-top: 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

/* 行の設定 */
.content .row {
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
}

/* カラムの基本設定 */
.content .col-lg-8,
.content .col-lg-4 {
    padding: 0 15px;
    box-sizing: border-box;
}

/* サイドバーカラムの特別設定 */
.content .col-lg-4 {
    min-width: 300px !important;
    width: 300px !important;
    max-width: 300px !important;
}

/* Bootstrapの設定を強制的に上書き */
.content .col-lg-4 {
    width: 300px !important;
    max-width: 300px !important;
    min-width: 300px !important;
    flex: 0 0 300px !important;
    box-sizing: border-box !important;
}

/* さらに強力なセレクタで上書き */
html body .content .col-lg-4,
html body .content .row .col-lg-4,
.content .row .col-lg-4 {
    width: 300px !important;
    max-width: 300px !important;
    min-width: 300px !important;
    flex: 0 0 300px !important;
    box-sizing: border-box !important;
}

/* 最終手段：すべての要素に強制適用 */
.content .col-lg-4,
.content .row .col-lg-4,
.col-lg-4 {
    width: 300px !important;
    max-width: 300px !important;
    min-width: 300px !important;
    flex: 0 0 300px !important;
    box-sizing: border-box !important;
}

/* 特定のページ用の強制スタイル */
body.page-template-archive .content .col-lg-4,
body.page-template-archive .col-lg-4 {
    width: 300px !important;
    max-width: 300px !important;
    min-width: 300px !important;
    flex: 0 0 300px !important;
    box-sizing: border-box !important;
}

/* 大画面での2カラムレイアウト */
@media (min-width: 992px) {
    .content .col-lg-8 {
        flex: 0 0 calc(100% - 300px) !important;
        max-width: calc(100% - 300px) !important;
        min-width: 600px !important;
    }
    
    .content .col-lg-4 {
        flex: 0 0 300px !important;
        max-width: 300px !important;
        width: 300px !important;
        min-width: 300px !important;
    }
}

/* ========================================
 * メインコンテンツエリア（アーカイブ・検索結果用）
 * ======================================== */

.main_archive {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* アーカイブヘッダー */
.archive-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #337ab7;
}

.archive-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.archive-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
}

/* 検索結果の件数表示 */
.search-results-count {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    margin-bottom: 25px;
    font-size: 1rem;
    color: #495057;
}

/* 記事一覧 - タイル表示 */
.post-list {
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.post-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.post-item h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-item h2 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-item h2 a:hover {
    color: #337ab7;
}

.post-meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 15px;
    order: -1;
}

.post-meta span {
    margin-right: 15px;
}

.post-excerpt {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.post-thumbnail {
    margin-bottom: 20px;
    text-align: center;
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* 記事の詳細情報 */
.post-categories {
    margin-bottom: 15px;
}

.post-categories a {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
    margin-right: 5px;
    display: inline-block;
    margin-bottom: 5px;
}

.post-categories a:hover {
    background: #1976d2;
    color: #fff;
}

/* ページネーション */
.pagination {
    text-align: center;
    margin-top: 40px;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    background: #f8f9fa;
    color: #337ab7;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: #337ab7;
    color: #fff;
}

.pagination .prev,
.pagination .next {
    font-weight: 600;
}

/* 検索フォーム */
.search-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.search-form input[type="search"] {
    width: 70%;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    margin-right: 10px;
}

.search-form input[type="submit"] {
    padding: 12px 25px;
    background: #337ab7;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form input[type="submit"]:hover {
    background: #286090;
}

/* 検索結果なしの場合 */
.no-results {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
}

.no-results h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #495057;
}

.no-results p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ========================================
 * サイドバー（column_two.phpと同様）
 * ======================================== */

.widget-area {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #337ab7;
    position: relative;
    text-align: left;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
    z-index: 10;
    overflow: visible;
}

.widget {
    margin-bottom: 30px;
    text-align: left;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    width: 100% !important;
    max-width: 100% !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    display: block;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #337ab7;
    text-align: left;
    writing-mode: horizontal-tb;
    width: 100% !important;
    max-width: 100% !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    display: block;
}

/* ウィジェット内のすべての要素を幅いっぱいに */
.widget * {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* .side-codeの画像をコラム内に収める */
.side-code img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.side-code {
    max-width: 100%;
}

/* サイドバーの基本設定は上記の.widget-areaに統合済み */

/* ========================================
 * レスポンシブ対応
 * ======================================== */

@media (max-width: 991px) {
    .content .col-lg-8,
    .content .col-lg-4 {
        padding: 0 10px;
    }
    
    .main_archive {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .archive-title {
        font-size: 2rem;
    }
    
    .widget-area {
        padding: 20px;
        position: relative;
        text-align: left;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        overflow: visible;
    }
    
    /* 中画面でもpタグを左寄せに */
    .content p,
    .main_archive p {
        text-align: left;
    }
    
    /* 中画面でも#profile_p imgの横幅を維持 */
    #profile_p img {
        width: 200px;
        max-width: 200px;
    }
    
    /* 中画面でも#ownerの絶対配置を維持 */
    #owner p {
        padding-right: 215px;
    }
    
    /* 中画面では1列表示に変更 */
    .post-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .post-item {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 0 15px;
    }
    
    .content .row {
        flex-direction: column;
        max-width: 100%;
    }
    
    .content .col-lg-8,
    .content .col-lg-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 20px;
    }
    
    .main_archive {
        padding: 15px;
    }
    
    .archive-title {
        font-size: 1.8rem;
    }
    
    .widget-area {
        padding: 15px;
        position: relative;
        text-align: left;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        overflow: visible;
    }
    
    /* モバイルでもpタグを左寄せに */
    .content p,
    .main_archive p {
        text-align: left;
    }
    
    /* モバイルでも#profile_p imgの横幅を維持 */
    #profile_p img {
        width: 200px;
        max-width: 200px;
    }
    
    /* モバイルでも#ownerの絶対配置を維持 */
    #owner p {
        padding-right: 210px;
    }
    
    /* モバイルでは1列表示に変更 */
    .post-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .post-item {
        padding: 15px;
    }
    
    /* モバイルでの記事一覧調整 */
    .post-thumbnail {
        margin-bottom: 15px;
        text-align: center;
    }
    
    .post-thumbnail img {
        width: 100%;
        height: 180px;
        object-fit: cover;
    }
}
