﻿/* --- ページ基本設定 --- */
body {
    /* メインのLP (index.html) と背景色を合わせる */
    background-color: var(--bg-white, #ffffff);
}
main {
    /* 固定ヘッダーの分だけコンテンツを下げる */
    padding-top: 73px; 
}
/* LPのスタイルを流用 */
.section-title {
    text-align: center;
    font-size: 2.5em;
    font-weight: 900;
    margin-bottom: 60px;
}
.subtitle {
    font-size: 1.1em;
    color: #555;
    max-width: 600px;
    margin: 0 auto 40px;
    text-align: center;
}
.cta-button {
    display: inline-block;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: #fff;
    padding: 16px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}
.cta-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0, 123, 255, 0.4);
}


/* --- テンプレート用ヒーロー --- */
.hero-template {
    background-color: var(--bg-light, #f8f9fa);
    text-align: center;
    padding: 60px 0;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

/* --- カテゴリボタン --- */
.template-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
}

.cat-btn {
    border: 1px solid #ccc;
    background-color: #ffffff;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.cat-btn:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
}

.cat-btn.active {
    background-color: var(--primary-color, #007bff);
    color: white;
    border-color: var(--primary-color, #007bff);
}


/* --- テンプレートギャラリー --- */
.template-gallery {
    padding: 60px 0;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.template-item {
    background-color: #ffffff;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}
/* フィルタリングで非表示にするためのクラス */
.template-item.hide {
    display: none;
}

.template-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.template-item img {
    width: 100%;
    height: auto;
    display: block;
    /* プレビュー画像にチェッカー盤背景を適用 */
    background-image: linear-gradient(45deg, #eee 25%, transparent 25%), 
                      linear-gradient(-45deg, #eee 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #eee 75%), 
                      linear-gradient(-45deg, transparent 75%, #eee 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.template-item h3 {
    text-align: center;
    padding: 20px 15px;
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

/* --- プレビューモーダル --- */
#preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: none; /* JSで制御 */
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: pointer;
    padding: 20px;
    box-sizing: border-box;
}

#preview-modal-content {
    background-color: white;
    padding: 30px 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 600px;
    width: 100%;
    cursor: default;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* モーダル内のタイトル */
#preview-modal-title {
    font-size: 1.8em;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

#preview-modal-image {
    max-width: 100%;
    height: auto;
    max-height: 50vh;
    margin-bottom: 25px;
    border-radius: 8px;
    /* プレビュー画像にチェッカー盤背景を適用 */
    background-image: linear-gradient(45deg, #eee 25%, transparent 25%), 
                      linear-gradient(-45deg, #eee 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #eee 75%), 
                      linear-gradient(-45deg, transparent 75%, #eee 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

#preview-modal-content p {
    font-size: 1em;
    color: #555;
    margin-bottom: 25px;
}

/* --- 使い方ステップ (template.html用) --- */
.template-how-to {
    background-color: var(--bg-white);
    padding: 60px 0;
    border-bottom: 1px solid var(--border-color);
}

.template-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

.template-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.template-step .step-num {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(45deg, #007bff, #00c6ff);
    color: white;
    font-size: 1.2em;
    font-weight: 700;
    padding-top: 2px;
}

.template-step h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    color: #333;
}

.template-step p {
    margin: 0;
    font-size: 0.95em;
    color: #555;
    line-height: 1.7;
}

/* --- 「もっと見る」ボタン関連 --- */

/* JSで制御し、初期表示数を超えるアイテムを隠すためのクラス */
.template-item.load-hidden {
    display: none;
}

/* 「もっと見る」ボタン自体のスタイル */
.load-more-btn {
    display: block;
    margin: 40px auto 0;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: 700;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background-color: #e0e0e0;
}

/* JSで制御し、すべて表示しきった時にボタンを隠すためのクラス */
.load-more-btn.hidden {
    display: none;
}