/* ==========================================================================
   TOP PAGE: HERO NAVIGATION (Dual Gate)
   ========================================================================== */

.top-hero {
    display: flex;
    width: 100%;
    height: 75vh; 
    min-height: 550px;
    background: #000;
    overflow: hidden;
    position: relative;
    /* 下部を少し斜めにカットして格ゲー感を演出 */
    clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
}

.hero-gate {
    flex: 1;
    position: relative;
    text-decoration: none;
    transition: flex 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 左側：BEGINNER */
.gate-beginner {
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
    margin-right: -10%; 
    z-index: 2;
    background-image: url('/assets/img/top/beginner.jpg');
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

/* 右側：CHARACTERS */
.gate-expert {
    z-index: 1;
    background-image: url('/assets/img/top/experienced.jpg');
}

.hero-gate:hover {
    flex: 1.4;
    z-index: 3;
    filter: brightness(1.15);
}

/* --- ヒーローエリアのボックス調整 --- */
.gate-frame-outer {
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 8px;
    transition: transform 0.4s ease;
    width: 90%; /* 幅を少し広げて横方向の余裕を持たせる */
    max-width: 480px;
}

.gate-frame-inner {
    border: 2px solid #fff;
    /* height: 180px; ← これを削除！ */
    min-height: 160px; /* 最低限の高さは維持 */
    padding: 30px 20px; /* 上下に余裕を持たせて文字を包む */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.hero-gate:hover .gate-frame-outer {
    transform: scale(1.05);
}

/* タイトルのフォントサイズを微調整（はみ出し防止） */
.gate-title {
    font-size: clamp(1.6rem, 4vw, 2.8rem); /* 最小値を少し下げて安全策 */
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-style: italic;
    text-decoration: underline;
    text-underline-offset: 8px;
    text-decoration-thickness: 3px;
    white-space: normal; /* 折り返しを許可してはみ出しを防ぐ */
    text-align: center;
}

.gate-subtitle {
    font-size: 0.9rem;
    color: #fff;
    margin-top: 20px;
    letter-spacing: 1px;
    font-weight: 700;
    font-style: italic;
}

/* ============================================================
   GENERIC SECTION HEADER
   ============================================================ */
.section-header {
    text-align: center;
    /* 25pxから10pxへ：タイトルと記事の隙間をほぼ無くす */
    margin-bottom: 10px; 
}

.section-title {
    display: inline-block;
    font-size: 2.8rem; 
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-bottom: 4px solid #8e2de2;
    padding-bottom: 2px; /* 下線との距離も極小に */
    line-height: 1;
}

/* ============================================================
   LATEST UPDATES SECTION (さらにタイトに + 背景のみ拡張)
   ============================================================ */
.top-news {
    max-width: 1200px;
    margin: 40px auto; 
    padding: 0 20px;
    /* 背景を背後に回すための設定 */
    position: relative;
}

/* ▽ 追加：ここが「背景だけ」を横いっぱいに広げる指定 ▽ */
.top-news::before {
    content: '';
    position: absolute;
    top: -40px; /* marginの40px分をカバー */
    left: 50%;
    transform: translateX(-50%);
    width: 100vw; /* 画面横幅いっぱい */
    height: calc(100% + 100px); /* 上下のマージン分を含めて背景を塗る */
    background: linear-gradient(
        to bottom,
        transparent 0%,
        #000 15%,
        #000 85%,
        transparent 100%
    );
    z-index: -1; /* コンテンツの裏側に配置 */
}
/* △ 追加ここまで △ */

/* --- グリッド部分の余白リセット --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 0 auto !important;
    padding: 0 !important;
    position: relative; /* z-indexを有効にするため */
    z-index: 1;
}

/* --- ボタンエリアを限界まで引き上げる --- */
.top-news-footer {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px !important; 
    padding: 0 !important;
    position: relative;
    z-index: 1;
}

.btn-more {
    color: #aaa;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.btn-more:hover {
    color: #fff;
    border-color: #8e2de2;
    text-shadow: 0 0 10px #8e2de2;
}

/* ==========================================================================
   RESPONSIVE (Smartphone)
   ========================================================================== */

@media screen and (max-width: 768px) {
    .top-hero {
        flex-direction: column;
        height: 80vh;
        clip-path: none;
    }

    .hero-gate {
        width: 100%;
        height: 50%;
        flex: none !important;
        margin: 0 !important;
    }

    .gate-beginner {
        clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
        border-right: none;
        border-bottom: 2px solid #fff;
    }

    .gate-expert {
        margin-top: -12%; 
    }

    .gate-frame-inner {
        height: 130px;
    }

    .gate-title {
        font-size: 1.8rem;
        text-underline-offset: 6px;
    }

    .section-title {
        font-size: 1.8rem; /* スマホではタイトルサイズを抑える */
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr); /* スマホは2列 */
    }
}

@media screen and (max-width: 480px) {
    .news-grid {
        grid-template-columns: 1fr; /* 極小画面は1列 */
    }
    .top-news-footer {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}

/* ==========================================================================
   MOBILE OPTIMIZATION (768px以下)
   LATEST NEWS / COLUMNS / SYSTEM GUIDE スライダー調整版
   ========================================================================== */

@media screen and (max-width: 768px) {

    /* 1. 親コンテナ：横スクロールの有効化と中央寄せのための余白設定 */
    .news-grid, 
    .column-grid, 
    .guide-grid {
        display: flex !important;
        overflow-x: auto !important;
        /* スナップさせてスライダー感を出す */
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        gap: 15px !important;
        
        /* 左右に15%のパディングを設けることで、
           幅70%のカードが初期状態で画面中央に配置されるようになります 
        */
        padding: 10px 15% 30px !important; 
        
        /* 既存のグリッド設定を打ち消し */
        grid-template-columns: none !important;
    }

    /* 2. 各カード：幅を70%に固定し、中央でスナップするように設定 */
    .news-card, 
    .column-card, 
    .guide-card {
        /* 画面幅の70%に設定 */
        flex: 0 0 70% !important;
        width: 70% !important;
        
        /* スクロールした時に画面中央でピタッと止まる */
        scroll-snap-align: center !important;
        
        margin-bottom: 0 !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* 3. SYSTEM GUIDE 特有の調整（縦長防止） */
    .guide-card {
        padding: 20px !important;
    }
    .guide-desc {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;

        /* 標準プロパティを併記（これで警告が消えることが多い） */
        line-clamp: 3; 
    }

    /* 4. カスタムスクロールバー：細くスタイリッシュに */
    .news-grid::-webkit-scrollbar, 
    .column-grid::-webkit-scrollbar, 
    .guide-grid::-webkit-scrollbar {
        height: 3px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        display: block !important;
    }

    .news-grid::-webkit-scrollbar-thumb, 
    .column-grid::-webkit-scrollbar-thumb, 
    .guide-grid::-webkit-scrollbar-thumb {
        background: var(--accent-purple, #bd00ff) !important;
        border-radius: 10px !important;
    }

    /* 5. その他SP用微調整（干渉防止） */
    .section-header {
        padding: 0 20px;
    }
}

/* NEWSとCOLUMNSのセクションに、SYSTEM GUIDEと同じ余白を強制する */
.top-news, .top-columns {
    width: 100%;
    max-width: 1200px; /* サイトの最大幅に合わせる */
    margin-left: auto;
    margin-right: auto;
    padding-left: 5%;  /* ★画面端から5%の余白を作る */
    padding-right: 5%; /* ★画面端から5%の余白を作る */
    box-sizing: border-box; /* パディングを幅に含める */
}

/* ついでにタイトル周りも少し内側に寄せたい場合 */
.section-header {
    /* もしタイトルだけ端に寄ってしまうなら、ここにも少しpaddingを入れると綺麗です */
    padding: 0 10px; 
}

/* COLUMNSセクション全体の余白を強制 */
.top-columns {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important; /* 中央寄せ */
    padding-left: 5% !important;
    padding-right: 5% !important;
    box-sizing: border-box !important;
}

/* もし中のグリッド自体がズレている場合の保険 */
#js-top-column-grid {
    width: 100% !important;
    margin: 0 !important;
}

/* ============================================================
   CHARACTERS SECTION (GRID & SELECTION) - 最終修正
   ============================================================ */

.chara-grid {
    display: grid;
    /* 11枚なら 100/11 = 9.09% なので、それより小さい値を指定して強制的に重ねる */
    grid-template-columns: repeat(11, 8.2%); 
    
    justify-content: center; /* 重なった全体を中央寄せ */
    column-gap: 0; 
    row-gap: 15px; 
    max-width: 1300px;
    margin: 0 auto;
    padding: 0px 30px;
}

/* ★これがあの「青い文字」の正体です。完全に非表示にします */
.chara-bg-text {
    display: none !important;
}

/* 個別キャラクターカード */
.chara-card {
    position: relative;
    display: block;
    width: 110%; /* グリッドの枠（8.2%）より少し大きくして隣と重ならせる */
    margin-left: -5%; /* 左側に少し食い込ませる */
    
    aspect-ratio: 10 / 19;
    background: #080808;
    text-decoration: none;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 平行四辺形の切り抜き */
    clip-path: polygon(20% 0, 100% 0, 80% 100%, 0% 100%);
    
    /* 枠外にはみ出ているものを物理的にカット */
    overflow: hidden; 
    border: none; 
}

/* 自作の枠線 (通常時) */
.chara-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.2); /* 灰色の枠線 */
    clip-path: polygon(20% 0, 100% 0, 80% 100%, 0% 100%);
    z-index: 5;
    pointer-events: none;
    transition: all 0.3s;
}

/* ホバー時の枠線変化 */
.chara-card:hover::before {
    border: 2px solid #ff8800; /* オレンジ枠 */
    background: rgba(255, 136, 0, 0.1);
    box-shadow: inset 0 0 15px rgba(255, 136, 0, 0.5);
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
}

.chara-card:hover {
    z-index: 10;
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
    transform: scale(1.15) translateY(-5px);
}

/* --- カード内部の要素 --- */

.chara-img-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2;
}

.chara-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

/* ============================================================
   ★名前演出：ステップ3（1文字目を起点にする「左揃え」設定）
   ============================================================ */

.chara-name-v {
    position: absolute;
    /* ★座標の基準を「カードの左から50%」「下から10%」の「点」にする */
    bottom: 15%; 
    left: 50%;
    
    writing-mode: horizontal-tb;
    white-space: nowrap;
    
    font-size: 0.9rem;
    font-weight: 900;
    color: #fff;
    font-family: 'Anton', sans-serif;
    text-shadow: 2px 2px 5px rgba(0,0,0,1);
    
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;

    /* ★ここが最重要：回転の軸を「文字の左端（1文字目）」に設定 */
    transform-origin: left center;

    /* ★ rotate(-90deg) だけを行う。
       translateX(-50%) を消したので、1文字目が left:50% の位置に固定されます */
    transform: rotate(-90deg) skewY(3deg);
}

/* ホバーで表示 */
.chara-card:hover .chara-name-v {
    opacity: 1;
}

/* --- ここから追記：位置と角度の最終調整 --- */

.chara-name-v {
    /* 1. 位置を右下に持っていく（％で調整） */
    /* 50%から数値を増やすほど右へ、減らすほど下へ動きます */
    left: 80% !important; 
    bottom: -5% !important;

    /* 2. 1文字目を固定して、算出した3度で傾ける */
    transform-origin: left center;
    transform: rotate(-90deg) skewY(3deg);
}

/* ホバー時の動き（もしスッと出したい場合） */
.chara-card:hover .chara-name-v {
    /* 角度を維持したまま、少しだけ左（上）に浮かせる演出 */
    transform: rotate(-90deg) skewY(3deg) translate(5px, 0);
}

:root {
    /* ここでヘッダーの高さを定義（現状 77px ＋ 境界線などで 80px くらい？） */
    --header-height: 77px; 
}

/* 左上固定ボタン：最新の調整版 */
.news-fixed-btn {
    position: fixed;
    top: var(--header-height);
    left: -20px;    /* ボタンのベース位置 */
    z-index: 1000;
    
    display: flex;
    align-items: center;

    /* 文字を右に寄せるためのパディング */
    padding: 12px 45px 12px 65px; 

    background: linear-gradient(90deg, #ff4400, #ff8800);
    color: #fff;
    text-decoration: none;
    font-family: 'Anton', sans-serif;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.15em;

    /* DOA風の平行四辺形カット */
    clip-path: polygon(0 0, 90% 0, 100% 100%, 0% 100%);
    
    /* 初期状態の隠れ具合 */
    transform: translateX(-35px); 
    /* transition に opacity を含めてフェードに対応 */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
    border-right: 2px solid #fff;
    
    opacity: 1;
    visibility: visible;
}


/* ホバー時の挙動 */
.news-fixed-btn:hover {
    transform: translateX(10px); 
    padding-right: 55px;
    filter: brightness(1.1);
}

/* ★JSから付与されるフェードアウト用クラス */
.news-fixed-btn.is-hidden {
    opacity: 0;
    visibility: hidden;
    /* 消える時にさらに左へ引っ込める演出 */
    transform: translateX(-80px); 
    pointer-events: none;
}

.news-fixed-btn .btn-text {
    position: relative;
    display: inline-block;
}

/* 画面が狭いスマホなどは邪魔になるので非表示にするか調整 */
@media (max-width: 768px) {
    .news-fixed-btn {
        display: none;
    }
}

/* ============================================================
   QUICK LINKS SECTION (Final Balance Edition)
   ============================================================ */

.top-quick-links {
    position: relative;
    z-index: 1;
    margin-top: -30px; 
    padding: 20px 0 100px;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0) 80%,
        transparent 100%
    );
    border: none !important;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px; 
    padding: 0 40px; 
    max-width: 1400px;
    margin: 30px auto 0;
    background: transparent;
    
}

/* --- カード本体 --- */
.quick-card {
    position: relative;
    height: 220px;
    background: #111; /* 画像読み込み前の下地 */
    overflow: hidden;
    text-decoration: none;
    clip-path: polygon(15% 0, 100% 0, 85% 100%, 0% 100%);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
}

/* --- 画像コンテナとimgの制御 --- */
.card-img {
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* 【明るさ調整】0.7 → 0.9 に変更。ほぼそのままの明るさで見せます */
    filter: brightness(0.9) contrast(1.05); 
    transition: filter 0.4s ease;
}

/* --- ホバー演出：カード全体と画像 --- */
.quick-card:hover {
    transform: translateY(-8px);
    border-color: #ff8800;
    z-index: 10;
    box-shadow: 0 15px 30px rgba(255, 136, 0, 0.3);
}

/* --- ホバー演出 --- */
.quick-card:hover .card-img {
    transform: scale(1.08); /* ズームを少し抑えて上品に */
}

.quick-card:hover .card-img img {
    filter: brightness(1.0) contrast(1.1); /* ホバー時は100%の明るさに */
}

/* --- オーバーレイ（グラデーションの調整） --- */
.quick-overlay {
    position: absolute;
    inset: 0;
    /* 【重要】グラデーションの開始を 40% → 60% に下げました。
       これにより、画像の上半分は本来の明るさでクッキリ見えます。 */
    background: linear-gradient(180deg, 
        rgba(0,0,0,0) 60%, 
        rgba(0,0,0,0.8) 100%
    );
    z-index: 2;
    transition: opacity 0.3s;
}

.quick-card:hover .quick-overlay {
    background: linear-gradient(135deg, rgba(255, 136, 0, 0.2) 0%, rgba(0, 0, 0, 0.7) 100%);
}

/* --- テキスト配置 --- */
.quick-content {
    position: absolute;
    bottom: 25px;
    left: 35px;
    z-index: 5;
}

/* --- テキスト：さらに浮き立たせる --- */
.quick-en {
    display: block;
    font-family: 'Anton', sans-serif;
    font-size: 1.8rem;
    color: #ffffff;
    line-height: 1.1;
    font-style: italic;
    text-transform: uppercase;
    /* 影を「ぼかしの強い黒」と「パキッとした黒」の2重にして、
       背後が明るくても読めるように強化しました */
    text-shadow: 
        0 0 10px rgba(0,0,0,1), 
        2px 2px 4px rgba(0,0,0,0.9);
}

.quick-jp {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: #ff8800;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* ============================================================
   SITEMAP MODAL (Fade & Slide-up Version)
   ============================================================ */

/* モーダル全体のコンテナ：初期状態は透明 */
#js-sitemap-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* アニメーション設定 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* クラス「is-active」がついた時にふわっと表示 */
#js-sitemap-modal.is-active {
    opacity: 1;
    visibility: visible;
}

/* 背景：少しぼかしを入れる */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

/* モーダルの中身：少し下から浮き上がる演出 */
.modal-content {
    position: relative;
    background: #0a0a0a; /* #をしっかり入れています */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 60px 40px;
    width: 90%;
    max-width: 900px;
    z-index: 10001;
    
    /* アニメーション：20px下から元の位置へ */
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

/* アクティブ時の中身の動き */
#js-sitemap-modal.is-active .modal-content {
    transform: translateY(0);
}

/* 閉じるボタン */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #bc00ff; /* ホバー時にテーマカラーに光らせる */
}

/* モバイル対応 */
@media (max-width: 1024px) {
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .quick-card {
        height: 150px;
        clip-path: polygon(8% 0, 100% 0, 92% 100%, 0% 100%);
    }
    .quick-content { left: 25px; }
    .quick-en { font-size: 1.4rem; }
}

/* ============================================================
   SYSTEM GUIDE (透過グラデーション・フェード版)
   ============================================================ */

.top-system-guide {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 50px 20px 100px;
    margin: 0; /* 前後のセクションと密着させてグラデーションで繋ぐ */
    
    /* 背景：上下を透過(transparent)させ、中央を黒(#000)にするグラデーション */
    background: linear-gradient(
        to bottom,
        transparent 0%,
        #000 15%,
        #000 85%,
        transparent 100%
    );
    
    /* 区切り線（ボーダー）も透過グラデーションにするとより綺麗です */
    border: none;
}

/* セクションタイトルの中央寄せ */
.top-system-guide .section-header {
    text-align: center;
    /* ここを 0px から 60px 程度に変更 */
    margin-bottom: 30px; 
}

/* グリッド配置の中央寄せ */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* カードの中央寄せ（ご指定通りヘッドライン含め全てセンター） */
.guide-card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 50px 30px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center; /* 垂直方向中央 */
    text-align: center;  /* テキスト中央 */
    transition: transform 0.3s ease, background 0.3s ease;
}

/* ホバー：シンプルな浮き上がり */
.guide-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.07);
    border-color: #bc00ff;
}

/* ヘッドラインの完全中央配置 */
.guide-headline {
    width: 100%;
    text-align: center;
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 20px;
    font-weight: 800;
}

/* その他共通スタイル */
.guide-label {
    color: #bc00ff;
    font-family: 'Anton', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    margin-bottom: 15px;
}

.guide-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
}

/* 左下のアクセント（共通デザイン） */
.guide-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid #bc00ff;
    border-left: 2px solid #bc00ff;
}

/* ============================================================
   TOP PAGE - COLUMNS SECTION (Sync with Column Index)
   ============================================================ */

/* 1. セクション全体のレイアウト（中央寄せ） */
.top-columns {
    max-width: 1200px;
    margin: 0px auto 0;
    padding: 0 20px;
}

/* 2. グリッドシステム（巨大化防止 & 4列固定） */
.top-columns .column-grid {
    display: grid;
    /* 1つしか記事がなくても、1/4の幅(約300px)に固定する */
    grid-template-columns: repeat(4, 1fr); 
    justify-content: center;
    gap: 24px;
    padding: 30px 0;
}

/* 3. カード本体のデザイン（一覧ページと同一化） */
.top-columns .column-card {
    width: 100%;
    max-width: 300px; /* 巨大化防止の防波堤 */
    background: rgba(15, 15, 15, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: 0.3s ease;
    margin: 0 auto; /* 記事が少ない時も中央に配置 */
}

.top-columns .column-card:hover {
    border-color: #ff00ff;
    box-shadow: 0 10px 30px rgba(255, 0, 255, 0.2);
}

/* 4. アイキャッチ画像の固定（16:9） */
.top-columns .card-eyecatch {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1a1a1a; /* 画像がない時の下地 */
}

.top-columns .card-eyecatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 5. 文字エリア（高さを一定に保ち、2行でカット） */
.top-columns .card-content {
    padding: 15px 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100px; /* カード全体の高さを揃える */
}

.top-columns .card-date {
    display: block;
    font-size: 0.95rem; 
    color: #ff00ff; 
    margin-bottom: 8px;
    font-weight: 900;
    border-bottom: 1px solid rgba(255, 0, 255, 0.3);
    padding-bottom: 4px;
}

.top-columns .card-title {
    /* --- 1. 基本スタイル --- */
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.4; /* 少しだけ広げて視認性確保 */
    color: #fff;
    margin-bottom: 5px; /* 下の余白をさらに圧縮 */

    /* --- 2. 行数制限（3種の神器） --- */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* ここを2に固定 */
    
    /* 標準プロパティも併記（エディタのエラー対策） */
    line-clamp: 2; 
    
    /* --- 3. 溢れ出し防止 --- */
    overflow: hidden;

    /* --- 4. 縦幅の「防波堤」（これで長くなっても膨らまない） --- */
    height: 2.8em; /* line-height(1.4) × 2行分 */
}

.top-columns .card-author {
    margin-top: auto;
    font-size: 0.75rem;
    color: #666;
    text-align: right;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

/* コラムセクションのタイトルとカードの間の隙間を調整 */
.top-columns .section-header {
    text-align: center;
    margin-bottom: 0px; /* ここを 0 から 60px 程度に変更 */
}

/* 6. レスポンシブ */
@media (max-width: 1024px) {
    .top-columns .column-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .top-columns .column-grid { grid-template-columns: 1fr; }
}