/* [gatya_list] ショートコード用スタイル。SWELLテーマ側は一切変更していない。 */

.gatya-timeline {
    --gatya-spine-color: #ffd166;
    --gatya-dot-color: linear-gradient(135deg, #ff9a56, #ff6b9d);
    --gatya-card-bg: #ffffff;
    --gatya-card-radius: 14px;
    --gatya-color-select: linear-gradient(135deg, #2f8fdd, #0aa08f);
    --gatya-color-pickup: linear-gradient(135deg, #f2792e, #e8447a);
    --gatya-color-other: linear-gradient(135deg, #8b93a1, #626b7a);

    position: relative;
    max-width: 960px;
    margin: 2.5em auto;
    padding: 0 0 0 28px;
}

.gatya-timeline::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, #ff9a56, #ff6b9d 45%, #4facfe 100%);
}

.gatya-timeline__month {
    position: relative;
    margin-bottom: 2.4em;
}

.gatya-timeline__month:last-child {
    margin-bottom: 0;
}

.gatya-timeline__month-marker {
    position: sticky;
    top: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1em;
}

.gatya-timeline__month-marker::before {
    content: "";
    position: absolute;
    left: -28px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--gatya-dot-color);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gatya-timeline__month-label {
    display: inline-block;
    padding: 0.35em 1em;
    font-weight: 700;
    font-size: 1.05em;
    color: #fff;
    background: linear-gradient(135deg, #ff9a56, #ff6b9d);
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(255, 107, 157, 0.35);
}

/*
 * .gatya-timeline__month-label は h2 化した（SEO対応：見出し構造を持たせるため）。
 * SWELLテーマは投稿本文中の素のh2に対して次の2種類のデフォルト装飾を当てるため、
 * どちらも `.post_content` を含めた高詳細度セレクタで明示的に打ち消す必要がある
 * （SWELL側に確実に勝つため !important は不要）。
 * 1) 紺色帯背景＋上下ボーダー（Style::add_post_style() が生成する
 *    `.post_content h2:where(:not([class^="swell-block-"]):not(.faq_q):not(.p-postList__title))`、
 *    詳細度(0,1,1)。::before側は(0,1,2)）
 * 2) 本文タイポグラフィの `.post_content h2 { font-size: 1.2em; }`（詳細度(0,1,1)）。
 *    これが上の `.gatya-timeline__month-label` 単体（詳細度(0,1,0)）に勝ってしまい、
 *    実測21px相当（記事タイトルh1=24pxに迫る大きさ）になっていたため、
 *    font-size/paddingも明示的に指定し直す。
 */
.post_content h2.gatya-timeline__month-label {
    margin: 0;
    background: linear-gradient(135deg, #ff9a56, #ff6b9d);
    border: none;
    border-radius: 999px;
    font-size: 16px;
    padding: 0.3em 0.9em;
    box-shadow: 0 2px 6px rgba(255, 107, 157, 0.3);
}

.post_content h2.gatya-timeline__month-label::before {
    content: none;
}

/*
 * 月見出しの下に添える軽い説明文。文字色・サイズはSWELLの通常本文デフォルト
 * （.post_content p、実測15px / #333）にそのまま任せる。
 * 見出しとの間隔は少し詰め、カードグリッドとの間隔はSWELL標準の段落下マージン
 * （実測30px）に揃えて、狭すぎないようにする。
 */
.gatya-timeline__month-desc {
    margin: 0.5em 0 30px;
}

.gatya-timeline__cards {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.gatya-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 190px;
    background: var(--gatya-card-bg);
    border-radius: var(--gatya-card-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gatya-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.14);
}

.gatya-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: contain;
    background: #f4f6f8;
    display: block;
}

.gatya-card__thumb--placeholder {
    background: linear-gradient(135deg, #eef1f5, #e2e6ec);
}

.gatya-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
    padding: 0.65em 0.8em 0.9em;
    flex: 1;
    min-width: 0;
}

.gatya-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.75em;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    border-radius: 999px;
    background: var(--gatya-color-other);
}

.gatya-card--select .gatya-card__badge {
    background: var(--gatya-color-select);
}

.gatya-card--pickup .gatya-card__badge {
    background: var(--gatya-color-pickup);
}

.gatya-card__title {
    font-size: 0.92em;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

@media (max-width: 640px) {
    .gatya-timeline {
        padding-left: 22px;
    }

    .gatya-timeline__month-marker::before {
        left: -22px;
    }

    .gatya-card {
        width: 100%;
        min-height: 85px;
        flex-direction: row;
        align-items: stretch;
    }

    .gatya-card__thumb {
        width: 150px;
        aspect-ratio: 16 / 9;
        height: auto;
        flex-shrink: 0;
        object-fit: contain;
        background: #f4f6f8;
        border-radius: var(--gatya-card-radius) 0 0 var(--gatya-card-radius);
    }

    .gatya-card__body {
        padding: 0.55em 0.75em;
        gap: 0.3em;
        justify-content: center;
        min-width: 0;
        overflow: hidden;
    }

    .gatya-card__badge {
        padding: 0.18em 0.6em;
        font-size: 0.68em;
    }

    .gatya-card__title {
        font-size: 0.82em;
        line-height: 1.35;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
        overflow: hidden !important;
        text-overflow: ellipsis;
    }
}
