/*
 Theme Name: Astra Child
 Template: astra
 Description: Astra Child Theme
 Version: 1.0.0
 Text Domain: astra-child
*/

/* --- 吹き出しセクション全体 --- */
.gamecocktail-dialogue-section {
    margin: 40px auto; /* 上下40px、左右中央寄せ */
    padding: 10px 0;
    max-width: 800px; /* 会話セクション全体の最大幅 */
    /* display: flex; flex-direction: column; gap: 24px; align-items: center; は
       各 .dialogue-line が独立して中央寄せされるため、ここでは不要です。
       もし全体の会話ブロックを中央寄せしたい場合は必要ですが、
       各 .dialogue-line に margin: auto を使う方が一般的です。 */
}

/* --- 各セリフ行（左・右共通） --- */
.dialogue-line {
    display: flex;
    align-items: flex-start; /* アイコンとバブルの上端を揃える */
    gap: 12px; /* アイコンとバブルの間隔 */
    width: 100%; /* 親要素 (gamecocktail-dialogue-section) の幅に合わせる */
    max-width: 700px; /* ★重要★ 各会話行の最大表示幅。これを基準に左右を揃えます */
    margin: 0 auto 24px auto; /* ★重要★ 各会話行を中央寄せし、下部に間隔を設ける */
}

/* 左セリフ（アイコン左、バブル右） */
.dialogue-line.left {
    flex-direction: row;
    justify-content: flex-start;
}

/* 右セリフ（アイコン右、バブル左） */
.dialogue-line.right {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

/* --- アイコン共通 --- */
.character-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    overflow: hidden; /* 画像がはみ出すのを防ぐ */
    flex-shrink: 0; /* アイコンが縮まないようにする */
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    border: 1px solid #ddd; /* 枠線を追加 (任意) */
}

/* アイコン画像自体 */
.character-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像がコンテナに収まるようにトリミング */
    border-radius: 50%; /* 画像自体も丸くする */
}

/* テキストアイコン（画像なし） */
.character-icon.text-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.8em; /* 84px に合わせて調整 */
    background-color: #ccc;
    color: #fff;
    line-height: 1; /* テキストの垂直中央揃えを助ける */
}

/* --- 吹き出しバブル --- */
.bubble-text {
    background-color: #fff3c4; /* バブルのデフォルト色 (元の黄色) */
    border: 1px solid #e6d88e;
    border-radius: 12px;
    padding: 16px;
    font-size: 1em;
    line-height: 1.6;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-grow: 1; /* ★重要★ 残りのスペースを埋めるように広がる */
    flex-basis: calc(100% - 84px - 12px); /* ★重要★ アイコンとギャップを除いた基準幅 */
    max-width: calc(100% - 84px - 12px); /* ★重要★ 吹き出しの最大幅を厳密に指定 */
    word-break: break-word; /* 長い単語でも改行されるように */
    /* position: relative; はしっぽがないので不要だが、もし将来的に何かpositionを使う可能性があれば残しても良い */
}

/* 吹き出しのしっぽ（三角形）を完全に削除する */
.bubble-text::before,
.bubble-text::after { /*念のため::afterも追加*/
    content: none !important; /* 強制的に非表示 */
}

/* ショートコード内のstrongタグのスタイリング */
.bubble-text strong {
    white-space: nowrap; /* 発言者名を改行させない */
    margin-right: 5px; /* 名前とテキストの間隔 */
}

/* --- モバイル対応 --- */
@media (max-width: 768px) {
    .dialogue-line {
        flex-direction: column !important;
        align-items: flex-start !important; /* デフォルトは左寄せにする */
        width: 100%;
        max-width: 95%;
        gap: 8px;
        padding: 0;
    }

    .dialogue-line.right {
        align-items: flex-end !important; /* 右キャラは右寄せにする */
    }

    .character-icon {
        width: 72px;
        height: 72px;
    }

    .character-icon.text-icon {
        font-size: 1.5em;
        line-height: 72px;
    }

    .bubble-text {
        width: auto;
        flex-basis: auto;
        max-width: 100%;
        padding: 12px 14px;
        font-size: 0.95rem;
    }
}

/* ==== Cocktail Search Form Styles ==== */
.cocktail-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.cocktail-search-form input[type="text"],
.cocktail-search-form select {
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    min-width: 160px;
    max-width: 220px;
    flex: 1 1 200px;
    background: #fff;
}

.cocktail-search-form button {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: #444;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cocktail-search-form button:hover {
    background-color: #222;
}

@media (max-width: 768px) {
    .cocktail-search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .cocktail-search-form input[type="text"],
    .cocktail-search-form select {
        width: 100%;
        max-width: 100%;
    }

    .cocktail-search-form button {
        width: 100%;
    }
}
