/* ========================================
   KAGENEKO-CHAN
   BLOG Page CSS
======================================== */


/* ========================================
   BLOG
======================================== */

.blog {
    padding: 80px 0;
}

/* ========================================
   BLOG VISUAL
======================================== */

.blog__visual {
    width: min(1000px, calc(100% - 40px));
    margin-inline: auto;
    margin-bottom: 64px;
}

.blog__visual-image {
    width: 100%;
    aspect-ratio: 16 / 6;
    object-fit: cover;
    border-radius: 8px;
}

.blog__title {
    margin-top: 24px;
    margin-bottom: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #202328;
}

/*
    BLOGメイン画像完成までの仮設定。
    本画像配置後にdisplay:noneを削除する。
*/
/*.blog__visual-image {
    display: none;
}*/


/*
    BLOGメイン画像完成までの仮表示。
    本画像配置後に削除する。
*/
/*.blog__visual::before {
    content: "BLOG VISUAL";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 6;
    background-color: #263D55;
    color: #FFFFFF;
    border-radius: 8px;
    font-family: "Montserrat", sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.12em;
}*/

/* ========================================
   BLOG POSTS
======================================== */

.blog__posts {
    width: min(1000px, calc(100% - 40px));
    margin-inline: auto;
}

.blog__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* 投稿画像は正方形にする。*/
.blog__item {
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
}

/* <button>のブラウザ標準デザインを消す。*/
.blog__post-button {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    overflow: hidden;
}

/* 画像が入った時用のヤツ*/
    .blog__post-button img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s;
    }
    .blog__post-button:hover img {
        transform: scale(1.04);
    }


    /*
    BLOG投稿画像完成までの仮設定。
    本画像配置後にdisplay:noneを削除する。
*/
    .blog__post-button img {
/*        display: none;*/
    }

    .blog__post-button.has-image::before {
        display: none;
    }


    /*
    BLOG投稿画像完成までの仮表示。
    本画像配置後に削除する。
*/
    .blog__post-button::before {
        content: "BLOG POST";
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #E7EAED;
        color: #263D55;
        font-family: "Montserrat", sans-serif;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: 0.1em;
        transition: background-color 0.2s, transform 0.3s;
    }

    .blog__post-button:hover::before {
        background-color: #DDE2E7;
        transform: scale(1.03);
    }

/* ========================================
   PAGINATION
======================================== */

.blog__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
}

    .blog__pagination button {
        min-width: 42px;
        height: 42px;
        padding: 0 12px;
        background-color: #FFFFFF;
        color: #202328;
        border: 1px solid #D7DBDF;
        border-radius: 6px;
        font-family: "Montserrat", sans-serif;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    }

        .blog__pagination button:hover {
            background-color: #202328;
            color: #FFFFFF;
            border-color: #202328;
        }



.blog__pagination-pages {
    display: flex;
    gap: 8px;
}


    /* 現在表示中のページ */
    .blog__pagination-pages button.is-current {
        background-color: #202328;
        color: #FFFFFF;
        border-color: #202328;
        opacity: 1;
        cursor: default;
    }


/* PREV / NEXTなど、現在押せないボタン */
.blog__pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}


/* 現在ページは暗い状態を維持 */
.blog__pagination-pages button.is-current:disabled {
    opacity: 1;
}

/* ========================================
   BLOG - Mobile
======================================== */

@media (max-width: 768px) {

    .blog {
        padding: 40px 0;
    }

    .blog__visual,
    .blog__posts {
        width: calc(100% - 24px);
    }

    .blog__visual {
        margin-bottom: 40px;
    }

        .blog__visual-image,
        .blog__visual::before {
            aspect-ratio: 16 / 7;
        }

    .blog__title {
        margin-top: 16px;
        font-size: 32px;
    }

    .blog__grid {
        gap: 4px;
    }

    .blog__pagination {
        gap: 8px;
        margin-top: 28px;
    }

        .blog__pagination button {
            min-width: 36px;
            height: 36px;
            padding: 0 8px;
            font-size: 11px;
        }
}


/* 基礎ではないやつ (あとで別cssにしたい。)*/
/* ========================================
   POST MODAL
======================================== */

.post-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}


    /* モーダルを開いている状態 */
    .post-modal.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }


/* ========================================
   背景の暗幕
======================================== */

.post-modal__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.72);
}


/* ========================================
   モーダル本体
======================================== */

.post-modal__content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    grid-template-areas:
        "main info"
        "thumb info";
    gap: 20px 28px;
    width: min(960px, 100%);
    max-height: calc(100vh - 48px);
    padding: 24px;
    overflow-y: auto;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}


/* ========================================
   閉じるボタン
======================================== */

.post-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 42px;
    height: 42px;
    padding: 0;
    background-color: rgba(32, 35, 40, 0.88);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}


    .post-modal__close:hover {
        background-color: #D94F55;
        transform: scale(1.06);
    }


/* ========================================
   メイン画像
======================================== */

.post-modal__main-image {
    grid-area: main;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background-color: #E7EAED;
    border-radius: 6px;
}


    .post-modal__main-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }


/* ========================================
   サブ画像
======================================== */

.post-modal__thumbnails {
    grid-area: thumb;
    display: flex;
    gap: 10px;
    overflow-x: auto;
}


.post-modal__thumbnail-button {
    flex: 0 0 92px;
    width: 92px;
    height: 70px;
    padding: 0;
    overflow: hidden;
    background: none;
    border: 1px solid #D7DBDF;
    border-radius: 4px;
    cursor: pointer;
}


    .post-modal__thumbnail-button img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }


/* ========================================
   投稿情報
======================================== */

.post-modal__information {
    grid-area: info;
    padding-top: 8px;
}


.post-modal__date {
    display: block;
    margin-bottom: 8px;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #D94F55;
}


.post-modal__title {
    margin-bottom: 20px;
    padding-right: 44px;
    font-size: 26px;
    line-height: 1.4;
    color: #202328;
}


.post-modal__body {
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.9;
    color: #555B61;
    white-space: pre-wrap;
}


/* ========================================
   モーダル表示中のbody
======================================== */

body.is-modal-open {
    overflow: hidden;
}


/* ========================================
   POST MODAL - Mobile
======================================== */

@media (max-width: 768px) {

    .post-modal {
        padding: 12px;
    }


    .post-modal__content {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "thumb"
            "info";
        gap: 16px;
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 16px;
    }


    .post-modal__main-image {
        aspect-ratio: 1 / 1;
    }


    .post-modal__thumbnail-button {
        flex-basis: 74px;
        width: 74px;
        height: 58px;
    }


    .post-modal__title {
        padding-right: 0;
        font-size: 22px;
    }


    .post-modal__close {
        top: 8px;
        right: 8px;
        width: 38px;
        height: 38px;
        font-size: 23px;
    }
}