/* 基本リセット */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* フォントとカラー */
body {
  font-family: "Noto Sans JP", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  line-height: 1.7;
  background: #ffffff;
  color: #222;
}

/* ヘッダー */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0f2f5;
  padding: 12px 20px;
  border-bottom: 1px solid #ccc;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 1000;
  height: 48px;
  box-sizing: border-box;
}

.site-header .logo {
  font-size: 20px;
  font-weight: bold;
  color: #005bac;
}

.site-header .top-nav a {
  margin-left: 20px;
  text-decoration: none;
  color: #005bac;
}

.site-header .top-nav a:hover {
  text-decoration: underline;
}

/* メインコンテンツ */
.main-content {
  width: 100vw;
  margin: 48px auto 40px auto;
  padding: 40px 20px;
  background: #fff;
  min-height: calc(100vh - 88px);
  box-sizing: border-box;
  height: calc(100vh - 48px - 40px);
  overflow-y: auto;
}

/* ヒーローセクション */
.hero-section {
  text-align: center;
  margin-bottom: 60px;
  padding: 40px 20px;
}

.hero-section h1 {
  font-size: 32px;
  color: #005bac;
  margin-bottom: 20px;
  line-height: 1.4;
}

.hero-section p {
  font-size: 18px;
  color: #444;
  margin: 0 auto;
}

/* ルール一覧セクション */
.rules-section {
  margin-top: 40px;
}

.rules-section h2 {
  font-size: 24px;
  color: #222;
  margin-bottom: 30px;
  text-align: center;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s;
}

.rule-item:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.rule-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.rule-content {
  flex: 1;
}

.rule-content h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

.rule-content h3 a {
  color: #005bac;
  text-decoration: none;
}

.rule-content h3 a:hover {
  text-decoration: underline;
}

.rule-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  background: #fff;
  color: #222;
  border: 1.5px solid #111;
  border-radius: 4px;
  padding: 2px 12px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.rule-date,
.rule-number {
  font-size: 14px;
  color: #666;
}

.rules-count {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-top: 20px;
}

/* ルール一覧セクション - 並び替えメニュー */
.rules-section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 30px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.rules-section-title {
  width: 100%;
  display: flex;
  justify-content: center;
}

.rules-section-title h2 {
  margin-bottom: 0;
  text-align: center;
  width: 100%;
}

.rules-sort {
  width: 100%;
  max-width: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
}

.rules-sort-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.rules-sort label {
  font-weight: normal;
  color: #222;
}

.rules-sort select {
  font-size: 15px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #bbb;
  background: #fff;
  color: #222;
}

/* フッター */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 14px;
  background: #f8f8f8;
  border-top: 1px solid #ccc;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  z-index: 1000;
  height: 40px;
  box-sizing: border-box;
  line-height: 40px;
}

.site-footer .footer-left,
.site-footer .footer-right {
  display: flex;
  align-items: center;
  height: 100%;
  line-height: 40px;
}

.site-footer .footer-left {
  justify-content: flex-start;
}

.site-footer .footer-right {
  justify-content: flex-end;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #005bac;
  text-decoration: none;
  margin-left: 10px;
  display: flex;
  align-items: center;
  line-height: 40px;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .site-header {
    padding: 0 12px;
  }
  
  .site-header .logo {
    font-size: 16px;
  }
  
  .site-header .top-nav a {
    margin-left: 12px;
    font-size: 14px;
  }
  
  .main-content {
    padding: 20px 12px;
    height: calc(100vh - 48px - 36px);
    min-height: unset;
    width: 100vw;
  }
  
  .hero-section {
    padding: 20px 0;
    margin-bottom: 40px;
  }
  
  .hero-section h1 {
    font-size: 24px;
  }
  
  .hero-section p {
    font-size: 16px;
  }
  
  .rules-section h2 {
    font-size: 20px;
  }
  
  .rule-item {
    padding: 15px;
  }
  
  .rule-content h3 {
    font-size: 16px;
  }
  
  .rule-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .site-footer {
    height: 36px;
    font-size: 12px;
    padding: 0 10px;
    line-height: 36px;
  }
  
  .site-footer .footer-left,
  .site-footer .footer-right {
    line-height: 36px;
  }
  
  .site-footer a {
    font-size: 12px;
    margin-left: 6px;
  }
  
  .rules-list {
    max-width: 100%;
  }
  
  .rules-section-header {
    margin-bottom: 18px;
    gap: 0;
    max-width: 100%;
  }
  .rules-section-title h2 {
    font-size: 20px;
  }
  .rules-sort {
    font-size: 13px;
    margin-top: 6px;
    max-width: 100%;
    width: 100%;
  }
  .rules-sort-inner {
    font-size: 13px;
    gap: 8px;
  }
  .rules-sort select {
    font-size: 13px;
    padding: 2px 8px;
  }
}

/* 印刷用スタイル */
@media print {
  .site-header,
  .site-footer {
    position: static !important;
  }
  
  .main-content {
    margin: 0 !important;
    box-shadow: none !important;
  }
}
