/* --- Google Fontsのフォント指定 --- */
:root {
    --font-serif: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif; /* 太めの明朝体 */
    --font-brush: 'Yuji Syuku', 'HGKyokashotai', 'Yu Kyokasho', serif; /* 毛筆体 */
    --color-gold: #b69b68; /* 金色のアクセント */
    --color-text: #2c2c2c; /* 濃い墨色 */
}

/* --- グローバル設定 --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-serif);
    background-color: #ffffff; /* 背景は白 */
    color: var(--color-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    /* 縦書き要素を中央に配置するためのFlex設定 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden; /* 横スクロールバーを防止 */
}

/* --- ヘッダー（サイトタイトル） --- */
header {
    width: 100%;
    text-align: center;
    padding: 2.5rem 1rem;
    position: relative; /* 罫線のための基準点 */
}

h1 {
    font-family: var(--font-brush); /* 毛筆体を適用 */
    font-weight: normal;
    font-size: 2.5rem;
    line-height: 1.4;
    color: var(--color-text);
    margin: 0;
}

/* ヘッダーの金色の線 */
h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: var(--color-gold);
    margin: 0.75rem auto 0; /* タイトルの下に配置 */
}

.subtitle {
    font-family: sans-serif; /* サブタイトルはゴシック系に */
    font-size: 0.8rem;
    color: #777;
    letter-spacing: 1px;
    margin-top: 0.25rem;
    text-transform: uppercase;
}

/* --- メイン（名言ボックス） --- */
main {
    flex: 1; /* ヘッダー以外の領域をすべて使う */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    width: 100%;
}

.quote-box {
    /* ▼ 縦書きの指定 ▼ */
    writing-mode: vertical-rl; /* 右から左への縦書き */
    
    background-color: #fff;
    border-right: 2px solid var(--color-gold); /* 右端（縦書きの始点）に金の線 */
    border-left: 1px solid #eee; /* 左端（縦書きの終点）に薄い線 */
    padding: 2.5rem 2rem;
    
    /* 縦書きのため、heightで高さを制御 */
    height: 50vh; /* 画面の高さの半分を基準 */
    min-height: 380px; /* 最低でもこの高さを確保 */
    max-height: 500px;
    
    width: 90vw; /* 画面幅の90% */
    max-width: 600px; /* PCでの最大幅 */

    display: flex;
    flex-direction: column; /* 縦書きコンテナ内の要素を上から下へ配置 */
    justify-content: flex-start;
    align-items: center;

    /* 影は控えめに */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

/* 名言テキスト */
#quote-text {
    font-family: var(--font-serif);
    font-weight: 700; /* 太めの明朝体 */
    font-size: 1.7rem;
    line-height: 1.8; /* 縦書きの「行間」 */
    letter-spacing: 0.1em; /* 縦書きの「文字間」 */
    color: #222;
    margin: 0;
    
    /* 縦書きのテキストの高さを制御 */
    max-height: 100%;
    flex: 1; /* ボックス内で可能な限り高さを取る */
    overflow: hidden; /* ボックスからはみ出た場合は隠す */
    text-align: right; /* 縦書きでの上揃え */
}

/* 作者 */
#quote-author {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--color-text);
    margin-top: 1.5rem; /* 縦書きでの上方向（名言本文との間）のマージン */
    padding-top: 1.5rem; /* 線とのスペース */
    border-top: 1px solid #ddd; /* 本文と作者の間に薄い境界線 */
    height: auto; /* 作者名の領域を確保 */
    text-align: right; /* 縦書きでの上揃え */
}

#quote-author::before {
    content: "— "; /* ハイフンはそのまま使用 */
}


#quote-text {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.8;
    letter-spacing: 0.1em;
    color: #222;
    margin: 0;
    max-height: 100%;
    flex: 1;
    overflow: hidden;
    text-align: right;
    
    white-space: pre; /* ▼ この1行を追加 ▼ */
}


/* * --------------------------------
 * ▼ レスポンシブ対応 (スマホ向け)
 * --------------------------------
 */

@media (max-width: 600px) {
    h1 {
        font-size: 2rem; /* スマホでは少し小さく */
    }

    .quote-box {
        height: 60vh; /* スマホでは高さを少し多めに確保 */
        min-height: 350px;
        padding: 2rem 1.5rem; /* 余白を調整 */
    }

    #quote-text {
        font-size: 1.3rem; /* 文字サイズを調整 */
        line-height: 1.9;
        letter-spacing: 0.05em;
    }

    #quote-author {
        font-size: 1.0rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }

#quote-text {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.8;
    letter-spacing: 0.1em;
    color: #222;
    margin: 0;
    max-height: 100%;
    flex: 1;
    overflow: hidden;
    text-align: right;
    
    white-space: pre; /* ▼ この1行を追加 ▼ */
}

}