/* CSS Document */

table.news {
	max-width: 1600px;
	font-family: Arial, Helvetica, sans-serif;
  	border-collapse: collapse;
	margin-top: 80px;
	margin-bottom: 40px;
    margin-left: auto;
    margin-right: auto;
	border: 1px solid #999;
}

@media screen and (max-width: 580px) {
table.news {
	padding: 10px 20px;
	}
}

td.news {
	font-family: Arial, Helvetica, sans-serif;
	font-size:14px;
	font-weight: normal;
	text-align: center;
	color:#000;
	background-color: #fff;
	border: 1px solid #999;
	padding: 10px 30px;
	margin:0;
}

P.all-news a {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	font-weight: bold;
  	text-decoration: none;
	color: #888;
	padding: 0px;
}

.all-news a:hover {
    color: #2980b9; /* ホバー時に青く変更 */
    text-decoration: underline;
}

h.topics {
    font-family: "Noto Sans JP", Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    padding: 5px 0 5px 15px;
    margin: 15px 0;
    border-left: 6px solid #fdd835;  /* 左側に黄色の装飾線 */    
    border-bottom: 1px solid #eee;  /* テーブルの青色と調和させるための下線 */
}

/* --------------------------------- */
/* A. 横並びのレイアウト設定 (Flexbox) */
/* --------------------------------- */

/* PCの画面幅 */
.postit-container {
    display: flex;
    justify-content: space-between; /* 子要素間に均等な間隔を空ける */
    align-items: flex-start; /* 上端を揃える */
    padding: 10px;
    margin-bottom: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------------------------------------------------- */
/* B. 各付箋のデザイン設定 */
/* ---------------------------------------------------- */
.postit-note {
    width: calc(25% - 20px); /* 4等分 - 要素間の余白 */
    padding: 25px;
    margin: 10px;   
    background-color: #e9e4e6; /* 温かみのあるローズグレー */
    border-radius: 8px; /* 角をわずかに丸めて柔らかさを出す */
    border: 1.5px solid #d6d1d3; /* 濃いめの境界線 */
  	box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease; /* ホバーアニメーションをスムーズに */   
    text-align: left;	
    cursor: pointer;
    height: 155px; /* 高さ固定で本文を切り詰める */
}

/* 青の付箋 (2枚目) */
.postit-container .postit-note:nth-child(2) {
    background-color: #e0f0ff;
    border-color: #e9e4e6;
}

/* 黄色の付箋 (3枚目) */
.postit-container .postit-note:nth-child(3) {
    background-color: #fff8e1;
    border-color: #e8e0c8;
}

/* 緑の付箋 (4枚目) */
.postit-container .postit-note:nth-child(4) {
    background-color: #e8faed;
    border-color: #cde0d2;
}

/* ホバーエフェクト */
.postit-note:hover {
    transform: translateY(-7px); /* 少し上に浮き上がる */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.20);
    border-color: #d0d0d0;
    z-index: 10;
}

/* 内部のテキストスタイル */
.postit-note h5 {
    margin-top: 0;
    font-size: 1rem;
    padding-bottom: 0;
    margin-bottom: 15px;
    font-weight: 700;
	display: inline-block;
	white-space: normal;
	max-width: 100%;
    
    /* 背景色を無くす */
    background-color: transparent; 
    
    /* 共通のタイトルの色（ダークグレー） */
    color: #333; 
    border-bottom: none;
}

/* ローズグレーの見出し (1枚目) */
.postit-note:nth-child(1) h5 {
    color: #6c6869;
}

/* 青の見出し (2枚目) */
.postit-note:nth-child(2) h5 {
    color: #2c5980;
}

/* イエローベージュの見出し (3枚目) */
.postit-note:nth-child(3) h5 {
    color: #a1843b;
}

/* 緑の見出し (4枚目) */
.postit-note:nth-child(4) h5 {
    color: #448058;
}

.postit-note p{
    font-size: 0.9rem;
    color: #333;
    line-height: 1.6;
}

@media (max-width: 1200px) {
    .postit-container {
        flex-wrap: wrap; 
        justify-content: center; 
        padding: 0px;
    }
    .postit-note {
		width: calc(25% - 15px);/* 3列表示 */
        margin: 15px 15px;
    }
}

@media (max-width: 800px) {
    .postit-container {
        flex-wrap: wrap; 
        justify-content: center; 
        padding: 0px;
    }
    .postit-note {
		width: calc(25% - 0px);/* 2列表示 */
        margin: 15px 15px;
    }
}

@media (max-width: 580px) {
    .postit-container {
        /* 1列表示のための左寄せに強制的に戻す */
        justify-content: flex-start; 
        padding: 10px;
    }
    .postit-note {
        width: 95%; 
        margin: 10px 20px;
    }
}

/* ---------------------------------------------------- */
/* C. 付箋をクリックして全文表示 */
/* ---------------------------------------------------- */

/* 本文のプレビュー部分のスタイル（CSSで切り詰める場合） */
.postit-content-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* 表示したい行数 */
    overflow: hidden;
    text-overflow: ellipsis; /* ...を付ける */
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.4;
    max-height: calc(1.4em * 3); /* line-height * line-clamp (Fallback) */
}

/* ポップアップ */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(150, 150, 150, 0.6); /* 半透明のグレーの背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* 他の要素より手前に表示 */
}

.postit-popup-large {
    position: relative;
    width: 60%; /* 大きい付箋の幅 */
    max-width: 600px;
    min-height: 200px;
    padding: 40px 40px;
    background-color: #f7f3f5; /* ここをjsで初期化 */
	transition: background-color 0.3s ease; /* 色変更もスムーズにする */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid #d6d1d3;
    animation: fadeIn 0.3s ease-out; /* アニメーション */
	display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 35px;                 /* 見出しと本文の間に適切な間隔を空ける */
}

@media (max-width: 580px) { /* スマホ用 */
    .postit-popup-large {
        width: 90%; /* 画面幅の大部分を使う */
        max-height: 80vh; /* ビューポートの高さの80%まで */
        overflow-y: auto; /* 画面からはみ出た内容をスクロール可能にする */
    }
}

/* ポップアップの見出し (h2) のスタイル */
#popup-title {
    margin-top: 0;
    margin-bottom: 0; /* postit-popup-large の gap で間隔を制御するため、marginをリセット */
    font-size: 1.3rem;
    font-weight: 700;
}

/* ポップアップの本文 (p) のスタイル */
#popup-full-text {
	width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.6;
    text-align: left;
	box-sizing: border-box;
	overflow-wrap: break-word; 
    word-wrap: break-word; /* 互換性のため */
}

/* ポップアップに表示する全文コンテンツは通常時非表示 */
.postit-content-full {
    display: none;
}

/* 付箋内のプレビュー本文の <a> タグをリセット */
#popup-full-text a {
    /* インライン要素として振る舞わせる */
    display: inline;
    
    margin: 0;
    padding: 0;
    width: auto;
	color: #2980b9;
	text-decoration: underline; /* 下線を表示 */
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 30px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    line-height: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}