/* STEP19-4 ブログ公開表示 */

.blog-list {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(0, 280px)
    );
    gap: 24px;
    justify-content: start;
}

.blog-card {
    width: 280px;
    overflow: hidden;
    border: 1px solid rgba(127, 127, 127, .25);
    border-radius: 12px;
    background: transparent;
}

.blog-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #20262b;
}

.blog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card__body {
    padding: 16px;
}

.blog-card__meta,
.blog-article__meta {
    margin: 0 0 10px;
    opacity: .72;
    font-size: .9rem;
}

.blog-card__title {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.55;
}

.blog-card__title a {
    color: inherit;
    text-decoration: none;
}

.blog-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
    align-items: start;
}

.blog-page-layout.has-sidebar {
    grid-template-columns: minmax(0, 1fr) 280px;
}

.blog-page-main {
    min-width: 0;
}

.blog-article {
    width: 100%;
    max-width: 900px;
}

.blog-article__eyecatch {
    width: min(100%, 820px);
    margin: 0 0 30px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #20262b;
}

.blog-article__eyecatch img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-article__body {
    line-height: 1.9;
}

.blog-article__body img {
    max-width: 100%;
    height: auto;
}

.blog-heading-style--underline h2 {
    margin: 2.5em 0 .9em;
    padding: 0 0 .5em;
    border-bottom: 4px solid currentColor;
    font-size: clamp(1.55rem, 2.6vw, 2rem);
    line-height: 1.4;
}

.blog-heading-style--underline h3 {
    margin: 2em 0 .8em;
    padding-bottom: .38em;
    border-bottom: 1px solid currentColor;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.blog-heading-style--underline h4 {
    margin: 1.6em 0 .65em;
    font-size: clamp(1.08rem, 1.6vw, 1.28rem);
}

.blog-heading-style--left-line h2,
.blog-heading-style--left-line h3 {
    margin: 2.3em 0 .85em;
    padding: .2em 0 .2em .75em;
    border-left: 7px solid currentColor;
    line-height: 1.45;
}

.blog-heading-style--left-line h2 {
    font-size: clamp(1.55rem, 2.6vw, 2rem);
}

.blog-heading-style--left-line h3 {
    border-left-width: 4px;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.blog-heading-style--left-line h4 {
    margin: 1.6em 0 .65em;
    padding-left: .65em;
    border-left: 2px solid currentColor;
}

.blog-heading-style--band h2 {
    margin: 2.4em 0 .9em;
    padding: .65em .8em;
    background: rgba(127, 127, 127, .16);
    border-left: 7px solid currentColor;
    font-size: clamp(1.5rem, 2.5vw, 1.95rem);
    line-height: 1.4;
}

.blog-heading-style--band h3 {
    margin: 2em 0 .8em;
    padding: .5em .7em;
    background: rgba(127, 127, 127, .10);
    font-size: clamp(1.24rem, 2vw, 1.5rem);
}

.blog-heading-style--band h4 {
    margin: 1.6em 0 .65em;
    padding-bottom: .35em;
    border-bottom: 2px dotted currentColor;
}

.blog-related {
    margin-top: clamp(48px, 8vw, 82px);
}

.blog-related__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.blog-related__heading h2 {
    margin: 0;
}

.blog-related__eyebrow {
    margin: 0 0 5px;
    font-size: .78rem;
    letter-spacing: .14em;
    opacity: .65;
}

.blog-related__controls {
    display: flex;
    gap: 8px;
}

.blog-related__controls button {
    width: 40px;
    height: 40px;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1.6rem;
    cursor: pointer;
}

.blog-related__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.blog-related__viewport::-webkit-scrollbar {
    display: none;
}

.blog-related__track {
    display: flex;
    gap: 18px;
    width: max-content;
}

.blog-related-card {
    width: 280px;
    flex: 0 0 280px;
    overflow: hidden;
    border: 1px solid rgba(127, 127, 127, .25);
    border-radius: 12px;
    scroll-snap-align: start;
}

.blog-related-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.blog-related-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #20262b;
}

.blog-related-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-related-card__body {
    display: grid;
    gap: 7px;
    padding: 14px;
}

.blog-related-card__body strong {
    line-height: 1.55;
}

.blog-article-cta {
    margin: 42px 0;
}

.blog-sidebar {
    position: sticky;
    top: 140px;
    display: grid;
    gap: 20px;
}

.blog-sidebar__section {
    padding: 18px;
    border: 1px solid rgba(127, 127, 127, .25);
    border-radius: 12px;
}

.blog-sidebar__section h2 {
    margin: 0 0 14px;
    font-size: 1.05rem;
}

.blog-sidebar__section ul {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-sidebar__section a {
    color: inherit;
    text-decoration: none;
}

.blog-sidebar__section form {
    display: flex;
    gap: 6px;
}

.blog-sidebar__section input {
    min-width: 0;
    width: 100%;
    padding: 9px;
}

.blog-sidebar__section button {
    padding: 9px 12px;
}

.blog-empty {
    text-align: center;
    padding: 50px 0;
}

@media (max-width: 900px) {
    .blog-page-layout.has-sidebar {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .blog-list {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
        gap: 12px;
    }

    .blog-card {
        width: 100%;
    }

    .blog-related-card {
        width: 250px;
        flex-basis: 250px;
    }
}


/* STEP19-9 ブログレイアウト最終修正 */

/*
 * サイドメニュー有効時:
 * 左 = メイン領域（残り全幅）
 * 右 = サイドメニュー（250px固定）
 */
.blog-list-layout.shop-layout.has-sidebar,
.blog-page-layout.shop-layout.has-sidebar {
    display: grid !important;
    grid-template-columns:
        minmax(0, 1fr)
        250px !important;
    gap: 30px !important;
    align-items: start;
}

.blog-list-layout.shop-layout.has-sidebar > .shop-layout__main,
.blog-page-layout.shop-layout.has-sidebar > .shop-layout__main {
    grid-column: 1 !important;
    min-width: 0;
    width: auto !important;
}

.blog-list-layout.shop-layout.has-sidebar > .shop-sidebar,
.blog-page-layout.shop-layout.has-sidebar > .shop-sidebar {
    grid-column: 2 !important;
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}

/*
 * サイドメニュー無効時:
 * 右側に空欄を残さず中央配置。
 */
.blog-list-layout:not(.has-sidebar),
.blog-page-layout:not(.has-sidebar) {
    display: block !important;
}

.blog-list-layout:not(.has-sidebar) .blog-list-main,
.blog-page-layout:not(.has-sidebar) .blog-page-main {
    width: min(100%, 900px) !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

.blog-list-layout:not(.has-sidebar) .blog-list {
    justify-content: center;
}

.blog-page-layout:not(.has-sidebar) .blog-article,
.blog-page-layout:not(.has-sidebar) .blog-article__eyecatch {
    margin-right: auto;
    margin-left: auto;
}

/* 記事一覧カードはサイドバー有無にかかわらず固定幅 */
.blog-list {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(0, 280px));
    gap: 24px;
}

.blog-card {
    width: 280px;
}

/* 代替画像を含め、画像枠を常に16:9で表示 */
.blog-card__image,
.blog-related-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #20262b;
}

.blog-card__image img,
.blog-related-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* スマホ・タブレットでは1カラムへ */
@media (max-width: 960px) {
    .blog-list-layout.shop-layout.has-sidebar,
    .blog-page-layout.shop-layout.has-sidebar {
        grid-template-columns: 1fr !important;
    }

    .blog-list-layout.shop-layout.has-sidebar > .shop-layout__main,
    .blog-page-layout.shop-layout.has-sidebar > .shop-layout__main,
    .blog-list-layout.shop-layout.has-sidebar > .shop-sidebar,
    .blog-page-layout.shop-layout.has-sidebar > .shop-sidebar {
        grid-column: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .blog-list-layout.shop-layout.has-sidebar > .shop-sidebar,
    .blog-page-layout.shop-layout.has-sidebar > .shop-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .blog-list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .blog-card {
        width: 100%;
    }
}


/* STEP19-10 保存済み記事画像の中央寄せ */
.blog-article__body img[style*="text-align: center"],
.blog-article__body img[style*="text-align:center"] {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.blog-article__body img[style*="text-align: left"],
.blog-article__body img[style*="text-align:left"] {
    display: block !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}

.blog-list-main > .pagination {
    margin-top: 34px;
}


/* Blog article card settings */
.blog-list.blog-card-grid--top,
.blog-list.blog-card-grid--list{
    display:grid;
    justify-content:stretch;
}
.blog-list.blog-card-grid--top{
    grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--site-blog-card-top-min-width,240px)),1fr));
    gap:var(--site-blog-card-top-gap,24px);
}
.blog-list.blog-card-grid--list{
    grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--site-blog-card-list-min-width,260px)),1fr));
    gap:var(--site-blog-card-list-gap,24px);
}
.blog-card{
    display:grid;
    /* テキスト量に関係なく、下配置時の画像とテキスト領域を固定する */
    grid-template-rows:minmax(0,58%) minmax(0,42%);
    width:100%;
    min-width:0;
    aspect-ratio:var(--site-blog-card-aspect,4 / 3);
    overflow:hidden;
    border:var(--site-blog-card-border-width,1px) solid var(--site-blog-card-border-color,#d9e0e5);
    border-radius:var(--site-blog-card-radius,12px);
    background:var(--site-blog-card-text-bg,#fff);
    color:var(--site-blog-card-text-color,#1f2933);
    box-shadow:var(--site-blog-card-shadow,none);
}
.blog-card:hover{box-shadow:var(--site-blog-card-hover-shadow,var(--site-blog-card-shadow,none))}
.blog-card__image{display:block;width:100%;height:100%;min-width:0;min-height:0;aspect-ratio:auto;background:#20262b;overflow:hidden}
.blog-card__image img{display:block;width:100%;height:100%;object-fit:cover}
.blog-card__body{display:flex;flex-direction:column;gap:6px;min-width:0;padding:14px;background:var(--site-blog-card-text-bg,#fff);color:var(--site-blog-card-text-color,#1f2933);overflow:hidden}
.blog-card__category,.blog-card__meta{margin:0;font-size:.78rem;line-height:1.3;opacity:.72}
.blog-card__category{font-weight:750}
.blog-card__title{margin:0;font-size:1rem;line-height:1.45;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.blog-card__title a{color:inherit;text-decoration:none}

body.blog-card-text-right .blog-card{grid-template-columns:minmax(0,1fr) minmax(120px,42%);grid-template-rows:1fr}
body.blog-card-text-left .blog-card{grid-template-columns:minmax(120px,42%) minmax(0,1fr);grid-template-rows:1fr}
body.blog-card-text-left .blog-card__image{grid-column:2;grid-row:1}
body.blog-card-text-left .blog-card__body{grid-column:1;grid-row:1}
body.blog-card-text-none .blog-card{display:block}
body.blog-card-text-none .blog-card__image{width:100%;height:100%}
body.blog-card-text-none .blog-card__body{display:none}

body.blog-card-top-layout-connected .blog-card-grid--top,
body.blog-card-list-layout-connected .blog-card-grid--list{
    gap:var(--site-blog-card-border-width,0px);
    padding:var(--site-blog-card-border-width,0px);
    overflow:hidden;
    background:var(--site-blog-card-border-color,#d9e0e5);
    border-radius:var(--site-blog-card-radius,12px);
}
body.blog-card-top-layout-connected .blog-card-grid--top .blog-card,
body.blog-card-list-layout-connected .blog-card-grid--list .blog-card{
    border-width:0;
    border-radius:0;
    box-shadow:none;
}
body.blog-card-top-layout-connected .blog-card-grid--top .blog-card:hover,
body.blog-card-list-layout-connected .blog-card-grid--list .blog-card:hover{box-shadow:none}

/* Related articles share the same card design, while the existing slider controls width. */
.blog-related-card{width:280px;flex:0 0 280px;border:0;border-radius:0;overflow:visible}
.blog-related-card>.blog-card{height:100%}
.blog-related__track{align-items:stretch}

/* Blog list responsive: reduce columns automatically, phone is one column. */
@media(max-width:960px){
    .blog-list.blog-card-grid--top,
    .blog-list.blog-card-grid--list{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
    .blog-list.blog-card-grid--top,
    .blog-list.blog-card-grid--list{grid-template-columns:1fr!important}
    body.blog-card-text-right .blog-card,
    body.blog-card-text-left .blog-card{grid-template-columns:minmax(0,1fr) minmax(120px,42%)}
}

/* Blog card: content amount must not change thumbnail/card dimensions */
.blog-card__body{min-height:0;height:100%;box-sizing:border-box;}
.blog-card__category,.blog-card__meta{flex:0 0 auto;min-height:1.05em;}
.blog-card__title{min-height:0;flex:1 1 auto;}
body.blog-card-text-right .blog-card,
body.blog-card-text-left .blog-card{grid-template-rows:1fr;}
body.blog-card-text-none .blog-card{grid-template-rows:1fr;}


/* Blog card title: max 2 lines, auto-fit font size, no bottom clipping */
.blog-card__body{
    min-height:0;
}
.blog-card__title{
    margin:0;
    min-height:0;
    line-height:1.35;
    font-size:clamp(.78rem, 1.15vw, 1rem);
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
    text-overflow:ellipsis;
    overflow-wrap:anywhere;
}
.blog-card__title a{
    display:block;
    color:inherit;
    text-decoration:none;
}
body.blog-card-text-right .blog-card__title,
body.blog-card-text-left .blog-card__title{
    font-size:clamp(.72rem, .95vw, .94rem);
}
.blog-card--related .blog-card__title{
    font-size:clamp(.72rem, .9vw, .92rem);
}


/* 2026-08-27: keep blog-card geometry fixed and guarantee room for a 2-line title.
   The previous font-only adjustment could not prevent clipping because the bottom
   text area's row itself was too short. */
body.blog-card-text-bottom .blog-card{
    grid-template-rows:54% 46%;
    container-type:inline-size;
}
body.blog-card-text-bottom .blog-card__image{
    min-height:0;
    height:100%;
}
body.blog-card-text-bottom .blog-card__body{
    min-height:0;
    height:100%;
    box-sizing:border-box;
    padding:clamp(7px,3.4cqw,12px);
    gap:clamp(2px,1.2cqw,5px);
    overflow:hidden;
}
body.blog-card-text-bottom .blog-card__category,
body.blog-card-text-bottom .blog-card__meta{
    flex:0 0 auto;
    min-height:0;
    margin:0;
    font-size:clamp(.64rem,3.2cqw,.78rem);
    line-height:1.15;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
body.blog-card-text-bottom .blog-card__title{
    flex:0 1 auto;
    min-height:0;
    margin:0;
    font-size:clamp(.72rem,4.1cqw,.98rem);
    line-height:1.28;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    line-clamp:2;
    overflow:hidden;
    text-overflow:ellipsis;
    overflow-wrap:anywhere;
}
body.blog-card-text-bottom .blog-card__title a{
    display:inline;
}

/* Side-text cards use the same two-line title rule, but do not change card geometry. */
body.blog-card-text-right .blog-card,
body.blog-card-text-left .blog-card{
    container-type:inline-size;
}
body.blog-card-text-right .blog-card__body,
body.blog-card-text-left .blog-card__body{
    min-height:0;
    box-sizing:border-box;
    padding:clamp(7px,3cqw,12px);
    gap:clamp(2px,1cqw,5px);
    overflow:hidden;
}
body.blog-card-text-right .blog-card__title,
body.blog-card-text-left .blog-card__title{
    min-height:0;
    font-size:clamp(.68rem,3.6cqw,.92rem);
    line-height:1.25;
    -webkit-line-clamp:2;
    line-clamp:2;
    overflow:hidden;
}


/* Explicit blog-card title size */
.blog-card__title,
body.blog-card-text-bottom .blog-card__title,
body.blog-card-text-right .blog-card__title,
body.blog-card-text-left .blog-card__title,
.blog-card--related .blog-card__title{
    font-size:var(--site-blog-card-title-size,16px);
    line-height:1.28;
    -webkit-line-clamp:2;
    line-clamp:2;
}
.blog-card__excerpt{display:none;margin:0}

/* Blog list: one-column summary mode */
body.blog-card-list-layout-summary .blog-card-grid--list{
    grid-template-columns:1fr!important;
    gap:0!important;
    padding:0!important;
    background:transparent!important;
    border-radius:0!important;
}
body.blog-card-list-layout-summary .blog-card-grid--list .blog-card{
    display:grid;
    grid-template-columns:minmax(160px,30%) minmax(0,1fr);
    grid-template-rows:1fr;
    width:100%;
    min-height:150px;
    aspect-ratio:auto;
    border:0;
    border-bottom:1px solid var(--site-blog-card-border-color,#d9e0e5);
    border-radius:0;
    box-shadow:none;
    background:transparent;
}
body.blog-card-list-layout-summary .blog-card-grid--list .blog-card:hover{box-shadow:none}
body.blog-card-list-layout-summary .blog-card-grid--list .blog-card__image{
    grid-column:1;
    grid-row:1;
    width:100%;
    height:auto;
    min-height:130px;
    aspect-ratio:var(--site-blog-card-aspect,4 / 3);
    align-self:center;
}
body.blog-card-list-layout-summary .blog-card-grid--list .blog-card__body{
    grid-column:2;
    grid-row:1;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-rows:auto auto minmax(0,1fr);
    align-content:center;
    column-gap:18px;
    row-gap:7px;
    min-width:0;
    height:auto;
    padding:18px 22px;
    background:transparent;
    color:var(--site-blog-card-text-color,#1f2933);
}
body.blog-card-list-layout-summary .blog-card-grid--list .blog-card__category{
    grid-column:1;
    grid-row:1;
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
body.blog-card-list-layout-summary .blog-card-grid--list .blog-card__meta{
    grid-column:2;
    grid-row:1;
    margin:0;
    white-space:nowrap;
    text-align:right;
}
body.blog-card-list-layout-summary .blog-card-grid--list .blog-card__title{
    grid-column:1 / -1;
    grid-row:2;
    margin:0;
    font-size:var(--site-blog-card-title-size,16px);
    line-height:1.3;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    line-clamp:2;
    overflow:hidden;
    text-overflow:ellipsis;
}
body.blog-card-list-layout-summary .blog-card-grid--list .blog-card__excerpt{
    grid-column:1 / -1;
    grid-row:3;
    display:-webkit-box;
    min-width:0;
    margin:0;
    color:inherit;
    opacity:.76;
    font-size:.88rem;
    line-height:1.55;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    line-clamp:2;
    overflow:hidden;
    text-overflow:ellipsis;
}
@media(max-width:640px){
    body.blog-card-list-layout-summary .blog-card-grid--list .blog-card{
        grid-template-columns:minmax(110px,38%) minmax(0,1fr);
        min-height:120px;
    }
    body.blog-card-list-layout-summary .blog-card-grid--list .blog-card__image{
        min-height:100px;
    }
    body.blog-card-list-layout-summary .blog-card-grid--list .blog-card__body{
        padding:10px 12px;
        column-gap:8px;
        row-gap:4px;
    }
    body.blog-card-list-layout-summary .blog-card-grid--list .blog-card__excerpt{
        -webkit-line-clamp:1;
        line-clamp:1;
        font-size:.76rem;
    }
}


/* Connected blog cards: no painted empty remainder cells. */
body.blog-card-top-layout-connected .blog-card-grid--top,
body.blog-card-list-layout-connected .blog-card-grid--list{
    gap:0 !important;
    padding:0 !important;
    overflow:visible !important;
    background:transparent !important;
    border-radius:0 !important;
}
body.blog-card-top-layout-connected .blog-card-grid--top .blog-card,
body.blog-card-list-layout-connected .blog-card-grid--list .blog-card{
    border-width:var(--site-blog-card-border-width,1px) !important;
    border-style:solid !important;
    border-color:var(--site-blog-card-border-color,#d9e0e5) !important;
    border-radius:0 !important;
    box-shadow:none !important;
}
