/* カスタム投稿共通スタイル */
.header {
    /* display: none; */
}

/* 外側1100pxのうち左右padding 120pxで内側860px */
#container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 120px;
    box-sizing: border-box;
}

#container section {
    padding: 10px 0;
}

#container section h2.content {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    line-height: initial;
    padding: .2em 0 .2em 5px;
    border-left: 7px solid var(--main);
    margin-top: 10px;
    margin-bottom: 10px;
    color: var(--main);
    width: auto;
}

#container section.title h2.content {
    font-size: 23px;
    font-weight: 500;
    margin: 0;
    line-height: initial;
    padding: .5em 1em;
    background-color: var(--main);
    color: #FFFFFF;
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
}

#container section h3.content {
    font-size: 21px;
    font-weight: bold;
    margin: 0;
    line-height: initial;
    padding: .2em 0 .2em 5px;
    border-left: 7px solid var(--main);
    color: var(--main);
    margin-top: 10px;
    margin-bottom: 10px;
}

#container section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    line-height: initial;
}

#container section span {
    font-size: 16px;
    white-space: pre-wrap;
    display: inline-block;
    width: 100%;
}

/* リンクのスタイル */
#container section a {
    color: #0066cc;
    text-decoration: underline;
    transition: color 0.2s ease;
}

#container section a:hover {
    color: #004499;
    text-decoration: underline;
}

#container section a:visited {
    color: #551a8b;
}

/* 画像セクション */
#container section.image div {
    width: 100%;
    display: grid;
    justify-content: center;
    gap: 5px;
}

#container section.image .image-container div {
    display: block;
    text-align: center;
}

#container section.image div img {
    width: 100%;
    height: auto;
}

/* 2列レイアウト */
#container .two-col div {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* テキストコンテナ */
#container .text-container {
    display: flex;
    flex-direction: column;
}

/* 2列の画像コンテナ */
#container .two-col .image-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: flex-start;
}

/* キャプション（直下の span）のみ中央寄せ。詳細テキスト内の span には効かない */
#container .two-col .image-container > span.content {
    text-align: center;
}

#container .two-col .image-container img {
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

#container .two-col .image-container .img-vertical {
    aspect-ratio: 2 / 3;
}

/* 画像下の詳細テキスト（複数行）※ .image-container div の text-align: center より優先させる */
#container section.image .image-container .image-detail {
    display: block;
    margin-top: 0.5em;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 16px;
    line-height: 1.5;
    min-height: 1.5em;
    text-align: left;
}

/* data-placeholder を持つ要素が空のときプレースホルダーを表示（キャプション・詳細テキスト・テキスト列など） */
#container [data-placeholder]:empty {
    min-height: 1.2em;
}
#container [data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: #999;
}

/* 1列の画像レイアウト */
#container section.one-col div {
    display: block;
}

#container section.one-col img {
    aspect-ratio: 5 / 2;
    object-fit: cover;
}


/* レスポンシブデザイン */
@media (max-width: 768px) {
    #container {
        padding-left: 20px;
        padding-right: 20px;
    }

    #container section.image div {
        grid-template-columns: 1fr;
    }
    
    #container .text-container {
        flex-wrap: wrap;
        flex-direction: row;
    }
    
    #container .text-container .content {
        width: 100%;
        margin-bottom: 20px;
    }
}
