/* ============================================================
   お知らせ一覧ページ
   Figma: h-[96px] / px-[16px] / gap-[24px] / alternating bg
   ============================================================ */

.p-news-archive {
    padding-bottom: 100px;
}

/* ページヘッダー・パンくず: p-page と共用 */
.p-news-archive__main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px var(--gutter) 0;
}

/* ========== リスト ========== */
/* Figma: flex-col gap-[48px] between list and pager */
.p-news-archive__list {
    margin-bottom: 48px;
}

/* 各行: Figma h-[96px] px-[16px] flex items-center justify-between */
.p-news-archive__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 96px;
    padding: 0 16px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s;
}

.p-news-archive__item:hover {
    opacity: 0.75;
    text-decoration: none;
}

/* Figma: 奇数行 bg-[rgba(240,249,255,0.5)] */
.p-news-archive__item--odd {
    background-color: rgba(240, 249, 255, 0.5);
}

/* 左コンテンツグループ: Figma flex gap-[24px] items-center */
.p-news-archive__item-left {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
    flex: 1;
}

/* 日付: Regular 16px */
.p-news-archive__date {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text);
    white-space: nowrap;
    flex-shrink: 0;
}

/* カテゴリバッジ: pill shape */
.p-news-archive__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: var(--border-radius-full);
    border: 1px solid;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- バッジカラー 10色（Figma 配色イメージ10色 準拠）---- */

/* デフォルト（未選択時）= 水色 */
.p-news-archive__badge {
    background-color: #f0f9ff;
    border-color: #0066be;
    color: #0055ad;
}

/* 青 */
.p-news-archive__badge--blue {
    background-color: #e8f1fe;
    border-color: #264af4;
    color: #0031d8;
}

/* 水色 */
.p-news-archive__badge--light-blue {
    background-color: #f0f9ff;
    border-color: #0066be;
    color: #0055ad;
}

/* シアン */
.p-news-archive__badge--cyan {
    background-color: #e9f7f9;
    border-color: #006f83;
    color: #006173;
}

/* 緑 */
.p-news-archive__badge--green {
    background-color: #e6f5ec;
    border-color: #197a4b;
    color: #115a36;
}

/* ライム */
.p-news-archive__badge--lime {
    background-color: #ebfad9;
    border-color: #507500;
    color: #3e5a00;
}

/* 黄 */
.p-news-archive__badge--yellow {
    background-color: #fbf5e0;
    border-color: #806300;
    color: #6e5600;
}

/* オレンジ */
.p-news-archive__badge--orange {
    background-color: #ffeee2;
    border-color: #ac3e00;
    color: #8b3200;
}

/* 赤 */
.p-news-archive__badge--red {
    background-color: #fdeeee;
    border-color: #ce0000;
    color: #a90000;
}

/* マゼンタ */
.p-news-archive__badge--magenta {
    background-color: #f3e5f4;
    border-color: #aa00aa;
    color: #8b008b;
}

/* 紫 */
.p-news-archive__badge--purple {
    background-color: #f1eafa;
    border-color: #5c10be;
    color: #5c10be;
}

/* タイトル: Bold leading-[1.5] */
.p-news-archive__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 右矢印: Figma size-[24px] */
.p-news-archive__arrow {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--color-text-sub);
    margin-left: 16px;
}

/* 空状態 */
.p-news-archive__empty {
    padding: 48px 0;
    text-align: center;
    color: var(--color-text-sub);
}

/* ========== ページャー ========== */
/* Figma: flex gap-[16px] items-center justify-center */
.c-pager {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.c-pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.15s;
}

.c-pager .page-numbers:hover {
    background-color: var(--color-secondary);
    text-decoration: none;
}

.c-pager .page-numbers.current {
    font-weight: 700;
    color: var(--color-primary);
}

/* Figma: 次へ/前へ: bg-white border border-[#0877d7] p-[6px] rounded */
.c-pager .page-numbers.next,
.c-pager .page-numbers.prev {
    background-color: var(--color-white);
    border: 1px solid var(--color-link);
    color: var(--color-link);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 6px;
}

.c-pager .page-numbers.next:hover,
.c-pager .page-numbers.prev:hover {
    background-color: var(--color-secondary);
}

/* ========== レスポンシブ（SP） ========== */
@media (max-width: 768px) {
    /* Figma SP: flex-col gap-[8px] px-[8px] py-[24px] */
    .p-news-archive__item {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 24px 8px;
        gap: 8px;
    }

    /* date + badge を横並び、title は2行目に展開 */
    .p-news-archive__item-left {
        flex-direction: row;
        flex-wrap: wrap;       /* タイトルを次行に折り返す */
        align-items: flex-end;
        gap: 8px;
        width: 100%;
    }

    .p-news-archive__date {
        font-size: 0.875rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Figma: タイトルは date+badge の下に独立した行として表示 */
    .p-news-archive__title {
        flex-basis: 100%;      /* 強制的に次行へ */
        white-space: normal;
    }

    /* 矢印はSPでは非表示 */
    .p-news-archive__arrow {
        display: none;
    }

    /* リスト↔ページャーのgap: Figma gap-[36px] */
    .p-news-archive__list {
        margin-bottom: 36px;
    }
}

/* ============================================================
   お知らせ・イベント 詳細ページ
   Figma: gap-[64px](header→body) / gap-[80px](body内) / pt-[48px] pb-[100px]
   ============================================================ */
.p-news-detail {
    padding-bottom: 100px;
}

/* 1080px コンテナ（一覧と共通） */
.p-news-detail__main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px var(--gutter) 0;
    display: flex;
    flex-direction: column;
    gap: 64px;
}

/* ========== 記事ヘッダー ========== */
/* Figma: gap-[8px] between meta-row and title */
.p-news-detail__header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* バッジ + 日付 横並び（Figma: flex gap-[16px] items-end） */
.p-news-detail__meta {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

/* バッジ: Figma h-[30px] px-[8px] py-[4px] text-[14px] */
.p-news-detail__badge {
    height: 30px;
    min-width: 90px;
    font-size: 0.875rem; /* 14px */
    padding: 4px 8px;
}

/* 日付: Figma text-[16px] color-[#4d4d4d] leading-[1.75] */
.p-news-detail__date {
    font-size: 1rem;
    color: var(--color-text-nav);
    line-height: 1.75;
    white-space: nowrap;
}

/* タイトル: Figma text-[32px] bold #333 tracking-[0.32px] leading-[1.5] */
.p-news-detail__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.5;
    letter-spacing: 0.32px;
    margin: 0;
}

/* ========== コンテンツ本体 ========== */
/* Figma: gap-[80px] between blocks */
.p-news-detail__body {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

/* サムネイル画像コンテナ
   同じ画像をぼかして背景に敷き、その上にクリア画像を中央に表示
   Figma: h-[420px] / bg-image blurred / center image 700px */
.p-news-detail__thumbnail {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ぼかし背景: CSS custom property --thumb-bg を使用 */
.p-news-detail__thumbnail::before {
    content: '';
    position: absolute;
    inset: -30px; /* ぼかしの端を隠すため外側にはみ出す */
    background-image: var(--thumb-bg, none);
    background-size: cover;
    background-position: center;
    filter: blur(20px);
}

/* 前景: クリアな画像を中央に配置 */
.p-news-detail__thumbnail-img {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 700px;
    width: 100%;
    height: 420px;
    object-fit: cover;
}

/* 本文エリア: p-page__content のスタイルを継承 */
.p-news-detail__content {
    /* p-page__content クラスで付与されるスタイルを利用 */
}

/* ========== イベント申込フォームボタン ========== */
/* Figma: pt-[80px] centered / 申込期間テキスト 20px bold */
.p-news-detail__entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.p-news-detail__entry-label {
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.5;
    text-align: center;
    margin: 0;
}

.p-news-detail__entry-period {
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.5;
    text-align: center;
    margin: 0 0 16px;
}

/* 申込期間 前・後の案内テキスト（ボタンの代わりに表示） */
.p-news-detail__entry-note {
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.5;
    text-align: center;
    margin: 0;
}

/* 申込フォームボタン: Figma min-h-[56px] p-[16px] w-[179px] blue filled */
.p-news-detail__entry-btn {
    min-height: 56px;
    padding: 16px;
    width: 179px;
}

/* ========== お知らせ一覧へ戻るボタン ========== */
.p-news-detail__back-wrap {
    display: flex;
    justify-content: center;
}

/* Figma: min-h-[56px] p-[16px] outline blue */
.p-news-detail__back-btn {
    min-height: 56px;
    padding: 16px 24px;
}

/* ========== レスポンシブ（SP） ========== */
@media (max-width: 768px) {
    .p-news-detail__main {
        padding-top: 32px;
        gap: 48px;
    }

    .p-news-detail__title {
        font-size: 1.5rem;
    }

    .p-news-detail__body {
        gap: 48px;
    }

    .p-news-detail__thumbnail-img {
        max-width: 100%;
    }

    .p-news-detail__entry-btn,
    .p-news-detail__back-btn {
        width: 100%;
    }
}

/* ============================================================
   イベント申込キャンセル（詳細ページ）
   ============================================================ */
/* キャンセルするリンク（退会リンクと同UI） */
.p-news-detail__cancel-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #ce0000;
    text-decoration: underline;
}
.p-news-detail__cancel-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* キャンセル完了メッセージ（会員情報保存メッセージと同一UI） */
.p-news-detail__cancel-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 16px 20px;
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #166534;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
}
.p-news-detail__cancel-notice svg {
    flex-shrink: 0;
    color: #16a34a;
}

/* ---- キャンセル確認モーダル ---- */
.p-event-cancel-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.p-event-cancel-modal[hidden] {
    display: none;
}
.p-event-cancel-modal__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
}
.p-event-cancel-modal__dialog {
    position: relative;
    width: 640px;
    max-width: calc(100vw - 32px);
    background-color: #fff;
    border-radius: 24px;
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: 90vh;
    overflow-y: auto;
}
.p-event-cancel-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text, #333);
    border-radius: 4px;
    transition: background-color 0.15s;
}
.p-event-cancel-modal__close:hover {
    background-color: rgba(0, 0, 0, 0.06);
}
.p-event-cancel-modal__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text, #333);
    line-height: 1.5;
    margin: 0;
    padding-right: 32px;
}
.p-event-cancel-modal__event {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text, #333);
    line-height: 1.6;
    margin: 0;
}
.p-event-cancel-modal__body {
    font-size: 1.0625rem;
    font-weight: 400;
    color: #000;
    line-height: 1.6;
    letter-spacing: 0.36px;
    margin: 0;
}
.p-event-cancel-modal__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
}
.p-event-cancel-modal__btn-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    min-height: 56px;
    background-color: #fff;
    color: var(--color-link, #0877d7);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid var(--color-link, #0877d7);
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.15s;
    white-space: nowrap;
}
.p-event-cancel-modal__btn-close:hover {
    background-color: rgba(8, 119, 215, 0.06);
}
.p-event-cancel-modal__btn-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    min-height: 56px;
    background-color: #ce0000;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.15s;
    white-space: nowrap;
}
.p-event-cancel-modal__btn-confirm:hover {
    background-color: #b30000;
}

@media (max-width: 768px) {
    .p-event-cancel-modal__actions {
        flex-direction: column-reverse;
        gap: 16px;
    }
    .p-event-cancel-modal__btn-close,
    .p-event-cancel-modal__btn-confirm {
        width: 100%;
    }
    .p-event-cancel-modal__actions form {
        width: 100%;
    }
}
