@charset "UTF-8";

/* =========================================
   Sidebar Global Styles (全ページ共通)
   ========================================= */

/* 1. サイドバー全体の背景を白にして一体化 */
.sidebar-main {
    background-color: #ffffff !important;
    padding: 30px !important;
    border-radius: 8px;
    height: auto !important;
    color: #0E4C5E !important; /* ★文字色を紺色に統一 */
}

/* リンク色も紺色に統一 */
.sidebar-main a {
    color: #0E4C5E !important;
    text-decoration: none !important;
    transition: 0.3s;
}
.sidebar-main a:hover {
    color: #F39C12 !important; /* ホバー時はアクセントカラー */
}

/* 2. ウィジェット共通リセット */
.sidebar-main .widget {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 0 40px 0 !important;
    margin-bottom: 0 !important;
}

/* 3. 見出しのデザイン */
.sidebar-main .widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0E4C5E !important;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 10px;
    margin-bottom: 20px;
    position: relative;
    display: block;
}
.sidebar-main .widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #0E4C5E;
}

/* 4. 検索窓のデザイン */
.sidebar-main .search-form {
    display: flex;
    gap: 5px;
    position: relative;
}
.sidebar-main .search-field {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    flex-grow: 1;
    background: #f9f9f9;
    color: #0E4C5E; /* 入力文字も紺 */
}
.sidebar-main .search-submit {
    background-color: #0E4C5E;
    color: #fff !important; /* ボタン文字は白 */
    border: none;
    border-radius: 4px;
    padding: 0 15px;
    transition: 0.3s;
    cursor: pointer;
}
.sidebar-main .search-submit:hover {
    background-color: #F39C12;
}
.sidebar-main .search-submit .ast-icon {
    fill: #fff;
}

/* 5. リストのデザイン（カテゴリー・アーカイブなど） */
.sidebar-main .widget_categories ul li,
.sidebar-main .widget_archive ul li,
.sidebar-main .widget_pages ul li,
.sidebar-main .widget_meta ul li {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #0E4C5E !important;
}

.sidebar-main .widget_categories ul li a,
.sidebar-main .widget_archive ul li a,
.sidebar-main .widget_pages ul li a,
.sidebar-main .widget_meta ul li a {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.sidebar-main .widget_categories ul li a:hover,
.sidebar-main .widget_archive ul li a:hover,
.sidebar-main .widget_pages ul li a:hover,
.sidebar-main .widget_meta ul li a:hover {
    transform: translateX(5px);
}

/* 矢印アイコン */
.sidebar-main .widget_categories ul li a::before,
.sidebar-main .widget_archive ul li a::before,
.sidebar-main .widget_pages ul li a::before,
.sidebar-main .widget_meta ul li a::before {
    content: '\f105'; /* FontAwesome右矢印 */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.8rem;
    color: #ccc; /* 矢印は薄いグレーのままが綺麗ですが、紺にするなら #0E4C5E に変更可 */
    transition: 0.3s;
}
.sidebar-main .widget_categories ul li a:hover::before,
.sidebar-main .widget_archive ul li a:hover::before,
.sidebar-main .widget_pages ul li a:hover::before,
.sidebar-main .widget_meta ul li a:hover::before {
    color: #F39C12;
}


/* 6. 最近の投稿（強制グリッドレイアウト） */

/* リストアイテム全体をグリッド化 */
.sidebar-main .ast-featured-post,
.sidebar-main .wp-block-latest-posts li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eaeaea;
    width: 100% !important;
    
    /* ★グリッドシステムを採用 */
    display: grid !important;
    grid-template-columns: 80px 1fr !important; /* [左:画像80px] [右:残り全部] */
    grid-template-rows: auto auto !important;   /* [上:タイトル] [下:日付] */
    column-gap: 15px !important; /* 画像と文字の間隔 */
    align-items: center !important; /* 垂直方向中央揃え */
}

.sidebar-main .ast-featured-post:last-child,
.sidebar-main .wp-block-latest-posts li:last-child {
    border-bottom: none;
}

/* --- 画像エリア --- */
/* 画像は「左列」の「上から下まで」を占有させる */
.sidebar-main .ast-featured-post .ast-featured-post-thumb,
.sidebar-main .wp-block-latest-posts__featured-image {
    grid-column: 1 / 2 !important; /* 1列目 */
    grid-row: 1 / -1 !important;   /* 上から最後までぶち抜き */
    
    margin: 0 !important;
    width: 80px !important;
    display: block !important;
}

.sidebar-main .ast-featured-post .ast-featured-post-thumb img,
.sidebar-main .wp-block-latest-posts__featured-image img {
    width: 80px !important;
    height: 60px !important;
    border-radius: 4px;
    object-fit: cover !important;
    display: block;
}

/* --- タイトルと日付の配置制御 --- */

/* パターンA: Astraウィジェットの場合（ラッパーdivがある） */
.sidebar-main .ast-featured-post .ast-featured-post-content {
    grid-column: 2 / 3 !important; /* 右列 */
    grid-row: 1 / -1 !important;   /* 上下中央 */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* パターンB: WP標準ブロックの場合（ラッパーがなくバラバラ） */
/* タイトル(aタグ)を強制的に「右列・1行目」へ */
.sidebar-main .wp-block-latest-posts li > a:not(.wp-block-latest-posts__featured-image) {
    grid-column: 2 / 3 !important;
    grid-row: 1 / 2 !important;
    align-self: end !important; /* 下揃えで日付に近づける */
    margin-bottom: 4px !important;
}

/* 日付(time/spanタグ)を強制的に「右列・2行目」へ */
.sidebar-main .wp-block-latest-posts__post-date {
    grid-column: 2 / 3 !important;
    grid-row: 2 / 3 !important;
    align-self: start !important; /* 上揃えでタイトルに近づける */
    margin-top: 0 !important;
}


/* --- テキスト装飾（共通） --- */

/* タイトル（2行制限・紺色） */
.sidebar-main .ast-featured-post .ast-featured-post-content a,
.sidebar-main .wp-block-latest-posts li > a:not(.wp-block-latest-posts__featured-image) {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #0E4C5E !important;
    text-decoration: none !important;
    display: block;
    
    /* 2行制限 */
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: auto !important;
}

/* ホバー時 */
.sidebar-main .ast-featured-post .ast-featured-post-content a:hover,
.sidebar-main .wp-block-latest-posts li > a:not(.wp-block-latest-posts__featured-image):hover {
    color: #F39C12 !important;
}

/* 日付 */
.sidebar-main .ast-featured-post-meta,
.sidebar-main .wp-block-latest-posts__post-date {
    font-size: 0.75rem;
    color: #0E4C5E !important;
    opacity: 0.7;
    display: block !important;
    line-height: 1;
}