/* TomTak Q&A Plugin Styles (Card Design Version) - Effects switched by screen width */

/* --- 全体の設定 --- */
:root {
    --qa-primary-color: #0073aa;
    --qa-text-color: #222;
    --qa-sub-text-color: #444;
    --qa-border-color: #e0e0e0;
    --qa-card-bg: #ffffff;
    --qa-card-shadow: rgba(0, 0, 0, 0.05);
    --qa-card-shadow-hover: rgba(0, 0, 0, 0.1);
    --qa-summary-bg: #f9f9f9;
}

/* --- 全体コンテナ --- */
.tomtak-qa-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

/* --- Q&Aリスト --- */
.tomtak-qa-list {
    margin-bottom: 2rem;
}

/* --- カード形式のデザイン (共通部分) --- */
.tomtak-qa-item {
    background-color: var(--qa-card-bg);
    border: 1px solid var(--qa-border-color);
    border-radius: 5px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    box-shadow: 0 2px 5px var(--qa-card-shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, filter 0.2s ease-in-out;
    cursor: pointer;
}

.tomtak-qa-question {
    font-size: 1.125rem;
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    padding-left: 2.5em;
    padding-right: 2em;
    position: relative;
}

.tomtak-qa-question::before {
    content: 'Q';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--qa-primary-color);
    color: white;
    font-weight: bold;
    font-size: 0.8em;
    width: 1.8em;
    height: 1.8em;
    line-height: 1.8em;
    text-align: center;
    border-radius: 50%;
}

.tomtak-qa-item::after {
    content: '›';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: #ccc;
    font-weight: bold;
    transition: right 0.2s ease-in-out, color 0.2s ease-in-out;
}

.tomtak-qa-question a {
    text-decoration: none;
    color: var(--qa-text-color);
    transition: color 0.2s ease-in-out;
}

.tomtak-qa-summary {
    color: var(--qa-sub-text-color);
    font-size: 0.9rem;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
    padding-left: 2.5em;
    padding-right: 2em;
    font-weight: 400;
}

/* --- PC向けの効果 (画面幅が769px以上の場合) --- */
@media (min-width: 769px) {
    .tomtak-qa-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 5px 15px var(--qa-card-shadow-hover);
    }

    .tomtak-qa-item:hover::after {
        right: 0.8rem;
        color: var(--qa-primary-color);
    }
    
    .tomtak-qa-item:hover .tomtak-qa-question a,
    .tomtak-qa-question a:hover {
        color: var(--qa-primary-color);
    }
}

/* --- スマホ向けの効果 (画面幅が768px以下の場合) --- */
@media (max-width: 768px) {
    .tomtak-qa-item:active {
        filter: brightness(0.97);
        transform: scale(0.99);
    }
}

/* --- Q&A詳細ページ --- */
.tomtak-qa-single .tomtak-qa-question {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.tomtak-qa-single .tomtak-qa-question::before {
    top: 0.7em;
}
.tomtak-qa-single .tomtak-qa-summary {
    background-color: var(--qa-summary-bg);
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 4px solid var(--qa-primary-color);
    font-size: 1rem;
    line-height: 1.7;
    overflow-wrap: break-word;
    font-weight: 400;
}
.tomtak-qa-single .tomtak-qa-detail {
    font-size: 0.95rem;
    line-height: 1.8;
    overflow-wrap: break-word;
    word-wrap: break-word;
    font-weight: 400;
    color: var(--qa-text-color);
}

/* --- ★★★ ページネーションのスタイル ★★★ --- */
.tomtak-qa-pagination {
    text-align: center;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.tomtak-qa-pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    margin: 0 0.2rem;
    border: 1px solid var(--qa-border-color);
    border-radius: 4px;
    background-color: var(--qa-card-bg);
    color: var(--qa-primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

/* 現在のページ */
.tomtak-qa-pagination .page-numbers.current {
    background-color: var(--qa-primary-color);
    color: white;
    border-color: var(--qa-primary-color);
    cursor: default;
}

/* ホバーした時 (現在のページ以外) */
.tomtak-qa-pagination .page-numbers:not(.current):hover {
    background-color: #f5f5f5;
    border-color: #ccc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
/* ★スマホ用に折り返し防止＆横スクロール対応★ */
@media (max-width: 768px) {
  .tomtak-qa-pagination {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0 0.3rem;
  }

  .tomtak-qa-pagination .page-numbers {
    display: inline-block;
    margin: 0 0.1rem;  
    padding: 0.45rem 0.75rem; 
    font-size: 0.85rem;
  }
}