/* news.css - レスポンシブ対応版 */




/* ========================================
   ページタイトルセクション のレスポンシブ対応
   ======================================== */

.news-header {
  text-align: center;
  margin-bottom: 4rem;
}

.news-main-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
}

.news-description {
  font-size: 1.25rem;
  color: #4b5563;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .news-header {
    margin-bottom: 3rem;
  }

  .news-main-title {
    font-size: 1.875rem;
  }

  .news-description {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .news-header {
    margin-bottom: 2rem;
  }

  .news-main-title {
    font-size: 1.5rem;
  }

  .news-description {
    font-size: 0.9rem;
  }
}

/* ========================================
   年度セクション のレスポンシブ対応
   ======================================== */

.year-section {
  margin-bottom: 3rem;
}

.year-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid;
}

/* 年度ごとのボーダー色 */
.year-title.green { border-color: #10b981; }
.year-title.blue { border-color: #3b82f6; }
.year-title.purple { border-color: #9333ea; }
.year-title.gray { border-color: #6b7280; }

@media (max-width: 768px) {
  .year-section {
    margin-bottom: 2.5rem;
  }

  .year-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 480px) {
  .year-section {
    margin-bottom: 2rem;
  }

  .year-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
  }
}

/* ========================================
   ニュースカード のレスポンシブ対応
   ======================================== */

.news-card {
  margin-bottom: 2rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.news-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.news-date {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.news-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.news-content {
  color: #4b5563;
  white-space: pre-line;
  line-height: 1.75;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* タグ表示 */
.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.news-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* カテゴリー色 */
.tag-blue {
  background-color: #dbeafe;
  color: #1e40af;
}

.tag-orange {
  background-color: #ffedd5;
  color: #9a3412;
}

.tag-purple {
  background-color: #f3e8ff;
  color: #6b21a8;
}

.tag-yellow {
  background-color: #fef9c3;
  color: #854d0e;
}

.tag-gray {
  background-color: #f3f4f6;
  color: #4b5563;
}

/* 画像ギャラリー */
.news-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.news-image-link {
  display: inline-block;
}

.news-image {
  height: auto;
  max-height: 20rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0.5rem !important;
  transition: opacity 0.3s ease;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.news-image:hover {
  opacity: 0.9;
}

/* 3xl: 小型ノートPC (1024px) */
@media (max-width: 1024px) {
  .news-card {
    padding: 1.5rem;
  }

  .news-title {
    font-size: 1.125rem;
  }

  .news-content {
    font-size: 0.9rem;
  }

  .news-image {
    max-height: 18rem;
  }
}

/* x-large: 一般的タブレット (768px) */
@media (max-width: 768px) {
  .news-card {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .news-date {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }

  .news-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .news-content {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
  }

  .news-tags {
    gap: 0.375rem;
    margin-bottom: 0.75rem;
  }

  .news-tag {
    padding: 0.2rem 0.625rem;
    font-size: 0.7rem;
  }

  .news-images {
    gap: 0.375rem;
  }

  .news-image {
    max-height: 15rem;
  }
}

/* large: 小型タブレット (600px) */
@media (max-width: 600px) {
  .news-image {
    max-height: 14rem;
  }
}

/* medium: スマホ横・大型スマホ (480px) */
@media (max-width: 480px) {
  .news-card {
    padding: 1rem;
    margin-bottom: 1.25rem;
    border-radius: 0.5rem;
  }

  .news-date {
    font-size: 0.75rem;
  }

  .news-title {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .news-content {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .news-tag {
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
  }

  .news-images {
    gap: 0.25rem;
  }

  .news-image {
    max-height: 16rem;
    border-radius: 0.375rem;
  }
}

/* small: 一般的スマホ (414px以下) */
@media (max-width: 414px) {
  .news-image {
    max-height: 14rem;
  }
}

/* x-small: 小型スマホ (360px以下) */
@media (max-width: 360px) {
  .news-card {
    padding: 0.875rem;
  }

  .news-title {
    font-size: 0.9rem;
  }

  .news-content {
    font-size: 0.75rem;
  }

  .news-image {
    max-height: 12rem;
  }
}

/* ========================================
   空状態表示 のレスポンシブ対応
   ======================================== */

.empty-state {
  text-align: center;
  padding: 3rem 0;
}

.empty-icon {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.empty-text {
  color: #4b5563;
  font-size: 1.125rem;
}

@media (max-width: 768px) {
  .empty-state {
    padding: 2rem 0;
  }

  .empty-icon {
    font-size: 3rem;
  }

  .empty-text {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .empty-state {
    padding: 1.5rem 0;
  }

  .empty-icon {
    font-size: 2.5rem;
  }

  .empty-text {
    font-size: 0.9rem;
  }
}

/* ========================================
   セクション間隔 のレスポンシブ対応
   ======================================== */

.news-section {
  margin-top: 2rem;
  padding-bottom: 3rem;
}

@media (max-width: 768px) {
  .news-section {
    margin-top: 1.5rem;
    padding-bottom: 2rem;
  }
}

@media (max-width: 480px) {
  .news-section {
    margin-top: 1rem;
    padding-bottom: 1.5rem;
  }
}

/* ========================================
   画像レスポンシブグリッド
   ======================================== */

/* デスクトップ: 画像を横並び */
@media (min-width: 769px) {
  .news-images {
    display: flex;
    flex-wrap: wrap;
  }

  .news-image-link {
    flex: 0 0 auto;
  }

  .news-image {
    max-width: 100%;
  }
}

/* タブレット: 画像を2列 */
@media (max-width: 768px) and (min-width: 481px) {
  .news-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .news-image-link {
    display: flex;
    justify-content: center;
    align-items: center;
  }


}

/* スマホ: 画像を1列 */
@media (max-width: 480px) {
  .news-images {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .news-image-link {
    width: 100%;
    display: flex;
    justify-content: center;
  }

}

/* ========================================
   年度ナビゲーション（join.phpと共通）
   ======================================== */

.page-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: 3rem;
}

.page-nav-bottom {
  position: static;
  margin-top: 2rem;
  margin-bottom: 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: none;
}

.page-nav-container {
  display: flex;
  flex-wrap: wrap; /* 改行を許可 */
  padding: 1rem 0;
  gap: 0.75rem;
}

.nav-btn {
  white-space: nowrap;
  padding: 0.5rem 1.5rem;
  border-radius: 9999px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-btn:hover {
  opacity: 0.9;
}

/* スクロール先のセクションがナビゲーションバーの下に隠れないようにする */
.year-section {
  scroll-margin-top: 120px; /* ナビゲーションバーの高さ + 余白 */
}

/* IDを持つすべての要素に適用 */
[id] {
  scroll-margin-top: 120px;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

@media (max-width: 768px) {
  .page-nav-container {
    gap: 0.5rem;
    padding: 0.75rem 0;
    flex-wrap: nowrap; /* 改行を禁止 */
    overflow-x: auto; /* 横スクロールを有効化 */
    -ms-overflow-style: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: #3b82f6 #e9ecef !important;
  }

  /* 小画面ではスクロールバーを表示（scrollbar-hideを上書き） */
  .page-nav-container.scrollbar-hide::-webkit-scrollbar {
    display: block !important;
    height: 8px;
  }

  .page-nav-container.scrollbar-hide::-webkit-scrollbar-track {
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    border-radius: 20px;
    margin: 0 0.5rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .page-nav-container.scrollbar-hide::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
  }

  .page-nav-container.scrollbar-hide::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 3px 6px rgba(59, 130, 246, 0.5);
    transform: scaleY(1.1);
  }

  .page-nav-container.scrollbar-hide::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
  }

  .nav-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }

  /* モバイルではナビゲーションバーの高さが異なる可能性があるため調整 */
  .year-section,
  [id] {
    scroll-margin-top: 100px;
  }
}

@media (max-width: 480px) {
  .nav-btn {
    padding: 0.35rem 0.875rem;
    font-size: 0.75rem;
  }

  .year-section,
  [id] {
    scroll-margin-top: 90px;
  }
}

/* ========================================
   ライトボックス
   ======================================== */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: opacity 0.15s ease;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  z-index: 10001;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  z-index: 10001;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

.lightbox-counter {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  z-index: 10001;
}

/* タブレット・スマホ対応 */
@media (max-width: 768px) {
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }

  .lightbox-nav {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }

  .lightbox-prev {
    left: 1rem;
  }

  .lightbox-next {
    right: 1rem;
  }

  .lightbox-counter {
    bottom: 1.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }

  .lightbox-content img {
    max-height: 80vh;
  }
}

@media (max-width: 480px) {
  .lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.25rem;
  }

  .lightbox-nav {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.25rem;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }

  .lightbox-counter {
    bottom: 1rem;
    padding: 0.35rem 0.875rem;
    font-size: 0.75rem;
  }

  .lightbox-content img {
    max-height: 75vh;
  }
}