/* ============================================================
   課題一覧ページ
   Figma: 3col grid / gap-36px(col) gap-48px(row) / card h-[180px]
   ============================================================ */

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

.p-need-archive__main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px var(--gutter) 0;
    display: flex;
    flex-direction: column;
    gap: 64px;
}

/* p-page__header の margin-bottom と flex gap の重複を解消 */
.p-need-archive__main .p-page__header {
    margin-bottom: 0;
}

/* グリッド＋ページャーのラッパー: Figma gap-[48px] */
.p-need-archive__wrap {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* 3カラムグリッド: Figma flex gap-[36px] × 3列 */
.p-need-archive__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px 36px; /* row-gap col-gap */
}

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

/* ============================================================
   課題カード
   Figma: bg-white border-2 border-[#e5e9f0] rounded-[32px] w-[340px]
   ============================================================ */
.p-need-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--color-white);
    border: 2px solid #e5e9f0;
    border-radius: 32px;
    overflow: hidden;
}

/* ログイン時: カード全体がリンク */
.p-need-card--linked {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s;
}

.p-need-card--linked:hover {
    opacity: 0.85;
    text-decoration: none;
}

.p-need-card--linked .p-need-card__title {
    color: var(--color-text);
}

/* 画像エリア: Figma h-[180px] */
.p-need-card__image-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #f2f2f2;
}

.p-need-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.p-need-card__image-placeholder {
    width: 100%;
    height: 100%;
    background-color: #d4d4d4;
}

/* ステータスバッジ（カード左上オーバーレイ）
   Figma: ml-[10px] mt-[11.5px] min-h-[32px] px-[16px] py-[8px] rounded-full font-size-16 */
.p-need-card__status {
    position: absolute;
    top: 11.5px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-white);
    line-height: 1;
    z-index: 1;
}

.p-need-card__status--before {
    background-color: #888888;
}

.p-need-card__status--open {
    background-color: var(--color-primary); /* #0068ce */
}

/* Figma: bg-[#4d4d4d] */
.p-need-card__status--closed {
    background-color: #4d4d4d;
}

.p-need-card__status svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* カード内容: Figma flex-col gap-[16px] pt-[16px] pb-[24px] px-[24px] */
.p-need-card__content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 24px 24px;
    flex: 1;
    justify-content: space-between;
}

/* 情報エリア: Figma flex-col gap-[8px] */
.p-need-card__info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 日付: Figma Regular 17px #0055ad leading-[1.7] tracking-[0.34px] */
.p-need-card__date {
    font-size: 1.0625rem;
    font-weight: 400;
    color: #0055ad;
    line-height: 1.7;
    letter-spacing: 0.34px;
}

/* タイトル: Figma Bold 20px leading-[1.5] tracking-[0.4px] */
.p-need-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.5;
    letter-spacing: 0.4px;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 説明文: Figma Regular 16px #333 leading-[1.7] tracking-[0.32px] 2行クランプ */
.p-need-card__desc {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text);
    line-height: 1.7;
    letter-spacing: 0.32px;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CTAリンク: Figma flex gap-[4px] items-center justify-center
   min-h-[36px] px-[12px] py-[6px] Bold 16px #0055ad underline */
.p-need-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 36px;
    padding: 6px 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #0055ad;
    text-decoration: underline;
    text-underline-offset: 2px;
    border: none;
    background: none;
    cursor: pointer;
    align-self: flex-start;
    transition: opacity 0.15s;
}

.p-need-card__cta:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.p-need-card__cta svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

    /* SPは1カラム */
    .p-need-archive__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* ============================================================
   課題詳細ページ
   Figma: gap-[64px](header→body) / gap-[80px](body内) / pt-[48px] pb-[100px]
   ============================================================ */
.p-need-detail {
    padding-bottom: 100px;
}

.p-need-detail__main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px var(--gutter) 0;
    display: flex;
    flex-direction: column;
    gap: 64px;
}

/* ========== 記事ヘッダー ========== */
/* Figma: pb-[16px] between header and body */
.p-need-detail__header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
}

/* メタ行: status/区局名/課名 左寄せ、日付 右寄せ */
/* Figma: flex items-end justify-between */
.p-need-detail__meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

/* Figma: flex gap-[16px] items-end */
.p-need-detail__meta-left {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

/* ステータスチップ: Figma bg-[#0068ce] min-h-[32px] px-[16px] py-[8px] */
.p-need-detail__status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-white);
    line-height: 1;
    flex-shrink: 0;
}

.p-need-detail__status--before {
    background-color: #888888;
}

.p-need-detail__status--open {
    background-color: var(--color-primary);
}

.p-need-detail__status--closed {
    background-color: var(--color-text-sub);
}

.p-need-detail__status svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* カテゴリーバッジ: pill shape（page-news.css と同パターン） */
.p-need-detail__category {
    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;
    /* デフォルト = 水色 */
    background-color: #f0f9ff;
    border-color: #0066be;
    color: #0055ad;
}

.p-need-detail__category--blue       { background-color: #e8f1fe; border-color: #264af4; color: #0031d8; }
.p-need-detail__category--light-blue { background-color: #f0f9ff; border-color: #0066be; color: #0055ad; }
.p-need-detail__category--cyan       { background-color: #e9f7f9; border-color: #006f83; color: #006173; }
.p-need-detail__category--green      { background-color: #e6f5ec; border-color: #197a4b; color: #115a36; }
.p-need-detail__category--lime       { background-color: #ebfad9; border-color: #507500; color: #3e5a00; }
.p-need-detail__category--yellow     { background-color: #fbf5e0; border-color: #806300; color: #6e5600; }
.p-need-detail__category--orange     { background-color: #ffeee2; border-color: #ac3e00; color: #8b3200; }
.p-need-detail__category--red        { background-color: #fdeeee; border-color: #ce0000; color: #a90000; }
.p-need-detail__category--magenta    { background-color: #f3e5f4; border-color: #aa00aa; color: #8b008b; }
.p-need-detail__category--purple     { background-color: #f1eafa; border-color: #5c10be; color: #5c10be; }

/* 区局名・課名: Figma Regular 16px #4d4d4d leading-[1.75] */
.p-need-detail__dept,
.p-need-detail__section {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-nav);
    line-height: 1.75;
    white-space: nowrap;
}

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

/* タイトル: Figma text-[32px] Bold #333 tracking-[0.32px] leading-[1.5] */
.p-need-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-need-detail__body {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

/* サムネイル: お知らせ詳細と同構造
   Figma: h-[420px] / ぼかし背景 / center image 700px */
.p-need-detail__thumbnail {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.p-need-detail__thumbnail::before {
    content: '';
    position: absolute;
    inset: -30px;
    background-image: var(--thumb-bg, none);
    background-size: cover;
    background-position: center;
    filter: blur(20px);
}

.p-need-detail__thumbnail-img {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 700px;
    width: 100%;
    height: 420px;
    object-fit: cover;
}

/* ========== 提案・質問アクションブロック ========== */
/* 提案期間ブロックと質問ブロックをまとめる縦並びコンテナ */
.p-need-detail__action-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 提案期間: Figma pt-[80px] centered / 20px bold */
.p-need-detail__proposal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding-top: 80px;
}

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

.p-need-detail__proposal-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-need-detail__proposal-note {
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.5;
    text-align: center;
    margin: 0;
}

/* 質問セクション: Figma pt-[40px] centered / 20px bold */
.p-need-detail__question {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding-top: 40px;
}

.p-need-detail__question-label {
    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] primary */
.p-need-detail__action-btn {
    min-height: 56px;
    padding: 16px;
    width: 179px;
    margin-top: 16px;
    background-color: var(--color-link); /* Figma: #0877d7 */
    border-color: var(--color-link);
    color: var(--color-white);
}

/* ========== 課題一覧へ戻るボタン ========== */
/* Figma: bg-white border-[#00428c] text-[#00428c] min-h-[56px] p-[16px] */
.p-need-detail__back-wrap {
    display: flex;
    justify-content: center;
}

.p-need-detail__back-btn {
    min-height: 56px;
    padding: 16px 24px;
    background-color: var(--color-white);
    border-color: #00428c;
    color: #00428c;
}

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

    .p-need-detail__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .p-need-detail__meta-left {
        flex-wrap: wrap;
    }

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

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

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

    .p-need-detail__action-btn,
    .p-need-detail__back-btn {
        width: 100%;
    }
}

/* 提案済み表示（提案するボタンの代わり） */
.p-need-detail__proposed-note {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}
