/*
Theme Name: konnichi
*/

:root {
  --bg: linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  --text: #222;
  --muted: #666;
  --primary: #0b6bcb;
  --primary-weak: #e8f2fd;
  --border: #e6e6e6;
  --container: 1100px;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  --logo-h: 30px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Header & Nav */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}
.brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), #6fb2ff);
  box-shadow: var(--shadow);
}

.menu-toggle {
  font-size: 1.25rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  display: none;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.nav-menu > li {
  position: relative;
}
.nav-menu > li > a {
  text-decoration: none;
  color: var(--text);
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  display: inline-block;
}
.nav-menu > li > a:hover {
  background: var(--primary-weak);
  color: var(--primary);
}

/* Sub menu */
.sub-menu {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  position: absolute;
  left: 0;
  top: 42px;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 1000;
}
.sub-menu li a {
  display: block;
  padding: 0.45rem 0.6rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
}
.sub-menu li a:hover {
  background: var(--primary-weak);
  color: var(--primary);
}
.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu {
  display: block;
}

/* caret */
.menu-item-has-children > a::after {
  content: "▾";
  margin-left: 0.35rem;
  font-size: 0.8em;
  color: var(--muted);
}

/* Banner */
.site-banner {
  background: linear-gradient(135deg, #e9f3ff, #f7fbff);
  border-bottom: 1px solid var(--border);
}
.banner-inner {
  padding: 3.2rem 0;
  display: grid;
  gap: 0.75rem;
}
.banner-title {
  margin: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  text-align: center;
}
.banner-sub {
  margin: 0;
  color: var(--muted);
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.8rem 0;
}
.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}
.breadcrumbs .sep {
  margin: 0 0.4rem;
  opacity: 0.6;
}

/* Content grid */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
}
.card {
  grid-column: span 12;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  background: #fff;
}

@media (min-width: 640px) {
  .card.sm-6 {
    grid-column: span 6;
  }
  .card.sm-4 {
    grid-column: span 4;
  }
}
@media (min-width: 960px) {
  .menu-toggle {
    display: none;
  }
}

/* Mobile nav */
@media (max-width: 959.98px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--logo-h);
    height: var(--logo-h);
    padding: 0;
    margin-left: auto;
    justify-self: end;
  }
  .nav-menu {
    display: none;
    position: fixed;
    inset: 54px 0 auto 0;
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 0.8rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }
  .nav-menu.active {
    display: flex;
  }
  .nav-menu > li > a {
    padding: 0.7rem 0.6rem;
    border-radius: 8px;
  }
  .nav-menu > li {
    position: static;
  }
  .sub-menu {
    position: static;
    border: none;
    border-radius: 10px;
    box-shadow: none;
    padding: 0.25rem 0 0.5rem 1rem;
    display: none;
  }
  .nav-menu li.open > .sub-menu {
    display: block;
  }
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer-inner {
  padding: 1.2rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-inner .info{
  display: block;
  margin: 0 auto;
}
/* Header 三栏布局 */
.header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

/* 居中搜索条样式 */
.header-center .search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
.search-form .search-field {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}
.search-form .search-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-weak);
}
.search-form .search-submit {
  height: 38px;
  padding: 0 0.8rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
}

@media (max-width: 959.98px) {
  .header-grid {
    grid-template-columns: auto 1fr auto;
    row-gap: 0.5rem;
  }
  .header-center {
    grid-column: 1 / -1;
    order: 3;
  }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--logo-h);
  }
}

/* 自定义 Logo（WP 输出的 the_custom_logo） */
.header-left .custom-logo-link img,
.header-left .custom-logo {
  height: var(--logo-h);
  max-height: var(--logo-h);
  width: auto;
  display: block;
  object-fit: contain;
}
.brand .logo {
  height: var(--logo-h);
  width: auto;
}

/* 搜索框与按钮跟 Logo 同高，保持整体对齐 */
.header-center .search-form .search-field,
.header-center .search-form .search-submit {
  height: var(--logo-h);
  line-height: calc(var(--logo-h) - 2px);
}

@media (min-width: 960px) {
  .menu-toggle {
    display: none !important;
  }
  .header-right {
    grid-column: 3;
    justify-self: end;
    align-self: right;
  }
}

.site-banner.has-banner {
  background:
    linear-gradient(0deg, rgba(0,0,0,0.12), rgba(0,0,0,0.12)),
    var(--banner) center / cover no-repeat,
    linear-gradient(135deg, #e9f3ff, #f7fbff); 
}

/* 用语集 UI 基础样式 */
.container { max-width: 980px; margin: 0 auto; padding: 24px; }
.header h1 { margin: 0 0 12px; }
.search { display:flex; gap:8px; margin: 10px 0 16px; }
.search input[type=search]{ flex:1; padding:8px 10px; }
.search button{ padding:8px 12px; }

.kana-grid .row{ display:flex; gap:8px; margin:6px 0; flex-wrap:wrap; }
.kana-grid .kana{ display:inline-block; min-width:32px; text-align:center; padding:4px 6px; border:1px solid #ddd; border-radius:6px; text-decoration:none; color:#111; }
.kana-grid .kana:hover{ background:#f5f5f5; }
.kana-grid .disabled{ opacity:.35; border-style:dashed; }
.filters{ display:flex; gap:8px; align-items:center; margin: 8px 0 20px; }

.cards{ display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
.card{ border:1px solid #eee; border-radius:10px; padding:12px; background:#fff; }
.card .t{ margin:0 0 6px; font-size:18px; }
.card .jp{ color:#222; font-weight:600; }
.card .rd{ color:#666; font-weight:400; }

.glossary-single .breadcrumb{ font-size:13px; color:#666; margin-bottom:12px; }
.glossary-single .badge{ display:inline-block; padding:3px 8px; border:1px solid #ddd; border-radius:999px; font-size:12px; }
.fig img{ max-width:100%; height:auto; border-radius:8px; }
.rel-list{ display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:8px; padding-left:18px; }
