/*
Theme Name: 7DTD Survival Hub
Theme URI: https://7daystodie.jp/
Author: 7daystodie.jp
Author URI: https://7daystodie.jp/
Description: 7 Days to Die向けのコミュニティサイト用カスタムテーマ
Version: 1.0.0
License: GPLv2 or later
Text Domain: seven-days-survival
*/

@import url('https://fonts.googleapis.com/css2?family=M+PLUS+1p:wght@400;500;700;800&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

:root {
  --paper: #f7f5ef;
  --paper-strong: #ffffff;
  --ink: #23313a;
  --muted: #5f7077;
  --line: #d8e1dd;
  --accent: #1f7a57;
  --accent-soft: #e7f3ec;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 15% -8%, rgba(31, 122, 87, 0.16), transparent 42%),
    linear-gradient(180deg, #eef4f0, var(--paper));
  color: var(--ink);
  font-family: 'Zen Kaku Gothic New', sans-serif;
}

a {
  color: #1e5a93;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-wrap {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  background: rgba(247, 245, 239, 0.88);
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'M PLUS 1p', sans-serif;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.logo span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.wiki-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 18px 70px;
}

.wiki-heading {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.wiki-heading h1 {
  margin: 0;
  font-family: 'M PLUS 1p', sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

.wiki-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.meta-line {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-line span {
  display: inline-block;
  background: var(--accent-soft);
  color: #16553d;
  border: 1px solid #bfdfcf;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.wiki-main-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.6fr 1fr;
  margin-bottom: 14px;
}

.wiki-panel {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  border-radius: 12px;
  padding: 18px;
}

.wiki-panel h2 {
  margin: 0 0 12px;
  font-family: 'M PLUS 1p', sans-serif;
  font-size: 22px;
  border-left: 5px solid var(--accent);
  padding-left: 10px;
}

.wiki-list,
.toc-list {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.9;
}

.wiki-list li + li,
.toc-list li + li {
  margin-top: 4px;
}

.wiki-list time {
  display: inline-block;
  min-width: 96px;
  color: var(--muted);
  font-size: 13px;
}

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

.wiki-link-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcf8;
  padding: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.wiki-link-card:hover {
  border-color: #98b9aa;
  transform: translateY(-2px);
  text-decoration: none;
}

.wiki-link-card strong {
  color: #1a476d;
  display: block;
  font-size: 15px;
}

.wiki-link-card span {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  color: var(--muted);
}

.tag-cloud {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tag-cloud a {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f8f5;
  color: #2f5f4a;
  text-align: center;
  padding: 8px 6px;
  font-size: 13px;
}

.wiki-list.ranked {
  list-style: none;
  padding-left: 0;
}

.wiki-list.ranked li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wiki-list.ranked li span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #1d4b38;
  background: #dff0e8;
  border: 1px solid #b4d8c8;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 0.55s ease forwards;
}

.reveal:nth-child(2) { animation-delay: 0.06s; }
.reveal:nth-child(3) { animation-delay: 0.12s; }
.reveal:nth-child(4) { animation-delay: 0.18s; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .wiki-main-grid {
    grid-template-columns: 1fr;
  }

  .tag-cloud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .link-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav {
    display: none;
  }

  .wiki-shell {
    padding-top: 18px;
  }
}

/* ============================================================
   Global Layout Variables
   ============================================================ */
:root {
  --header-h: 80px;
}

/* compensate for fixed header */
body {
  padding-top: var(--header-h);
}

/* ============================================================
   Accessibility: screen-reader-only text
   ============================================================ */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Fixed Site Header
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}

.header-title-bar {
  background: #ffffff;
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border-bottom: 2px solid #e8e8e8;
}

.header-brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-title {
  font-family: 'M PLUS 1p', sans-serif;
  font-size: clamp(20px, 2.2vw, 34px);
  font-weight: 800;
  color: #0d4a7a;
  text-decoration: none;
  letter-spacing: 0.4px;
  line-height: 1.05;
}

.site-title:hover {
  color: #186ba8;
  text-decoration: none;
}

.site-subtitle {
  color: #333333;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.header-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 2px solid #ddd;
  color: #1a1a1a;
  background: #e8f4f8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  min-height: 34px;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.header-top-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  background: #d4eaf0;
  border-color: #666;
}

.header-top-btn.is-steam {
  border-color: #2563eb;
  color: #0c3a66;
}

.header-top-btn.is-steam:hover {
  background: #e3f2fd;
}

.header-top-btn.is-discord {
  border-color: #5865f2;
  color: #1a1d29;
}

.header-top-btn.is-discord:hover {
  background: #f0f1f3;
}

.header-top-btn.is-logout {
  border-color: #dc2626;
  color: #991b1b;
}

.header-user-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 6px 10px;
}

.header-user-name {
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 700;
}

.header-user-meta {
  color: #555;
  font-size: 11px;
  white-space: nowrap;
}

.header-nav-bar {
  background: #f0f0f0;
  border-top: 1px solid #e0e0e0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  flex-wrap: nowrap;
}

.primary-nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.primary-nav a,
.primary-nav li > a {
  color: #1a1a1a;
  font-size: 13px;
  padding: 11px 10px;
  display: inline-block;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav li > a:hover {
  background: rgba(100, 170, 255, 0.15);
  color: #0056b3;
  text-decoration: none;
}

/* reset ul generated by wp_nav_menu inside nav bar */
.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

/* Search form inside header */
.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.header-nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-search .search-form {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-search .search-field {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #ccc;
  background: #ffffff;
  color: #333;
  border-radius: 3px;
  min-width: 130px;
  outline: none;
}

.header-search .search-field:focus {
  border-color: #999;
  background: #fafafa;
}

.header-search .search-field::placeholder {
  color: #999;
}

.header-search .search-submit {
  padding: 4px 10px;
  font-size: 12px;
  background: #e8e8e8;
  color: #333;
  border: 1px solid #bbb;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.header-search .search-submit:hover {
  background: #d8d8d8;
}

.header-auth-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid #999;
  color: #1a1a1a;
  background: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.header-auth-link:hover {
  text-decoration: none;
  background: #e0e0e0;
  border-color: #666;
}

.sevendtd-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.sevendtd-card {
  border: 1px solid #d7dfe5;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(16, 32, 52, 0.06);
  display: flex;
  flex-direction: column;
}

.sevendtd-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #eef2f6;
  overflow: hidden;
}

.sevendtd-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sevendtd-card-noimage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #607387;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.sevendtd-card-title {
  margin: 12px 12px 4px;
  font-size: 18px;
  line-height: 1.3;
}

.sevendtd-card-title a {
  color: #173f69;
  text-decoration: none;
}

.item-rarity,
.zombie-stats,
.item-excerpt,
.sevendtd-card-meta {
  margin-left: 12px;
  margin-right: 12px;
}

.item-rarity {
  margin-top: 0;
  margin-bottom: 6px;
  color: #7a5800;
  font-weight: 700;
  font-size: 12px;
}

.item-excerpt {
  margin-top: 0;
  margin-bottom: 10px;
  color: #3f4f5f;
  font-size: 13px;
  line-height: 1.6;
}

.zombie-stats p {
  margin: 0 0 4px;
  color: #3f4f5f;
  font-size: 13px;
}

.sevendtd-card-meta {
  margin-top: auto;
  margin-bottom: 10px;
  color: #627283;
  font-size: 12px;
}

.btn-detail {
  display: inline-block;
  margin: 0 12px 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #8fb3d4;
  background: #f2f8ff;
  color: #17456f;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.btn-detail:hover {
  background: #e3f1ff;
  text-decoration: none;
}

.entry-featured-image {
  margin: 12px 0;
}

.entry-featured-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #d9e2ea;
}

.entry-comments {
  margin-top: 24px;
  border-top: 1px solid #dde4ea;
  padding-top: 20px;
}

.sevendtd-detail-section {
  margin-top: 20px;
  border: 1px solid #d9e2ea;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.sevendtd-detail-section h2 {
  margin: 0;
  padding: 10px 12px;
  font-size: 16px;
  color: #173f69;
  background: #eef5fb;
  border-bottom: 1px solid #d9e2ea;
}

.sevendtd-detail-table,
.sevendtd-compare-table {
  width: 100%;
  border-collapse: collapse;
}

.sevendtd-detail-table th,
.sevendtd-detail-table td,
.sevendtd-compare-table th,
.sevendtd-compare-table td {
  border: 1px solid #e1e7ee;
  padding: 8px 10px;
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}

.sevendtd-detail-table th,
.sevendtd-compare-table th {
  width: 180px;
  background: #f7fbff;
  color: #294a66;
}

.sevendtd-compare-table td.changed {
  background: #fff3cd;
  font-weight: bold;
  color: #7a5200;
}

.sevendtd-recipe {
  padding: 10px 12px;
  border-bottom: 1px dashed #d9e2ea;
}
.sevendtd-recipe:last-child {
  border-bottom: none;
}
.sevendtd-recipe p {
  margin: 0 0 8px;
  font-size: 13px;
}

.sevendtd-inline-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border: 1px solid #d9e2ea;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  display: block;
}

.single-sevendtd_item .post-thumbnail,
.single-sevendtd_zombie .post-thumbnail {
  display: none;
}

/* ============================================================
   Page Body: sidebar + main side by side
   ============================================================ */
.page-body {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--header-h));
}

/* ============================================================
   Left Sidebar
   ============================================================ */
.left-sidebar {
  width: 176px;
  min-width: 176px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #cdd6d1;
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar nav container */
.sidebar-nav {
  display: block;
}

.sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Top-level items → section headers */
.sidebar-nav-list > .menu-item > a {
  display: block;
  background: #3c4e58;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  text-decoration: none;
  margin-top: 3px;
  line-height: 1.4;
  word-break: normal;
}

.sidebar-nav-list > .menu-item:first-child > a {
  margin-top: 0;
}

.sidebar-nav-list > .menu-item > a:hover {
  background: #4d6070;
  text-decoration: none;
}

.sidebar-nav-list > .current-menu-ancestor > a,
.sidebar-nav-list > .current-menu-item > a {
  background: #2c3e48;
}

/* sub-menu reset */
.sidebar-nav-list .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Level 2: nav links */
.sidebar-nav-list > .menu-item > .sub-menu > .menu-item > a {
  display: block;
  padding: 3px 9px 3px 11px;
  font-size: 12px;
  color: #1548a0;
  border-bottom: 1px solid #eceeed;
  text-decoration: none;
  line-height: 1.5;
}

.sidebar-nav-list > .menu-item > .sub-menu > .menu-item > a::before {
  content: "• ";
  color: #8a9ea8;
}

.sidebar-nav-list > .menu-item > .sub-menu > .menu-item > a:hover {
  background: #f0f7f4;
  text-decoration: none;
}

.sidebar-nav-list > .menu-item > .sub-menu > .current-menu-item > a {
  background: #e8f4ef;
  color: #0f3878;
}

/* Level 3: indented sub-links */
.sidebar-nav-list > .menu-item > .sub-menu > .menu-item > .sub-menu > .menu-item > a {
  display: block;
  padding: 3px 9px 3px 20px;
  font-size: 11px;
  color: #1548a0;
  border-bottom: 1px solid #f0f2ef;
  text-decoration: none;
  line-height: 1.5;
}

.sidebar-nav-list > .menu-item > .sub-menu > .menu-item > .sub-menu > .menu-item > a::before {
  content: "◦ ";
  color: #aabac4;
}

.sidebar-nav-list > .menu-item > .sub-menu > .menu-item > .sub-menu > .menu-item > a:hover {
  background: #eef7f2;
  text-decoration: none;
}

/* Sidebar widget titles */
.sidebar-section-head {
  background: #3c4e58;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  margin-top: 3px;
}

.sidebar-widget {
  border-bottom: 1px solid #cdd6d1;
}

/* ============================================================
   Main Content Area
   ============================================================ */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 18px 20px 60px;
}

/* Generic entry (page / post / archive) */
.entry-title {
  font-family: 'M PLUS 1p', sans-serif;
  font-size: clamp(22px, 3vw, 34px);
  margin: 0 0 16px;
  border-left: 5px solid var(--accent);
  padding-left: 10px;
  line-height: 1.2;
}

.entry-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
}

.entry-content {
  line-height: 1.8;
  color: var(--ink);
}

.entry-content h2 {
  font-family: 'M PLUS 1p', sans-serif;
  font-size: 20px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 4px;
  margin: 28px 0 12px;
}

.entry-content h3 {
  font-size: 17px;
  color: var(--accent);
  margin: 22px 0 8px;
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */
@media (max-width: 768px) {
  .left-sidebar {
    display: none;
  }

  .header-title-bar {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .header-top-actions {
    width: 100%;
    margin-left: 0;
    order: 3;
  }

  .header-user-card {
    width: 100%;
    justify-content: space-between;
    order: 4;
  }

  .header-nav-actions {
    display: none;
  }
}

@media (max-width: 480px) {
  .primary-nav a,
  .primary-nav li > a {
    font-size: 12px;
    padding-left: 7px;
    padding-right: 7px;
  }

  .header-search {
    display: none;
  }

  .site-subtitle {
    font-size: 11px;
  }
}
