/* ========================================
   nagasaki-flyer 公開サイト
   ネイビー＋ゴールドの上質デザイン
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Noto+Serif+JP:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

:root {
  --navy-900: #0b1426;
  --navy-800: #0f172a;
  --navy-700: #1e293b;
  --navy-600: #334155;
  --navy-500: #475569;
  --gold-600: #b8954f;
  --gold-500: #c9a961;
  --gold-400: #d4b876;
  --gold-300: #e5cc99;
  --bg-base:   #fafaf7;
  --bg-card:   #ffffff;
  --text-main: #1a1f2e;
  --text-sub:  #5a6478;
  --text-muted:#8a93a6;
  --border:    #e8e6df;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont,
               "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg-base);
  color: var(--text-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-700); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-600); }
img { max-width: 100%; height: auto; display: block; }

/* ヘッダー */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--navy-800);
}
.site-logo:hover { color: var(--navy-800); }

.site-logo .logo-en {
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--gold-600);
}

.site-logo .logo-jp {
  font-family: "Noto Serif JP", serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--navy-700);
}

.header-portal-link {
  font-size: 12px;
  color: var(--text-sub);
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.2s;
}
.header-portal-link:hover {
  border-color: var(--gold-500);
  color: var(--gold-600);
}

/* AI検索 Hero */
.ai-hero {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  position: relative;
  overflow: hidden;
  padding: 56px 20px 64px;
  color: #fff;
}

.ai-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(201,169,97,0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(201,169,97,0.06) 0%, transparent 40%);
  pointer-events: none;
}

.ai-hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.ai-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(201,169,97,0.4);
  border-radius: 999px;
  font-family: "Cormorant Garamond", serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--gold-300);
  margin-bottom: 18px;
}

.ai-hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-400);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}

.ai-hero h1 {
  font-family: "Noto Serif JP", serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.5;
  margin-bottom: 10px;
  color: #fff;
}

.ai-hero-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 32px;
  letter-spacing: 0.05em;
}

/* AI検索ボックス */
.ai-search-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(201,169,97,0.3);
  border-radius: 14px;
  padding: 4px;
  display: flex;
  align-items: stretch;
  max-width: 640px;
  margin: 0 auto;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-search-box:focus-within {
  border-color: var(--gold-400);
  box-shadow: 0 0 0 4px rgba(201,169,97,0.15);
}

.ai-search-box textarea {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  padding: 14px 16px;
  outline: none;
  resize: none;
  line-height: 1.5;
  min-height: 48px;
  max-height: 120px;
}

.ai-search-box textarea::placeholder {
  color: rgba(255,255,255,0.4);
}

.ai-search-mic,
.ai-search-submit {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
}
.ai-search-mic:hover,
.ai-search-submit:hover {
  background: rgba(201,169,97,0.15);
  color: var(--gold-300);
}
.ai-search-mic.recording {
  background: rgba(220,38,38,0.2);
  color: #fca5a5;
  animation: pulse 1.5s infinite;
}

.ai-search-submit {
  background: var(--gold-500);
  color: var(--navy-900);
  margin: 4px 4px 4px 0;
}
.ai-search-submit:hover {
  background: var(--gold-400);
  color: var(--navy-900);
}

.ai-search-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 例文チップ */
.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  padding: 0 12px;
}

.example-chips-label {
  width: 100%;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  font-family: "Cormorant Garamond", serif;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.chip:hover {
  background: rgba(201,169,97,0.15);
  border-color: var(--gold-400);
  color: var(--gold-300);
}

/* AI解析中ローディング */
.ai-thinking {
  display: none;
  margin-top: 18px;
  font-size: 13px;
  color: var(--gold-300);
  letter-spacing: 0.05em;
}
.ai-thinking.active { display: block; }

.ai-thinking .dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}
.ai-thinking .dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-400);
  animation: bounce 1.4s infinite;
}
.ai-thinking .dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* AI検索結果サマリー */
.ai-result-summary {
  background: linear-gradient(to right, rgba(201,169,97,0.08), transparent);
  border-left: 3px solid var(--gold-500);
  padding: 14px 18px;
  margin-bottom: 24px;
  border-radius: 0 6px 6px 0;
}

.ai-result-summary .label {
  font-family: "Cormorant Garamond", serif;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--gold-600);
  margin-bottom: 4px;
}

.ai-result-summary .text {
  font-size: 14px;
  color: var(--navy-700);
  line-height: 1.6;
}

.ai-result-summary .clear-link {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 6px;
  display: inline-block;
}

/* コンテナ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 36px 0; }

.section-title {
  font-family: "Noto Serif JP", serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.05em;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 18px;
  background: var(--gold-500);
}

/* 業種タブ */
.category-tabs {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 40;
}

.category-tabs-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-tabs-inner::-webkit-scrollbar { display: none; }

.category-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}

.category-tab:hover { color: var(--navy-800); }

.category-tab.active {
  color: var(--gold-600);
  border-bottom-color: var(--gold-500);
}

.category-tab .icon { font-size: 16px; }

/* 地域フィルタ */
.area-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  align-items: center;
}

.area-filter-label {
  font-size: 12px;
  color: var(--text-sub);
  font-family: "Noto Serif JP", serif;
  letter-spacing: 0.1em;
}

.area-pill {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-sub);
  background: #fff;
  transition: all 0.2s;
}

.area-pill:hover {
  border-color: var(--gold-500);
  color: var(--gold-600);
}

.area-pill.active {
  background: var(--navy-800);
  color: var(--gold-300);
  border-color: var(--navy-800);
}

/* チラシグリッド */
.flyer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.flyer-card {
  background: var(--bg-card);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.25s;
  position: relative;
  color: var(--text-main);
}

.flyer-card:hover {
  border-color: var(--gold-400);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(11,20,38,0.08);
  color: var(--text-main);
}

.flyer-card-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f1efea;
  position: relative;
  overflow: hidden;
}

.flyer-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flyer-card-thumb .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  opacity: 0.4;
}

.flyer-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #fff;
}

.flyer-card-badge.featured  { background: var(--gold-600); }
.flyer-card-badge.expiring  { background: rgba(220,38,38,0.95); }

.flyer-card-body {
  padding: 14px 14px 16px;
}

.flyer-card-store {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-sub);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.flyer-card-store-logo {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
  background: #f1efea;
}

.flyer-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-800);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flyer-card-period {
  font-size: 11px;
  color: var(--text-muted);
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.05em;
}

/* 空状態 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state .text {
  font-size: 14px;
  margin-bottom: 8px;
  font-family: "Noto Serif JP", serif;
}

/* AIアシスタントカード（0件時の代替提案） */
.ai-assistant-card {
  background: linear-gradient(135deg, #fff 0%, #fafaf7 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 28px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.ai-assistant-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--gold-500), var(--gold-400), var(--gold-500));
}

.ai-assistant-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.ai-assistant-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(11, 20, 38, 0.15);
}

.ai-assistant-label {
  font-family: "Cormorant Garamond", serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold-600);
  font-weight: 600;
  margin-bottom: 2px;
}

.ai-assistant-name {
  font-family: "Noto Serif JP", serif;
  font-size: 14px;
  color: var(--navy-800);
  font-weight: 600;
}

.ai-assistant-message {
  font-size: 15px;
  color: var(--navy-700);
  line-height: 1.7;
  margin-bottom: 20px;
  padding-left: 58px;
}

.ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--navy-800);
  transition: all 0.2s;
}

.ai-suggestion-item:hover {
  border-color: var(--gold-500);
  background: linear-gradient(to right, rgba(201,169,97,0.05), transparent);
  transform: translateX(2px);
  text-decoration: none;
  color: var(--navy-800);
}

.ai-suggestion-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.ai-suggestion-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy-700);
}

.ai-suggestion-count {
  font-family: "Cormorant Garamond", serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-600);
  background: rgba(201,169,97,0.1);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.ai-suggestion-arrow {
  color: var(--text-muted);
  font-size: 20px;
  font-weight: 300;
  transition: transform 0.2s, color 0.2s;
}

.ai-suggestion-item:hover .ai-suggestion-arrow {
  color: var(--gold-500);
  transform: translateX(3px);
}

/* フッター */
.site-footer {
  background: var(--navy-900);
  color: rgba(255,255,255,0.7);
  padding: 36px 20px;
  margin-top: 60px;
  text-align: center;
  border-top: 1px solid var(--gold-600);
}

.site-footer .footer-brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  letter-spacing: 0.1em;
  color: var(--gold-400);
  margin-bottom: 14px;
}

.site-footer .footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.site-footer .footer-links a { color: rgba(255,255,255,0.7); }
.site-footer .footer-links a:hover { color: var(--gold-300); }

.site-footer .copyright {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
  font-family: "Cormorant Garamond", serif;
}

/* ページング */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 28px;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
}

.pagination a:hover {
  border-color: var(--gold-500);
  color: var(--gold-600);
}

.pagination .current {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: var(--gold-300);
}

/* レスポンシブ */
@media (max-width: 640px) {
  .site-header-inner { padding: 12px 14px; gap: 8px; }
  .site-logo .logo-en { font-size: 22px; }
  .site-logo .logo-jp { font-size: 13px; }
  .header-portal-link { font-size: 11px; padding: 5px 10px; }

  .ai-hero { padding: 40px 16px 48px; }
  .ai-hero h1 { font-size: 22px; line-height: 1.5; }
  .ai-hero-subtitle { font-size: 12.5px; margin-bottom: 24px; }
  .ai-hero-eyebrow { font-size: 11px; padding: 5px 12px; margin-bottom: 14px; }

  .ai-search-box textarea { font-size: 14px; padding: 12px 14px; min-height: 44px; }
  .ai-search-mic, .ai-search-submit { width: 42px; height: 42px; }

  .chip { font-size: 11.5px; padding: 6px 12px; }

  .container { padding: 0 14px; }
  .section { padding: 24px 0; }
  .section-title { font-size: 17px; }

  .category-tabs { top: 56px; }
  .category-tab { padding: 12px 12px; font-size: 12px; }

  .flyer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .flyer-card-body { padding: 10px 10px 12px; }
  .flyer-card-title { font-size: 13px; }

  .area-filter { gap: 6px; margin-bottom: 18px; }
  .area-pill { font-size: 11px; padding: 5px 11px; }

  .ai-assistant-card { padding: 22px 18px 18px; }
  .ai-assistant-message { padding-left: 0; font-size: 14px; }
  .ai-suggestion-item { padding: 12px 14px; gap: 10px; }
  .ai-suggestion-icon { font-size: 18px; }
  .ai-suggestion-label { font-size: 13px; }
  .ai-suggestion-count { font-size: 11px; padding: 2px 8px; }
}

@media (hover: none) {
  .flyer-card:hover { transform: none; }
}
