@charset "UTF-8";

/* TOPICページ */
.topics {
    padding: 60px 0;
}

.topics__inner {
    text-align: center;
}

.topics__inner .section-sub-title {
    margin-bottom: 40px;
}

/* カテゴリーボタン */
.topics__categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.category-btn {
    padding: 8px 20px;
    background-color: var(--bg-light);
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn:hover {
    background-color: #e6e6e6;
}

.category-btn.active {
    background-color: var(--pink-color);
    color: white;
}

/* TOPIC一覧 */

.topics__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid #000;
    margin-bottom: 50px;
    position: relative;
    min-height: 200px;
}

/* 該当する記事がない場合のメッセージ */
.no-topics {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px;
    background-color: var(--bg-light);
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    color: var(--text-color);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* ローディング表示 */
.topics__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 300px;
}

.topics__loading p {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-color);
    font-weight: 500;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 5px solid var(--bg-light);
    border-top-color: var(--pink-color);
    animation: spin 1s linear infinite;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    text-align: center;
    font-size: 16px;
    color: var(--text-color);
    width: 100%;
    max-width: 200px;
}

.loading::after {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    margin: 15px auto 0;
    border-radius: 50%;
    border: 4px solid var(--bg-light);
    border-top-color: var(--main-color);
    animation: spin 1s linear infinite;
}

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

/* エラーメッセージ */
.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px;
    background-color: #fff0f0;
    border-radius: 10px;
    text-align: center;
    color: #e53e3e;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 3px 10px rgba(229, 62, 62, 0.2);
}

.error-message p {
    margin-bottom: 10px;
}

.error-message p:last-child {
    margin-bottom: 0;
}

/* TOPIC一覧エラー表示 */
.topics__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 300px;
    background-color: #fff0f0;
    border-radius: 10px;
    margin: 40px auto;
    max-width: 600px;
    box-shadow: 0 3px 10px rgba(229, 62, 62, 0.1);
}

.topics__error p {
    color: #e53e3e;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.topics__error p:last-child {
    margin-bottom: 0;
}

/* TOPICカード */

.topic-card {
    overflow: hidden;
    transition: transform 0.3s;
    position: relative;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    text-align: center;
    background-color: var(--bg-color);
}

.topic-card:nth-of-type(3n) {
    border-right: none;
}

.topic__card__inner {
    padding-top: 20px;
}

.topic-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding-top: 20px;
}

.topic-card:hover .topic-card__img {
    transform: scale(1.05);
    transition:1s all;
}

.topic-card__thumb {
    overflow: hidden;
    margin: 0 auto;
    border: 1px solid #000000;
    width: 90%;
    position: relative;
    width: min(250vw / 12.8, 250px);
	height: min(250vw / 12.8, 250px);
}

.topic-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    font-family: "object-fit: cover";
    transition: transform 0.3s;
    transition:1s all;
}

.topic-card__category {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--pink-color);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 1;
}

.topic-card__body {
    padding: 20px;
}

.topic-card__title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--main-color);
}

.topic-card__excerpt {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topic-card__date {
    display: block;
    font-size: 12px;
    color: #999;
    text-align: right;
}

/* ページネーション */
.pagination-wrapper {
    width: 100%;
}

.pagination {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination__current,
.pagination__link,
.pagination__next,
.pagination__prev {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.pagination__current {
    background-color: var(--pink-color);
    color: white;
}

.pagination__link {
    background-color: var(--bg-light);
    color: var(--text-color);
    text-decoration: none;
}

.pagination__link:hover {
    background-color: #e6e6e6;
}

.pagination__next,
.pagination__prev {
    background-color: var(--pink-color);
    color: white;
    text-decoration: none;
}

.pagination__next:hover,
.pagination__prev:hover {
    background-color: #DE4E74;
}

.pagination__dots {
    color: #999;
    letter-spacing: 2px;
}

.footer.topic-footer::before {
    display: none;
}

/* レスポンシブ対応 */
@media screen and (max-width: 992px) {

    .topics__list {
        grid-template-columns: repeat(2, 1fr);
    }

    .topic-card:nth-of-type(3n) {
        border-right: 1px solid #000;
    }

    .topic-card:nth-of-type(2n) {
        border-right: none;
    }

    .topic-card__thumb {
        width: min(250vw / 9.92, 250px);
        height: min(250vw / 9.92, 250px);
    }

}

@media screen and (max-width: 768px) {
    
    .topics__categories {
        gap: 10px;
    }
    
    .category-btn {
        padding: 6px 15px;
        font-size: 13px;
    }
    
    .topic-card__thumb {
        width: min(194vw / 7.68, 194px);
        height: min(194vw / 7.68, 194px);
    }
}

@media screen and (max-width: 576px) {
    .topics__list {
        grid-template-columns: 1fr;
    }
        
    .topics__categories {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        margin: 0 20px 20px;
    }
    
    .category-btn {
        white-space: nowrap;
    }

    .topic-card__link {
        width: 90vw;
        margin: 0 auto;
        border-left: 1px solid #000000;
        border-right: 1px solid #000000;
    }

    .topic-card__thumb {
        width: min(373vw / 5.76, 373px);
        height: min(373vw / 5.76, 373px);
    }

    .topic-card {
        border-right: none;
    }

    .topic-card:nth-of-type(3n) {
        border-right: none;
    }

    .topic-card__inner {
        width: 90vw;
        border-left: 1px solid #000;
        border-right: 1px solid #000;
        margin: 0 auto;
    }

} 