/*
Theme Name: kureseiki
Description: 呉精器工業株式会社 オリジナルテーマ
Version: 1.0.0
Author: Your Name
*/

/* ==========================================================================
   WordPress Theme Custom Styles (kureseiki)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Breadcrumbs (pan) - 強制上書き
   -------------------------------------------------------------------------- */
.pan {
    display: flex !important;
    flex-wrap: wrap;
    list-style: none !important;
    margin: 0 !important;
    padding-left: 0 !important;
}

.pan li {
    display: flex !important;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

.pan li::before {
    content: "/" !important;
    padding: 0 15px !important;
    color: #fff !important;
    display: inline-block !important;
}

.pan li:first-child::before {
    display: none !important;
}

.pan li a {
    color: #fff !important;
    padding: 0 !important;
    text-decoration: none !important;
}

/* --------------------------------------------------------------------------
   Layout (2 Column)
   -------------------------------------------------------------------------- */
.wp-archive-container,
.wp-single-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 60px; /* メインとサイドバーの間に十分な余白を確保 */
    width: 100%; /* コンテナ自体の幅を100%に */
}

.wp-archive-main,
.wp-single-main {
    width: calc(75% - 60px); /* 75%からgap分を引いて計算 */
    box-sizing: border-box; /* paddingやborderを幅に含める */
}

.sidebar {
    width: 25%;
    text-align: left;
    box-sizing: border-box; /* paddingやborderを幅に含める */
}

@media screen and (max-width: 768px) {
    .wp-archive-container,
    .wp-single-container {
        flex-direction: column; /* 縦並びに変更 */
        gap: 0; /* スマホ時はgapをリセット */
    }

    .wp-archive-main,
    .wp-single-main {
        width: 100% !important; /* スマホ時は全幅100%を強制 */
        order: 1; /* メインコンテンツを上に */
    }
    
    .sidebar {
        width: 100% !important; /* スマホ時は全幅100%を強制 */
        margin-top: 60px;
        order: 2; /* サイドバーを下に */
    }
}

/* --------------------------------------------------------------------------
   Archive Page (index.php)
   -------------------------------------------------------------------------- */
.wp-archive-section .greeting_head {
    text-align: left;
    margin-bottom: 40px;
}

.wp-archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wp-archive-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 30px 0;
}

.wp-archive-item:first-child {
    border-top: 1px solid #e0e0e0;
}

.wp-archive-link {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
    gap: 30px;
}

.wp-archive-link:hover {
    opacity: 0.7;
}

.wp-archive-meta {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 20px;
    width: 240px; /* メタ情報の幅を固定してタイトルを揃える */
}

.wp-archive-date-block {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
}

.wp-archive-year-month {
    font-size: 16px;
    color: #666;
    font-family: 'Inter', sans-serif;
}

.wp-archive-day {
    font-size: 16px;
    color: #666;
    font-family: 'Inter', sans-serif;
}

.wp-archive-cat {
    display: inline-block;
    padding: 4px 16px;
    border: 1px solid #333;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
}

.wp-archive-title {
    font-size: 18px;
    font-weight: normal; /* 太字を解除してスタイリッシュに */
    line-height: 1.6;
    margin: 0;
    color: #333;
    flex-grow: 1;
    text-align: left; /* 確実に左寄せに */
}

@media screen and (max-width: 768px) {
    .wp-archive-link {
        flex-direction: column;
        gap: 15px;
    }
    .wp-archive-meta {
        width: auto;
    }
}

/* Pagination */
.wp-pagination {
    margin-top: 40px;
    text-align: center;
}

.wp-pagination .nav-links {
    display: inline-flex;
    gap: 10px;
}

.wp-pagination .page-numbers {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.wp-pagination .page-numbers.current {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

.wp-pagination .page-numbers:hover:not(.current) {
    background-color: #f5f5f5;
}

/* --------------------------------------------------------------------------
   Single Page (single.php)
   -------------------------------------------------------------------------- */
.wp-single-section .greeting_head {
    display: none;
}

.wp-single-main {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.wp-single-header {
    margin-bottom: 40px;
    padding-bottom: 0;
    border-bottom: none;
    text-align: left;
}

.wp-single-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 15px;
}

.wp-single-date {
    font-size: 16px;
    color: #666;
    font-family: 'Inter', sans-serif;
}

.wp-single-title {
    font-size: 28px;
    font-weight: normal;
    line-height: 1.6;
    margin: 0;
    color: #333;
}

/* Content Area Responsive */
.wp-single-content {
    line-height: 1.8;
    font-size: 16px;
    color: #333;
    text-align: left; /* 記事本文を確実に左寄せに */
}

.wp-single-content p {
    margin-bottom: 1.5em;
}

.wp-single-content img {
    max-width: 100%;
    height: auto;
}

.wp-single-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.wp-single-content iframe {
    max-width: 100%;
}

@media screen and (max-width: 768px) {
    .wp-single-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Post Navigation */
.wp-post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.wp-post-nav a {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s ease;
}

.wp-post-nav a:hover {
    background-color: #f5f5f5;
}

/* --------------------------------------------------------------------------
   Sidebar (sidebar.php)
   -------------------------------------------------------------------------- */
.sidebar {
    width: 25%;
    text-align: left;
}

.sidebar_widget {
    margin-bottom: 50px;
}

.sidebar_title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
    color: #333;
}

.sidebar_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar_list li {
    margin-bottom: 12px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 12px;
}

.sidebar_list li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar_list a {
    text-decoration: none;
    color: #333;
    display: block;
    position: relative;
    padding-left: 20px;
    transition: color 0.3s ease;
    line-height: 1.6;
}

.sidebar_list a::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: #ccc;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.sidebar_list a:hover {
    color: #888;
}

.sidebar_list a:hover::before {
    background-color: #888;
}