/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  color: #333;
  background: #f5f7fa;
  line-height: 1.8;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.sp-only { display: none; }

/* ===== Header ===== */
.site-header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 32px;
  color: #2e7d32;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-size: 18px;
  font-weight: 700;
  color: #2e7d32;
  line-height: 1.3;
}

.logo-sub {
  font-size: 11px;
  color: #888;
  line-height: 1.3;
}

.main-nav ul {
  display: flex;
  gap: 8px;
}

.main-nav a {
  display: block;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  background: #e8f5e9;
  color: #2e7d32;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: #333;
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: 0.3s;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 10px; }
.hamburger span:nth-child(3) { top: 20px; }

.hamburger.active span:nth-child(1) { top: 10px; transform: rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { top: 10px; transform: rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #2e7d32 0%, #43a047 50%, #66bb6a 100%);
  color: #fff;
  text-align: center;
  padding: 60px 20px;
}

.hero h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.4;
}

.hero-desc {
  font-size: 16px;
  opacity: 0.9;
  line-height: 1.8;
}

/* ===== About Section ===== */
.about-section {
  background: #fff;
  padding: 40px 20px;
}

.about-section .container {
  text-align: center;
}

.about-section h2 {
  font-size: 22px;
  color: #2e7d32;
  margin-bottom: 16px;
}

.about-section h2 i {
  margin-right: 8px;
}

.about-section p {
  max-width: 700px;
  margin: 0 auto;
  color: #555;
}

/* ===== Categories Section ===== */
.categories-section {
  padding: 50px 20px;
}

.categories-section h2 {
  font-size: 24px;
  color: #2e7d32;
  text-align: center;
  margin-bottom: 36px;
}

.categories-section h2 i {
  margin-right: 8px;
}

.category-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.category-group {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.category-group h3 {
  font-size: 18px;
  color: #2e7d32;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8f5e9;
}

.category-group h3 i {
  margin-right: 8px;
  width: 24px;
  text-align: center;
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.service-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #f5f7fa;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.service-card:hover {
  border-color: #2e7d32;
  background: #e8f5e9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46,125,50,0.15);
}

.service-card i {
  font-size: 20px;
  color: #43a047;
  flex-shrink: 0;
}

.service-card small {
  font-size: 11px;
  color: #888;
}

/* ===== Data Source ===== */
.data-source {
  background: #fff;
  padding: 40px 20px;
}

.data-source h2 {
  font-size: 22px;
  color: #2e7d32;
  text-align: center;
  margin-bottom: 20px;
}

.data-source h2 i {
  margin-right: 8px;
}

.data-source ul {
  max-width: 600px;
  margin: 0 auto;
}

.data-source li {
  margin-bottom: 10px;
}

.data-source a {
  color: #1976d2;
  font-weight: 500;
  transition: color 0.2s;
}

.data-source a:hover {
  color: #0d47a1;
  text-decoration: underline;
}

.data-source a i {
  font-size: 12px;
  margin-left: 4px;
}

/* ===== Footer ===== */
.site-footer {
  background: #2e7d32;
  color: #fff;
  text-align: center;
  padding: 30px 20px;
}

.site-footer p {
  font-size: 14px;
}

.footer-note {
  margin-top: 8px;
  font-size: 12px !important;
  opacity: 0.8;
}

/* ===== Service Page ===== */
.service-page-header {
  background: linear-gradient(135deg, #2e7d32, #43a047);
  color: #fff;
  padding: 30px 20px;
}

.service-page-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.service-page-header .back-link {
  color: #fff;
  opacity: 0.8;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.service-page-header .back-link:hover {
  opacity: 1;
}

.service-page-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.service-page-header .badge {
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
}

/* Map & Controls */
.map-controls {
  background: #fff;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.map-controls .container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.map-controls label {
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.map-controls select,
.map-controls input[type="text"] {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.map-controls input[type="text"] {
  flex: 1;
  min-width: 200px;
}

.btn-search {
  padding: 8px 20px;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-search:hover {
  background: #1b5e20;
}

.map-container {
  width: 100%;
  height: 450px;
  background: #e0e0e0;
  position: relative;
}

.map-container #map {
  width: 100%;
  height: 100%;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #888;
  gap: 12px;
}

.map-placeholder i {
  font-size: 48px;
  color: #bbb;
}

/* Facility Table */
.facility-section {
  padding: 30px 20px;
}

.facility-section h2 {
  font-size: 20px;
  color: #2e7d32;
  margin-bottom: 6px;
}

.facility-count {
  font-size: 14px;
  color: #888;
  margin-bottom: 16px;
}

.facility-table-wrapper {
  overflow-x: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.facility-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.facility-table thead {
  background: #2e7d32;
  color: #fff;
}

.facility-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}

.facility-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.facility-table tbody tr:hover {
  background: #f1f8e9;
}

.facility-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.facility-table .name-cell {
  font-weight: 500;
  color: #2e7d32;
  min-width: 180px;
}

.facility-table .address-cell {
  min-width: 250px;
}

.facility-table .phone-cell {
  white-space: nowrap;
}

/* Ward tabs */
.ward-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.ward-tab {
  padding: 6px 16px;
  border: 2px solid #2e7d32;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  color: #2e7d32;
}

.ward-tab:hover,
.ward-tab.active {
  background: #2e7d32;
  color: #fff;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #888;
}

.loading i {
  font-size: 32px;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
  display: block;
  color: #2e7d32;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* No data message */
.no-data {
  text-align: center;
  padding: 40px;
  color: #888;
}

.no-data i {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .sp-only { display: inline; }

  .header-inner {
    height: 60px;
  }

  .logo-main {
    font-size: 15px;
  }

  .logo-sub {
    font-size: 10px;
  }

  .logo-icon {
    font-size: 26px;
  }

  .hamburger {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 16px;
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 4px;
  }

  .main-nav a {
    padding: 12px 16px;
  }

  .hero {
    padding: 40px 20px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero-desc {
    font-size: 14px;
  }

  .service-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  .service-card {
    padding: 12px;
    font-size: 13px;
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }

  .service-card i {
    font-size: 24px;
  }

  .category-group {
    padding: 16px;
  }

  .service-page-header {
    padding: 20px;
  }

  .service-page-header h1 {
    font-size: 20px;
  }

  .map-container {
    height: 300px;
  }

  .map-controls .container {
    flex-direction: column;
    align-items: stretch;
  }

  .map-controls input[type="text"] {
    min-width: 0;
  }

  .facility-table {
    font-size: 13px;
  }

  .facility-table th,
  .facility-table td {
    padding: 10px 12px;
  }

  .ward-tabs {
    gap: 4px;
  }

  .ward-tab {
    padding: 5px 12px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .service-cards {
    grid-template-columns: 1fr 1fr;
  }
}
