/* ================================================
   WORK COMIC - レイアウトシステム
   構造とレスポンシブ対応専用CSS
   ※デザイン・装飾は style.css で管理
================================================ */

/* ================================================
   レスポンシブブレークポイント
================================================ */
/* 
   Mobile:  〜767px (デフォルト)
   Tablet:  768px 〜 1023px
   Desktop: 1024px 〜
*/

/* ================================================
   コンテナシステム
================================================ */
.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 40px;
    padding-right: 40px;
    width: 100%;
}

.container-wide {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 40px;
    padding-right: 40px;
    width: 100%;
}

.container-fluid {
    max-width: 100%;
    padding-left: 40px;
    padding-right: 40px;
    width: 100%;
}

/* Tablet以下 */
@media (max-width: 1023px) {
    .container,
    .container-wide,
    .container-fluid {
        padding-left: 30px;
        padding-right: 30px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .container,
    .container-wide,
    .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ================================================
   グリッドシステム（Grid Layout）
================================================ */

/* 基本グリッド */
.layout-grid {
    display: grid;
    gap: 40px;
}

/* 2カラムグリッド */
.layout-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

/* 3カラムグリッド */
.layout-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

/* 4カラムグリッド */
.layout-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

/* カード用グリッド（自動調整） */
.layout-grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

/* Tablet: 2カラム → 1カラム */
@media (max-width: 1023px) {
    .layout-grid-3,
    .layout-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .layout-grid {
        gap: 30px;
    }
}

/* Mobile: 全て1カラム */
@media (max-width: 767px) {
    .layout-grid-2,
    .layout-grid-3,
    .layout-grid-4 {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .layout-grid-auto {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* card-gridを強制的に1カラムに（インラインスタイルを上書き） */
    .card-grid,
    div.card-grid,
    section .card-grid,
    .container .card-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* ================================================
   Flexboxシステム
================================================ */

/* 基本Flexbox */
.layout-flex {
    display: flex;
    gap: 40px;
}

/* 横並び・中央揃え */
.layout-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

/* 横並び・左右均等配置 */
.layout-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* 横並び・左揃え */
.layout-flex-start {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 40px;
}

/* 縦並び */
.layout-flex-column {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* 縦並び・中央揃え */
.layout-flex-column-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

/* 折り返しあり */
.layout-flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

/* Tablet以下: gapを縮小 */
@media (max-width: 1023px) {
    .layout-flex,
    .layout-flex-center,
    .layout-flex-between,
    .layout-flex-start,
    .layout-flex-column,
    .layout-flex-column-center,
    .layout-flex-wrap {
        gap: 30px;
    }
}

/* Mobile: 縦並びに変更 */
@media (max-width: 767px) {
    .layout-flex,
    .layout-flex-center,
    .layout-flex-between,
    .layout-flex-start,
    .layout-flex-wrap {
        flex-direction: column;
        gap: 20px;
    }
}

/* ================================================
   スペーシングシステム
================================================ */

/* セクション用パディング */
.section-padding {
    padding-top: 100px;
    padding-bottom: 100px;
}

.section-padding-top {
    padding-top: 100px;
}

.section-padding-bottom {
    padding-bottom: 100px;
}

/* Tablet */
@media (max-width: 1023px) {
    .section-padding {
        padding-top: 80px;
        padding-bottom: 80px;
    }
    
    .section-padding-top {
        padding-top: 80px;
    }
    
    .section-padding-bottom {
        padding-bottom: 80px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .section-padding {
        padding-top: 60px;
        padding-bottom: 60px;
    }
    
    .section-padding-top {
        padding-top: 60px;
    }
    
    .section-padding-bottom {
        padding-bottom: 60px;
    }
}

/* マージンユーティリティ */
.margin-top-small { margin-top: 20px; }
.margin-top-medium { margin-top: 40px; }
.margin-top-large { margin-top: 60px; }

.margin-bottom-small { margin-bottom: 20px; }
.margin-bottom-medium { margin-bottom: 40px; }
.margin-bottom-large { margin-bottom: 60px; }

/* ================================================
   カードレイアウト
================================================ */

/* カードコンテナ */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

@media (max-width: 1023px) {
    .card-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 767px) {
    .card-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ================================================
   相対配置コンテナ（装飾用）
================================================ */

/* 装飾要素を配置するための相対配置コンテナ */
.position-relative {
    position: relative;
}

/* 装飾レイヤー（absoluteはこのクラス内のみ使用） */
.decoration-layer {
    position: absolute;
    pointer-events: none; /* クリック無効化 */
    z-index: 1;
}

/* 装飾レイヤー - 上部 */
.decoration-top {
    top: 0;
}

/* 装飾レイヤー - 右上 */
.decoration-top-right {
    top: 0;
    right: 0;
}

/* 装飾レイヤー - 左上 */
.decoration-top-left {
    top: 0;
    left: 0;
}

/* 装飾レイヤー - 下部 */
.decoration-bottom {
    bottom: 0;
}

/* ================================================
   表示制御
================================================ */

/* Desktopのみ表示 */
.show-desktop {
    display: block;
}

@media (max-width: 1023px) {
    .show-desktop {
        display: none;
    }
}

/* Tabletのみ表示 */
.show-tablet {
    display: none;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .show-tablet {
        display: block;
    }
}

/* Mobileのみ表示 */
.show-mobile {
    display: none;
}

@media (max-width: 767px) {
    .show-mobile {
        display: block;
    }
}

/* Desktop以外で非表示 */
.hide-tablet-mobile {
    display: block;
}

@media (max-width: 1023px) {
    .hide-tablet-mobile {
        display: none;
    }
}

/* Mobile以外で非表示 */
.hide-desktop-tablet {
    display: none;
}

@media (max-width: 767px) {
    .hide-desktop-tablet {
        display: block;
    }
}

/* ================================================
   テキスト配置
================================================ */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Mobile時のみ中央揃え */
@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center;
    }
}

/* ================================================
   幅制御
================================================ */

.width-full {
    width: 100%;
}

.width-auto {
    width: auto;
}

.max-width-small {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.max-width-medium {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.max-width-large {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* ================================================
   高さ制御
================================================ */

.height-full {
    height: 100%;
}

.height-auto {
    height: auto;
}

.min-height-screen {
    min-height: 100vh;
}

/* ================================================
   オーバーフロー制御
================================================ */

.overflow-hidden {
    overflow: hidden;
}

.overflow-x-hidden {
    overflow-x: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

/* ================================================
   Z-index管理
================================================ */

.z-index-header {
    z-index: 1000;
}

.z-index-overlay {
    z-index: 900;
}

.z-index-modal {
    z-index: 800;
}

.z-index-dropdown {
    z-index: 700;
}

.z-index-decoration {
    z-index: 1;
}

.z-index-content {
    z-index: 10;
}
