/* ==========================================================================
   DESIGN SYSTEM & CSS VARIABLES (STEP 2)
   ========================================================================== */
:root {
    --primary-color: #0f172a;    /* ディープスレート（知性・洗練） */
    --accent-color: #2563eb;     /* 信頼のブルー（成約・行動） */
    --accent-hover: #1d4ed8;
    --bg-light: #f8fafc;         /* ベース背景色 */
    --bg-white: #ffffff;
    --text-main: #334155;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* UIテイスト（STEP 2: BtoB向けのスマートな角丸） */
    --radius-sm: 4px;
    --radius-md: 6px;
    
    /* フォントシステム */
    --font-base: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Segoe UI', sans-serif;
}

/* ==========================================================================
   BASE & RESET STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box; /* STEP 5: はみ出しバグの排除 */
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
    color: var(--text-main);
    background-color: var(--bg-light);
    font-size: 16px;
    line-height: 1.7;
    -webkit-text-size-adjust: 100%;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* ==========================================================================
   LAYOUT COMPONENTS
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー・ナビゲーション */
.header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-dark);
    text-decoration: none;
}

/* STEP 5: スマホ時のヘッダー横スクロール逃がし */
.nav-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
    white-space: nowrap;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-color);
}

/* ==========================================================================
   FIRST VIEW & CV BUTTON (STEP 3)
   ========================================================================== */
.hero {
    background-color: var(--primary-color);
    color: var(--bg-white);
    padding: 100px 0;
    text-align: center;
}

.hero-title {
    font-size: 36px;
    font-weight: bold;
    line-height: 1.4;
    margin: 0 0 20px 0;
    color: var(--bg-white);
}

.hero-lead {
    font-size: 18px;
    color: #94a3b8;
    margin-bottom: 40px;
}

/* STEP 3: タップしやすい高機能CVボタン */
.btn-cv {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--bg-white);
    text-decoration: none;
    padding: 16px 40px;
    font-weight: bold;
    font-size: 18px;
    border-radius: var(--radius-sm);
    min-height: 48px; /* スマホ親指サイズ */
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    transition: background-color 0.2s, transform 0.2s;
    animation: pulse 3s infinite;
}

.btn-cv:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   FEATURE CARD SECTION (STEP 1 & STEP 5 CARD REVERSAL)
   ========================================================================== */
.section-title {
    font-size: 28px;
    color: var(--text-dark);
    text-align: center;
    margin: 60px 0 40px 0;
}

.feature-row {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
}

.feature-row.reverse {
    flex-direction: row-reverse;
}

.feature-img-box {
    flex: 1;
}

.feature-img-box img {
    width: 100%;
    height: 350px;
    object-fit: cover; /* STEP 6: トリミング対策 */
    object-position: center top; /* STEP 6: 人物写真の頭切れ防止 */
    border-radius: var(--radius-md);
}

.feature-content {
    flex: 1;
}

.feature-tag {
    display: inline-block;
    background-color: #eff6ff;
    color: var(--accent-color);
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.feature-heading {
    font-size: 22px;
    color: var(--text-dark);
    margin: 0 0 16px 0;
}

/* ==========================================================================
   TEMPLATE MARKETPLACE GRID
   ========================================================================== */
.grid-categories {
    display: block;
    margin-bottom: 50px;
}

.category-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    margin-bottom: 25px;
}

.category-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-dark);
}

.download-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.download-item:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: bold;
    color: var(--text-dark);
    text-decoration: none;
}

.file-name:hover {
    color: var(--accent-color);
}

.file-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-download {
    background-color: var(--primary-color);
    color: var(--bg-white);
    text-decoration: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    border-radius: var(--radius-sm);
}

.btn-download:hover {
    background-color: var(--accent-color);
}

/* ==========================================================================
   DATA TABLE RESPONSIVE (STEP 5)
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* STEP 5: スマホでのテーブル潰れを横スクロールで解決 */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    margin-bottom: 40px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 15px;
    min-width: 600px; /* スマホ時もテーブル形状を維持 */
}

th, td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f1f5f9;
    color: var(--text-dark);
    font-weight: bold;
}

/* ==========================================================================
   GUIDELINE LEGAL NOTE (STEP 4)
   ========================================================================== */
.legal-note {
    background-color: #fffbeb;
    border-left: 4px solid #d97706;
    padding: 15px 20px;
    margin: 30px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 14px;
    color: #92400e;
}

/* ==========================================================================
   MEDIA QUERIES (STEP 5: SMARTPHONE FIRST)
   ========================================================================== */
@media (max-width: 768px) {
    .hero {
        padding: 60px 0;
    }
    .hero-title {
        font-size: 26px;
    }
    .hero-lead {
        font-size: 15px;
    }
    
    /* STEP 5: スマホ表示時は縦一列に並び順を統一（画像が必ず上） */
    .feature-row, .feature-row.reverse {
        flex-direction: column;
        gap: 20px;
    }
    
    .feature-img-box img {
        height: 220px;
    }
    
    .section-title {
        font-size: 22px;
        margin: 40px 0 25px 0;
    }

    .download-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-download {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
}
