/* --- 評価推進機構ニュースページ (newsletter.html) --- */
.newsletter-container {
    padding: 0 16px;
    max-width: 1000px;
    margin: 0 auto;
}

.newsletter-section {
    margin-bottom: 40px;
}

/* 最新号カード */
.latest-newsletter-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: visible; /* バッジ用 */
    position: relative;
}

@media (min-width: 640px) {
    .latest-newsletter-card {
        display: grid;
        /* 画像カラムを420pxに拡大 */
        grid-template-columns: 420px 1fr;
        align-items: start; 
    }
}

/* 画像ラッパー (共通) */
.latest-newsletter-image-wrapper,
.newsletter-image-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background-color: var(--white); 
    display: flex;
    align-items: flex-start; 
    justify-content: center;
}

.latest-newsletter-image-wrapper {
    height: auto;
    /* 高さを自動調整 */
    min-height: auto; 
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    border-right: 1px solid var(--border-color);
    padding: 16px; /* 画像周りの余白 */
}

/* スマホ表示時は上の角丸 */
@media (max-width: 639px) {
    .latest-newsletter-image-wrapper {
        min-height: auto;
        border-top-right-radius: 8px;
        border-bottom-left-radius: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0; /* スマホでは余白なし */
    }
}

/* 画像本体 (共通アニメーション) */
.newsletter-card-image {
    width: 100%;
    height: auto; 
    object-fit: contain; 
    display: block;
    transition: transform 0.5s ease;
    /* 影をつけて書類っぽさを出す */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
}

/* ホバー時に画像を拡大 */
.latest-newsletter-image-wrapper:hover .newsletter-card-image,
.newsletter-image-wrapper:hover .newsletter-card-image {
    transform: scale(1.02); 
}

/* NEWバッジ (インライン型) */
.badge-new {
    display: inline-block;
    background-color: #d93025;
    color: white;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 12px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
}

.latest-newsletter-image-wrapper:hover .image-overlay,
.newsletter-image-wrapper:hover .image-overlay {
    opacity: 1;
}

.image-overlay .fas {
    font-size: 24px;
    margin-bottom: 8px;
}

.latest-newsletter-content {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%; 
    box-sizing: border-box;
}

/* スマホでのパディング調整 */
@media (max-width: 639px) {
    .latest-newsletter-content {
        padding: 24px;
    }
}

.latest-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.latest-newsletter-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.latest-newsletter-date {
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 24px;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 12px;
    display: block;
}

.latest-newsletter-topics {
    margin-bottom: 32px;
    text-align: left;
}

.topics-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color-dark);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 5px solid var(--secondary-color);
    padding-left: 12px;
}

.topics-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.topics-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color-dark);
    border-bottom: 1px dashed #eee;
    padding-bottom: 6px;
}

.topics-list li:last-child {
    border-bottom: none;
}

.topics-list li::before {
    content: '\f00c'; /* check icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 5px;
    font-size: 14px;
    color: var(--secondary-color);
}

/* バックナンバーグリッド */
.newsletter-grid {
    display: grid;
    /* カードの最小幅を230pxに設定 */
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 24px;
}

@media (min-width: 992px) {
    .newsletter-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.newsletter-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.newsletter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.newsletter-card-image {
    width: 100%;
    object-fit: contain; 
    display: block;
}

.newsletter-card-content {
    padding: 16px 12px 8px 12px;
    flex-grow: 1;
}

.newsletter-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color-dark);
    margin: 0 0 6px 0;
}

.newsletter-card-date {
    font-size: 13px;
    color: var(--text-color);
    margin: 0;
}

.newsletter-card-footer {
    /* 横パディングを増やしてボタンの収まりを良くする */
    padding: 0 16px 20px 16px; 
    /* ボタンがはみ出さないようにボックスサイズを調整 */
    box-sizing: border-box;
}

/* --- PDFボタン (赤色系に統一) --- */

/* バックナンバー用: 白背景 + 赤枠 */
.btn-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* パディングを調整し、ボックスサイズを明示 */
    padding: 10px 4px; 
    box-sizing: border-box; /* ★重要: パディングを含めた幅計算 */
    background-color: var(--white);
    color: #d93025; /* PDFレッド */
    border: 1px solid #d93025;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px; 
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    white-space: nowrap; /* 折り返し禁止 */
}

.btn-pdf:hover {
    background-color: #d93025;
    color: var(--white);
    box-shadow: 0 4px 8px rgba(217, 48, 37, 0.3);
}

.btn-pdf i {
    margin-right: 6px;
    font-size: 1.2em; 
}

/* 最新号用: 赤背景 + 白文字 (目立つように) */
.btn-pdf-primary {
    background-color: #d93025;
    color: var(--white);
    border: none;
    font-size: 16px;
    padding: 14px 32px; 
    width: 100%; 
    /* ★追加: これではみ出しを防ぐ */
    box-sizing: border-box;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 100px;
    box-shadow: 0 4px 10px rgba(217, 48, 37, 0.3);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 10px;
}

@media (min-width: 640px) {
    .btn-pdf-primary {
        width: auto; 
        align-self: flex-start; 
        padding: 14px 40px;
    }
}

.btn-pdf-primary:hover {
    background-color: #b31e12; 
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(217, 48, 37, 0.4);
}


/* もっと見るボタンコンテナ */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.btn-secondary {
    background-color: var(--white);
    color: var(--text-color-dark);
    border: 1px solid var(--border-color);
    padding: 12px 40px;
    border-radius: 100px;
    font-weight: 700;
    transition: all 0.3s;
    font-size: 16px;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #f1f3f4;
    border-color: #bbb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* フェードインアニメーション */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ローディングスピナー */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    text-align: center;
    color: #d93025;
    padding: 20px;
    background-color: #fce8e6;
    border-radius: 8px;
}