/**
 * WP Content Search スタイルシート
 * 検索フォームと検索結果のスタイル
 */

/* ========================================
   検索フォーム
======================================== */
.wp-content-search-wrapper {
    margin: 2rem 0;
}

.wp-content-search-form {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.search-form-inner {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.search-input-wrapper {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.wp-content-search-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    outline: none;
    transition: all 0.3s ease;
}

.wp-content-search-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.wp-content-search-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wp-content-search-button:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.wp-content-search-button:active {
    transform: translateY(0);
}

.search-icon {
    width: 20px;
    height: 20px;
}

.search-term-display {
    padding: 0.75rem 1rem;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-term-display strong {
    color: #2271b1;
    font-weight: 600;
}

.clear-search {
    margin-left: 1rem;
    color: #d63638;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.clear-search:hover {
    color: #b32d2e;
    text-decoration: underline;
}

/* ========================================
   検索結果
======================================== */
.wp-content-search-results {
    margin-top: 2rem;
}

.search-results-header {
    margin-bottom: 1.5rem;
}

.results-count {
    font-size: 1.1rem;
    color: #1e1e1e;
}

.results-count strong {
    color: #2271b1;
    font-weight: 700;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-result-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    border-color: #2271b1;
    box-shadow: 0 4px 16px rgba(34, 113, 177, 0.1);
    transform: translateY(-2px);
}

.result-header {
    margin-bottom: 0.75rem;
}

.result-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    line-height: 1.4;
}

.result-title a {
    color: #1e1e1e;
    text-decoration: none;
    transition: color 0.2s;
}

.result-title a:hover {
    color: #2271b1;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #757575;
}

.post-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.post-type-badge.post {
    background: #e3f2fd;
    color: #1976d2;
}

.post-type-badge.page {
    background: #f3e5f5;
    color: #7b1fa2;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.date-icon {
    width: 14px;
    height: 14px;
}

.result-excerpt {
    margin: 1rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-left: 3px solid #2271b1;
    border-radius: 4px;
    line-height: 1.6;
    color: #4a4a4a;
}

.search-highlight {
    background: #fff59d;
    padding: 0.1rem 0.25rem;
    border-radius: 2px;
    font-weight: 600;
}

.result-footer {
    margin-top: 1rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.read-more:hover {
    color: #135e96;
    gap: 0.75rem;
}

.arrow-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.read-more:hover .arrow-icon {
    transform: translateX(4px);
}

/* ========================================
   検索結果なし
======================================== */
.search-no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.no-results-icon {
    margin-bottom: 1.5rem;
}

.no-results-icon svg {
    opacity: 0.3;
    stroke: #2271b1;
}

.search-no-results h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: #1e1e1e;
}

.search-no-results p {
    margin-bottom: 1.5rem;
    color: #757575;
    font-size: 1.1rem;
}

.search-tips {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 6px;
    list-style-position: inside;
}

.search-tips li {
    margin: 0.5rem 0;
    color: #4a4a4a;
}

/* ========================================
   ページネーション
======================================== */
.wp-content-search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
}

.wp-content-search-pagination a,
.wp-content-search-pagination .current-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #1e1e1e;
    font-weight: 500;
    transition: all 0.2s;
}

.wp-content-search-pagination a:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.wp-content-search-pagination .current-page {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.wp-content-search-pagination .dots {
    padding: 0 0.5rem;
    color: #757575;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   レスポンシブデザイン
======================================== */
@media (max-width: 768px) {
    .search-input-wrapper {
        flex-direction: column;
    }

    .wp-content-search-button {
        justify-content: center;
    }

    .result-title {
        font-size: 1.25rem;
    }

    .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .wp-content-search-pagination {
        flex-wrap: wrap;
    }

    .page-numbers a,
    .page-numbers .current-page {
        min-width: 36px;
        height: 36px;
        padding: 0.25rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .search-form-inner {
        padding: 1rem;
    }

    .wp-content-search-input,
    .wp-content-search-button {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }

    .search-result-item {
        padding: 1rem;
    }

    .result-title {
        font-size: 1.1rem;
    }

    .button-text {
        display: none;
    }
}

/* ========================================
   アクセシビリティ
======================================== */
.wp-content-search-input:focus-visible,
.wp-content-search-button:focus-visible,
.wp-content-search-pagination a:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
