/* コラムフッター用スタイル */

/* 関連記事セクション */
.related-post {
    font-family: "Noto Sans JP", Sans-serif;
}

.related-post__title {
    position: relative;
    padding-bottom: 10px;
}

.related-post__title::before {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #DDDDDD;
}

.related-post__title::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30%;
    height: 3px;
    background-color: #297842;
}

.related-post__title h2,
.related-post__title .column-footer-heading-title {
    color: #297842;
    font-family: "Noto Sans JP", Sans-serif;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0;
}

/* 関連記事グリッド */
.related-post .column-footer-posts-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-row-gap: 35px;
    grid-column-gap: 30px;
    gap: 35px 30px;
}

/* 関連記事セクションのマージン */
.related-post .column-footer-inner-column > .column-footer-widget-wrap > .column-footer-element-populated {
    margin-top: 5%;
}

/* 関連記事カード */
.column-footer-post {
    background: #fff;
    border-radius: 3px;
    overflow: hidden;
    border: 0 solid #69727d;
    transition: box-shadow 0.3s ease;
}

.column-footer-post__card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* box-shadowの適用 (elementorの設定と同じ) */
.related-post .column-footer-post {
    box-shadow: 0 0 10px 0 rgba(0,0,0,.15);
}

.related-post .column-footer-post:hover {
    box-shadow: 0 0 30px 0 rgba(0,0,0,.15);
}

/* 関連記事サムネイル */
.column-footer-post__thumbnail__link {
    display: block;
    position: relative;
    overflow: hidden;
}

/* グラデーションオーバーレイ効果 */
.related-post .column-footer-post .column-footer-post__thumbnail__link::after {
    background-image: linear-gradient(0deg, rgba(0,0,0,.35), transparent 75%);
    background-repeat: no-repeat;
    bottom: 0;
    content: "";
    display: block;
    height: 100%;
    opacity: 1;
    position: absolute;
    transition: all .3s ease-out;
    width: 100%;
}

.related-post .column-footer-post:hover .column-footer-post__thumbnail__link::after {
    opacity: .5;
}

.column-footer-post__thumbnail {
    width: 100%;
    padding-bottom: calc(0.66 * 100%); /* 0.66 aspect ratio (2:3) */
    position: relative;
    overflow: hidden;
}

.column-footer-post__thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 関連記事テキスト */
.column-footer-post__text {
    padding: 20px;
    flex-grow: 1;
    margin-top: 0;
}

.column-footer-post__title {
    font-family: "Noto Sans JP", Sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #297842;
    margin-bottom: 5px;
    line-height: 1.5;
}

.column-footer-post__title a {
    color: #297842;
    text-decoration: none;
}

.column-footer-post__title a:hover {
    text-decoration: underline;
}

.column-footer-post__excerpt {
    font-family: "Noto Sans JP", Sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    line-height: 1.6;
}

/* 関連記事メタデータ */
.column-footer-post__meta-data {
    padding: 0 20px 20px;
    font-family: "Noto Sans JP", Sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #999;
}

.column-footer-post-date {
    display: inline-block;
}

/* 人気記事セクション */
.popular-post__title {
    position: relative;
    padding-bottom: 10px;
}

.popular-post__title::before {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #DDDDDD;
}

.popular-post__title::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30%;
    height: 3px;
    background-color: #297842;
}

.popular-post__title h2,
.popular-post__title .column-footer-heading-title {
    color: #297842;
    font-family: "Noto Sans JP", Sans-serif;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0;
}

/* 人気記事ラッパー */
.popular-post__wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 人気記事カード */
.popular-post_card {
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    background-color: #FFF;
    position: relative;
    overflow: hidden;
}

.popular-post_card a {
    display: flex;
    color: #000;
    align-items: center;
    text-decoration: none;
}

/* ランキング番号（フラッグ型） */
.popular-post_card .ranking-number {
    position: absolute;
    top: 0px;
    left: 15px;
    width: 40px;
    height: 40px;
    font-weight: bold;
    text-align: center;
    z-index: 2;
}

.popular-post_card .ranking-number::before {
    content: "";
    position: absolute;
    display: block;
    width: 40px;
    height: 30px;
    clip-path: polygon(0 0, 100% 23%, 0 100%);
    bottom: -12px;
}

.popular-post_card .ranking-number::after {
    content: "";
    position: absolute;
    display: block;
    width: 40px;
    height: 30px;
    clip-path: polygon(0% 20%, 100% 0, 103% 100%);
    bottom: -11px;
    right: 0;
    z-index: -1;
}

/* ランキング番号の色分け */
.popular-post_card:nth-child(1) .ranking-number,
.popular-post_card:nth-child(1) .ranking-number::before,
.popular-post_card:nth-child(1) .ranking-number::after {
    background-color: gold;
}

.popular-post_card:nth-child(2) .ranking-number,
.popular-post_card:nth-child(2) .ranking-number::before,
.popular-post_card:nth-child(2) .ranking-number::after {
    background-color: silver;
}

.popular-post_card:nth-child(3) .ranking-number,
.popular-post_card:nth-child(3) .ranking-number::before,
.popular-post_card:nth-child(3) .ranking-number::after {
    background-color: #8c4841;
}

.popular-post_card .ranking-number span {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.popular-post_card:nth-child(3) span {
    color: #FFF;
}

/* 人気記事画像 */
.popular-post_card .post-img {
    max-width: 300px;
    width: 40%;
    margin-left: 15px;
}

.popular-post_card .post-img img {
    width: 100%;
    height: auto;
    vertical-align: bottom;
}

/* 人気記事テキスト */
.popular-post_card .popular-post__text {
    padding: 15px 30px;
    width: 60%;
}

.popular-post_card h3 {
    font-size: 18px;
    color: #297842;
    margin-bottom: 25px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 600;
    min-height: 44px;
}

.popular-post_card .popular-post__text p {
    min-height: 72px;
    font-family: 'Noto Sans JP', sans-serif;
}

.popular-post_card .post-date {
    border-top: 1px solid #eaeaea;
    padding: 15px 30px;
    color: #adadad;
    font-size: 12px;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .related-post .column-footer-posts-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 767px) {
    /* 関連記事 */
    .related-post .column-footer-posts-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .related-post__title h2 {
        font-size: 20px;
    }
    
    .column-footer-post__thumbnail {
        padding-bottom: calc(0.5 * 100%); /* 0.5 aspect ratio for mobile */
    }
    
    .column-footer-post__excerpt {
        font-size: 14px;
        line-height: 1.5em;
    }
    
    /* 人気記事 */
    .popular-post__title h2 {
        font-size: 22px;
    }
    
    .popular-post_card a {
        flex-direction: column;
    }
    
    .popular-post_card .post-img {
        max-width: 100%;
        width: 100%;
        margin-left: 0;
    }
    
    .popular-post_card .popular-post__text {
        width: 100%;
    }
    
    .popular-post_card h3 {
        margin-top: 0;
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .popular-post_card .popular-post__text p {
        font-size: 14px;
        margin-bottom: 0;
    }
}

/* 共通スタイル */
.column-footer-section {
    margin: 40px 0;
}

.column-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* セクション間のスペース */
.column-footer-section + .column-footer-section {
    margin-top: 3%;
}

/* コンテナの最大幅 */
.column-footer-inner-section > .column-footer-container {
    max-width: 800px;
}

/* widgetのマージン */
.column-footer-widget:not(:last-child) {
    margin-bottom: 20px;
}
