@charset "utf-8";

/* ==========================================================================
   gallery.css
   - CM Gallery Modern Stylesheet
   - mainタグの統一化（#gallery廃止）および二重余白・重複記述の解消
   ========================================================================== */

/* Main Base Layout */
.p-gallery-container {
    width: 100%;
    /* sub-header.css の padding-bottom: 40px 等と合わせて全体のバランスを調整。
       上部マージンの二重化を解消するため、padding-top を大幅に抑えています。 */
    padding: 40px 0 140px; 
    background-color: #fff;
}

.p-gallery-inner {
    max-width: 900px; /* 会社沿革の .p-history-inner に統一 */
    margin: 0 auto;
    padding: 0 4%;
    box-sizing: border-box;
}

/* 
   【削除】ヘッダーセクション（旧 #gallery .p-division-header 等）
   共通ヘッダー「sub-main-header」に完全移行し、sub-header.css と重複していた
   タイトル周りのスタイル定義は二重管理を防ぐためすべてカットしました。
*/

/* Modern Column / Grid Reset (ワンカラムに最適化) */
.p-division-section {
    margin-bottom: 80px;
}

.p-division-section:last-child {
    margin-bottom: 0;
}

.p-division-category {
    display: block;
    width: 100%;
}

.p-division-items-wrapper {
    width: 100%;
}

.p-division-cat-title {
    font-size: 1.6rem;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #005bac; /* セクションの始まりをシャープに演出 */
}

/* 1. Latest Video Grid (最新の公開動画エリア) */
.p-division-items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); /* 動画を最適サイズで並べる */
    gap: 30px;
    margin-top: 25px;
}

.p-division-item-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.p-gallery-item-title {
    font-size: 1rem;
    font-weight: bold;
    color: #222;
    margin: 0;
    line-height: 1.4;
    border-left: 4px solid #005bac;
    padding-left: 10px;
}

/* Responsive Video Wrapper (16:9) */
.p-gallery-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.p-gallery-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .p-gallery-container {
        /* スマホ時：sub-header.css の padding-bottom に追従し、
           コンテンツ開始位置の二重余白をスマートにリセット（60px → 20px） */
        padding: 20px 0 80px; 
    }
    
    .p-gallery-inner {
        padding: 0 4%;
    }
    
    .p-division-cat-title {
        font-size: 1.35rem;
    }
    
    .p-division-items-list {
        grid-template-columns: 1fr; /* スマホでは動画を縦に1カラム表示 */
        gap: 20px;
    }
}