/* 記事一覧・カテゴリ・ガイド */

:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) {
  --nk-archive-ink: #3D332C;
  --nk-archive-muted: #74675D;
  --nk-archive-coral: #D97955;
  --nk-archive-sage: #839D73;
  --nk-archive-border: #E7DED4;
  --nk-archive-ivory: #FBF7F1;
  --nk-archive-white: #FFFDFC;
  --nk-archive-max: 1500px;
  color: var(--nk-archive-ink);
}

/* 一覧レイアウト */
:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) :is(#content, .content) {
  width: 100%;
  max-width: none;
  margin-top: 0;
  background: var(--nk-archive-ivory);
}

:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #content .content-in {
  display: block !important;
  box-sizing: border-box;
  width: min(var(--nk-archive-max), calc(100% - 80px));
  max-width: none;
  margin-inline: auto;
  padding: 42px 0 86px;
}

:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main {
  box-sizing: border-box;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}


:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #sidebar {
  display: none !important;
}


:where(body.category, body.tax-beginner_guide, body.blog:not(.home)) #main .archive-title:has(> .nk-archive-paw) {
  display: flex;
  align-items: center;
  gap: 12px;
}

:where(body.category, body.tax-beginner_guide, body.blog:not(.home)) #main .archive-title > .nk-archive-paw {
  display: block;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #A58271; 
  transform: translateY(1px);
}

:where(body.category, body.tax-beginner_guide, body.blog:not(.home)) #main .archive-title > .nk-archive-paw path {
  fill: currentColor;
}

/* アーカイブ見出し */
:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main :is(.archive-title, .list-title) {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--nk-archive-ink);
  font-size: clamp(25px, 2.5vw, 34px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .025em;
}

:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main :is(.archive-description, .category-description, .taxonomy-description) {
  margin: 0 0 27px;
  padding: 0;
  border: 0;
  color: var(--nk-archive-muted);
  background: transparent;
  font-size: 14px;
  line-height: 1.85;
}

:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main :is(.archive-description, .category-description, .taxonomy-description) p {
  margin: 0 0 10px;
}

/* 記事カードの列数 */
:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  justify-content: initial;
  column-gap: 18px;
  row-gap: 28px;
  width: 100%;
  max-width: none;
}
:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .list > .entry-card-wrap {
  float: none;
  flex: initial;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
}

/* ページ送り */
:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .pagination-next,
:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .pagination-next-link {
  display: none !important;
}


:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .pagination {
  margin: 42px 0 0;
}

:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main :is(.pagination .page-numbers, .pagination-next-link) {
  border: 1px solid var(--nk-archive-border);
  border-radius: 999px;
  background: var(--nk-archive-white);
  color: var(--nk-archive-ink);
  box-shadow: none;
  text-decoration: none;
}

:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .pagination .page-numbers.current {
  border-color: var(--nk-archive-sage);
  background: #E8F0E5;
  color: #315944;
}

:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main a.page-numbers:hover,
:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .pagination-next-link:hover {
  border-color: var(--nk-archive-sage);
  background: #F0F5EE;
  color: #315944;
}

/* 分類ナビ */
:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .widget-index-top:has(.nk-archive-nav) {
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) .nk-archive-nav__panel[hidden] {
  display: none !important;
}
:where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .widget-index-top:has(.nk-archive-nav) .nk-archive-nav {
  margin: 0;
}


:where(body.category, body.tax-beginner_guide) .nk-archive-nav {
  box-sizing: border-box;
  margin: 18px 0 30px;
  color: var(--nk-archive-ink);
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: clamp(20px, 2.5vw, 36px);
  margin: 0 0 18px;
  padding: 0;
  border-bottom: 1px solid #E7DED4;
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab {
  --nk-nav-tab-color: #54795A;  
  --nk-nav-tab-strong: #4F7656;
  --nk-nav-tab-accent: #8FA984; 
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-height: 48px;
  min-width: 0;
  margin: 0;
  padding: 10px 1px 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--nk-nav-tab-color);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .015em;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s ease;
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab--guide {
  --nk-nav-tab-color: #9B684F;
  --nk-nav-tab-strong: #985F45;
  --nk-nav-tab-accent: #D97955;
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--nk-nav-tab-accent);
  opacity: 0;
  transform: scaleX(.65);
  transition: opacity .18s ease, transform .18s ease;
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab:is(.is-active, [aria-selected="true"]) {
  color: var(--nk-nav-tab-strong);
  font-weight: 700;
  background: transparent;
  border: 0;
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab:is(.is-active, [aria-selected="true"])::after {
  opacity: 1;
  transform: scaleX(1);
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab:hover {
  color: var(--nk-nav-tab-strong);
  background: transparent;
}


:where(body.category, body.tax-beginner_guide) .nk-archive-nav__panel--category {
  --nk-nav-ink: #54795A;  
  --nk-nav-strong: #4F7656;
  --nk-nav-line: #DEE9DA;
  --nk-nav-line-strong: #8FA984;
  --nk-nav-current: #EBF3E8;
  --nk-nav-hover: #F3F8F0;
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__panel--guide {
  --nk-nav-ink: #9B684F;  
  --nk-nav-strong: #985F45;
  --nk-nav-line: #EFDDD3;
  --nk-nav-line-strong: #D97955;
  --nk-nav-current: #FBE9DF;
  --nk-nav-hover: #FEF3EC;
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__links li {
  margin: 0;
  padding: 0;
  list-style: none;
}

:where(body.category, body.tax-beginner_guide) #main .nk-archive-nav__links :is(a, a:visited) {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: 9px 20px; 
  border: 1px solid var(--nk-nav-line);
  border-radius: 10px;
  background: var(--nk-archive-white);
  box-shadow: none;
  color: var(--nk-nav-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

:where(body.category, body.tax-beginner_guide) #main .nk-archive-nav__links a:hover {
  border-color: var(--nk-nav-line-strong);
  background: var(--nk-nav-hover);
  color: var(--nk-nav-strong);
}

:where(body.category, body.tax-beginner_guide) #main .nk-archive-nav__links a:is([aria-current="page"], .is-current) {
  border-color: var(--nk-nav-line-strong);
  background: var(--nk-nav-current);
  color: var(--nk-nav-strong);
  font-weight: 700;
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab:focus-visible {
  outline: 2px solid var(--nk-nav-tab-strong);
  outline-offset: 3px;
}

:where(body.category, body.tax-beginner_guide) .nk-archive-nav__panel .nk-archive-nav__links a:focus-visible {
  outline: 2px solid var(--nk-nav-line-strong);
  outline-offset: 3px;
}

/* レスポンシブ */
@media screen and (min-width: 768px) and (max-width: 1239px) {
  :where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 24px;
  }
}


@media screen and (min-width: 601px) and (max-width: 767px) {
  :where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 24px;
  }
}

@media screen and (max-width: 1023px) {
  :where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #content .content-in {
    width: calc(100% - 44px);
    padding-top: 30px;
  }
}


@media screen and (max-width: 600px) {
  :where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #content .content-in {
    width: calc(100% - 32px);
    padding: 24px 0 60px;
  }

  :where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main :is(.archive-title, .list-title) {
    margin-bottom: 8px;
    font-size: 25px;
  }
  :where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main :is(.archive-description, .category-description, .taxonomy-description) {
    margin-bottom: 23px;
    font-size: 13px;
  }
  :where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .list {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 11px;
    row-gap: 11px;
  }
  :where(body.category, body.tax-beginner_guide) .nk-archive-nav {
    margin: 14px 0 23px;
  }
  :where(body.category, body.tax-beginner_guide) #main .widget-index-top:has(.nk-archive-nav) {
    margin-bottom: 24px;
  }
  :where(body.category, body.tax-beginner_guide) .nk-archive-nav__tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
    gap: 12px;
    margin-bottom: 14px;
  }
  :where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab {
    min-height: 44px;
    padding: 8px 2px 11px;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    text-align: center;
  }
  :where(body.category, body.tax-beginner_guide) .nk-archive-nav__links {
    gap: 8px;
  }
  :where(body.category, body.tax-beginner_guide) #main .nk-archive-nav__links :is(a, a:visited) {
    min-height: 38px;
    padding: 7px 14px; 
    font-size: 12px;
  }
}

@media screen and (max-width: 360px) {
  :where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(body.category, body.tax-beginner_guide, body.search, body.blog:not(.home)) #main .list > .entry-card-wrap,
  :where(body.category, body.tax-beginner_guide) .nk-archive-nav__links a,
  :where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab,
  :where(body.category, body.tax-beginner_guide) .nk-archive-nav__tab::after {
    transition: none;
  }
}


/* 検索結果 */
body.search #main .archive-title {
  margin-bottom: 20px;
}


body.search #main form.search-box {
  box-sizing: border-box;
  width: min(100%, 700px);
  max-width: 100%;
  margin: 0 0 15px;
}

body.search #main form.search-box .search-edit {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 12px 55px 12px 18px;
  border: 1px solid var(--nk-archive-border);
  border-radius: 12px;
  background: var(--nk-archive-white);
  color: var(--nk-archive-ink);
  font-size: 15px;
  box-shadow: none;
}

body.search #main form.search-box .search-edit:focus-visible {
  outline: 2px solid var(--nk-archive-sage);
  outline-offset: 2px;
}


body.search #main form.search-box {
  position: relative;
}

body.search #main form.search-box .search-submit {
  position: absolute;
  inset: auto 7px auto auto;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--nk-archive-ink);
  line-height: 1;
  cursor: pointer;
}

body.search #main form.search-box .search-submit .fa {
  display: block;
  position: static;
  margin: 0;
  padding: 0;
  line-height: 1;
  transform: translateY(-2px); 
}

body.search #main form.search-box .search-submit:focus-visible {
  outline: 2px solid var(--nk-archive-sage);
  outline-offset: -2px;
  border-radius: 10px;
}


body.search #main .widget-index-top:has(.nk-search-results-count) {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}


body.search #main .nk-search-results-count {
  margin: 6px 0 25px;
  color: var(--nk-archive-muted);
  font-size: 14px;
  line-height: 1.7;
}

body.search #main .nk-search-results-count strong {
  color: var(--nk-archive-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}


body.search #main .posts-not-found {
  box-sizing: border-box;
  margin: 0;
  padding: 30px 32px;
  border: 1px solid var(--nk-archive-border);
  border-radius: 16px;
  background: var(--nk-archive-white);
  color: var(--nk-archive-ink);
  box-shadow: 0 5px 16px rgba(61,51,44,.035);
}

body.search #main .posts-not-found h2 {
  display: none; 
}

body.search #main .posts-not-found p {
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
}

@media screen and (max-width: 600px) {
  body.search #main .archive-title {
    margin-bottom: 15px;
  }
  body.search #main form.search-box {
    margin-bottom: 11px;
  }
  body.search #main form.search-box .search-edit {
    min-height: 48px;
    padding-left: 14px;
    font-size: 14px;
  }
  body.search #main .nk-search-results-count {
    margin-bottom: 20px;
    font-size: 13px;
  }
  body.search #main .posts-not-found {
    padding: 22px 20px;
  }
  body.search #main .posts-not-found p {
    font-size: 14px;
  }
}

/* すべての記事 */
body.blog:not(.home) #main .widget-index-top:has(.nk-all-articles-intro) {
  margin: 0 0 25px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.blog:not(.home) #main .nk-all-articles-intro {
  margin: 0;
}

body.blog:not(.home) #main .nk-all-articles-intro .archive-title {
  margin: 0;
}

@media screen and (max-width: 600px) {
  body.search #main form.search-box .search-submit {
    width: 40px;
    height: 40px;
    right: 5px;
  }
  :where(body.category, body.tax-beginner_guide, body.blog:not(.home)) #main .archive-title:has(> .nk-archive-paw) {
    gap: 10px;
  }
  :where(body.category, body.tax-beginner_guide, body.blog:not(.home)) #main .archive-title > .nk-archive-paw {
    flex-basis: 27px;
    width: 27px;
    height: 27px;
    min-width: 27px;
  }
}
