/* 共通CSS styles.css */
:root {
  --blue-main: #2f80ed;
  --blue-dark: #0b4f8a;
  --accent-orange: #ffa94d;
  --accent-mint: #e6f7f2;
  --bg-main: #f7f9ff;
  --text-main: #1c2436;
  --text-muted: #5b6476;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg-main);
  background-image:
    url("images/ballot-illustration-left.svg"),
    url("images/ballot-illustration-right.svg"),
    radial-gradient(circle at 10% 10%, rgba(79,175,239,0.12) 0, transparent 55%),
    radial-gradient(circle at 90% 80%, rgba(47,128,237,0.10) 0, transparent 55%);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position:
    left -40px bottom -20px,
    right -20px top 40px,
    10% 10%,
    90% 80%;
  background-size:
    260px auto,
    220px auto,
    auto,
    auto;
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.8;
  font-size: 17px;
}
a {
  color: var(--blue-dark);
  text-decoration: none;
}
a:hover { text-decoration: underline; }
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 10px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 10px 18px;
  text-align: center;
  position: relative;
  border-bottom: 3px solid rgba(255,169,77,0.35);
  overflow: hidden;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: -60px -80px;
  z-index: -1;
  background-image:
    linear-gradient(18deg,
      transparent 0,
      transparent 35%,
      rgba(255,169,77,0.95) 35%,
      rgba(255,169,77,0.95) 38%,
      transparent 38%,
      transparent 100%
    ),
    linear-gradient(-10deg,
      transparent 0,
      transparent 40%,
      rgba(47,128,237,0.95) 40%,
      rgba(47,128,237,0.95) 43%,
      transparent 43%,
      transparent 100%
    ),
    linear-gradient(32deg,
      transparent 0,
      transparent 30%,
      rgba(76,201,240,0.95) 30%,
      rgba(76,201,240,0.95) 33%,
      transparent 33%,
      transparent 100%
    ),
    linear-gradient(-24deg,
      transparent 0,
      transparent 55%,
      rgba(111,207,151,0.95) 55%,
      rgba(111,207,151,0.95) 58%,
      transparent 58%,
      transparent 100%
    ),
    linear-gradient(6deg,
      transparent 0,
      transparent 48%,
      rgba(186,104,200,0.95) 48%,
      rgba(186,104,200,0.95) 51%,
      transparent 51%,
      transparent 100%
    );
  background-repeat: no-repeat;
  background-size: 160% 120%;
  background-position: center center;
  opacity: 0.35;
}
.ballotbox {
    margin-left: 32px;
    margin-right: 32px;
    width: 140px;
    height: auto;
    min-width: 100px;
    max-width: 180px;
    object-fit: contain;
    display: block;
}
.site-title {
  position: relative;
  margin-left: 30%;
  display: inline-block;
  margin: 0;
  padding: 6px 18px;
  font-size: clamp(2.6rem, 4.4vw, 3.6rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-dark);
  font-family: 'M PLUS Rounded 1c', system-ui, -apple-system,
               BlinkMacSystemFont, "Segoe UI", "Noto Sans JP",
               "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  z-index: 100;
  text-shadow:
    -2px -2px 0 #ffffff,
     2px -2px 0 #ffffff,
    -2px  2px 0 #ffffff,
     2px  2px 0 #ffffff;
   transform: translateX(40px);
}
.title-bang {
  display: inline-block;
  transform-origin: 50% 80%;
  animation: bang-rock 0.8s ease-in-out infinite;
}
@keyframes bang-rock {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(20deg); }
  100% { transform: rotate(0deg); }
}
.site-subtitle {
  position: relative;
  margin-top: 10px;
  font-size: 1rem;
  color: var(--text-muted);
}
.layout {
  display: grid;
  grid-template-columns: minmax(260px, 280px) minmax(0, 1fr);
  gap: 26px;
  margin-top: 10px;
  height: calc(100vh - 60px);
}
@media (max-width: 840px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }
  .ballotbox {
    margin-left: 12px;
    margin-right: 12px;
    width: 90px;
    height: auto;
    min-width: 60px;
    max-width: 100px;
    display: block;
}
  .site-title {
    margin-left: 20%;
    transform: translateX(0px);
    padding: 2px 6px;
    font-size: clamp(2rem, 3.4vw, 3rem);
    font-weight: 600;
    letter-spacing: 0.1em;
  }
}
@media (min-width: 841px) {
  .layout {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
    gap: 38px;
  }
  .content {
    max-width: 1100px;
    margin-left: 0;
    margin-right: 0;
  }
  .panel {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (max-width: 840px) {
  .content, .panel {
    max-width: 100vw;
    margin: 0;
    padding-left: 1vw;
    padding-right: 1vw;
  }
}
/* --- ハンバーガーメニュー用 --- */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 1001;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 0;
}
.sidebar-toggle-bar {
  display: block;
  width: 26px;
  height: 3px;
  background: #2f80ed;
  border-radius: 2px;
  transition: all 0.2s;
}
@media (max-width: 840px) {
  .sidebar-toggle {
    display: flex;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 80vw;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 16px rgba(0,0,0,0.13);
    z-index: 1000;
    transition: left 0.25s cubic-bezier(.4,1.3,.5,1);
    overflow-y: auto;
  }
  .sidebar.open {
    left: 0;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .content {
    margin-left: 0 !important;
  }
  body.sidebar-open {
    overflow: hidden;
  }
}
.sidebar {
  align-self: stretch;
  overflow-y: auto;
  padding-right: 4px;
}
.sidebar-box {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(18, 44, 80, 0.16);
  box-shadow: 0 10px 22px rgba(15, 40, 80, 0.13);
  font-size: 0.95rem;
}
.sidebar-box h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}
.sidebar-intro {
  font-size: 0.9rem;
  margin: 4px 0 6px;
  color: #4b566b;
}
.sidebar-separator {
  border: none;
  border-top: 1px solid rgba(18, 44, 80, 0.12);
  margin: 10px 0;
}
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.sidebar-nav li { margin-bottom: 6px; }
.sidebar-nav a {
  font-size: 0.96rem;
  color: var(--blue-dark);
}
.category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.category-card {
  display: block;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(18, 44, 80, 0.14);
  box-shadow: 0 6px 14px rgba(15, 40, 80, 0.10);
  font-size: 0.9rem;
  text-decoration: none;
  color: #1c2436;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.category-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 40, 80, 0.18);
  border-color: rgba(47, 128, 237, 0.5);
}
.category-card-title {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 2px;
}
.category-card-desc {
  font-size: 0.82rem;
  color: #4b566b;
  margin: 0;
}
.category-voter   { border-left: 4px solid rgba(47,128,237,0.6); }
.category-early   { border-left: 4px solid rgba(255,169,77,0.7); }
.category-system  { border-left: 4px solid rgba(76,201,240,0.7); }
.category-media   { border-left: 4px solid rgba(186,104,200,0.7); }
.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding-right: 4px;
}
.panel {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px 18px 14px;
  border: 1px solid rgba(18, 44, 80, 0.14);
  box-shadow: 0 10px 22px rgba(15, 40, 80, 0.12);
  font-size: 1.02rem;
}
.panel h1,
.panel h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}
.panel h2::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 20px;
  margin-right: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-orange), #ffd8a2);
  vertical-align: middle;
}
.panel p {
  margin: 5px;
  color: #414b60;
}
.news-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 0.96rem;
}
.news-item {
  padding: 6px 0;
  border-top: 1px solid rgba(18, 44, 80, 0.08);
}
.news-item:first-child { border-top: none; }
.news-meta {
  font-size: 0.86rem;
  color: #838da3;
}
#requirements.panel {
  background: linear-gradient(135deg, #ffffff, var(--accent-mint));
}
.requirements-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  counter-reset: req-counter;
}
.requirement-item {
  counter-increment: req-counter;
  padding: 14px 0 14px;
  border-top: 1px solid rgba(18, 44, 80, 0.10);
}
.requirement-item:first-child {
  border-top: none;
}
.requirement-title-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.requirement-index::before {
  content: counter(req-counter);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 1.0rem;
  font-weight: 700;
  background: radial-gradient(circle at 30% 30%, #ffd8a2 0, #ffa94d 65%);
  color: #6b3b05;
}
.requirement-title {
  font-weight: 700;
  font-size: 1.08rem;
  color: #1b2f4a;
}
.requirement-body {
  font-size: 1.0rem;
  color: #4a566a;
  line-height: 1.7;
}
.requirement-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid #f3c6d3;
  background: #fff0f6;
  color: #b36b7c;
  text-decoration: none;
  cursor: pointer;
  margin-right: 2px;
  margin-bottom: 2px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tag-pill:hover {
  background-color: #ffe4ef;
  color: #d81b60;
  border-color: #f8b6c7;
}
.article-title {
  font-weight: 700;
  font-size: 1.12rem;
  margin: 0 0 4px;
  color: #18305a;
}
.article-meta {
  font-size: 0.82rem;
  color: #7a8294;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}
.article-meta span {
  white-space: nowrap;
}
.article-body {
  font-size: 0.94rem;
  color: #444f64;
  margin: 2px 0 4px;
}
.article-links {
  font-size: 0.78rem;
  color: #2366b8;
}
.article-links * {
  color: #2366b8 !important;
}
@media (max-width: 840px) {
  body .layout {
    grid-template-columns: 1fr;
    max-width: 100vw;
    gap: 6px;
    margin: 0;
    padding: 0;
  }
  body.category-page .content, body.category-page .panel {
    max-width: 100vw;
    margin: 0;
    padding-left: 1vw;
    padding-right: 1vw;
  }
  body.category-page .sidebar {
    max-width: 100vw;
    width: 100vw;
    left: -100vw;
  }
  body.category-page .sidebar.open {
    left: 0;
  }
  body.category-page .article-list {
  display: flex;
  flex-direction: column;
  gap: 50px;
}
}
body.category-page .article-item {
  margin-bottom: 50px;
}
body.category-page .article-list {
  gap: 0;
}
body.category-page .article-item:last-child {
  margin-bottom: 0;
}
body.category-page .site-title,
body.tag-page .site-title {
  margin-left: 0 !important;
  transform: none !important;
}
.action-link-box, .gov-link-box {
  background: #f7fbff;
  border: 2px solid #2f80ed;
  border-radius: 12px;
  padding: 18px 18px 14px 18px;
  margin: 32px 0 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(47,128,237,0.08);
}
.action-link, .gov-link {
  font-size: 1.08rem;
  font-weight: 700;
  color: #2f80ed;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.gov-link-icon {
  display: flex;
  align-items: center;
  height: 100%;
}
.action-link, .gov-link-text {
  display: flex;
  align-items: center;
  height: 100%;
}
.action-link:hover, .gov-link:hover {
  background: #e6f7f2;
  border-radius: 8px;
  text-decoration: underline;
}
@media (min-width: 841px) {
  #news.panel {
    min-height: 600px;
    overflow-y: auto;
  }
}
@media (max-width: 840px) {
  #news.panel {
    max-height: 420px;
    overflow-y: auto;
  }
}
