/* src/public/css/genre.css
 *
 * ツールジャンル
 *   ・トップページの「ツールジャンル」（.genre-section）
 *   ・ジャンルのページ（/genre/{key}）の説明文と「ほかのジャンル」
 * ジャンルのページのカード自体は、サイト共通の .tool-card（style.css）です。
 */

/* =========================================
   トップページ：ジャンルの並び
   ========================================= */

.genre-section {
    margin-top: 30px;
}

.genre-section-title {
    margin: 0 0 16px;
    font-size: 1.3rem;
    color: #1e3c72;
}

/* 💡 最大で横3列。画面が狭くなると2列・1列に自動で減ります。
      ジャンルの数が3つ未満のときも、空いた列ができないよう広がります（auto-fit）。
      最小幅は「3列のときの1つぶん」と 260px の大きいほうなので、4列以上にはなりません。 */
.genre-grid {
    --genre-gap: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(max(260px, calc((100% - var(--genre-gap) * 2) / 3)), 1fr));
    gap: var(--genre-gap);
}

.genre-box {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* マーク＋ジャンル名（横並び） */
.genre-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9edf3;
    text-decoration: none;
    color: #1e3c72;
}

.genre-icon {
    flex: none;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #ffffff;
    font-size: 1.2rem;
}

.genre-name {
    flex: 1;
    min-width: 0;
    font-size: 1.08rem;
    font-weight: bold;
}

.genre-head:hover .genre-name {
    text-decoration: underline;
}

/* ジャンルの下のツール名 */
.genre-tools {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    flex: 1;
}

.genre-tools a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 8px;
    color: #22303f;
    font-size: 0.95rem;
    text-decoration: none;
}

.genre-tools a:hover {
    background: #f4f7fc;
    color: #2a5298;
}

.genre-tools i {
    width: 18px;
    text-align: center;
    color: #2a5298;
}

.genre-more {
    align-self: flex-end;
    margin-top: 8px;
    font-size: 0.82rem;
    color: #2a5298;
    text-decoration: none;
}

.genre-more:hover {
    text-decoration: underline;
}

/* =========================================
   ジャンルのページ
   ========================================= */

.genre-lead {
    margin: 10px 0 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #5a6a7d;
}

.genre-others {
    margin-top: 36px;
}

.genre-others-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: #1e3c72;
}

.genre-others-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.genre-others-list a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #1e3c72;
    font-size: 0.9rem;
    text-decoration: none;
}

.genre-others-list a:hover {
    border-color: #2a5298;
    background: #f4f7fc;
}
