/* 名瀬第二町内会 カスタムスタイル */

:root {
  --primary-color: #4169e1;
  --secondary-color: #6495ed;
  --accent-color: #87ceeb;
  --light-blue: #f0f8ff;
  --text-dark: #2d2d2d;
  --border-color: #e0e0e0;
}

body {
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic Medium', 'Meiryo', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: #f8f9fa;
}

/* ヘッダー */
.navbar-custom {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.3rem;
  color: white !important;
}

.navbar-nav .nav-link {
  color: rgba(255,255,255,0.9) !important;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
  color: white !important;
}

/* ヒーローセクション */
.hero-section {
  background-color: #4169e1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  color: white;
  padding: 5rem 0;
  text-align: center;
  min-height: 400px;
  display: flex;
  align-items: center;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(65, 105, 225, 0.6), rgba(100, 149, 237, 0.6));
  z-index: 1;
}

.hero-section .container {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  letter-spacing: 0.5px;
}

.hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.95;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  margin-bottom: 0.8rem;
  font-weight: 400;
}

/* カードスタイル */
.news-card {
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border-radius: 10px;
  overflow: hidden;
}

.news-card.h-100 {
  transition: all 0.3s ease;
  border: 1px solid #e0e0e0;
}

.news-card.h-100:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: var(--primary-color);
}

.news-card .card-img-top {
  border-radius: 10px 10px 0 0;
  transition: transform 0.3s ease;
}

.news-card .news-thumbnail:hover .card-img-top {
  transform: scale(1.02);
}

.news-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.news-card .news-content {
  color: #666;
  line-height: 1.6;
  font-size: 0.95rem;
}

.news-card .news-meta {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 0.5rem;
}

.news-card .btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 500;
  transition: all 0.2s ease;
}

.news-card .btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateX(3px);
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-header {
  background: var(--light-blue);
  border-bottom: 1px solid var(--border-color);
  font-weight: bold;
}

.news-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item:hover {
  background-color: var(--light-blue);
}

.news-date {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.news-title {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.news-content {
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.5;
}

.badge-important {
  background-color: #dc3545;
}

.badge-category {
  background-color: var(--secondary-color);
}

/* フッター */
.footer {
  background-color: var(--primary-color);
  color: white;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer h5 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.footer p {
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

/* サムネイル関連のスタイル */
.newsletter-preview img {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.newsletter-preview img:hover {
  transform: scale(1.02);
}

.thumbnail-container {
  position: relative;
  overflow: hidden;
}

.thumbnail-container img {
  transition: all 0.3s ease;
}

.thumbnail-container:hover img {
  transform: scale(1.05);
}

.pdf-fallback-icon {
  background: linear-gradient(135deg, var(--light-blue), #e6f3ff);
  border: 2px solid var(--primary-color);
}

/* サムネイル読み込み中のスケルトン */
.thumbnail-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* バックナンバー表示 */
.back-number-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-number-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.collapse-toggle {
  transition: all 0.3s ease;
}

.collapse-toggle[aria-expanded="true"] {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.year-section {
  border-left: 3px solid var(--primary-color);
  padding-left: 1rem;
}

.back-number-list-item {
  transition: background-color 0.2s ease;
}

.back-number-list-item:hover {
  background-color: var(--light-blue) !important;
}

#allBackNumbers .card-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* 折りたたみアニメーション */
.collapsing {
  transition: height 0.35s ease;
}

/* 添付ファイル・サムネイル表示 */
.news-thumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.news-thumbnail img {
  transition: transform 0.3s ease;
  max-height: 300px;
  object-fit: cover;
  width: 100%;
}

.news-thumbnail:hover img {
  transform: scale(1.05);
}

/* トップページ用小サイズサムネイル */
.news-thumbnail-small {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.news-thumbnail-small img {
  transition: transform 0.3s ease;
  border: 1px solid var(--border-color);
}

.news-thumbnail-small:hover img {
  transform: scale(1.03);
}

.news-attachments {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.news-attachments h6 {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.news-attachments .btn {
  transition: all 0.2s ease;
  border-radius: 6px;
}

/* 会長のあいさつページ用スタイル */
.president-photo {
  max-width: 200px;
  margin: 0 auto;
}

.president-photo img {
  width: 100%;
  height: auto;
  max-width: 200px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* トップページの会長のあいさつセクション用 */
.president-photo-small {
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.president-photo-small img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

/* サイドバー広報誌サムネイル */
.newsletter-thumbnail {
  flex-shrink: 0;
}

.newsletter-thumb-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.newsletter-thumb-wrapper:hover {
  transform: scale(1.05);
}

.newsletter-thumb-fallback {
  transition: background 0.2s ease;
}

.newsletter-thumb-fallback:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important;
}

/* タイル表示用スタイル */
.news-card.h-100 {
  transition: all 0.3s ease;
  border: 1px solid #e0e0e0;
}

.news-card.h-100:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: var(--primary-color);
}

.news-card .card-img-top {
  border-radius: 10px 10px 0 0;
  transition: transform 0.3s ease;
}

.news-card .news-thumbnail:hover .card-img-top {
  transform: scale(1.02);
}

.news-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.news-card .news-content {
  color: #666;
  line-height: 1.6;
  font-size: 0.95rem;
}

.news-card .news-meta {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 0.5rem;
}

.news-card .btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 500;
  transition: all 0.2s ease;
}

.news-card .btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateX(3px);
}

/* アニメーション */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* カテゴリフィルター */
.category-filter {
  transition: all 0.3s ease;
}

.category-filter.active {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.filter-active-indicator {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* カテゴリフィルター用ボタンのホバー効果 */
.btn-outline-primary:hover {
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* フィルター解除ボタン */
.btn-filter-clear {
  border: 2px solid #dc3545;
  color: #dc3545;
  background: transparent;
  transition: all 0.3s ease;
}

.btn-filter-clear:hover {
  background: #dc3545;
  color: white;
  transform: scale(1.05);
}

/* フィルター情報アラート */
.alert-filter-info {
  border-left: 4px solid var(--primary-color);
  background: linear-gradient(90deg, rgba(65, 105, 225, 0.1) 0%, rgba(255, 255, 255, 0.1) 100%);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .news-card {
    margin-bottom: 1rem;
  }
  
  .news-thumbnail {
    margin-bottom: 1rem;
  }
  
  .news-attachments .col-md-6 {
    margin-bottom: 0.5rem;
  }
  
  .news-attachments .btn {
    font-size: 0.875rem;
  }
  
  .news-card .card-img-top {
    height: 160px;
  }
  
  .news-card .card-title {
    font-size: 1rem;
  }
  
  .news-card .news-content {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding: 2rem 0;
    min-height: 250px;
  }
  
  .hero-section::before {
    background: linear-gradient(rgba(65, 105, 225, 0.8), rgba(100, 149, 237, 0.8));
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .col-md-6 {
    margin-bottom: 1rem;
  }
  
  .news-card .card-img-top {
    height: 140px;
  }
}

/* 賛助会員カード */
.sponsors-card {
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.sponsors-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border-color: var(--primary-color);
}

.sponsors-card .card-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.sponsors-card .card-text {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: #6c757d;
}

.sponsors-card .btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

.sponsors-card .btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

@media (max-width: 768px) {
  .sponsors-card .card-title {
    font-size: 1rem;
  }
  
  .sponsors-card .card-text {
    font-size: 0.85rem;
  }
}
