/**
 * ニュースコンポーネント CSS
 * @description 全ページ共通のニュース表示スタイル
 */

/* ==========================================================================
   ニュースセクションヘッダー
   ========================================================================== */

.news-section-header {
  text-align: center;
  margin-bottom: 32px;
}

.news-section-header h2 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--navy-dark);
  margin: 0;
  word-break: auto-phrase;
  overflow-wrap: break-word;
}

.news-section-header h2::after {
  content: '';
  display: block;
  width: 120px;
  height: 8px;
  background: var(--primary-blue);
  margin: 16px auto 0;
  border-radius: 4px;
}

/* ==========================================================================
   ニュースグリッド
   ========================================================================== */

.news-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 48px;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
}

/* レスポンシブグリッド */
@media (max-width: 767px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* カード数に応じた動的レイアウト */
.news-grid.cards-1 {
  grid-template-columns: 1fr;
  max-width: 600px;
  margin: 0 auto;
}

.news-grid.cards-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  max-width: 800px;
  margin: 0 auto;
}

/* ==========================================================================
   ニュースカード
   ========================================================================== */

.news-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--gray-light);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--gray-border);
}

.news-card-header {
  padding: 1.5rem 1.5rem 0 1.5rem;  /* Instagram統一：24px余白 */
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;  /* Instagram統一：12px gap */
  position: relative;
  min-height: 32px;
}

.news-category-area {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;  /* Instagram統一：8px gap */
  justify-self: start;
  max-width: calc(100% - 100px);
}

.news-date {
  font-size: 0.875rem;
  color: var(--gray-medium);
  font-weight: 500;
  white-space: nowrap;
  justify-self: end;
}

.news-card-content {
  padding: 0.75rem 1.5rem 1.5rem 1.5rem;  /* Instagram統一：内容エリアも24px余白 */
  display: flex;
  flex-direction: column;
  gap: 0.75rem;  /* Instagram統一：12px gap */
  flex: 1;
}

.news-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy-dark);
  line-height: 1.4;
  margin: 0;
  word-break: auto-phrase;
  overflow-wrap: break-word;
}

.news-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-title a:hover {
  color: var(--primary-blue);
}

.news-summary {
  font-size: 0.95rem;
  color: var(--gray-dark);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: auto-phrase;
  overflow-wrap: break-word;
}

/* ==========================================================================
   ニュースカテゴリバッジ
   ========================================================================== */

.news-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-transform: none;
  letter-spacing: 0;
  flex-shrink: 0;
  line-height: 1;
  vertical-align: baseline;
  min-height: 28px;
  height: 28px;
  white-space: nowrap;
  background-color: var(--gray-medium);
}

/* カテゴリ別カラー */
.news-category.announcement {
  background-color: #4a90e2;
}

.news-category.event {
  background-color: #50c8a3;
}

.news-category.media {
  background-color: #9b59b6;
}

.news-category.important {
  background-color: #e74c3c;
}

.news-category.featured {
  background-color: var(--primary-orange);
}

/* ==========================================================================
   ニュース一覧へのボタン
   ========================================================================== */

.news-list-button {
  text-align: center;
  margin: 48px 0 64px 0;
  padding: 24px;
}

.news-list-button .nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  background: var(--primary-blue);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
  min-width: 200px;
}

.news-list-button .nav-btn:hover {
  background: var(--primary-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

/* ==========================================================================
   モバイル対応
   ========================================================================== */

@media (max-width: 768px) {
  .news-section-header {
    margin-bottom: 24px;
  }
  
  .news-section-header h2 {
    font-size: 2rem;
  }
  
  .news-grid {
    margin-bottom: 32px;
  }
  
  .news-card-header {
    padding: 1rem 1rem 0 1rem;  /* Instagram統一：モバイル16px */
  }
  
  .news-card-content {
    padding: 0.5rem 1rem 1rem 1rem;  /* Instagram統一：モバイル16px */
  }
  
  .news-title {
    font-size: 1.1rem;
  }
  
  .news-summary {
    font-size: 0.9rem;
  }
}
