/* ニュースAPI専用CSS */

/* 共通クラス */
.news-hidden {
    display: none !important;
}

/* コンテナ */
.news-api-container {
    width: 100%;
}

.news-filters-card {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
}

.news-dynamic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ニュース一覧 */
.news-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.news-item:hover {
    background-color: #f8f9fa;
}

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.news-item-date {
    color: #6c757d;
    font-size: 0.875rem;
}

.news-item-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.2;
}

.news-item-summary {
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
}

/* 空状態 */
.news-empty-state {
    text-align: center;
    padding: 3rem 0;
}

.news-empty-message {
    color: #6c757d;
    margin: 0;
}

/* ローディング */
.news-loading {
    text-align: center;
    padding: 3rem 0;
}

.news-loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid #f3f4f6;
    border-top: 0.25rem solid #0d6efd;
    border-radius: 50%;
    animation: news-loading-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes news-loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.news-loading-text {
    margin: 0;
    color: #6c757d;
}

/* エラー */
.news-error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.news-api-status {
    margin-bottom: 1rem;
}

/* デバッグ情報 */
.news-debug-info {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.news-debug-content {
    margin: 0.5rem 0 0 0;
    font-family: monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    overflow-x: auto;
}

/* ページネーション */
.news-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.news-pagination-info {
    color: #6c757d;
    font-size: 0.875rem;
}

.news-pagination-nav {
    margin: 0;
}

.news-pagination-list {
    display: flex;
    padding-left: 0;
    list-style: none;
    margin: 0;
}

.news-pagination-item {
    margin: 0;
}

.news-pagination-btn {
    position: relative;
    display: block;
    color: #0d6efd;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    cursor: pointer;
    font-size: 0.875rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.news-pagination-btn:hover {
    z-index: 2;
    color: #0a58ca;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.news-pagination-btn:focus {
    z-index: 3;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.news-pagination-item:first-child .news-pagination-btn {
    margin-left: 0;
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.news-pagination-item:last-child .news-pagination-btn {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.news-pagination-item.active .news-pagination-btn {
    z-index: 3;
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.news-pagination-item.disabled .news-pagination-btn {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
}

/* フィルター */
.news-filter-group {
    margin-bottom: 1rem;
    flex: 0 0 auto;
    width: 200px;
    margin-right: 1rem;
}

.news-filter-group-wide {
    width: 400px;
}

.news-filter-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #212529;
}

.news-filter-select {
    display: block;
    width: 100%;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
}

.news-filter-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.news-filter-checkbox-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-filter-checkbox-item {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.news-filter-checkbox {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    margin-top: 0;
    vertical-align: top;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid #ced4da;
    appearance: none;
    border-radius: 0.25em;
    transition: background-color 0.15s ease-in-out, background-position 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.news-filter-checkbox:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.news-filter-checkbox:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.news-filter-checkbox-label {
    margin: 0;
    font-size: 1rem;
    cursor: pointer;
}

/* モーダル */
.news-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s linear, visibility 0.15s linear;
}

.news-modal.show {
    opacity: 1;
    visibility: visible;
}

.news-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
}

.news-modal-content {
    position: relative;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    margin: 1.75rem auto;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    outline: 0;
    transform: translateY(-50px);
    transition: transform 0.3s ease-out;
}

.news-modal.show .news-modal-content {
    transform: translateY(0);
}

.news-modal-header {
    position: relative;
    z-index: 1070;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
    background-color: #fff;
}

.news-modal-title {
    margin: 0;
    line-height: 1.5;
    font-size: 1.25rem;
    font-weight: 500;
}

.news-modal-close {
    position: relative;
    z-index: 1080;
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 1em;
    height: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-modal-close:hover {
    opacity: 0.75;
}

.news-modal-body {
    position: relative;
    z-index: 1070;
    flex: 1 1 auto;
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
    background-color: #fff;
}

.news-modal-footer {
    position: relative;
    z-index: 1070;
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: calc(0.375rem - 1px);
    border-bottom-left-radius: calc(0.375rem - 1px);
    background-color: #fff;
}

.news-modal-btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.news-modal-btn:hover {
    text-decoration: none;
}

.news-modal-btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.news-modal-btn-close {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.news-modal-btn-close:hover {
    color: #fff;
    background-color: #5c636a;
    border-color: #565e64;
}

.news-modal-btn-close:focus {
    color: #fff;
    background-color: #5c636a;
    border-color: #565e64;
    box-shadow: 0 0 0 0.25rem rgba(130, 138, 145, 0.5);
}

/* モーダル内コンテンツ */
.news-detail-date {
    margin-bottom: 1rem;
}

.news-detail-muted {
    color: #6c757d;
    font-size: 0.875rem;
}

.news-detail-field {
    margin-bottom: 1rem;
}

.news-detail-heading {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    font-size: 1rem;
}

.news-field-content {
    line-height: 1.6;
}

.news-detail-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

.news-detail-file-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #0d6efd;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    background-color: transparent;
    border: 1px solid #0d6efd;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.news-detail-file-link:hover {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.news-detail-tag {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.news-detail-tag-primary {
    background-color: #0d6efd;
}

.news-detail-tag-secondary {
    background-color: #6c757d;
}

.news-detail-text {
    margin: 0;
    line-height: 1.5;
}

/* レスポンシブ */
@media (max-width: 576px) {
    .news-modal-content {
        margin: 0.5rem;
        max-width: none;
    }
    
    .news-pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .news-filter-group {
        width: 100%;
        margin-right: 0;
    }
    
    .news-filter-group-wide {
        width: 100%;
    }
    
    .news-dynamic-filters {
        flex-direction: column;
    }
}