/*
Theme Name: Wada Knowledge Theme
Description: 和田設備工業 現場ノウハウポータルテーマ
Version: 0.5.0
Text Domain: wada-knowledge-theme
*/

:root {
  --wk-navy: #06275f;
  --wk-navy-deep: #002957;
  --wk-blue: #0b78d0;
  --wk-cyan: #0aa8ad;
  --wk-purple: #7250c6;
  --wk-orange: #ff9800;
  --wk-bg: #f4f8fc;
  --wk-surface: #fff;
  --wk-line: #dfe8f2;
  --wk-text: #08245a;
  --wk-muted: #61708b;
  --wk-shadow: 0 8px 24px rgba(14, 55, 100, .10);
  --wk-radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--wk-bg);
  color: var(--wk-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans", Meiryo, sans-serif;
  letter-spacing: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.wk-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  grid-template-rows: 72px 1fr;
  min-height: 100vh;
}

.wk-header {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 560px minmax(280px, 1fr) auto;
  align-items: center;
  gap: 24px;
  height: 72px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--wk-line);
  box-shadow: 0 2px 14px rgba(12, 42, 80, .08);
}

.wk-brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.wk-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.wk-brand-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.wk-brand-title {
  overflow: hidden;
  color: var(--wk-navy);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wk-brand-name-suffix {
  display: inline-block;
  margin-left: 1px;
  font-size: .74em;
  line-height: 1;
  transform: translateY(-1px);
  transform-origin: left baseline;
}

.wk-brand-subtitle {
  overflow: hidden;
  color: #526179;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wk-search {
  position: relative;
  width: min(100%, 640px);
  justify-self: center;
}

.wk-search .dashicons {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 22px;
  height: 22px;
  color: #63748f;
  font-size: 22px;
  transform: translateY(-50%);
}

.wk-search input {
  width: 100%;
  height: 48px;
  padding: 0 20px 0 52px;
  color: var(--wk-text);
  background: #fff;
  border: 1px solid #d8e4f0;
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(20, 50, 90, .04), 0 2px 8px rgba(20, 50, 90, .05);
  outline: none;
}

.wk-user {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
  min-width: max-content;
}

.wk-user-legacy {
  display: none;
}

.wk-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--wk-navy);
  text-decoration: none;
  border-radius: 999px;
}

.wk-bell:hover,
.wk-bell:focus-visible {
  color: var(--wk-blue);
  background: #edf6ff;
  outline: none;
}

.wk-bell .dashicons {
  width: 38px;
  height: 38px;
  font-size: 28px;
  line-height: 38px;
}

.wk-bell i {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  color: #fff;
  background: #e23d46;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.wk-help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--wk-navy);
  background: #f3f8ff;
  border: 1px solid #d3e4f6;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.wk-help-button:hover,
.wk-help-button:focus-visible {
  color: var(--wk-blue);
  background: #e9f4ff;
  outline: none;
}

.wk-admin-button {
  color: #fff;
  background: #102a43;
  border-color: #102a43;
}

.wk-admin-button:hover,
.wk-admin-button:focus-visible {
  color: #fff;
  background: #0f7c8b;
  border-color: #0f7c8b;
}

.wk-help-button .dashicons {
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 18px;
}

.wk-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  color: #0b4f9f;
  background: linear-gradient(135deg, #e8f4ff, #d6ebff);
  border: 2px solid #edf3f9;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.wk-avatar-initial {
  display: block;
}

.wk-avatar {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.wk-user-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.2;
}

.wk-user-text strong {
  color: var(--wk-navy);
  font-size: 15px;
}

.wk-user-text small {
  color: var(--wk-muted);
  font-size: 12px;
}

.wk-login-button,
.wk-user-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 13px;
  color: #fff;
  background: var(--wk-blue);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.wk-user-action {
  color: var(--wk-blue);
  background: #eef6ff;
  border: 1px solid #cfe2f5;
}

.wk-login-button .dashicons {
  width: 18px;
  height: 18px;
  font-size: 18px;
}

.wk-sidebar {
  position: sticky;
  top: 72px;
  grid-row: 2;
  height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  padding: 16px 0 24px;
  color: #fff;
  background: linear-gradient(180deg, #003f83 0%, #002a62 46%, #001b45 100%);
  overflow-y: auto;
}

.wk-menu {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 12px;
  list-style: none;
}

.wk-menu a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 0 18px;
  color: rgba(255, 255, 255, .88);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
}

.wk-menu a:hover,
.wk-menu a.active {
  color: #fff;
  background: linear-gradient(135deg, #0b93e5, #0067bc);
  box-shadow: 0 10px 22px rgba(0, 20, 70, .25);
}

.wk-menu-section {
  margin: 18px 10px 4px;
  padding-top: 16px;
  color: rgba(255, 255, 255, .58);
  border-top: 1px solid rgba(255, 255, 255, .20);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.wk-menu a.is-admin-link {
  min-height: 50px;
  color: rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .06);
}

.wk-menu-section-help {
  margin-top: 24px;
}

.wk-menu a.is-help-link {
  min-height: 50px;
  color: rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
}

.wk-menu a.is-admin-link small {
  margin-left: auto;
  padding: 3px 7px;
  color: #cfe5ff;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.wk-menu .dashicons {
  width: 26px;
  height: 26px;
  font-size: 26px;
}

.wk-sidefooter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 24px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.wk-side-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.wk-main {
  grid-column: 2;
  min-width: 0;
  padding: 20px;
}

.wk-content {
  max-width: 1500px;
  margin: 0 auto;
}

.wk-page-card {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--wk-line);
  border-radius: var(--wk-radius);
  box-shadow: var(--wk-shadow);
}

.wk-entry-card h1,
.wk-entry-summary h1 {
  margin: 0 0 16px;
  color: var(--wk-navy);
  font-size: 22px;
  line-height: 1.45;
}

.wk-entry-summary h1 {
  font-size: 20px;
  line-height: 1.5;
}

.wk-entry-type,
.wk-entry-meta {
  margin: 0 0 10px;
  color: #64748b;
  font-weight: 700;
}

.wk-entry-content {
  color: #20335f;
  line-height: 1.85;
}

.wk-question-block,
.wk-answer-block {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--wk-line);
  border-radius: 8px;
  background: #f8fbff;
}

.wk-question-block strong,
.wk-answer-block strong {
  display: block;
  margin-bottom: 8px;
  color: var(--wk-navy);
}

.wk-question-block p,
.wk-answer-block p {
  margin: 0 0 10px;
}

.wk-question-block p:last-child,
.wk-answer-block p:last-child {
  margin-bottom: 0;
}

.wk-answer-block {
  background: #fff;
}

.wk-answer-block-pending {
  background: #fffaf0;
}

.wk-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.wk-entry-button {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 18px;
  color: #fff;
  background: #0866c9;
  border-radius: 8px;
  font-weight: 800;
}

.wk-entry-actions .wk-entry-button {
  margin-top: 0;
}

.wk-entry-button-secondary {
  color: #0866c9;
  background: #e8f2ff;
}

.wk-entry-summary + .wk-entry-summary {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--wk-line);
}

.wk-archive-head {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--wk-line);
}

.wk-archive-head p {
  margin: 0 0 6px;
  color: var(--wk-muted);
  font-size: 13px;
  font-weight: 800;
}

.wk-archive-head h1 {
  margin: 0;
  color: var(--wk-navy);
  font-size: 24px;
  line-height: 1.4;
}

.wk-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--wk-line);
}

.wk-pagination .page-numbers {
  min-width: 38px;
  padding: 8px 12px;
  color: var(--wk-navy);
  background: #f4f8fc;
  border: 1px solid #d8e4f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.wk-pagination .current {
  color: #fff;
  background: var(--wk-blue);
  border-color: var(--wk-blue);
}

.wk-material-archive-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wk-material-archive-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
}

.wk-material-archive-item:last-child {
  border-bottom: 0;
}

.wk-material-archive-link {
  min-width: 0;
}

.wk-material-archive-link strong {
  display: block;
  overflow: hidden;
  color: #0a2860;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wk-material-archive-link small {
  display: block;
  margin-top: 3px;
  color: #66748d;
  font-size: 12px;
  font-weight: 700;
}

.wk-file-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: #60718a;
  border-radius: 8px;
}

.wk-file-icon .dashicons {
  width: auto;
  height: auto;
  font-size: 22px;
}

.wk-file-icon-pdf {
  background: #d64242;
}

.wk-file-icon-word {
  background: #2468c9;
}

.wk-file-icon-excel {
  background: #168a4f;
}

.wk-file-icon-image {
  background: #0aa8ad;
}

.wk-empty {
  margin: 0;
  color: #66748d;
  font-weight: 700;
}

.wk-footer {
  padding: 18px 0 4px;
  color: #6c7890;
  font-size: 12px;
  text-align: center;
}

.wk-bottom-nav {
  display: none;
}

body:not(.logged-in) .wk-bottom-nav {
  display: none;
}

body:not(.logged-in) .wk-search,
body:not(.logged-in) .wk-user-live {
  display: none;
}

@media (max-width: 1180px) {
  .wk-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .wk-header {
    grid-template-columns: 1fr minmax(260px, 520px) auto;
  }

  .wk-brand-text,
  .wk-menu a span:last-child,
  .wk-menu a small,
  .wk-menu-section,
  .wk-sidefooter span {
    display: none;
  }

  .wk-menu a {
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 760px) {
  .wk-shell {
    display: block;
    padding-bottom: 76px;
  }

  .wk-header {
    position: sticky;
    display: grid;
    grid-template-columns: 1fr auto;
    height: auto;
    min-height: 64px;
    gap: 10px 12px;
    padding: 10px 14px 12px;
  }

  .wk-brand-row {
    gap: 10px;
  }

  .wk-logo {
    width: 40px;
    height: 40px;
  }

  .wk-brand-text {
    display: block;
  }

  .wk-brand-title {
    display: block;
    font-size: 20px;
    white-space: normal;
  }

  .wk-brand-subtitle {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    white-space: normal;
  }

  .wk-search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .wk-search input {
    height: 42px;
    border-radius: 8px;
  }

  .wk-user {
    gap: 8px;
  }

  .wk-user-text {
    display: none;
  }

  .wk-bell {
    width: 44px;
    height: 44px;
  }

  .wk-bell .dashicons {
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 32px;
  }

  .wk-avatar-wrap,
  .wk-avatar {
    width: 34px;
    height: 34px;
  }

  .wk-avatar-wrap {
    font-size: 14px;
  }

  .wk-sidebar {
    display: none;
  }

  .wk-main {
    padding: 12px;
  }

  .wk-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 70px;
    padding: 6px 4px 8px;
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid #d8e3ef;
    box-shadow: 0 -8px 24px rgba(5, 40, 80, .12);
  }

  .wk-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    color: #63718a;
    font-size: 10px;
    font-weight: 700;
  }

  .wk-bottom-nav a.active {
    color: var(--wk-blue);
  }

  .wk-bottom-nav .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
  }

  .wk-entry-card h1,
  .wk-entry-summary h1 {
    font-size: 18px;
  }
}
