/* part1.css - Dark Corporate VTuber Aesthetic & Mobile Responsive */
:root {
  --bg-primary: #121318;       /* Dark base background */
  --bg-card: #1c1e26;          /* Dark card container background */
  --bg-meta: #252833;          /* Darker shade for info grids */
  --text-main: #e2e4ed;        /* Bright body text */
  --text-muted: #9499ad;       /* Muted label text */
  --accent-red: #E23C55;        /* Himeno Nomiko scarlet red */
  --border-color: #2e3240;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
}

/* Page Base */
body.phase-1 {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  margin: 0;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Search Navigation */
.top-nav {
  max-width: 800px;
  margin: 0 auto 16px auto;
  width: 100%;
}

.top-nav__search {
  display: flex;
  gap: 8px;
  position: relative; /* Anchor for absolute search dropdown */
}

.top-nav__search input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.top-nav__search button {
  background: var(--bg-meta);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

/* Accessibility Utility: Hide text visually while keeping it accessible to screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =====================================================
   Search Modal (Popup Overlay)
   ===================================================== */
.hidden,
.search-modal.hidden {
  display: none !important;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.search-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.search-modal__content {
  position: relative;
  width: min(560px, 100%);
  max-height: min(620px, calc(100vh - 2rem));
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-card, #1c1e26);
  color: var(--text-main, #e2e4ed);
  border: 1px solid var(--border-color, #2e3240);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}

.search-modal__content h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: #ffffff;
  border-bottom: 1px solid var(--border-color, #2e3240);
  padding-bottom: 0.5rem;
}

.search-result-list,
.search-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-result-list li,
.search-results-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color, #2e3240);
}

.search-result-list li:last-child,
.search-results-list li:last-child {
  border-bottom: 0;
}

.search-result-list a,
.search-results-list a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}

.search-result-list a:hover,
.search-results-list a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.search-modal__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.search-modal__actions button,
.search-modal__content .close-btn {
  padding: 0.4rem 1rem;
  color: var(--text-main, #e2e4ed);
  background: var(--bg-meta, #252833);
  border: 1px solid var(--border-color, #2e3240);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
}

.search-modal__actions button:hover,
.search-modal__content .close-btn:hover {
  background: var(--border-color, #2e3240);
}

/* Site Container & Card Layout */
.site-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.vtuber-profile {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid var(--border-color);
  padding: 28px;
  margin-bottom: 30px;
}

.profile-header h1 {
  margin: 8px 0 20px 0;
  font-size: 1.8rem;
  color: #ffffff;
}

.badge {
  font-size: 0.8rem;
  color: var(--accent-red);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Metadata Grid */
.profile-meta {
  display: grid;
  grid-template-columns: max-content 1fr; /* 140px から max-content に変更 */
  gap: 12px 16px;
  background: var(--bg-meta);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.profile-meta dt {
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap; /* テキストの折り返しを防止する行を追加 */
}

.profile-meta dd {
  margin: 0;
  color: var(--text-main);
  word-break: break-word;
}

.color-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* Profile Bio */
.profile-bio h2 {
  font-size: 1.2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-top: 24px;
  color: #ffffff;
}

/* Footer Section */
.site-footer {
  margin-top: auto;
  padding: 24px 0 40px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

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

/* Fixed Bottom-Right Page Counter */
.page-counter {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(18, 19, 24, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 1000;
}

/* Mobile Responsive Fixes */
@media (max-width: 600px) {
  body.phase-1 {
    padding: 10px;
  }

  .vtuber-profile {
    padding: 16px;
  }

  .profile-meta {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px;
  }

  .profile-meta dt {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
  }

  .profile-meta dt:first-child {
    margin-top: 0;
  }

  .profile-meta dd {
    font-size: 0.95rem;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  }

  .profile-meta dd:last-child {
    border-bottom: none;
  }

  .page-counter {
    bottom: 12px;
    right: 12px;
    font-size: 0.78rem;
    padding: 4px 10px;
  }
}