/*
 * お知らせ・ブログページ専用CSS (news.css)
 * body.news-page・.nw-single-wrap 配下に限定したスタイル
 * クラスプレフィックス: nw-
 * 共通コンポーネント: pg-breadcrumb / pg-fv-badge / pg-fv-lead / pg-cta
 */

/* ================================================================
 * ラッパー
 * ================================================================ */
.nw-wrap {
    overflow: hidden;
}

/* フェードイン（main.js の .visible クラスを使用） */
.nw-wrap .fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .55s ease, transform .55s ease;
}
.nw-wrap .fade-in.visible {
    opacity: 1;
    transform: none;
}

/* ================================================================
 * ① ファーストビュー
 * ================================================================ */
.nw-fv {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    background: var(--green-dark);
    color: var(--white);
    overflow: hidden;
}

.nw-fv-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .45;
}
.nw-fv-bg--default {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
    opacity: 1;
}
.nw-fv-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(30,77,26,.75) 0%, rgba(30,77,26,.5) 100%);
}

.nw-fv-inner {
    position: relative;
    z-index: 1;
    padding-top: 120px;
    padding-bottom: 64px;
}

/* タイトル（h1） */
.nw-fv-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .04em;
    margin-bottom: 12px;
    color: var(--white);
}

/* コピー（タイトル直下のキャッチ） */
.nw-fv-copy {
    font-size: clamp(.95rem, 1.8vw, 1.1rem);
    color: rgba(255,255,255,.9);
    letter-spacing: .06em;
    margin-bottom: 16px;
}

/* ================================================================
 * 共通カードグリッド
 * ================================================================ */
.nw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 40px;
}
.nw-grid--sm {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* ================================================================
 * 記事カード
 * ================================================================ */
.nw-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease;
}
.nw-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.nw-card-thumb {
    display: block;
    overflow: hidden;
    height: 180px;
    background: var(--green-light);
}
.nw-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
    display: block;
}
.nw-card:hover .nw-card-img { transform: scale(1.04); }

.nw-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--green-light) 0%, var(--green-pale) 100%);
    color: var(--green-mid);
}
.nw-card-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: .5;
}

.nw-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.nw-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.nw-card-cat {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-decoration: none;
    background: var(--green);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 3px;
    display: inline-block;
    transition: background .2s;
}
.nw-card-cat:hover { background: var(--green-dark); }

.nw-card-date {
    font-size: .78rem;
    color: var(--text-light);
}

.nw-card-title {
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.55;
    color: var(--text);
    flex: 1;
}
.nw-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color .2s;
}
.nw-card-title a:hover { color: var(--green); }

.nw-card-excerpt {
    font-size: .82rem;
    line-height: 1.7;
    color: var(--text-mid);
}

.nw-card-more {
    margin-top: auto;
    font-size: .82rem;
    font-weight: 600;
    color: var(--green);
    text-decoration: none;
    transition: color .2s;
}
.nw-card-more:hover { color: var(--green-dark); }

/* ================================================================
 * ② カテゴリー案内
 * ================================================================ */
.nw-cats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.nw-cats-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--green);
    border-radius: 8px;
    padding: 28px 24px;
    text-align: center;
    transition: box-shadow .25s ease, transform .25s ease;
}
.nw-cats-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

/* アイコン：48px 円形背景（ガイドライン準拠） */
.nw-cats-icon {
    width: 48px;
    height: 48px;
    background: var(--green-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-mid);
    margin: 0 auto 16px;
    transition: background .3s ease;
}
.nw-cats-icon svg {
    width: 24px;
    height: 24px;
}
.nw-cats-card:hover .nw-cats-icon {
    background: #d4e9cf;
}

.nw-cats-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.nw-cats-name a {
    color: inherit;
    text-decoration: none;
}

.nw-cats-desc {
    font-size: .82rem;
    line-height: 1.75;
    color: var(--text-mid);
    margin-bottom: 14px;
}

.nw-cats-link {
    font-size: .82rem;
    font-weight: 600;
    color: var(--green);
    text-decoration: none;
    transition: color .2s;
}
.nw-cats-link:hover { color: var(--green-dark); }

/* ================================================================
 * メインレイアウト（2カラム）
 * ================================================================ */
.nw-layout {
    background: var(--bg-warm);
    padding: 64px 0;
}

.nw-layout-inner {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

/* ================================================================
 * メインコンテンツ内のセクション
 * ================================================================ */
.nw-section {
    background: var(--white);
    border-radius: 10px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}
.nw-section:last-child { margin-bottom: 0; }

.nw-section--alt {
    background: var(--green-pale);
}

.nw-section-header {
    margin-bottom: 24px;
}

.nw-section-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .18em;
    color: var(--green);
    border: 1px solid var(--green);
    padding: 3px 10px;
    border-radius: 2px;
    margin-bottom: 10px;
}
.nw-section-badge--tips    { color: var(--brown); border-color: var(--brown); }
.nw-section-badge--cases   { color: var(--gold);  border-color: var(--gold); }
.nw-section-badge--monthly { color: var(--green-mid); border-color: var(--green-mid); }

.nw-section-title {
    font-size: clamp(1.05rem, 2.2vw, 1.3rem);
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--text);
    line-height: 1.45;
    margin-bottom: 10px;
}

.nw-section-body {
    font-size: .85rem;
    line-height: 1.8;
    color: var(--text-mid);
}

.nw-section-more {
    margin-top: 24px;
    text-align: center;
}

.nw-empty {
    font-size: .85rem;
    color: var(--text-light);
    padding: 16px 0;
    text-align: center;
}

/* ================================================================
 * お知らせ リスト形式
 * ================================================================ */
.nw-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--border);
}

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

.nw-news-link {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 10px 12px;
    padding: 14px 4px;
    text-decoration: none;
    transition: background .2s;
}
.nw-news-link:hover { background: var(--green-pale); }

.nw-news-cat {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    background: var(--green);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nw-news-date {
    font-size: .78rem;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.nw-news-title {
    font-size: .88rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================================================================
 * ⑦ 月別テーマグリッド
 * ================================================================ */
.nw-monthly-wrap {
    background: var(--white);
    border-radius: 10px;
    padding: 32px;
    margin-bottom: 0;
    box-shadow: var(--shadow);
}

.nw-monthly-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 24px;
    transition: height .35s ease, opacity .35s ease;
}

.nw-monthly-card {
    background: var(--green-pale);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    transition: box-shadow .2s ease, transform .2s ease;
}
.nw-monthly-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.nw-monthly-num {
    font-size: .78rem;
    font-weight: 700;
    color: var(--green);
    letter-spacing: .06em;
    margin-bottom: 6px;
}

.nw-monthly-theme {
    font-size: .78rem;
    line-height: 1.6;
    color: var(--text-mid);
}

.nw-monthly-toggle {
    display: none;
    margin: 20px auto 0;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 20px;
    font-size: .82rem;
    color: var(--text-mid);
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.nw-monthly-toggle:hover { border-color: var(--green); color: var(--green); }
.nw-monthly-toggle-close { display: none; }

/* ================================================================
 * ⑧ サイドバー
 * ================================================================ */
.nw-sidebar {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nw-sb-widget {
    background: var(--white);
    border-radius: 10px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.nw-sb-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .06em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--green-light);
    margin-bottom: 14px;
}

/* カテゴリーリスト */
.nw-sb-cats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nw-sb-cat-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 6px;
    font-size: .83rem;
    color: var(--text-mid);
    text-decoration: none;
    border-radius: 4px;
    transition: background .2s, color .2s;
}
.nw-sb-cat-item a:hover {
    background: var(--green-pale);
    color: var(--green);
}
.nw-sb-cat-count {
    font-size: .75rem;
    color: var(--text-light);
}

.nw-sb-cat-empty span {
    display: block;
    padding: 8px 6px;
    font-size: .83rem;
    color: var(--text-light);
}

/* 人気記事 */
.nw-sb-popular {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nw-sb-popular-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-decoration: none;
    transition: opacity .2s;
}
.nw-sb-popular-link:hover { opacity: .75; }

.nw-sb-popular-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--green-light);
}
.nw-sb-popular-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nw-sb-popular-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nw-sb-popular-cat {
    font-size: .68rem;
    background: var(--green);
    color: var(--white);
    padding: 2px 7px;
    border-radius: 2px;
    display: inline-block;
    width: fit-content;
}

.nw-sb-popular-title {
    font-size: .8rem;
    line-height: 1.5;
    color: var(--text);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nw-sb-empty {
    font-size: .82rem;
    color: var(--text-light);
    text-align: center;
    padding: 8px 0;
}

/* サイドバーCTA */
.nw-sb-cta {
    background: var(--green-dark);
    color: var(--white);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
}

.nw-sb-cta-title {
    font-size: .9rem;
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.5;
    color: var(--white);
    margin-bottom: 10px;
}

.nw-sb-cta-body {
    font-size: .8rem;
    line-height: 1.7;
    color: rgba(255,255,255,.8);
    margin-bottom: 16px;
}

.nw-sb-cta .btn {
    width: 100%;
    text-align: center;
    font-size: .85rem;
}

/* ================================================================
 * CTA 背景画像（pg-cta の上に重ねる）
 * pg-cta 本体は common.css で定義。背景画像設定時のみ使用。
 * ================================================================ */
.nw-cta-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .3;
    z-index: 0;
}

.nw-cta-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30,77,26,.6);
    z-index: 0;
}

/* ================================================================
 * 記事詳細 (single.php) 専用
 * ================================================================ */
.nw-single-wrap .nw-layout {
    padding-top: 48px;
}

/* ヒーロー */
.nw-single-hero {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    background: var(--green-dark);
    color: var(--white);
    overflow: hidden;
}

.nw-single-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .4;
}

.nw-single-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(30,77,26,.55) 0%, rgba(30,77,26,.85) 100%);
}

.nw-single-hero-inner {
    position: relative;
    z-index: 1;
    padding-top: 112px;
    padding-bottom: 48px;
}

.nw-single-cat {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    background: var(--green);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 3px;
    margin-bottom: 12px;
    text-decoration: none;
    transition: background .2s;
}
.nw-single-cat:hover { background: var(--green-dark); }

.nw-single-title {
    font-size: clamp(1.2rem, 3vw, 1.9rem);
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--white);
    line-height: 1.45;
    margin-bottom: 12px;
}

.nw-single-meta {
    font-size: .82rem;
    color: rgba(255,255,255,.7);
}

/* 記事本文 */
.nw-article {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 28px;
}

.nw-article-thumb {
    aspect-ratio: 16/7;
    overflow: hidden;
}
.nw-article-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nw-article-content {
    padding: 40px 48px;
    font-size: .95rem;
    line-height: 1.9;
    color: var(--text-mid);
}

/* entry-content デフォルトスタイル補完 */
.nw-article-content h2 {
    font-size: 1.2rem;
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--text);
    border-left: 3px solid var(--green);
    padding-left: 14px;
    margin: 2em 0 1em;
}
.nw-article-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.8em 0 .8em;
}
.nw-article-content p { margin-bottom: 1.4em; }
.nw-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.2em 0;
}
.nw-article-content ul,
.nw-article-content ol {
    padding-left: 1.6em;
    margin-bottom: 1.4em;
}
.nw-article-content li { margin-bottom: .4em; }
.nw-article-content a {
    color: var(--green);
    text-decoration: underline;
}
.nw-article-content a:hover { color: var(--green-dark); }

/* 記事ナビゲーション */
.nw-post-nav .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    border-top: 1px solid var(--border);
    padding: 24px 48px;
}

.nw-post-nav .nav-previous,
.nw-post-nav .nav-next {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nw-post-nav .nav-next { text-align: right; }

.nw-post-nav-label {
    font-size: .72rem;
    color: var(--text-light);
    display: block;
}

.nw-post-nav-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--green);
    display: block;
}

/* 記事下CTA */
.nw-scta {
    background: var(--green-pale);
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 24px;
    text-align: center;
}

.nw-scta-title {
    font-size: 1rem;
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--green-dark);
    line-height: 1.55;
    margin-bottom: 12px;
}

.nw-scta-body {
    font-size: .88rem;
    line-height: 1.8;
    color: var(--text-mid);
    margin-bottom: 20px;
}

.nw-scta-btns {
    justify-content: center;
}

/* ブログ一覧に戻るリンク */
.nw-back-link {
    text-align: center;
    margin-bottom: 0;
}

/* ================================================================
 * タブレット (〜 960px)
 * ================================================================ */
@media (max-width: 960px) {
    .nw-fv { min-height: 360px; }
    .nw-fv-inner { padding-top: 100px; padding-bottom: 48px; }

    .nw-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .nw-grid--sm { grid-template-columns: repeat(2, 1fr); }

    .nw-cats-grid { grid-template-columns: repeat(3, 1fr); }

    .nw-layout-inner {
        grid-template-columns: 1fr 260px;
        gap: 28px;
    }

    .nw-sidebar { position: static; }

    .nw-monthly-grid { grid-template-columns: repeat(3, 1fr); }

    /* single */
    .nw-article-content { padding: 28px 32px; }
    .nw-post-nav .nav-links { padding: 20px 32px; }
}

/* ================================================================
 * スマートフォン (〜 720px)
 * ================================================================ */
@media (max-width: 720px) {
    .nw-fv { min-height: 300px; }
    .nw-fv-inner { padding-top: 84px; padding-bottom: 40px; }

    .nw-grid { grid-template-columns: 1fr; gap: 16px; }
    .nw-grid--sm { grid-template-columns: 1fr; }

    .nw-cats-grid { grid-template-columns: 1fr; gap: 16px; }

    .nw-layout-inner { grid-template-columns: 1fr; }

    .nw-monthly-grid { grid-template-columns: repeat(2, 1fr); }
    .nw-monthly-toggle { display: block; }

    .nw-section { padding: 20px; }
    .nw-monthly-wrap { padding: 20px; }
    .nw-monthly-wrap .nw-monthly-grid.is-collapsed { display: none; }

    /* single */
    .nw-single-hero { min-height: 260px; }
    .nw-single-hero-inner { padding-top: 80px; padding-bottom: 32px; }
    .nw-article-content { padding: 20px; }
    .nw-post-nav .nav-links {
        grid-template-columns: 1fr;
        padding: 16px 20px;
    }
    .nw-post-nav .nav-next { text-align: left; }
    .nw-scta { padding: 20px; }
}
