/* style.css - サイト全体の基本スタイル */

:root {
  /* 明るくポップなカラーパレット（水色系へ変更） */
  --primary-color: #4facfe;
  /* さわやかな水色 */
  --secondary-color: #00f2fe;
  /* シアン系 */
  --accent-color: #fff3e0;
  /* アクセントの薄オレンジ */
  --text-color: #333333;
  --text-light: #666666;
  --bg-color: #eef7ff;
  /* ベースの薄い水色 */
  --card-bg: #ffffff;
  --border-color: #e0eaf5;
  --tag-bg: #e1f5fe;
  --tag-text: #0277bd;

  --font-main: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', Meiryo, メイリオ, sans-serif;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 40px;
  --border-radius: 12px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  color: var(--text-color);
  background-color: var(--bg-color);
  background-image:
    radial-gradient(#d4eaff 1px, transparent 1px);
  background-size: 20px 20px;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  opacity: 0.8;
}

/* Typography */
h1,
h2,
h3,
h4 {
  color: var(--text-color);
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1.5rem;
  text-align: center;
  position: relative;
  padding-bottom: 10px;
  margin-bottom: var(--spacing-xl);
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  border-radius: 3px;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.site-header {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
}

.site-title {
  font-size: 1.3rem;
  font-weight: bold;
  background: linear-gradient(120deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  white-space: nowrap;
}

nav ul {
  display: flex;
  list-style: none;
  gap: var(--spacing-lg);
}

nav a {
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.95rem;
}

nav a:hover,
nav a.active {
  color: var(--primary-color);
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-color);
}

main {
  padding: var(--spacing-xl) 0;
  min-height: calc(100vh - 160px);
  /* header+footer approx */
}

footer {
  background: white;
  text-align: center;
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(120deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-radius: 30px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  color: white;
  opacity: 1;
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* Card UI */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-img-placeholder {
  height: 180px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 2rem;
  object-fit: cover;
  width: 100%;
}

.card-img {
  height: 180px;
  width: 100%;
  object-fit: cover;
}

/* 参加前イベント用（画像なしカード）の調整 */
.card.no-image .card-content {
  padding-top: var(--spacing-lg);
  /* 少し上部の余白を増やす */
}


.card-content {
  padding: var(--spacing-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* 横見切れ防止 */
  overflow-wrap: anywhere;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: var(--spacing-sm);
  flex-wrap: wrap;
  /* スマホで縮んだ時にメタ情報が重ならないように折返し */
  gap: 4px;
}

.card-title {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  /* スマホ縦長対策：2行で省略 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  /* 長い単語(URL等)による横はみ出しを防ぐ */
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: var(--spacing-md);
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--spacing-sm);
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
}

.category {
  background: #ffe0b2;
  color: #e65100;
}

.area {
  background: #e1bee7;
  color: #4a148c;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: var(--spacing-xl) 0;
  background: radial-gradient(circle at center, #ffffff 0%, var(--accent-color) 100%);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--box-shadow);
}

.hero p {
  color: var(--text-light);
  margin-bottom: var(--spacing-lg);
  font-size: 1.1rem;
}

/* Sections */
.section {
  margin-bottom: var(--spacing-xl);
}

.text-center {
  text-align: center;
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

/* Profile Card */
.profile-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  box-shadow: var(--box-shadow);
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.profile-icon {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  flex-shrink: 0;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
  font-weight: bold;
  overflow: hidden;
}

.profile-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-info {
  flex: 1;
}

.profile-info h3 {
  margin-bottom: 5px;
}

.profile-info p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.profile-action {
  flex-shrink: 0;
}

/* ========================================================================= */
/* P9: Home Weather Section Styles */
/* ========================================================================= */

.home-weather-content {
  margin-top: var(--spacing-md);
}

.weather-weekly-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

@media (min-width: 768px) {
  .weather-weekly-container {
    flex-direction: row;
  }
}

.weather-area-card {
  flex: 1;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
}

.weather-area-title {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-md);
  color: var(--primary-color);
  text-align: center;
  border-bottom: 2px dashed var(--border-color);
  padding-bottom: var(--spacing-sm);
}

.weather-days-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.weather-day-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.weather-day-item:last-child {
  border-bottom: none;
}

.weather-today-highlight {
  background-color: #fff9e6;
  /* 薄い黄色で今日を強調 */
  border-radius: 6px;
  padding: var(--spacing-sm) var(--spacing-sm);
  margin: 0 calc(var(--spacing-sm) * -1);
}

.weather-date {
  flex: 0 0 70px;
  font-weight: bold;
  color: var(--text-color);
}

.weather-desc {
  flex: 1;
  text-align: left;
  padding: 0 var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
}

.weather-temps {
  flex: 0 0 135px;
  text-align: right;
  font-weight: bold;
  white-space: nowrap;
}

.temp-high {
  color: #e53935;
  /* 赤系統 */
}

.temp-low {
  color: #1e88e5;
  /* 青系統 */
}

.weather-pop {
  flex: 0 0 70px;
  text-align: right;
  color: var(--text-light);
}

.weather-map-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  margin-bottom: var(--spacing-lg);
}

.weather-map-link {
  display: block;
  text-align: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.weather-map-link:hover {
  opacity: 0.9;
  border-color: var(--primary-color);
}

.weather-map-img {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.weather-source-info {
  text-align: right;
  color: var(--text-light);
  line-height: 1.4;
  margin-top: calc(var(--spacing-md) * -1);
  /* 少し詰める */
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: block;
  }

  nav ul {
    display: none;
    /* Hide by default on mobile, toggled via JS */
    width: 100%;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-md);
  }

  nav ul.show {
    display: flex;
  }

  nav a {
    display: block;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
  }

  .section {
    margin-bottom: var(--spacing-md);
    /* 余白を圧縮 */
  }

  .card-grid {
    grid-template-columns: 1fr;
    /* 1 column on mobile */
    gap: var(--spacing-sm);
    /* カード間余白を圧縮 */
  }

  .card-content {
    padding: var(--spacing-sm);
    /* スマホ用のカード内余白圧縮 */
  }

  .hero {
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-lg);
  }

  h2 {
    margin-bottom: var(--spacing-lg);
  }

  .profile-card {
    flex-direction: column;
    text-align: center;
  }

  .profile-icon {
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
    font-size: 2rem;
  }

  .profile-action {
    margin-top: var(--spacing-md);
  }
}

/* ========================================================================= */
/* P14: Calendar Grid Colors (Sat, Sun, Holiday) */
/* ========================================================================= */

/* カレンダー等のセル背景色（薄い色を付ける） */
.cell-sat {
  background-color: rgba(80, 140, 255, 0.08) !important;
}

.cell-sun {
  background-color: rgba(255, 80, 120, 0.08) !important;
}

.cell-holiday {
  background-color: rgba(255, 140, 80, 0.10) !important;
}

/* ========================================================================= */
/* Watermark Layer */
/* ========================================================================= */
#site-watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-repeat: repeat;
  background-position: 0 0;
  opacity: 1;
  /* SVG内のfill-opacityで調整するため1を維持 */
}

/* ========================================================================= */
/* P11: Freshness Badges */
/* ========================================================================= */
.freshness-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.freshness-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
}

.status-upcoming {
  background: #e3f2fd;
  color: #1565c0;
}

.status-ongoing {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-ended {
  background: #f5f5f5;
  color: #757575;
}

.freshness-today {
  background: #ffebee;
  color: #c62828;
}

.freshness-tomorrow {
  background: #fff3e0;
  color: #ef6c00;
}

.freshness-weekend {
  background: #f3e5f5;
  color: #6a1b9a;
}