/**
 * Dynamic Filter Pro 検索結果表示用スタイル
 */

/* ==========================================================================
   検索結果表示
   ========================================================================== */

.dfp-results-wrapper {
    margin-top: 1rem;
    position: relative;
}

.dfp-results:empty {
    display: none;
}

/* 結果ヘッダー */
.dfp-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.dfp-results-header:has(.dfp-results-count:empty) {
    display: none;
}

.dfp-results-count {
    font-size: 14px;
    color: #666;
    font-weight: bold;
}

.dfp-results-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dfp-sort-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.dfp-sort-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* 結果コンテナ */
.dfp-results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dfp-result-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.dfp-result-item-link:hover {
    text-decoration: none;
    color: inherit;
}

.dfp-result-item-link:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.dfp-result-item {
    border: 1px solid #e1e1e1;
    padding: 1rem;
    background-color: #fff;
    border-radius: 4px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dfp-result-item-link:hover .dfp-result-item {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.dfp-field {
    margin-bottom: 0.5rem;
}

.dfp-field:last-child {
    margin-bottom: 0;
}

.dfp-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.dfp-title {
    color: #0073aa;
}

.dfp-result-item-link:hover .dfp-title {
    color: #005a87;
}

.dfp-label {
    font-weight: bold;
    margin-right: 0.5rem;
    color: #333;
}

.dfp-content,
.dfp-content-link,
.dfp-content-text {
    display: inline;
    margin: 0;
    color: #666;
}

.dfp-date-value {
    color: #666;
    font-size: 0.9em;
}

/* 画像表示 */
.dfp-featured-image,
.dfp-acf-image {
    margin-bottom: 0.5rem;
}

.dfp-featured-img,
.dfp-acf-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.dfp-featured-img {
    display: block;
}

.dfp-acf-image {
    text-align: center;
}

/* アクション */
.dfp-actions {
    margin-top: 1rem;
    text-align: right;
}

.dfp-read-more {
    display: inline-block;
    padding: 6px 12px;
    background-color: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.dfp-read-more:hover {
    background-color: #005a87;
    color: #fff;
    text-decoration: none;
}

/* エラー・メッセージ */
.dfp-no-results,
.dfp-error {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
    background-color: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.dfp-no-results,
.dfp-error {
    margin: 1rem 0;
}

.dfp-error {
    background-color: #fef2f2;
    border-color: #fee2e2;
    color: #dc2626;
}

.dfp-notice {
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid #0073aa;
    background-color: #f0f8ff;
    border-radius: 0 4px 4px 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .dfp-result-item {
        padding: 0.75rem;
    }
    
    .dfp-result-item-link {
        display: block;
    }
    
    .dfp-result-item-link:hover {
        transform: none;
    }
    
    .dfp-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .dfp-results-sort {
        width: 100%;
        justify-content: flex-end;
    }
    
    .dfp-sort-select {
        flex: 1;
        max-width: 200px;
    }
}

/* レイアウトバリエーション */

/* グリッドレイアウト - 2列 */
.dfp-results-grid-2 .dfp-results-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* グリッドレイアウト - 3列 */
.dfp-results-grid-3 .dfp-results-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* コンパクトスタイル */
.dfp-compact .dfp-result-item {
    padding: 0.5rem;
}

.dfp-compact .dfp-field {
    margin-bottom: 0.25rem;
}

.dfp-compact .dfp-title {
    font-size: 1em;
    margin-bottom: 0.25rem;
}

/* カードスタイル */
.dfp-card-style .dfp-result-item {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dfp-card-style .dfp-result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* リストスタイル */
.dfp-list-style .dfp-results-container {
    gap: 0;
}

.dfp-list-style .dfp-result-item {
    border-radius: 0;
    border-bottom: 1px solid #e1e1e1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dfp-list-style .dfp-featured-image {
    margin-bottom: 0;
    flex-shrink: 0;
}

.dfp-list-style .dfp-featured-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.dfp-list-style .dfp-content-area {
    flex: 1;
}

/* ダークテーマ */
.dfp-dark-theme .dfp-filter-form-container {
    background-color: #333;
    color: #fff;
    padding: 1rem;
    border-radius: 4px;
}

.dfp-dark-theme .dfp-field-label {
    color: #fff;
}

.dfp-dark-theme .dfp-select-field {
    background-color: #555;
    color: #fff;
    border-color: #666;
}

.dfp-dark-theme .dfp-checkbox-group {
    color: #fff;
}

.dfp-dark-theme .dfp-result-item {
    background-color: #333;
    border-color: #555;
    color: #fff;
}

/* ACFフィールド表示 */
.dfp-acf-field {
    margin-bottom: 0.5rem;
}

.dfp-label {
    display: inline-block;
    font-weight: bold;
    margin-right: 0.5rem;
    color: #333;
}

/* ACF画像フィールド */
.dfp-acf-image {
    text-align: left;
    margin-bottom: 0.5rem;
}

/* 画像サイズクラス */
.dfp-image-thumbnail {
    max-width: 150px;
}

.dfp-image-medium {
    max-width: 300px;
}

.dfp-image-large {
    max-width: 500px;
}

.dfp-image-full {
    max-width: 100%;
}

/* ファイルリンク */
.dfp-file-link {
    display: inline-block;
    padding: 4px 8px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.dfp-file-link:hover {
    background-color: #e0e0e0;
    text-decoration: none;
}

.dfp-file-link::before {
    content: "📄 ";
    margin-right: 4px;
}

/* リンクボタンスタイル */
.dfp-link-button,
.dfp-link {
    display: inline-block;
    padding: 6px 12px;
    background-color: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.dfp-link-button:hover,
.dfp-link:hover {
    background-color: #005a87;
    color: #fff;
    text-decoration: none;
}

.dfp-link,
.dfp-link-simple {
    background: none;
    color: #0073aa;
    padding: 0;
}

.dfp-link:hover,
.dfp-link-simple:hover {
    color: #005a87;
    text-decoration: underline;
}

/* アイコン */
.dfp-icon-check {
    color: #46b450;
}

.dfp-icon-cross {
    color: #dc3232;
}

/* ページネーション */
.dfp-pagination {
    margin-top: 2rem;
    text-align: center;
}

.dfp-load-more-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-width: 120px;
}

.dfp-load-more-button:hover {
    background-color: #005a87;
    color: #fff;
    text-decoration: none;
}

.dfp-load-more-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.dfp-load-more-button:disabled:hover {
    background-color: #ccc;
}

/* ページネーション情報 */
.dfp-pagination-info {
    margin-top: 1rem;
    text-align: center;
    color: #666;
    font-size: 14px;
}

@media (max-width: 768px) {
    .dfp-load-more-button {
        width: 100%;
        max-width: 300px;
    }
    
    .dfp-pagination {
        margin-top: 1.5rem;
    }
}

/* スクロール効果 */
html {
    scroll-behavior: smooth;
}

.dfp-results-wrapper {
    scroll-margin-top: 20px;
}

.dfp-results-scrolling {
    scroll-behavior: smooth;
}

@keyframes dfp-highlight {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

/* 範囲区切り文字 */
.dfp-range-separator {
    margin: 0 0.5rem;
    color: #666;
    font-weight: bold;
}

/* グリッドレイアウトのレスポンシブ対応 */
@media (max-width: 768px) {
    .dfp-results-grid-2 .dfp-results-container,
    .dfp-results-grid-3 .dfp-results-container {
        grid-template-columns: 1fr;
    }
    
    .dfp-list-style .dfp-result-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .dfp-list-style .dfp-featured-img {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
} 