@charset "UTF-8";

/* ==========================================================================
   箱庭クラフト - ニュース専用スタイルシート (news.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 共通レイアウト & ヘッダー
   -------------------------------------------------------------------------- */
.main-content {
    padding: 60px 0;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-title {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--light-text);
    letter-spacing: 0.1em;
}

/* --------------------------------------------------------------------------
   2. カテゴリナビゲーション（タブ）
   -------------------------------------------------------------------------- */
.news-category-nav {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-light);
}

.category-tab-list {
    display: flex;
    justify-content: center;
    gap: 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-tab {
    display: block;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--light-text);
    text-decoration: none;
    padding: 12px 10px;
    position: relative;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.category-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateX(-50%);
}

.category-tab:hover,
.category-tab.is-active {
    color: var(--primary-color);
}

.category-tab.is-active::after,
.category-tab:hover::after {
    width: 100%;
}

/* --------------------------------------------------------------------------
   3. ニュース一覧リスト
   -------------------------------------------------------------------------- */
.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--border-light);
}

.news-item {
    border-bottom: 1px solid var(--border-light);
}

.news-item-link {
    display: flex;
    flex-wrap: wrap;
    /* @mediaを使わずスマホで自動縦並びにするための折り返し許可 */
    align-items: center;
    padding: 24px 15px;
    text-decoration: none;
    transition: background-color 0.3s ease, padding-left 0.3s ease;
}

.news-item-link:hover {
    background-color: rgba(230, 126, 34, 0.02);
    padding-left: 20px;
}

.news-item-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    width: min(100%, 260px);
    /* スマホ時は100%幅、PC時は260px固定にする自動計算 */
    margin-bottom: clamp(0px, (380px - 100vw) * 1000, 10px);
    /* スマホ縦並び時のみ自動で下余白を発生させる計算 */
}

.news-item-date {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 0.95rem;
    color: var(--light-text);
    font-weight: 500;
}

.news-item-title-wrap {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: min(100%, 300px);
    /* 画面幅を突き破らない安全限界値 */
    padding-left: clamp(0px, (100vw - 480px) * 1000, 10px);
    /* 縦並び時は余白0、横並び時は10pxに自動変動 */
}

.news-item-title {
    margin: 0;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-color);
    transition: color 0.3s ease;
    word-break: break-all;
    /* font-size は JavaScript で動的に設定されるため、ここでは指定しない */
}

.news-item-link:hover .news-item-title {
    color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   4. ニュース詳細画面
   -------------------------------------------------------------------------- */
.news-article-detail {
    max-width: 850px;
    margin: 0 auto;
    padding: 20px 10px;
}

.article-header {
    margin-bottom: 35px;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 25px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.article-title {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-color);
    margin: 0;
    /* font-size は JavaScript で動的に設定されるため、ここでは指定しない */
}

.article-body {
    color: var(--text-color);
    font-size: clamp(1rem, 0.8vw + 0.7rem, 1.15rem);
    line-height: 1.9;
    word-break: break-word;
}

.article-footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-light);
}

.btn-back-to-list {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 12px 45px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.02);
    font-family: 'Zen Maru Gothic', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.btn-back-to-list:hover {
    background: var(--primary-color);
    color: #fff !important;
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.2);
}

/* --------------------------------------------------------------------------
   5. 共通パーツ（カテゴリ、NEWアイコン）
   -------------------------------------------------------------------------- */
.list__data.cate {
    display: inline-block;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 12px;
    border-radius: 4px;
    color: #fff !important;
    min-width: 85px;
    text-align: center;
}

.cate-1 {
    background-color: #34495e;
}

.cate-2 {
    background-color: #2ecc71;
}

.cate-3 {
    background-color: #e67e22;
}

.cate-4 {
    background-color: #3498db;
}

.cate-5 {
    background-color: #95a5a6;
}

.cate-6 {
    background-color: #9b59b6;
}

.list__data.icon__new img {
    height: 64px;
    width: auto;
    display: block;
}

/* --------------------------------------------------------------------------
   6. ページネーション
   -------------------------------------------------------------------------- */
.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
}

.btn-num {
    display: flex;
    gap: 8px;
}

.btn-num__item,
.btn-back,
.btn-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    background: rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

.btn-num__item.current {
    background: var(--primary-color);
    color: #fff !important;
    border-color: var(--primary-color);
    box-shadow: 0 5px 12px rgba(230, 126, 34, 0.3);
}

.btn-num__item:not(.current):hover,
.btn-back:hover,
.btn-next:hover {
    background: var(--primary-color);
    color: #fff !important;
    border-color: var(--primary-color);
}

/* ==========================================================================
   TOPページ専用：「MORE ALL」ボタン装飾
   ========================================================================== */

/* メディアクエリ無しで1ピクセル単位で滑らかに可変する流麗なボタン */
.news .btn-view {
    display: block;
    width: clamp(200px, 30vw, 240px);
    margin: clamp(35px, 5vw, 45px) auto 0 auto;
    padding: clamp(12px, 1.8vw, 14px) 0;
    text-align: center;
    text-decoration: none;
    border: 1px solid var(--border-light);
    border-radius: 30px;
    background: #fff;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

/* 英字テキストのカーニング（文字間隔）を広げてラグジュアリーな世界観を表現 */
.news .btn-view span {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: clamp(0.8rem, 1.2vw, 0.85rem);
    font-weight: 700;
    letter-spacing: 0.18em;
    /* 高級感を出すためさらに広く調整 */
    color: var(--light-text);
    display: block;
    transition: color 0.4s ease;
}

/* ==========================================================================
   TOPページ：ニュースセクション タイトルエリア（.news-title）装飾
   ========================================================================== */

.news-title {
    text-align: center;
    /* タイトル画像を完全に中央寄せ */
    margin-top: 0;
    margin-bottom: 45px;
    /* 下のニュースリストとの間にゆったりとした高級感のある余白を確保 */
    padding: 0;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* タイトル画像自体の調整と洗練された演出 */
.news-title img {
    max-width: 360px;
    /* サイト全体のバランスに合わせた美しい最適サイズ */
    width: 100%;
    /* 画面幅が360px以下になった際に自動縮小させるトリガー */
    flex-shrink: 0;
    /* 👈 左右の飾り線に押されても、絶対に画像を横・縦に潰さない設定 */
    height: auto;
    object-fit: contain;
    display: block;

    /* ほんの少しだけシャドウを落として、背景から綺麗に浮かび上がらせる（ラグジュアリー感の演出） */
    filter: drop-shadow(0 2px 5px rgba(230, 126, 34, 0.15));
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* タイトルエリアに高雅な印象を与えるための、左右に広がるフェードアウトライン装飾 */
.news-title::before,
.news-title::after {
    content: '';
    display: block;
    height: 1px;
    flex-grow: 1;
    /* 画面幅に合わせて線が自動で限界まで伸びる設定 */
    flex-shrink: 1;
    /* 画面が狭くなったら画像ではなく「線」から先に縮む設定 */
    min-width: 0;
    /* 👈 画面が360px前後まで狭くなった際、線を完全に0まで消算できるようにする設定 */
    max-width: 150px;
    /* 線の最大長さを150pxに制限し、中央の画像を目立たせる */
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
    margin: 0 24px;
    /* 画像と線の間に高貴なゆとり（空間）を持たせる */
}

/* --------------------------------------------------------------------------
   7. 🌙 ダークモード環境への完全な自動最適化
   -------------------------------------------------------------------------- */
.dark-mode .news-article-detail {
    /* 修正：真っ白背景バグを修正し、ベース色に綺麗に馴染ませます */
    background: transparent;
}

.dark-mode .btn-back-to-list {
    background: rgba(255, 255, 255, 0.03);
}

.dark-mode .btn-num__item,
.dark-mode .pager .btn-back,
.dark-mode .pager .btn-next {
    background: rgba(255, 255, 255, 0.03);
}


/* ==========================================================================
   👑 TOPページ：ニュースセクション タイトルエリア（.news-title）リッチ装飾
   ========================================================================== */

/* 豪華さを演出：タイトルの上下に極細のラグジュアリーラインを配置し、中央寄せ */
.news-title {
    text-align: center;
    margin-top: 0;
    margin-bottom: clamp(30px, 5vw, 45px);
    padding: 0;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* タイトル左右に伸びる高雅な拡張ライン（メディアクエリ無しで滑らかに伸縮） */
.news-title::before,
.news-title::after {
    content: '';
    display: block;
    height: 1px;
    flex-grow: 1;
    max-width: clamp(40px, 10vw, 120px);
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

/* ご指定の画像サイズ「32px」に厳密固定、シャドウによる立体演出 */
.news-title img {
    filter: drop-shadow(0 2px 5px rgba(230, 126, 34, 0.15));
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   👑 TOPページ：ニュースセクション最下部 「VIEW ALL」ボタン高級装飾
   ========================================================================== */

/* メディアクエリ無しで1ピクセル単位で滑らかに可変する流麗なボタン */
.news .btn-view {
    display: block;
    width: clamp(200px, 30vw, 240px);
    margin: clamp(35px, 5vw, 45px) auto 0 auto;
    padding: clamp(12px, 1.8vw, 14px) 0;
    text-align: center;
    text-decoration: none;
    border: 1px solid var(--border-light);
    border-radius: 30px;
    background: #fff;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

/* 英字テキストのカーニング（文字間隔）を広げてラグジュアリーな世界観を表現 */
.news .btn-view span {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: clamp(0.8rem, 1.2vw, 0.85rem);
    font-weight: 700;
    letter-spacing: 0.18em;
    /* 高級感を出すためさらに広く調整 */
    color: var(--light-text);
    display: inline-block;
    transition: all 0.3s ease;
}

/* ホバーエフェクト：背景がテーマカラーに染まり、ふわりと浮かび上がる */
.news .btn-view:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(230, 126, 34, 0.25);
}

/* ホバー時に文字を純白化して視認性を高める */
.news .btn-view:hover span {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 🌙 ダークモード環境への完全な自動最適化 */
.dark-mode .news .btn-view {
    background: var(--white);
    border-color: var(--border-light);
}

.dark-mode .news .btn-view:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   9. News layout stabilization
   -------------------------------------------------------------------------- */
.news:hover .news-title img {
    transform: none;
}

#dynamic-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

#dynamic-category-nav .category-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.03);
    color: var(--light-text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    position: static;
}

#dynamic-category-nav .category-tab::after {
    display: none;
}

#dynamic-category-nav .category-tab.is-active {
    background: var(--primary-color);
    color: #fff;
}

.news .news-item-link {
    flex-wrap: nowrap;
    align-items: center;
    gap: 18px;
}

.news .news-item-meta {
    flex: 0 0 auto;
    width: auto;
    margin-bottom: 0;
}

.news .news-item-title-wrap {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding-left: 0;
}

.news .list__text,
.news .news-item-title {
    display: block;
    width: 100%;
    max-width: none;
    line-height: 1.65;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.news-article-detail {
    width: min(100%, 980px);
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 10px;
}

.news-article-detail .article-title {
    width: 100%;
    max-width: 100%;
}

.news-article-detail .article-header {
    width: 100%;
    max-width: none;
    margin: 0 auto 35px auto;
    padding-bottom: 25px;
    box-sizing: border-box;
}

.news-article-detail .article-title {
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
    font-size: clamp(1.5rem, 1.05rem + 1vw, 2.15rem);
}

.news-article-detail .article-meta {
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .news .news-item-link {
        flex-wrap: wrap;
    }

    .news .news-item-meta,
    .news .news-item-title-wrap {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   10. Final overrides for top page and query detail
   -------------------------------------------------------------------------- */
#top-news-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 18px;
}

#top-news-list .list__item {
    list-style: none;
    justify-content: center;
    /* 水平方向の中央寄せ */
    align-items: center;
    /* 垂直方向の中央寄せ */
    margin: 0;
}

#top-news-list .list__item>a {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0 4px;
    justify-content: center;
    /* 水平方向の中央寄せ */
    align-items: center;
    /* 垂直方向の中央寄せ */
}

#top-news-list .flex.flex__ai-c {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
}

#top-news-list .list__text {
    display: block;
    margin-top: 30px;
    line-height: 1.65;
    word-break: normal;
    overflow-wrap: normal;
    white-space: nowrap;
    font-size: 1.2em;
}

#top-news-list .list__data.cate {
    min-width: 72px;
    width: auto;
    flex: 0 0 auto;
}

#top-news-list .list__data.date {
    flex: 0 0 auto;
}

#dynamic-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 28px;
    padding-bottom: 0;
    border-bottom: none;
}

#dynamic-category-nav .category-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.03);
    color: var(--light-text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    position: static;
}

#dynamic-category-nav .category-tab::after {
    display: none;
}

#dynamic-category-nav .category-tab.is-active {
    background: var(--primary-color);
    color: #fff;
}

.news-article-detail {
    width: min(100%, 980px);
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 16px;
    box-sizing: border-box;
}

.news-article-detail .article-header {
    width: 100%;
    max-width: none;
    margin: 0 auto 35px auto;
    padding-bottom: 25px;
    overflow: visible;
}

.news-article-detail .article-title {
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
    font-size: clamp(1.5rem, 1.05rem + 1vw, 2.15rem);
}


/* --------------------------------------------------------------------------
   8. Adaptive width for news pages
   -------------------------------------------------------------------------- */
.news .news-item-link {
    align-items: flex-start;
    gap: 18px;
}

.news .news-item-meta {
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 0;
}

.news .news-item-title-wrap {
    flex: 1 1 auto;
    min-width: 0;
    width: min(100%, clamp(18ch, calc(var(--news-title-chars, 32) * 0.95ch + 4ch), 64ch));
    padding-left: 0;
}

.news .news-item-title {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    line-height: 1.65;
    word-break: normal;
    overflow-wrap: anywhere;
    line-break: strict;
}

.news .list__text {
    display: inline-block;
    width: fit-content;
    max-width: min(100%, calc(var(--news-title-chars, 32) * 1ch + 8rem));
    line-height: 1.65;
    word-break: normal;
    overflow-wrap: anywhere;
    line-break: strict;
}

.news-article-detail {
    width: min(100%, 980px);
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 10px;
}

.news-article-detail .article-header {
    width: 100%;
    max-width: none;
    margin: 0 auto 35px auto;
    padding-bottom: 25px;
    margin-bottom: 35px;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 25px;
}

.news-article-detail .article-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.news-article-detail .article-title {
    display: block;
    width: 100%;
    max-width: 100%;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: clamp(1.6rem, 1.1rem + 1.1vw, 2.2rem);
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    color: var(--text-color);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.news-article-detail .article-body {
    color: var(--text-color);
    font-size: clamp(1rem, 0.8vw + 0.7rem, 1.15rem);
    line-height: 1.9;
    word-break: break-word;
}

.news-article-detail .article-body-inner {
    max-width: 100%;
}

.news-article-detail .article-footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-light);
}

.news-article-detail .btn-back-to-list {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: min(280px, 100%);
    height: auto;
    padding: 12px 45px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-color);
}

/* ニュースリストの各アイテムのスタイル変更 */
.news .list__item {
    border-bottom: 1px solid #e0e0e0; /* ニュースごとの区切り線 */
    padding: 15px 10px;               /* 上下に余白を作って見やすく */
    transition: background-color 0.2s ease; /* ホバー時のアニメーション */
}

/* 一番最後の線の余計な余白や重複を防ぐ */
.news .list__item:last-child {
    border-bottom: none; 
}

/* マウスカーソルを乗せたときに背景色を変えて、選択しやすくする（お好みで） */
.news .list__item:hover {
    background-color: rgba(230, 126, 34, 0.05); /* サーバーのテーマカラーの薄いオレンジ */
}

/* リンク全体のブロック化と、文字の重なり防止 */
.news .list__item a {
    display: block;
    text-decoration: none;
    color: inherit;
}