/* ==========================================
   News一覧（トップページ）
   ========================================== */
.news-section {
    padding: 60px 0;
    margin: 0 auto;
}

.news-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #333;
    width: 90%;
    margin: 0 auto;
}

.news-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #222;
    text-decoration: none;
    color: #eee;
    transition: background 0.3s, transform 0.2s;
    position: relative;
}

.news-item:hover {
    background: rgba(255, 79, 163, 0.05);
    transform: translateX(5px);
}

.news-date {
    font-size: 14px;
    color: #888;
    width: 120px;
    flex-shrink: 0;
}

.new-badge {
    background: #ff4fa3;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 15px;
    text-transform: uppercase;
}

.news-title {
    font-size: 16px;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-footer {
    text-align: right;
    margin-top: 20px;
}

.view-all {
    color: #888;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.view-all:hover {
    color: #ff4fa3;
}

/* ==========================================
   News詳細ページ：画像ギャラリーの並びと正方形トリミング
   ========================================== */
.news-detail-page {
    padding: 40px 20px;
    line-height: 1.8;
}

.detail-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.detail-date {
    color: #888;
    font-size: 14px;
}

.detail-title {
    font-size: 28px;
    margin: 10px 0;
}

.detail-text {
    font-size: 16px;
    margin-bottom: 40px;
    white-space: pre-wrap;
}

/* 画像ギャラリーの並び方修正 */
.detail-gallery {
    display: flex;       /* gridからflexに変更 */
    flex-wrap: wrap;     /* 折り返し許可 */
    gap: 10px;           /* 画像同士の隙間を狭く（お好みで調整） */
    margin: 30px 0;
    justify-content: flex-start; /* 左詰め（中央寄せならcenter） */
}

/* ★サムネイル（透かしの枠）を正方形に固定 */
.detail-gallery .image-watermark {
    width: 200px;        /* 幅を200pxに固定 */
    height: 200px;       /* 高さを200pxに固定（正方形） */
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s;
    overflow: hidden;    /* はみ出した部分を隠す（トリミング） */
    position: relative;
}

/* ★画像を正方形の枠いっぱいに広げ、上下をトリミング */
.detail-gallery .news-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;    /* 縦横比を崩さず、枠を埋める。はみ出し分はトリミング */
    object-position: center; /* 中央を中心にトリミング（上下が切れる） */
    display: block;
}

/* 透かしの密度調整 */
.detail-gallery .image-watermark .watermark {
    background-size: 80px 80px !important;
    opacity: 0.15 !important;
}

.detail-gallery .image-watermark:hover {
    transform: scale(1.05);
    border-color: #ff4fa3;
}

/* ==========================================
   付箋スタイルのリンクカード
   ========================================== */
.detail-links {
    display: flex;
    flex-direction: column; /* 縦に並べる */
    gap: 15px;              /* 付箋同士の隙間 */
    margin-top: 30px;
}

/* 作品詳細と共通のデザイン */
.web-link-area {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #ff4fa3; /* あのピンクの線 */
}

.link-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.web-url-text {
    color: #ff4fa3;
    text-decoration: none;
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
}

.link-url-full {
    display: block;
    font-family: monospace;    /* URLっぽく等幅フォントに */
}

/* ==========================================
   モーダル：画面最前面・中央固定
   ========================================== */
/* IDで指定することで style.css より優先順位を高くします */
#newsModal {
    display: none; /* JSでflexに切り替え */
    position: fixed !important;
    z-index: 999999 !important; /* 絶対に一番上 */
    inset: 0 !important;        /* top, left, right, bottom すべて 0 */
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.95) !important;
    margin: 0 !important;
    padding: 0 !important;
    
    /* 中央揃え */
    align-items: center !important;
    justify-content: center !important;
}

.news-modal-content {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 90% !important;
    max-width: 900px !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
}

.news-modal-close {
    position: absolute !important;
    top: -50px !important;
    right: 0 !important;
    color: #fff !important;
    font-size: 40px !important;
    cursor: pointer !important;
    line-height: 1;
}

.modal-image-display {
    max-width: 100% !important;
    max-height: 85vh !important;
    object-fit: contain !important;
    border-radius: 4px;
}
/* ==========================================
   レスポンシブ
   ========================================== */
@media screen and (max-width: 768px) {
    .news-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .news-date {
        width: auto;
    }
    .news-title {
        width: 100%;
        white-space: normal;
    }
    /* ★スマホでも正方形に */
    .detail-gallery .image-watermark {
        width: calc(50% - 5px); /* 2列並び */
        height: auto;
        aspect-ratio: 1 / 1;    /* 正方形の比率を維持 */
    }
}