/**
 * 用語辞書ページ スタイル - ミニマルデザイン
 */

/* 検索エリア */
.glossary-search {
    max-width: 700px;
    margin: 0 auto 3rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.glossary-search__row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: stretch;
}

.glossary-search__field {
    flex: 0 0 auto;
}

.glossary-search__field--keyword {
    flex: 1 1 auto;
}

@media (min-width: 601px) {
    .glossary-search__field--keyword {
        flex: 1 1 200px;
    }
}

.glossary-search__label {
    display: none;
}

.glossary-search__select {
    height: 44px;
    padding: 0 2.5rem 0 1rem;
    font-size: 0.9375rem;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.glossary-search__select option {
    color: #333;
    background: #fff;
}

.glossary-search__input {
    width: 100%;
    height: 44px;
    padding: 0 2.5rem 0 1rem;
    font-size: 0.9375rem;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.glossary-search__select:focus,
.glossary-search__input:focus {
    outline: none;
    border-color: var(--color_main, #0073aa);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.glossary-search__input::placeholder {
    color: #999;
}

.glossary-search__count {
    display: none;
}

/* 結果一覧 */
.glossary-results {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* セクション（カテゴリごと） */
.glossary-section {
    margin: 0;
}

.glossary-dictionary .glossary-section__title,
.post_content .glossary-section__title,
.p-entry__body .glossary-section__title,
.post_content h2.glossary-section__title,
.p-entry__body h2.glossary-section__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem !important;
    padding: 0 !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: var(--color_main, #333) !important;
    text-transform: none;
    letter-spacing: 0.02em;
    background: none !important;
    border: none !important;
    line-height: 1.5 !important;
}

/* 擬似要素を非表示 */
.glossary-dictionary .glossary-section__title::before,
.glossary-dictionary .glossary-section__title::after,
.post_content .glossary-section__title::before,
.post_content .glossary-section__title::after,
.post_content h2.glossary-section__title::before,
.post_content h2.glossary-section__title::after {
    display: none !important;
    content: none !important;
}

/* 見出しの装飾（左のアクセントライン） */
.glossary-section__title::before {
    content: '' !important;
    display: block !important;
    width: 3px !important;
    height: 1em !important;
    background: var(--color_main, #333) !important;
    border-radius: 2px !important;
    flex-shrink: 0;
}

.glossary-section__list {
    display: flex;
    flex-direction: column;
}

/* 用語アイテム - アコーディオン */
.glossary-item {
    border-bottom: 1px solid #eee;
}

.glossary-item__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}

.glossary-item__header:hover {
    opacity: 0.7;
}

.glossary-item__toggle {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #ccc;
    transition: transform 0.3s ease;
}

.glossary-item.is-open .glossary-item__toggle {
    transform: rotate(180deg);
    border-top-color: var(--color_main, #333);
}

.glossary-item:not(.is-open) .glossary-item__toggle {
    transform: rotate(-90deg);
}

.glossary-item__title {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    line-height: 1.5;
}

.glossary-item__body {
    display: none;
    overflow: hidden;
}

.glossary-item.is-open .glossary-item__body {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glossary-item__content {
    padding: 0.5rem 0 1.5rem 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.8;
    color: #555;
    margin-left: 0.25rem;
}

.glossary-item__content p {
    margin: 0;
}

.glossary-item__content p + p {
    margin-top: 0.75em;
}

/* 0件メッセージ */
.glossary-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    font-size: 1rem;
    color: #666;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .glossary-search {
        padding: 1.25rem;
        margin-bottom: 2rem;
    }

    .glossary-search__row {
        flex-direction: column;
    }

    .glossary-search__select,
    .glossary-search__input {
        width: 100%;
    }

    .glossary-item__title {
        font-size: 0.9375rem;
    }

    .glossary-item__content {
        font-size: 0.875rem;
    }
}

/* YouTube埋め込みプレースホルダー */
.glossary-youtube {
    display: inline-flex;
    align-items: center;
    margin: 0.5rem 0;
}

.glossary-youtube__link {
    display: none;
}

.glossary-youtube__button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #fff;
    background: #cc0000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.glossary-youtube__button::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid #fff;
}

.glossary-youtube__button:hover {
    background: #ff0000;
}

.glossary-youtube iframe {
    display: block;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .glossary-youtube__button {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }

    .glossary-youtube iframe {
        max-width: 100%;
    }
}

