/* ============================================================
   WP Community Q&A - Stylesheet
   ============================================================ */

:root {
    --wcqa-primary: #3b82f6;
    --wcqa-primary-hover: #2563eb;
    --wcqa-success: #10b981;
    --wcqa-warning: #f59e0b;
    --wcqa-error: #ef4444;
    --wcqa-best: #f59e0b;
    --wcqa-text: #1f2937;
    --wcqa-text-light: #6b7280;
    --wcqa-border: #e5e7eb;
    --wcqa-bg: #f9fafb;
    --wcqa-white: #ffffff;
    --wcqa-radius: 8px;
    --wcqa-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ハニーポット（Bot対策） */
.wcqa-hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ============================================================
   注意事項
   ============================================================ */
.wcqa-notice {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: var(--wcqa-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.wcqa-notice-title {
    font-weight: 700;
    font-size: 15px;
    color: #991b1b;
    margin-bottom: 8px;
}

.wcqa-notice-list {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.wcqa-notice-list li {
    font-size: 13px;
    line-height: 1.7;
    color: #7f1d1d;
    margin-bottom: 2px;
}

/* ============================================================
   メッセージ
   ============================================================ */
.wcqa-message {
    padding: 12px 16px;
    border-radius: var(--wcqa-radius);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.wcqa-message--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.wcqa-message--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ============================================================
   フォーム
   ============================================================ */
.wcqa-form-wrap {
    max-width: 680px;
    margin: 0 auto;
}

.wcqa-form {
    background: var(--wcqa-white);
    padding: 28px;
    border-radius: var(--wcqa-radius);
    box-shadow: var(--wcqa-shadow);
    border: 1px solid var(--wcqa-border);
}

.wcqa-field {
    margin-bottom: 20px;
}

.wcqa-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--wcqa-text);
    margin-bottom: 6px;
}

.wcqa-required {
    color: var(--wcqa-error);
}

.wcqa-input,
.wcqa-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--wcqa-border);
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--wcqa-text);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.wcqa-input:focus,
.wcqa-textarea:focus {
    outline: none;
    border-color: var(--wcqa-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.wcqa-char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: var(--wcqa-text-light);
    margin-top: 4px;
}

/* 店舗選択ボタン */
.wcqa-store-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcqa-store-btn {
    cursor: pointer;
}

.wcqa-store-btn input[type="radio"] {
    display: none;
}

.wcqa-store-btn span {
    display: inline-block;
    padding: 8px 18px;
    border: 2px solid var(--wcqa-border);
    border-radius: 24px;
    font-size: 14px;
    color: var(--wcqa-text);
    background: var(--wcqa-white);
    transition: all 0.2s;
    user-select: none;
}

.wcqa-store-btn input:checked + span {
    border-color: var(--wcqa-primary);
    background: var(--wcqa-primary);
    color: var(--wcqa-white);
}

.wcqa-store-btn:hover span {
    border-color: var(--wcqa-primary);
}

/* 星評価 */
.wcqa-star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
}

.wcqa-star-rating input {
    display: none;
}

.wcqa-star-rating label {
    font-size: 32px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.15s;
    line-height: 1;
}

.wcqa-star-rating label:hover,
.wcqa-star-rating label:hover ~ label,
.wcqa-star-rating input:checked ~ label {
    color: var(--wcqa-warning);
}

/* 送信ボタン */
.wcqa-agree-field {
    margin-bottom: 16px;
}

.wcqa-agree-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--wcqa-text);
    line-height: 1.5;
}

.wcqa-agree-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--wcqa-primary);
    cursor: pointer;
}

.wcqa-agree-error {
    color: #dc2626;
    font-size: 13px;
    font-weight: 600;
    margin: 6px 0 0 26px;
}

.wcqa-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    background: var(--wcqa-primary);
    color: var(--wcqa-white);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.wcqa-submit-btn:hover {
    background: var(--wcqa-primary-hover);
}

.wcqa-submit-btn--answer {
    background: var(--wcqa-success);
}

.wcqa-submit-btn--answer:hover {
    background: #059669;
}

/* ============================================================
   スレッド一覧
   ============================================================ */
.wcqa-list {
    max-width: 780px;
    margin: 0 auto;
}

.wcqa-thread-card {
    background: var(--wcqa-white);
    padding: 20px 24px;
    border-radius: var(--wcqa-radius);
    box-shadow: var(--wcqa-shadow);
    border: 1px solid var(--wcqa-border);
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
}

.wcqa-thread-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wcqa-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.wcqa-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.wcqa-badge--store {
    background: #e0f2fe;
    color: #0369a1;
}

.wcqa-badge--best {
    background: #fef3c7;
    color: #92400e;
}

.wcqa-stars--small {
    font-size: 14px;
    margin-left: auto;
}

.wcqa-star--filled {
    color: var(--wcqa-warning);
}

.wcqa-star--empty {
    color: #d1d5db;
}

.wcqa-card-title {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 1.4;
}

.wcqa-card-title a {
    color: var(--wcqa-text);
    text-decoration: none;
}

.wcqa-card-title a:hover {
    color: var(--wcqa-primary);
}

.wcqa-card-excerpt {
    color: var(--wcqa-text-light);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 12px;
}

.wcqa-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--wcqa-text-light);
}

.wcqa-card-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--wcqa-text);
    margin: 0 0 14px;
    padding: 12px 16px;
    background: var(--wcqa-bg);
    border-radius: 6px;
    border: 1px solid var(--wcqa-border);
}

.wcqa-card-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--wcqa-border);
}

.wcqa-card-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--wcqa-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.wcqa-card-link:hover {
    color: var(--wcqa-primary-hover);
    text-decoration: underline;
}

/* ============================================================
   シングルスレッド
   ============================================================ */
.wcqa-single-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 20px 0;
}

.wcqa-thread-detail {
    background: var(--wcqa-white);
    padding: 28px;
    border-radius: var(--wcqa-radius);
    box-shadow: var(--wcqa-shadow);
    border: 1px solid var(--wcqa-border);
    margin-bottom: 32px;
}

.wcqa-thread-detail .wcqa-card-header {
    margin-bottom: 16px;
}

.wcqa-thread-title {
    font-size: 24px;
    margin: 0 0 16px;
    line-height: 1.3;
}

.wcqa-thread-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--wcqa-text);
    margin-bottom: 16px;
}

.wcqa-thread-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--wcqa-border);
    flex-wrap: wrap;
}

/* 参考になったボタン */
.wcqa-helpful-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--wcqa-bg);
    border: 1px solid var(--wcqa-border);
    border-radius: 24px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--wcqa-text);
}

.wcqa-helpful-btn:hover {
    background: #dbeafe;
    border-color: var(--wcqa-primary);
    color: var(--wcqa-primary);
}

.wcqa-helpful-btn.wcqa-voted {
    background: #dbeafe;
    border-color: var(--wcqa-primary);
    color: var(--wcqa-primary);
    cursor: default;
}

.wcqa-helpful-count {
    font-weight: 600;
}

/* ============================================================
   回答セクション
   ============================================================ */
.wcqa-answers-section {
    margin-bottom: 32px;
}

.wcqa-section-title {
    font-size: 20px;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--wcqa-border);
}

.wcqa-answer-card {
    background: var(--wcqa-white);
    padding: 20px 24px;
    border-radius: var(--wcqa-radius);
    border: 1px solid var(--wcqa-border);
    margin-bottom: 16px;
    position: relative;
}

.wcqa-answer-card--best {
    border-color: var(--wcqa-best);
    border-width: 2px;
    background: #fffbeb;
}

.wcqa-best-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--wcqa-best);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}

.wcqa-answer-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--wcqa-text);
    margin-bottom: 12px;
}

.wcqa-answer-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--wcqa-text-light);
    flex-wrap: wrap;
}

/* ============================================================
   ページネーション
   ============================================================ */
.wcqa-pagination {
    text-align: center;
    margin-top: 24px;
}

.wcqa-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--wcqa-text);
    background: var(--wcqa-white);
    border: 1px solid var(--wcqa-border);
    font-size: 14px;
}

.wcqa-pagination .page-numbers.current {
    background: var(--wcqa-primary);
    color: var(--wcqa-white);
    border-color: var(--wcqa-primary);
}

.wcqa-no-results {
    text-align: center;
    padding: 40px;
    color: var(--wcqa-text-light);
    font-size: 16px;
}

/* ============================================================
   回答フォーム
   ============================================================ */
.wcqa-answer-form-wrap {
    margin-top: 32px;
}

/* ============================================================
   店舗別リンク集
   ============================================================ */
.wcqa-store-links {
    display: grid;
    grid-template-columns: repeat(var(--wcqa-cols, 3), 1fr);
    gap: 16px;
    max-width: 780px;
    margin: 0 auto;
}

.wcqa-store-link-card {
    display: block;
    background: var(--wcqa-white);
    padding: 20px;
    border-radius: var(--wcqa-radius);
    border: 1px solid var(--wcqa-border);
    box-shadow: var(--wcqa-shadow);
    text-decoration: none;
    color: var(--wcqa-text);
    transition: all 0.2s;
}

.wcqa-store-link-card:hover {
    border-color: var(--wcqa-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.wcqa-store-link-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.wcqa-store-link-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--wcqa-text-light);
}

.wcqa-store-link-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 14px;
}

.wcqa-store-link-stars strong {
    margin-left: 4px;
    color: var(--wcqa-text);
}

.wcqa-store-link-count {
    font-size: 13px;
}

/* 店舗フィルター中のヘッダー */
.wcqa-store-filter-header {
    text-align: center;
    margin-bottom: 24px;
}

.wcqa-store-filter-header h2 {
    font-size: 22px;
    margin: 0 0 8px;
}

.wcqa-store-filter-back {
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    color: var(--wcqa-primary);
    text-decoration: none;
}

.wcqa-store-filter-back:hover {
    text-decoration: underline;
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 640px) {
    .wcqa-store-links {
        grid-template-columns: 1fr;
    }

    .wcqa-form {
        padding: 20px 16px;
    }

    .wcqa-thread-detail {
        padding: 20px 16px;
    }

    .wcqa-star-rating label {
        font-size: 28px;
    }

    .wcqa-thread-title {
        font-size: 20px;
    }

    .wcqa-card-meta {
        gap: 8px;
    }
}
