/* サイト全体のレイアウト用CSS。kintoneのフォーム部品自体は 51-modern-default.css (Cybozu製,
   kintone-plugin-css) の .kintoneplugin-* クラスを流用し、ここではページ構成(ヘッダー・タブ・
   カード一覧・フィルタ・デモ用の補助表示)のみを扱う。 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', Meiryo, sans-serif;
  color: #333;
  background: #f4f7f8;
  line-height: 1.6;
}

a {
  color: #3498db;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e3e7e8;
  padding: 16px 24px;
}

.site-header .site-title {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.site-logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.site-logo:hover {
  opacity: 0.8;
}

.site-logo .logo-gov {
  color: #0b6e6e;
}

.site-logo .logo-apps {
  color: #2ecc71;
}

.site-tagline {
  font-size: 13px;
  color: #888;
  padding-left: 12px;
  border-left: 1px solid #e3e7e8;
}

.site-header .breadcrumb {
  margin-top: 4px;
  font-size: 13px;
  color: #888;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
}

/* --- トップページ: ファーストビュー(ヒーロー画像 + 新規作成要望CTA) --- */

.hero {
  margin: -24px -24px 24px;
  text-align: center;
  background: #fff;
  border-bottom: 1px solid #e3e7e8;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
}

.hero-cta {
  padding: 20px 24px;
}

/* --- トップページ: フィルタ + カード一覧 --- */

.filter-bar {
  background: #fff;
  border: 1px solid #e3e7e8;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 24px;
}

.filter-bar .filter-group {
  margin-bottom: 12px;
}

.filter-bar .filter-group:last-child {
  margin-bottom: 0;
}

.filter-bar .filter-group-label {
  font-weight: bold;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.search-input {
  width: 100%;
  max-width: 420px;
  padding: 8px 12px;
  border: 1px solid #c9d2d5;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: #3498db;
}

.chip {
  display: inline-block;
  padding: 4px 12px;
  margin: 0 6px 6px 0;
  border: 1px solid #3498db;
  border-radius: 999px;
  background: #fff;
  color: #3498db;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.chip.is-active {
  background: #3498db;
  color: #fff;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.app-card {
  display: block;
  background: #fff;
  border: 1px solid #e3e7e8;
  border-radius: 4px;
  padding: 16px;
  text-decoration: none;
  color: #333;
}

.app-card:hover {
  border-color: #3498db;
}

.app-card .initiative-name {
  font-size: 12px;
  color: #888;
}

.app-card .app-name {
  font-size: 16px;
  font-weight: bold;
  margin: 4px 0 8px;
}

.app-card .app-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  margin: 0 4px 4px 0;
}

.badge-category-master {
  background: #eaf6ff;
  color: #1a6ca8;
}

.badge-category-business {
  background: #eafaf0;
  color: #1a8a4a;
}

.badge-tag {
  background: #f1f1f1;
  color: #666;
}

.badge-status-未作成 {
  background: #f1f1f1;
  color: #888;
}

.badge-status-作成中 {
  background: #fff3cd;
  color: #8a6d1a;
}

.badge-status-完了 {
  background: #e2f2fe;
  color: #1a6ca8;
}

.app-card.is-hidden {
  display: none;
}

/* --- 企画ページ: タブ --- */

.tab-list {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 2px solid #e3e7e8;
  margin-bottom: 24px;
}

.tab-button {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 14px;
  cursor: pointer;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab-button.is-active {
  color: #3498db;
  border-bottom-color: #3498db;
  font-weight: bold;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.app-section {
  background: #fff;
  border: 1px solid #e3e7e8;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
}

.app-section h3 {
  margin-top: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e3e7e8;
}

.demo-subtabs,
.doc-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.demo-subtab-button,
.doc-subtab-button {
  padding: 6px 14px;
  border: 1px solid #e3e7e8;
  background: #f7f9fa;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
}

.demo-subtab-button.is-active,
.doc-subtab-button.is-active {
  background: #3498db;
  border-color: #3498db;
  color: #fff;
}

.demo-subpanel,
.doc-subpanel {
  display: none;
}

.demo-subpanel.is-active,
.doc-subpanel.is-active {
  display: block;
}

.doc-subpanel .mermaid {
  background: #fff;
  padding: 12px;
  border: 1px solid #e3e7e8;
  border-radius: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.field-table-wrap {
  overflow-x: auto;
}

.field-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

.field-table th,
.field-table td {
  border: 1px solid #e3e7e8;
  padding: 6px 10px;
  text-align: left;
  white-space: nowrap;
}

.field-table th {
  background: #f7f9fa;
}

.demo-list-table-wrap {
  overflow-x: auto;
}

.demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 16px;
}

.demo-row > * {
  flex: 1 1 220px;
  min-width: 200px;
}

.demo-group {
  border: 1px solid #e3e7e8;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
}

.demo-group legend {
  padding: 0 8px;
  font-weight: bold;
  color: #3498db;
}

.demo-textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 1px solid #e3e7e8;
  font-family: inherit;
  font-size: inherit;
}

.demo-file {
  padding: 8px;
  border: 1px dashed #c9d2d5;
  border-radius: 3px;
  color: #888;
  font-size: 13px;
}

.demo-map {
  flex: 1 1 100%;
  min-height: 300px;
  border: 1px solid #e3e7e8;
  border-radius: 4px;
  background: #eaf6ff;
}

.demo-map-small {
  min-height: 220px;
  margin-bottom: 16px;
}

.demo-label-field {
  font-weight: bold;
  color: #666;
  align-self: center;
}

.demo-hr {
  flex: 1 1 100%;
  border: none;
  border-top: 1px solid #e3e7e8;
}

.demo-lookup {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
}

.demo-lookup .kintoneplugin-input-text {
  flex: 1;
  background: #f7f9fa;
}

.demo-lookup-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  background: #fff;
  border: 1px solid #3498db;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  min-width: 260px;
  margin-top: 4px;
}

.no-fields-notice {
  color: #888;
  font-size: 13px;
}

.download-note {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

.map-plugin-note {
  margin-top: 12px;
  padding: 8px 12px;
  border-left: 3px solid #cfe3e0;
  font-size: 12px;
  color: #888;
}

.map-plugin-note a {
  color: #3498db;
}

.site-footer {
  text-align: center;
  color: #888;
  font-size: 12px;
  padding: 24px;
}

.site-footer p {
  margin: 0 0 6px;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer a {
  color: #3498db;
}
