/* file: public/css/style.css */

:root {
  --bg: #fbf8f3;
  --bg-soft: #fdf1e3;
  --card: #ffffff;
  --card-soft: rgba(255, 255, 255, 0.88);
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand: #f97316;
  --brand-dark: #ea580c;
  --brand-soft: rgba(249, 115, 22, 0.1);
  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.12);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.12);
  --shadow-sm: 0 8px 24px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 18px 52px rgba(17, 24, 39, 0.1);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(251, 146, 60, 0.15), transparent 30%),
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.09), transparent 28%),
    linear-gradient(180deg, #fff8f1 0%, #fbf8f3 42%, #ffffff 100%);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP",
    "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic",
    "Meiryo", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
textarea,
select {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.82);
}

.shell-header-inner {
  min-height: 88px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand-link {
  color: var(--text);
  text-decoration: none;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-title {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.header-actions,
.form-actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-shell {
  padding-top: 28px;
  padding-bottom: 56px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,255,255,0.96));
  border: 1px solid rgba(229,231,235,0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 22px;
}

.hero-kicker,
.section-label,
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero-copy h2,
.page-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.hero-copy p,
.page-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.hero-metrics,
.summary-card-grid,
.info-block-grid {
  display: grid;
  gap: 12px;
}

.hero-metrics {
  grid-template-columns: 1fr;
}

.summary-card-grid,
.info-block-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card,
.soft-card,
.summary-card {
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #fffaf5);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-value,
.summary-value {
  display: block;
  margin: 0;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.93), rgba(255,255,255,0.99));
  border: 1px solid rgba(229,231,235,0.96);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.panel-span-12 { grid-column: span 12; }
.panel-span-8 { grid-column: span 8; }
.panel-span-7 { grid-column: span 7; }
.panel-span-6 { grid-column: span 6; }
.panel-span-5 { grid-column: span 5; }
.panel-span-4 { grid-column: span 4; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
}

.map-card {
  overflow: hidden;
  padding: 0;
}

.map {
  width: 100%;
  min-height: 620px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow: hidden;
  background: #eef2f7;
}

.map.map-small {
  min-height: 380px;
}

.map-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 10px;
}

.spot-list {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.spot-card {
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.spot-card:hover {
  transform: translateY(-1px);
  border-color: rgba(249,115,22,0.35);
  box-shadow: 0 14px 28px rgba(17,24,39,0.08);
}

.spot-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.3;
}

.spot-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.spot-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 10px;
  background: #f3f4f6;
}

.detail-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: start;
}

.detail-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  background: #f3f4f6;
}

.detail-meta {
  display: grid;
  gap: 12px;
}

.meta-row {
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
}

.meta-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #374151;
}

.meta-row span,
.meta-row p {
  margin: 0;
  color: var(--muted);
}

.card {
  width: min(560px, 100%);
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-span-2 {
  grid-column: span 2;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 850;
  color: #1f2937;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(249,115,22,0.38);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.11);
}

.field-hint {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17,24,39,0.07);
  text-decoration: none;
}

.btn.primary {
  background: linear-gradient(180deg, #fb923c, #f97316);
  color: #fff;
  border-color: transparent;
}

.btn.primary:hover {
  box-shadow: 0 14px 30px rgba(249,115,22,0.24);
}

.btn.ghost {
  background: rgba(255,255,255,0.74);
}

.btn.danger {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #fff;
  border-color: transparent;
}

.btn.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill-open {
  color: #9a3412;
  background: rgba(249,115,22,0.12);
  border-color: rgba(249,115,22,0.2);
}

.pill-close {
  color: #991b1b;
  background: rgba(220,38,38,0.08);
  border-color: rgba(220,38,38,0.12);
}

.pill-neutral {
  color: #334155;
  background: rgba(15,23,42,0.06);
  border-color: rgba(15,23,42,0.08);
}

.form-feedback {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 800;
}

.form-feedback.info,
.form-feedback.success,
.form-feedback.error {
  display: block;
}

.form-feedback.info {
  color: #9a3412;
  background: rgba(249,115,22,0.08);
  border-color: rgba(249,115,22,0.16);
}

.form-feedback.success {
  color: #065f46;
  background: rgba(5,150,105,0.1);
  border-color: rgba(5,150,105,0.18);
}

.form-feedback.error {
  color: #991b1b;
  background: rgba(220,38,38,0.08);
  border-color: rgba(220,38,38,0.15);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: #fff;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.data-table th {
  background: #fffaf5;
  color: #374151;
  font-size: 13px;
  font-weight: 900;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.cell-title {
  font-weight: 900;
}

.cell-note {
  color: #4b5563;
  max-width: 300px;
}

.empty-cell {
  text-align: center !important;
  color: var(--muted);
  padding: 28px !important;
}

.vote-candidate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.vote-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.vote-card.is-selected {
  border-color: rgba(249,115,22,0.58);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.12), var(--shadow-sm);
}

.vote-card input {
  width: auto;
  margin-right: 8px;
}

.result-list {
  display: grid;
  gap: 12px;
}

.notice {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.86);
  color: var(--muted);
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
}

.popup-card {
  width: 220px;
}

.popup-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.popup-card p {
  margin: 0 0 10px;
  color: #4b5563;
  font-size: 13px;
}

.popup-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 8px;
  background: #f3f4f6;
}

@media (max-width: 1080px) {
  .hero-panel,
  .map-layout,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .panel-span-8,
  .panel-span-7,
  .panel-span-6,
  .panel-span-5,
  .panel-span-4 {
    grid-column: span 12;
  }

  .summary-card-grid,
  .info-block-grid,
  .vote-candidate-grid {
    grid-template-columns: 1fr;
  }

  .spot-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 16px;
  }

  .shell-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions,
  .form-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .hero-panel,
  .panel,
  .card {
    padding: 18px;
  }

  .map {
    min-height: 520px;
  }

  .search-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-span-2 {
    grid-column: span 1;
  }
}
