/* ==========================================================================
   common.css - TOPページ（公開側）用スタイル
   ========================================================================== */

/* リセット
------------------------------------------------------------*/
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
    overflow-y: scroll;
}
body {
    font-family: "M PLUS 1", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ヘッダー
------------------------------------------------------------*/
.site-header {
    background: #222;
    color: #fff;
    padding: 6px 0;
    flex-shrink: 0;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
}
.header-logo {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}
.header-logout-link {
    margin-left: auto;
    font-size: 12px;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.header-logout-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* メインコンテンツ
------------------------------------------------------------*/
.container {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px 20px;
    width: 100%;
}

/* タイトルバー（全幅）
------------------------------------------------------------*/
.hero {
    background: #1b47a0;
    border-radius: 0;
    padding: 40px 30px 30px;
    text-align: center;
    margin-bottom: 0;
    width: 100%;
}
.hero-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}
.hero-icon {
    width: auto;
    height: 44px;
    object-fit: contain;
    border-radius: 6px;
    margin: 0px 0px 0px 0px;
}
.hero-title {
    color: #fff;
    font-size: 34px;
    font-weight: 500;
    letter-spacing: 2.5px;
    margin: 0;
}

/* 検索
------------------------------------------------------------*/
.search-box {
    max-width: 550px;
    margin: 0 auto 18px;
    display: flex;
    align-items: stretch;
    gap: 0;
}
.search-box-input-wrap {
    flex: 1;
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 10px 30px 10px 38px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 12px;
    color: #999;
    font-size: 14px;
}
.search-clear-btn {
    position: absolute;
    right: 6px;
    top: 10px;
    width: 22px;
    height: 22px;
    border: none;
    background: #ccc;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    display: none;
    padding: 0;
}
.search-clear-btn:hover {
    background: #999;
}
.search-btn {
    padding: 10px 20px;
    background: #e8820e;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    align-self: stretch;
}
.search-btn:hover {
    background: #d0740c;
}

/* 検索結果
------------------------------------------------------------*/
.search-results {
    margin-bottom: 30px;
    display: none;
}
.search-results-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
}
.search-results-list {
    list-style: none;
}
.search-result-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-result-item:hover {
    border-color: #1b47a0;
    box-shadow: 0 2px 8px rgba(27, 71, 160, 0.15);
}
.search-result-content-title {
    font-size: 14px;
    font-weight: 700;
    color: #1b47a0;
}
.search-result-chapter {
    font-size: 13px;
    color: #555;
    margin-top: 3px;
}
.search-result-reason {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}
.search-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
    display: none;
}
.search-loading-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 4px solid #ddd;
    border-top-color: #1b47a0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.search-loading-text {
    color: #666;
    font-size: 14px;
}

.back-to-top {
    text-align: center;
    margin-bottom: 30px;
    display: none;
}
.back-to-top-btn {
    display: inline-block;
    padding: 10px 28px;
    background: #1b47a0;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.back-to-top-btn:hover {
    background: #153a85;
}

/* カテゴリセクション
------------------------------------------------------------*/
.category-section {
    margin-bottom: 40px;
}
.category-section-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-top: 7px;
    margin-bottom: 25px;
    color: #333;
}

/* カテゴリグリッド
------------------------------------------------------------*/
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.category-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.category-card:hover {
    border-color: #1b47a0;
    box-shadow: 0 2px 8px rgba(27, 71, 160, 0.15);
}
.category-card-image {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    object-fit: contain;
}
.category-card-image-placeholder {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #e8eaf6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #1b47a0;
}
.category-card-title {
    font-size: 15px;
    font-weight: 500;
}

/* 問い合わせリンク
------------------------------------------------------------*/
.contact-link-section {
    text-align: center;
    margin-top: 40px;
}
.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 500;
    color: #1976D2;
    text-decoration: none;
}
.contact-link:hover {
    text-decoration: underline;
}
.contact-icon {
    font-size: 22px;
}

/* フッター
------------------------------------------------------------*/
.site-footer {
    background: #222;
    color: #fff;
    padding: 10px 0;
    flex-shrink: 0;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    font-size: 11px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.footer-inner a { color: #fff; text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.footer-sep { color: rgba(255,255,255,0.4); }
.footer-copy { color: rgba(255,255,255,0.6); }

/* レスポンシブ対応
------------------------------------------------------------*/
@media (max-width: 768px) {
    .container {
        padding: 15px 12px;
    }
    .hero {
        padding: 25px 15px 20px;
        margin-bottom: 0;
    }
    .hero-title {
        font-size: 20px;
        letter-spacing: 1.5px;
        margin-bottom: 6px;
    }
    .search-box {
        max-width: 100%;
    }
    .search-box input {
        padding: 10px 30px 10px 36px;
        font-size: 16px; /* iOS拡大防止 */
    }
    .category-section-title {
        font-size: 17px;
        margin-top: 0;
        margin-bottom: 15px;
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .category-card {
        padding: 14px 12px;
        gap: 10px;
    }
    .category-card-image,
    .category-card-image-placeholder {
        width: 40px;
        height: 40px;
    }
    .category-card-title {
        font-size: 13px;
    }
    .contact-link {
        font-size: 15px;
    }
    .search-result-item {
        padding: 12px 14px;
    }
    .hero-icon {
        width: auto;
        height: 32px;
    }
    .hero-title-wrap {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 20px 12px 16px;
        margin-bottom: 0;
    }
    .hero-title {
        font-size: 20px;
    }
    .category-grid {
        grid-template-columns: 1fr;
    }
    .category-card {
        padding: 12px 14px;
    }
}
