/*
Theme Name: JIN:R Child
Description: 本きもの松葉ブログ用の JIN:R 子テーマ。site-specific なカスタマイズ（カテゴリ説明文表示・前後記事ナビ・カード画像 16:9 統一・PHP エラー抑止）を集約。
Template: jinr
Version: 1.0.0
Text Domain: jinr-child
*/

/* ============================================================
 * 一覧カード（postlist-square 等）の画像を 16:9 に統一
 * JIN:R は画像の自然なアスペクト比を保持する仕様のため、
 * 縦長／横長画像が混在するとカード高さが不揃いになる問題を回避。
 * ============================================================ */
.o--postlist-item .c--post-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.o--postlist-item .c--post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
 * 単記事末尾の前後記事ナビ（functions.php で出力）
 * ============================================================ */
.hm-post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    margin: 2em 0;
    padding-top: 1.5em;
    border-top: 1px solid #eee;
}
.hm-post-nav-prev,
.hm-post-nav-next {
    flex: 1 1 0;
    min-width: 0;
}
.hm-post-nav-next {
    text-align: right;
}
.hm-post-nav a {
    display: inline-flex;
    gap: 0.4em;
    align-items: baseline;
    text-decoration: none;
    color: inherit;
}
.hm-post-nav a:hover .hm-post-nav-title {
    text-decoration: underline;
}
.hm-post-nav-title {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.hm-post-nav-arrow {
    flex: 0 0 auto;
    opacity: 0.6;
}

/* ============================================================
 * カテゴリ archive のアーカイブ説明文（共通テンプレート）
 * functions.php が loop_start で post list 冒頭に挿入する div の体裁。
 * グリッド／フレックスの投稿リスト内に入っても全幅で 1 段に表示させる。
 * ============================================================ */
.hm-archive-lead {
    grid-column: 1 / -1;
    flex-basis: 100%;
    width: 100%;
    margin-bottom: 1.5em;
}
.hm-archive-lead p {
    margin: 0 0 0.75em;
}
.hm-archive-lead p:last-child {
    margin-bottom: 0;
}
