/* 栄光の歴史ページ専用スタイル */

#glorious_page {
    padding-bottom: 80px;
}

.glorious_wrap {
    width: 80%;
    max-width: 1030px; /* 表のボーダー分を含めても初期状態で横スクロールが出ないように少し余裕を持たせる */
    margin: 0 auto;
    overflow: hidden;
}

.glorious_page_title {
    font-size: 36px;
    margin: 40px 0 60px;
    text-align: center;
    font-family: '游明朝 Medium', serif;
    color: #006600;
    /* テーマカラーに合わせて緑系に調整 */
    position: relative;
    padding-bottom: 15px;
}

.glorious_page_title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #006600;
}

.glorious_content {
    line-height: 1.8;
    color: #333;
}

/* 表のタイトル（表の直前にある要素）を強調 */
.glorious_content > *:has(+ .glorious_table_scroll_box) {
    font-size: 20px; /* 文字サイズアップ */
    font-weight: bold;
    color: #006600; /* テーマカラーに合わせて緑系に */
    margin-bottom: 12px;
}

.glorious_table_scroll_box {
    overflow-x: auto; /* 各テーブルごとに横スクロールを許可 */
    margin-bottom: 50px; /* 各表の下部の余白を少し広げる */
}

/* テーブルのスタイル調整（ベース設定） */
.glorious_content table {
    border-collapse: collapse;
    margin-bottom: 0; /* 親の glorious_table_scroll_box で余白をとるため 0 に */
    border: 1px solid #ddd;
    table-layout: fixed;
    margin-left: 0;
    margin-right: auto; /* 左側の位置を揃える */
}

.glorious_content th,
.glorious_content td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: center;
    vertical-align: middle;
    word-break: break-all;
}

.glorious_content th {
    background-color: #f4f4f4;
    font-weight: bold;
}

/* 強調表示（strongタグ）のスタイル */
.glorious_content td strong,
.glorious_content th strong {
    color: #d00000;
    font-weight: bold;
}

/* =======================================
   8列構成の表 (開催年, 大会名, 成績, 先鋒〜大将)
   ======================================= */
.glorious_content table:has(tr > *:nth-child(8)) {
    width: 1010px !important; /* 各列を狭めた分、表全体を縮小 */
}
.glorious_content table:has(tr > *:nth-child(8)) th:nth-child(1),
.glorious_content table:has(tr > *:nth-child(8)) td:nth-child(1) {
    width: 80px; 
}
.glorious_content table:has(tr > *:nth-child(8)) th:nth-child(2),
.glorious_content table:has(tr > *:nth-child(8)) td:nth-child(2) {
    width: 140px; /* 大会名: さらに1文字分（約20px）狭く */
    text-align: left;
}
.glorious_content table:has(tr > *:nth-child(8)) th:nth-child(3),
.glorious_content table:has(tr > *:nth-child(8)) td:nth-child(3) {
    width: 140px; /* 成績: そのまま */
}
.glorious_content table:has(tr > *:nth-child(8)) th:nth-last-child(-n+5),
.glorious_content table:has(tr > *:nth-child(8)) td:nth-last-child(-n+5) {
    width: 130px; /* メンバー5名分: 1文字分（約20px）狭く */
}

/* =======================================
   7列構成の表 (開催年, 成績, 先鋒〜大将)
   ======================================= */
.glorious_content table:has(tr > *:nth-child(7)):not(:has(tr > *:nth-child(8))) {
    width: 980px !important; /* 2列目を狭めた分、表全体を縮小 */
}
.glorious_content table:has(tr > *:nth-child(7)):not(:has(tr > *:nth-child(8))) th:nth-child(1),
.glorious_content table:has(tr > *:nth-child(7)):not(:has(tr > *:nth-child(8))) td:nth-child(1) {
    width: 80px; 
}
.glorious_content table:has(tr > *:nth-child(7)):not(:has(tr > *:nth-child(8))) th:nth-child(2),
.glorious_content table:has(tr > *:nth-child(7)):not(:has(tr > *:nth-child(8))) td:nth-child(2) {
    width: 150px; /* 2列目(成績): さらに1文字分（約20px）狭く */
}
.glorious_content table:has(tr > *:nth-child(7)):not(:has(tr > *:nth-child(8))) th:nth-last-child(-n+5),
.glorious_content table:has(tr > *:nth-child(7)):not(:has(tr > *:nth-child(8))) td:nth-last-child(-n+5) {
    width: 150px; /* メンバー5名分: 3文字分（約50px）広げる */
}

/* =======================================
   3列構成の表 (開催年, 成績, 名前 など)
   ======================================= */
.glorious_content table:not(:has(tr > *:nth-child(4))) {
    width: 360px !important; /* 全体の幅を前回の半分程度(60%→360px想定)に狭める */
}
.glorious_content table:not(:has(tr > *:nth-child(4))) th:nth-child(1),
.glorious_content table:not(:has(tr > *:nth-child(4))) td:nth-child(1) {
    width: 80px; /* 1列目: 狭め */
}
.glorious_content table:not(:has(tr > *:nth-child(4))) th:nth-child(2),
.glorious_content table:not(:has(tr > *:nth-child(4))) td:nth-child(2) {
    width: 100px; /* 2列目: 狭め */
}
.glorious_content table:not(:has(tr > *:nth-child(4))) th:nth-child(3),
.glorious_content table:not(:has(tr > *:nth-child(4))) td:nth-child(3) {
    width: 180px; /* 3列目: 名前が入るので少し広め */
}


/* レスポンシブ対応 */
@media screen and (max-width: 1024px) {
    .glorious_wrap {
        width: 95%;
        /* 少し広げる */
    }

    .glorious_content table {
        /* 横スクロール対応のため幅100%指定や自動レイアウトを解除 */
    }
}

@media screen and (max-width: 768px) {
    .glorious_wrap {
        width: 95%;
    }

    .glorious_page_title {
        font-size: 28px;
        margin: 30px 0 40px;
    }

    .glorious_content th,
    .glorious_content td {
        padding: 10px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .glorious_page_title {
        font-size: 24px;
    }

    /* モバイルでも横スクロールを維持 */
    .glorious_content {
        overflow-x: auto;
    }
}
