.wrap{
    width: 100% !important;
}

#main.main{
    background-color: var(--white);
    color: var(--text-main);
    padding: 0;
}

.entry-content{
    margin-bottom: 0 !important;
}

/* ファーストビュー */
.firstview-img img {
    object-fit: cover;
    width: 100%;
    object-position: center;
}

/* コラムタイトル */
.entry-header { 
    background-color: color-mix(in srgb, var(--green-1) 65%, transparent) !important; 
    position: absolute;
    left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 45%;
}

p.entry-title {
    font-weight: bold;
    color: var(--white);
    margin: 0 !important;
    text-align: center;
}

/* 投稿内容 */
.column-detail-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 0 !important;
}

.column-detail-wrap {
    display: flex;
    justify-content: center;
}

.column-detail {
    width: 100%;
}

.column-detail-inner {
    border-bottom: 2px solid var(--gray-2);
}

/* コラムがなかった時 */
.no-column-detail-inner {
    width: 100%;
    text-align: center;
}

.column-detail-inner a:hover{
    color: var(--green-1);
}

/* 投稿タイトル */
.column-detail-title-content {
    border-bottom: 2px solid var(--gray-2);
}

.column-detail-title {
    color: var(--text-main);
    font-weight: bold;
}

/* 投稿情報 */
.column-detail-info {
    margin-bottom: 16px;
}

.column-detail-date {
    background: #f8f9fa;
    color: var(--green-1);
    font-weight: bold;
    padding: 0 10px;
}

/* アイキャッチ画像 */
.column-detail-thumbnail img {
    width: 100%;
    height: auto;
}

/* 投稿テキスト */
.column-detail-body p {
    color: var(--text-main);
}

/* 目次 */
.toc {
    background-color: #f6f6f6; 
    width: 100%;
    font-weight: bold;
    color: var(--text-main);
}

.toc-title {
    border-bottom: 1px solid var(--text-main);    
    padding-bottom: 4px;         
}

.toc a {
    text-decoration: underline !important; 
    color: var(--text-main) !important;
    
}

.toc a:hover {
    color: #6B6B6B !important; 
}

/* サイドバー */
.column-detail-sidebar-wrapper {
    display: flex;
    justify-content: center;
    align-items: start;
    flex-shrink: 0; /* 縮まらないように */
}


/* コラムランキング */
.column-ranking p {
    color: var(--white);
    text-align: center;
    background: linear-gradient(135deg,#00331f 0%,#004628 30%,#1e7154 100%);
    border-radius: 50px;
    font-size: 16px;
    padding: 10px 0;
    margin-bottom: 20px;
}

.column-ranking ul {
    list-style: none;
    padding-left: 0;
}

.column-ranking li {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

/* コラム順位アイコン共通 */
.column-ranking strong {
    color: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    line-height: 1;
    flex-shrink: 0;
}

.column-ranking li.rank-1 strong {
    background: #dcc017; /* 1位の色（ゴールド） */
}

.column-ranking li.rank-2 strong {
    background: #c0c0c0; /* 2位の色（シルバー） */
}

.column-ranking li.rank-3 strong {
    background: #cd7f32; /* 3位の色（ブロンズ） */
}

.column-ranking a {
    text-decoration: none;
    color: var(--text-main);
    width: fit-content;
    font-weight: bold;
}

.column-ranking a:hover{
    color: var(--green-1);
}

/* CTA */
.sidebar-cta-wrapper {
    background: linear-gradient(135deg,#00331f 0%,#004628 30%, #1e7154 100%);
    color: var(--white);
    text-align: center;
    line-height: normal;
    overflow: hidden;
}

.sidebar-cta-title {
    font-weight: bold;
}

/* CTAボタン */
.sidebar-cta-btn {
    position: relative;
    background-color: var(--white);
    color: var(--green-1);
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    overflow: hidden;
}

/* 擬似要素でグラデーションを作る */
.sidebar-cta-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(94deg, #c5d1c3 0%, #a3b3a0 100%);
    opacity: 0;
    transition: opacity 0.4s ease 0.15s;
    border-radius: 10px;
    pointer-events: none;
    z-index: 0;
}

/* テキストは前面に */
.sidebar-cta-btn > * {
    position: relative;
    z-index: 1;
}

/* ホバー時はグラデ背景の透明度を上げる */
.sidebar-cta-btn:hover::before {
    opacity: 1;
    transition-delay: 0s;
}

.sidebar-cta-btn:hover {
    color: var(--green-1) !important;
}

/* コラム一覧へ戻るボタン */
.back-archive-button {
    display: flex;
    justify-content: center;
}

.back-archive-button a{
    display: inline-block;
    text-decoration: none;
    color: var(--white);
    background: var(--green-1);
    border: 2px solid var(--green-1);
    border-radius: 50px;
    transition: background 0.3s;
    font-weight: bold;
    padding: 10px 40px;
}

.back-archive-button a:hover {
    background: var(--white);
    color: var(--green-1);
}

/* PC表示（1024px以上） */
@media screen and (min-width: 1024px) {

    .sp-only {
        display: none;
    }

    /* ファーストビュー */
    .firstview-img {
        height: 430px;
    }

    .firstview-img img {
        height: 380px;
        margin-bottom: 60px;
    }
    
    .entry-header {
        height: 200px;
        top: 252px;
    }
    
    /* コラム一覧タイトル */
    p.entry-title{
        font-size: 48px !important;
        margin-right: 25% !important;
    }

    /* コラム一覧内容 */
    .column-detail-wrap {
        gap: 40px;
        width: 80%;
        margin-top: 60px;
    }

    .column-detail-inner {
        margin-bottom: 50px;
    }

    /* コラムがなかった時 */
    .no-column-detail-inner {
        margin: 300px 0;
    }

    /* 投稿タイトル */
    .column-detail-title-content {
        margin-bottom: 30px;
    }

    .column-detail-title {
        font-size: 34px;
        margin-bottom: 16px;
    }

    /* 投稿情報 */
    .column-detail-info {
        margin-bottom: 16px;
    }

    .column-detail-date {
        padding: 0 10px;
        margin-bottom: 10px;
    }

    /* アイキャッチ画像 */
    .column-detail-thumbnail {
        margin-bottom: 20px;
    }

    /* 投稿内容 */
    .column-detail-body {
        line-height: 2em;
        margin-bottom: 30px;
    }

    /* 投稿テキスト */
    .column-detail-body p {
        margin-bottom: 10px;
    }

    /* 投稿画像 */
    .wp-block-image{
        margin-top: 20px;
    }

    /* 目次 */
    .toc {
        margin: 60px 0 !important;
    }

    .toc-title {
        font-size: 20px !important;       
    }

    .toc a {
        font-size: 18px;
    }
    
    [id^="toc"] {
        scroll-margin-top: 90px; /* ヘッダー高さに合わせて調整 */
    }

    h2[id], h3[id] {
        scroll-margin-top: 90px;
    }

    /* サイドバー */
    .column-detail-sidebar-wrapper {
        width: 460px;
        position: relative; /* stickyのために必要 */
    }

    .column-detail-sidebar {
        width: 80%;
        position: sticky;
        top: 120px; /* スクロール時に画面上部から120pxの位置(ヘッダーの高さ)で固定 */
        margin-bottom: 50px;
    }

    /* コラムランキング */
    .column-ranking {
        margin-bottom: 50px;
    }

    .column-ranking ul {
        margin: 0 20px;
    }

    .column-ranking li {
        margin-bottom: 30px;
    }

    /* コラム順位アイコン共通 */
    .column-ranking strong {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .sidebar-cta {
        margin: 20px;
    }

    .sidebar-cta-title {
        font-size: 26px;
        margin-bottom: 20px;
    }

    .sidebar-cta-img {
        margin-bottom: 20px;
        padding: 0 40px;
    }

    /* CTAボタン */
    .sidebar-cta-btn {
        padding: 12px 30px;
        font-size: 16px;
    }

    /* コラム一覧へ戻るボタン */
    .back-archive-button {
        margin-bottom: 50px;    
    }
}

/* SP表示（1023px以下） */
@media screen and (max-width: 1023px) {  

    .pc-only {
        display: none;
    }

    /* ファーストビュー */
    .firstview-img img {
        height: 130px;
    }

    .entry-header {
        height: 50px;
        top: 96px;
    }

    /* コラム一覧タイトル */
    p.entry-title{
        font-size: 16px;
        margin-right: 2% !important;
    }

    .column-detail-wrap {
        flex-direction: column;
        width: 90%;
        margin-top: 30px;
    }

    /* コラム一覧内容 */
    .column-detail-inner {
        margin-bottom: 20px;
    }

    /* コラムがなかった時 */
    .no-column-detail-inner {
        margin: 100px 0;
    }

    /* 投稿タイトル */
    .column-detail-title-content {
        margin-bottom: 20px;
    }

    .column-detail-title {
        font-size: 20px;
    }

    /* 投稿情報 */
    .column-detail-info {
        margin-bottom: 10px;
    }

    .column-detail-date {
        padding: 0 6px;
        margin-bottom: 10px;
        font-size: 12px;
    }

    /* アイキャッチ画像 */
    .column-detail-thumbnail {
        margin-bottom: 10px;
    }

    /* 投稿テキスト */
    .column-detail-body {
        margin-bottom: 20px;
    }

    .column-detail-body p {
        margin-bottom: 10px;
    }

    /* 投稿画像 */
    .wp-block-image{
        margin-top: 10px;
    }

    /* 目次 */
    .toc {
        margin: 40px 0 !important;
    }

    .toc-title {
        font-size: 16px !important;         
    }

    .toc a {
        font-size: 14px;
    }
     
    [id^="toc"] {
        scroll-margin-top: 56px; /* ヘッダー高さに合わせて調整 */
    }

    h2[id], h3[id] {
        scroll-margin-top: 56px;
    }

    /* コラムランキング */
    .column-ranking {
        margin-bottom: 40px;
    }

    .column-ranking ul {
        margin: 0 10px;
    }

    .column-ranking li {
        margin-bottom: 20px;
    }

    .column-ranking a {
        font-size: 14px;
    }

    /* コラム順位アイコン共通 */
    .column-ranking strong {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }

    .sidebar-cta-wrapper {
        margin-bottom: 50px;
    }

    .sidebar-cta {
        margin: 5%;
        display: flex ;
        flex-direction: column;
        gap: 20px;
        justify-content: center;
        align-items: center;
    }

    .sidebar-cta-title {
        font-size: 20px;
    }

    .sidebar-cta-img {
        width: 50%;
    }

    /* CTAボタン */
    .sidebar-cta-btn {
        padding: 12px 30px;
        font-size: 14px;
    }

    /* コラム一覧へ戻るボタン */
    .back-archive-button {
        margin-bottom: 50px;
    }

    .back-archive-button a{
        font-size: 14px;
    }
   
}


