/*
Theme Name: SWELL Glossary
Theme URI: https://venu-sys.co.jp/knowledge/
Description: 情シスIT辞典専用の子テーマ。e-words.jp風の用語辞典サイト用にカスタマイズ。
Author: GoodIT
Author URI: http://goodit.jp/
Template: swell
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: swell-glossary
*/

/* ============================================
   用語辞典サイト用カスタムスタイル
   ============================================ */

/* 五十音インデックス */
.glossary-index {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    margin: 20px 0;
}

.glossary-index a,
.glossary-index .inactive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    min-height: 40px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
    vertical-align: middle;
}

.glossary-index a {
    transition: all 0.3s;
    cursor: pointer;
}

.glossary-index a:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.glossary-index .inactive {
    color: #aaa;
    background: #f9f9f9;
    border-color: #e0e0e0;
    cursor: default;
}

/* 用語一覧 */
.glossary-list {
    list-style: none;
    padding: 0;
}

.glossary-list li {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.glossary-term-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.glossary-term-reading {
    font-size: 0.9em;
    color: #666;
    margin-left: 10px;
}

.glossary-term-excerpt {
    margin-top: 8px;
    color: #333;
    line-height: 1.6;
}

/* 関連用語セクション */
.related-terms {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
}

.related-terms h3 {
    margin-top: 0;
    font-size: 1.1em;
}

.related-terms ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.related-terms li a {
    display: block;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
    transition: all 0.3s;
}

.related-terms li a:hover {
    background: #0073aa;
    color: #fff;
}

/* カテゴリーバッジ */
.glossary-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.glossary-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 20px;
    font-size: 0.85em;
    text-decoration: none;
    transition: all 0.3s;
}

.glossary-category-badge:hover {
    background: #1976d2;
    color: #fff;
}

/* 検索フォーム強化 */
.glossary-search-form {
    max-width: 600px;
    margin: 30px auto;
    position: relative;
}

.glossary-search-form input[type="search"] {
    width: 100%;
    padding: 15px 120px 15px 20px;
    font-size: 1.1em;
    border: 2px solid #0073aa;
    border-radius: 50px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s;
}

.glossary-search-form input[type="search"]:focus {
    border-color: #005a87;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.glossary-search-form .search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    width: 44px;
    height: 44px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.glossary-search-form .search-submit:hover {
    background: #005a87;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
    transform: translateY(-50%) scale(1.05);
}

.glossary-search-form .search-submit:active {
    transform: translateY(-50%) scale(0.95);
}

.glossary-search-form .search-submit svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* 用語ナビゲーション（前後の用語） */
.glossary-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 2px solid #eee;
}

.glossary-navigation .nav-previous,
.glossary-navigation .nav-next {
    flex: 0 1 45%;
}

.glossary-navigation .nav-previous {
    text-align: left;
}

.glossary-navigation .nav-next {
    text-align: right;
}

.glossary-navigation a {
    display: inline-block;
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
    transition: all 0.3s;
}

.glossary-navigation a:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .glossary-index {
        gap: 5px;
    }
    
    .glossary-index a {
        padding: 6px 10px;
        font-size: 0.9em;
    }
    
    .related-terms ul {
        grid-template-columns: 1fr;
    }
    
    .glossary-navigation {
        flex-direction: row;
        gap: 10px;
        margin-top: 30px;
    }
    
    .glossary-navigation .nav-previous,
    .glossary-navigation .nav-next {
        flex: 1;
        width: auto;
    }
    
    .glossary-navigation .nav-previous {
        text-align: left;
    }
    
    .glossary-navigation .nav-next {
        text-align: right;
    }
    
    .glossary-navigation a {
        padding: 8px 12px;
        font-size: 0.9em;
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .glossary-search-form input[type="search"] {
        padding: 12px 60px 12px 15px;
        font-size: 1em;
    }
    
    .glossary-search-form .search-submit {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .glossary-search-form .search-submit svg {
        width: 18px;
        height: 18px;
    }
}

/* カテゴリーアーカイブページ */
.category-archive {
    margin-top: 30px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.category-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.category-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-name {
    font-size: 1.4em;
    font-weight: bold;
    color: #0073aa;
    margin: 0 0 10px;
}

.category-count {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 15px;
}

.category-description {
    font-size: 0.95em;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.category-terms-preview {
    list-style: none;
    padding: 15px 0 0;
    margin: 15px 0 0;
    border-top: 1px solid #eee;
}

.category-terms-preview li {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.category-terms-preview li a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.category-terms-preview li a:hover {
    color: #0073aa;
    text-decoration: underline;
}

.back-to-top {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.back-to-top .button {
    display: inline-block;
    padding: 12px 30px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.back-to-top .button:hover {
    background: #005a87;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-card {
        padding: 15px;
    }
    
    .category-name {
        font-size: 1.2em;
    }
}

/* 五十音・アルファベットアーカイブページ */
.kana-archive,
.alpha-archive {
    margin-top: 30px;
}

.kana-grid,
.alpha-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.kana-card,
.alpha-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.kana-card:hover,
.alpha-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.kana-title,
.alpha-title {
    font-size: 1.8em;
    font-weight: bold;
    margin: 0 0 10px;
    text-align: center;
}

.kana-title a,
.alpha-title a {
    color: #0073aa;
    text-decoration: none;
}

.kana-title a:hover,
.alpha-title a:hover {
    color: #005a87;
}

.kana-count,
.alpha-count {
    font-size: 0.9em;
    color: #666;
    text-align: center;
    margin: 0 0 15px;
}

.kana-terms-list,
.alpha-terms-list {
    list-style: none;
    padding: 15px 0 0;
    margin: 15px 0 0;
    border-top: 1px solid #eee;
}

.kana-terms-list li,
.alpha-terms-list li {
    margin-bottom: 10px;
    font-size: 0.95em;
    padding-left: 15px;
    position: relative;
}

.kana-terms-list li::before,
.alpha-terms-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #0073aa;
    font-weight: bold;
}

.kana-terms-list li a,
.alpha-terms-list li a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.kana-terms-list li a:hover,
.alpha-terms-list li a:hover {
    color: #0073aa;
}

.kana-terms-list .reading,
.alpha-terms-list .english {
    font-size: 0.85em;
    color: #777;
    margin-left: 5px;
}

.view-more {
    margin-top: 15px;
    text-align: right;
    font-size: 0.9em;
}

.view-more a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.view-more a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .kana-grid,
    .alpha-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .kana-card,
    .alpha-card {
        padding: 15px;
    }
    
    .kana-title,
    .alpha-title {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .kana-grid,
    .alpha-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ページネーション（横並び）
   ============================================ */
.nav-links {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
