/* =============================================
   共同研究ページのARCHIVE SECTION (年度別 公募・採択リスト) のためのCSS BY NISHIKAWA SORA
   ============================================= */

/* コンテナ全体：セクションの中央に配置 */
.archive-container {
    width: 100%;
    margin: 50px auto;
    max-width: 1000px; /* PCでの広がりすぎを防止 */
}

/* 1年度分の行：常に中央に配置 */
.archive-row {
    display: flex;
    justify-content: center; 
    padding: 25px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* 最後の子要素のボーダーは消してスッキリさせる */
.archive-row:last-child {
    border-bottom: none;
}

/* 年度とボタンのひとかたまり */
.archive-set {
    display: flex;
    align-items: center;    /* 年度とボタンの上下中央を揃える */
    gap: 40px;              /* 年度タイトルとボタン群の間の距離 */
}

/* 年度ラベル：中央寄せで安定させる */
.year-label {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
    text-align: center;
    min-width: 120px;
    flex-shrink: 0;
}
.year-label span {
    display: block;
    font-size: 0.85rem;
    color: #999;
    font-weight: normal;
    margin-top: 4px;
}

/* ボタン（カード）の並び */
.card-group {
    display: flex;
    gap: 20px;
}

/* --- 共通：カード基本デザイン（内部の余白を調整） --- */
.archive-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 要素を上下に分散配置 */
    align-items: center;
    width: 200px;
    height: 105px;           /* アイコン分、高さを少しだけプラス（95px -> 105px） */
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
    padding: 12px 10px;      /* 上下のパディングを少し広めに確保 */
    box-sizing: border-box;
    position: relative;
}

/* PDFバッジの配置を安定させる */
.archive-card.pdf-link::before {
    content: "PDF";
    font-size: 10px;
    font-weight: bold;
    color: #d43c34;
    border: 1px solid #d43c34;
    padding: 0 5px;
    border-radius: 2px;
    background: #fff;
    margin-bottom: 2px;      /* 下のテキストとの距離 */
    line-height: 1.2;
    display: inline-block;
}


.archive-card .type {
    font-size: 0.95rem;
    font-weight: bold;
    margin: auto 0;          /* 中央のテキストを上下の空きスペースの中央に */
    text-align: center;
    line-height: 1.3;
    color: #333;
}

.archive-card .status {
    font-size: 0.7rem;
    padding: 2px 12px;
    border-radius: 20px;
    font-weight: bold;
    flex-shrink: 0;          /* ステータスラベルが潰れないように固定 */
}

/* --- 1. 公開中（アクティブ：赤） --- */
.archive-card.is-open {
    background-color: #fff;
    border-color: #d43c34;
}
.archive-card.is-open .type {
    color: #333;
}
.archive-card.is-open .status {
    background-color: #d43c34;
    color: #fff;
}
.archive-card.is-open:hover {
    box-shadow: 0 8px 20px rgba(212, 60, 52, 0.15);
    transform: translateY(-3px);
    border-width: 1px;
}

/* --- 2. 募集締め切り（閲覧可能：グレー） --- */
.archive-card.is-closed {
    background-color: #f9f9f9;
    border-color: #d43c34;
}
.archive-card.is-closed .type {
    color: #666;
}
.archive-card.is-closed .status {
    background-color: #888;
    color: #fff;
}
.archive-card.is-closed:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

/* --- 3. 準備中（アクセス不可：薄グレー・点線） --- */
/* .archive-card.is-pending と繋げて書くことで優先順位を上げます */
.archive-card.is-pending {
    background-color: #fcfcfc !important; /* 背景色を強制 */
    border: 1px dashed #ddd !important;
    cursor: not-allowed;
    pointer-events: none; 
    box-shadow: none !important; /* ホバー効果などを消す */
}

/* 内部の文字色を強制的にグレーにする */
.archive-card.is-pending .type {
    color: #bbb !important;
}

.archive-card.is-pending .status {
    background-color: #eee !important;
    color: #ccc !important;
}

/* 準備中の時のPDFアイコン（PDFバッジも消すかグレーにする） */
.archive-card.is-pending.pdf-link::before {
    color: #ccc !important;
    border-color: #eee !important;
    background: #fcfcfc !important;
}

/* --- PDFアイコン装飾 --- */
.archive-card.pdf-link::before {
    content: "PDF";
    font-size: 10px;
    font-weight: bold;
    color: #d43c34;
    border: 1px solid #d43c34;
    padding: 0 4px;
    border-radius: 2px;
    margin-bottom: 4px;
    background: #fff;
}

/* ホバー時にPDFアイコンの色を反転させる（is-openの場合） */
.archive-card.is-open.pdf-link:hover::before {
    background: #d43c34;
    color: #fff;
}

/* モバイル対応（必要に応じて） 
@media (max-width: 650px) {
    .archive-set {
        flex-direction: column;
        gap: 15px;
    }
    .card-group {
        flex-direction: column;
        gap: 10px;
    }
    .archive-card {
        width: 260px;
    }
}*/