/* ======================================================
   KAI-KETSU TOPICS ページ専用スタイル
   ====================================================== */

/* 既存の共通スタイルの上書き・微調整 */
body {
    background-color: #FAFAFC; /* 清潔感のある極めて淡いグレー */
}

/* ヘッダー調整（非スクロール時でもトピックスページでは白背景ベースで見やすくするため） */
.header:not(.scrolled) {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.8rem 0;
}
.header:not(.scrolled) .nav a {
    color: #1A1A1A;
    text-shadow: none;
}
.header:not(.scrolled) .logo {
    color: #1A1A1A;
    text-shadow: none;
}
.header:not(.scrolled) .mobile-menu-btn span {
    background: #1A1A1A;
}
.header:not(.scrolled) .btn-contact {
    border-color: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
}

/* ドロップダウンメニューのスタイリング（PC版） */
.nav-item-dropdown {
    position: relative;
}
.nav-item-dropdown .arrow-indicator {
    font-size: 0.7rem;
    margin-left: 2px;
    display: inline-block;
    transition: transform 0.3s;
}
.nav-item-dropdown:hover .arrow-indicator {
    transform: rotate(180deg);
    color: var(--accent-primary);
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 136, 204, 0.1);
    border-radius: 12px;
    padding: 10px 0;
    width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    border-left: 1px solid rgba(0, 136, 204, 0.1);
    border-top: 1px solid rgba(0, 136, 204, 0.1);
}
.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(5px);
}
.dropdown-menu li {
    display: block;
    width: 100%;
}
.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: var(--text-color) !important;
    text-align: left;
    transition: background 0.2s, color 0.2s;
    text-shadow: none !important;
}
.dropdown-menu a::after {
    display: none !important; /* ホバーアンダーラインを無効化 */
}
.dropdown-menu a:hover {
    background: rgba(0, 136, 204, 0.05);
    color: var(--accent-primary) !important;
}
.active-parent {
    color: var(--accent-primary) !important;
}

/* スマホ版ハンバーガーメニュー展開時のスタイリング */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
    z-index: 999;
    padding: 100px 40px 40px;
    transition: right 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.mobile-nav.active {
    right: 0;
}
.mobile-nav ul {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.mobile-nav a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    display: block;
}
.mobile-nav a.active {
    color: var(--accent-primary);
}

/* ======================================================
   トピックス ヒーローセクション
   ====================================================== */
.topics-hero {
    position: relative;
    height: 50vh;
    min-height: 380px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0088cc 100%);
    padding-top: 80px;
}
.topics-hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 136, 204, 0.2) 0%, transparent 80%);
    z-index: 1;
}
.topics-hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
}
.topics-hero .subtitle {
    display: block;
    font-family: var(--font-en);
    font-size: 0.9rem;
    font-weight: 700;
    color: #00c3ff;
    letter-spacing: 0.3em;
    margin-bottom: 0.8rem;
}
.topics-hero .title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    color: #FFFFFF;
    letter-spacing: 0.05em;
    margin-bottom: 1.2rem;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}
.topics-hero .desc {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    line-height: 1.7;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ======================================================
   トピックス グリッドリスト
   ====================================================== */
.topics-list-section {
    padding: 6rem 0;
}
.topics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}
@media (max-width: 992px) {
    .topics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .topics-grid {
        grid-template-columns: 1fr;
    }
    .topics-list-section {
        padding: 4rem 0;
    }
}

/* カードデザイン */
.topic-card {
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                border-color 0.4s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.topic-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 136, 204, 0.25);
}

/* カード内画像 */
.topic-card-img {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    background: #e2e8f0;
}
.topic-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.topic-card:hover .topic-card-img img {
    transform: scale(1.06);
}

/* カード内テキスト */
.topic-card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.topic-card-meta {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}
.topic-card-date {
    font-family: var(--font-en);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}
.topic-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.5rem; /* 高さを揃えてバランス維持 */
    transition: color 0.3s;
}
.topic-card:hover .topic-card-title {
    color: var(--accent-primary);
}
.topic-card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}
.topic-card-more {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}
.topic-card-more .arrow {
    transition: transform 0.3s;
}
.topic-card:hover .topic-card-more .arrow {
    transform: translateX(5px);
}

/* ======================================================
   詳細表示用モーダル (グラスモーフィズム & エレガント)
   ====================================================== */
.topic-detail-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 24px;
}
.topic-detail-modal.active {
    opacity: 1;
    visibility: visible;
}

/* 背景ぼかしオーバーレイ */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(8, 12, 24, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* モーダルウィンドウ */
.modal-wrapper {
    position: relative;
    background: #FFFFFF;
    border-radius: 24px;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 2;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.8);
}
.topic-detail-modal.active .modal-wrapper {
    transform: scale(1) translateY(0);
}

/* 閉じるボタン */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-color);
    font-size: 1.8rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
}
.modal-close-btn:hover {
    background: #FFFFFF;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* スクロールコンテンツ */
.modal-content-scroll {
    overflow-y: auto;
    flex-grow: 1;
}

/* モーダル画像 */
.modal-img-container {
    width: 100%;
    height: 380px;
    overflow: hidden;
    background: #f1f5f9;
}
@media (max-width: 640px) {
    .modal-img-container {
        height: 240px;
    }
}
.modal-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* モーダルテキスト */
.modal-text-content {
    padding: 3rem;
}
@media (max-width: 640px) {
    .modal-text-content {
        padding: 2rem 1.5rem;
    }
}
.modal-meta {
    margin-bottom: 1rem;
}
.modal-date {
    font-family: var(--font-en);
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}
.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text-color);
    margin-bottom: 2rem;
}
@media (max-width: 640px) {
    .modal-title {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
}
.modal-body {
    font-size: 1.05rem;
    color: var(--text-color);
    line-height: 1.9;
    white-space: pre-wrap; /* 改行をそのまま反映 */
}
