/* Yossy Tools — header / drawer / shell tokens / breadcrumb (sitewide) */

:root {
  --ink: #0b1b3b;
  --blue: #e8f5ff;
  --green: #41b62c;
  --yellow: #ffce0b;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body.yt-shell-body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: "Zen Maru Gothic", serif;
  font-weight: 500;
}

a {
  color: inherit;
}

/*
 * テキストリンクのホバー統一（サイト全体）
 * 色＝「すべての記事を見る」系、下線の太さ＝「すべての生成ツールを見る」系
 * FVの柱ボタン（.yt-pillars）は対象外
 */
.yt-nav-desktop a:hover,
.yt-nav-desktop a:focus-visible,
.yt-drawer-nav a:hover,
.yt-drawer-nav a:focus-visible,
.yt-footer nav a:hover,
.yt-footer nav a:focus-visible,
.yt-text-link:hover,
.yt-text-link:focus-visible,
a.yt-articles-all:hover,
a.yt-articles-all:focus-visible,
.yt-view-all:hover,
.yt-view-all:focus-visible {
  color: #166f9e;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  background: none;
}

/* —— Utilities —— */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background: #fff;
  clip: auto;
  clip-path: none;
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 700;
  height: auto;
  left: 8px;
  line-height: normal;
  padding: 12px 16px;
  text-decoration: none;
  top: 8px;
  width: auto;
  z-index: 100000;
}

/* —— Layout shell —— */
.yt-shell {
  width: min(calc(100% - 72px), var(--max));
  margin-inline: auto;
}

/* —— Main ambient voxel décor (SVG; faint, behind text) —— */
main {
  position: relative;
  isolation: isolate;
  overflow-x: clip; /* 装飾のはみ出しで横スクロールしない */
}

main::before,
main::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  background: url("../assets/yt-home/main-voxel-bg.svg") center / contain no-repeat;
}

/* 右上：大きめ（画面幅の約 22–28%） */
main::before {
  top: 40px;
  right: 0;
  width: clamp(88px, 26vw, 300px);
  aspect-ratio: 320 / 280;
  opacity: 0.13;
}

/* 左下：小さめ（画面幅の約 10–15%） */
main::after {
  bottom: 64px;
  left: 0;
  width: clamp(64px, 13vw, 168px);
  aspect-ratio: 320 / 280;
  opacity: 0.1;
  transform: scaleX(-1);
}

/* —— Header —— */
.yt-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: auto;
  min-height: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 #dce8f1, 0 4px 15px #244e6d0b;
}

@supports (backdrop-filter: blur(12px)) {
  .yt-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* ヘッダー内側は最大幅なし（ウィンドウ幅いっぱい。左右余白だけ確保）。.yt-shell の幅上限より優先 */
.yt-header-inner.yt-shell {
  width: auto;
  max-width: none;
  margin-inline: 36px;
}

.yt-header-inner {
  height: auto;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}

.yt-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--ink);
}

.yt-brand .yt-site-title {
  display: block;
  margin: 10px 0;
  font-size: 0;
  line-height: 0;
}

.yt-header-logo {
  display: block;
  width: auto;
  height: 50px;
  max-width: min(442px, 68vw);
  object-fit: contain;
  object-position: left center;
}

.yt-brand-icon,
.yt-brand-text {
  display: none;
}

.yt-brand-cube {
  position: relative;
  width: 35px;
  height: 35px;
  display: inline-block;
  background: linear-gradient(145deg, #ffdb25 0 40%, #0f99a9 40% 68%, #118657 68%);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  border: 1px solid #fff;
}

.yt-brand-cube span {
  position: absolute;
  inset: 7px;
  background: linear-gradient(135deg, #ffdb29 0 45%, #e4f7fc 45% 67%, #9adf8e 67%);
  clip-path: inherit;
}

.yt-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.yt-nav-desktop {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.4vw, 28px);
}

.yt-nav-desktop a {
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
}


.yt-icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.yt-icon-btn:hover,
.yt-icon-btn:focus-visible {
  background: #eef6fc;
  outline: 2px solid #9ec9e8;
  outline-offset: 1px;
}

.yt-search-desk {
  position: relative;
}

.yt-search-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(360px, 84vw);
  padding: 12px;
  background: #fff;
  border: 1px solid #d7e6f1;
  border-radius: 12px;
  box-shadow: 0 10px 28px #123a5a22;
}

.yt-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  /* BunnyPress .bnp_searchform { height:3em } が残っても種別ボタンをクリップしない */
  height: auto;
  min-height: 0;
}

.yt-search-form input[type="search"] {
  flex: 1 1 140px;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.55em 0.7em;
  border: 1px solid #c5d7e6;
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  background: #fff;
}

.yt-search-form > button[type="submit"],
.yt-search-form > .bnp_searchbutton {
  flex: none;
  position: static;
  top: auto;
  right: auto;
  transform: none;
  padding: 0.55em 0.9em;
  border: 0;
  border-radius: 8px;
  background: #1a6ea8;
  color: #fff;
  font: inherit;
  font-weight: 500;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
}

.yt-search-form > button[type="submit"]:hover,
.yt-search-form > .bnp_searchbutton:hover {
  background: #155a8a;
}

/* BunnyPress の虫眼鏡 :before は yt ボタン文言と二重になるので抑止 */
.yt-search-form > .bnp_searchbutton::before {
  content: none;
}

.yt-search-type {
  flex: 1 1 100%;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.yt-search-type-opts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.yt-search-type-opt {
  display: block;
  margin: 0;
  cursor: pointer;
}

.yt-search-type-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.yt-search-type-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.3em 0.4em;
  border: 1px solid #c5d7e6;
  border-radius: 8px;
  background: #f5fafd;
  color: #35536e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.yt-search-type-opt input:checked + span {
  border-color: #1a6ea8;
  background: #1a6ea8;
  color: #fff;
}

.yt-search-type-opt input:focus-visible + span {
  outline: 2px solid #1a6ea8;
  outline-offset: 2px;
}

.yt-menu-toggle {
  display: none;
}

.yt-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
  height: 18px;
}

.yt-hamburger span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.yt-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(12, 28, 48, 0.42);
  cursor: pointer;
}

.yt-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1101;
  width: min(320px, 86vw);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 28px #0c1c301f;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  padding: 18px 18px 28px;
  overflow: auto;
  box-sizing: border-box;
}

.yt-drawer.is-open {
  transform: translateX(0);
}

html.yt-drawer-open {
  overflow: hidden;
}

.yt-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.yt-drawer-title {
  font-size: 15px;
  font-weight: 700;
}

.yt-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 22px;
}

.yt-drawer-nav a {
  display: block;
  padding: 12px 10px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
}


.yt-drawer-search {
  margin-top: 8px;
}

/* —— Breadcrumb（テーマデフォルト削除時用。firstveiw.css から移植） —— */
@font-face {
  font-family: "icomoon";
  src:
    url("webfonts/icomoon.eot") format("embedded-opentype"),
    url("webfonts/icomoon.ttf") format("truetype"),
    url("webfonts/icomoon.woff") format("woff"),
    url("webfonts/icomoon.svg") format("svg");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.bnp_bc_cover {
  background: #f9f9f9;
  white-space: nowrap;
  overflow-x: auto;
  border-bottom: 1px solid #ddd;
}

/* パンくずはヘッダーと同じく最大幅なし（左右余白もヘッダーと揃える） */
.bnp_bc {
  width: auto;
  max-width: none;
  margin: 0 36px;
  box-sizing: border-box;
  line-height: 1.6em;
  font-size: 0.75em;
  padding: 0;
  list-style: none;
}

.bnp_bc a {
  padding: 1em 0;
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
}

.bnp_bc a:hover,
.bnp_bc a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.breadcrumb_list,
.breadcrumb_last {
  display: inline;
  position: relative;
}

.breadcrumb_last {
  padding: 0 15px 0 0;
}

.breadcrumb_list:after,
.breadcrumb_home:before {
  font-family: "icomoon";
  content: "\f0da";
  padding: 0 5px 0 10px;
}

.breadcrumb_home:before {
  font-size: 1.1em;
  content: "\f015";
  padding: 0 5px 0 0;
}

@media (max-width: 1024px) {
  .yt-shell {
    width: min(calc(100% - 44px), var(--max));
  }

  .bnp_bc {
    margin-inline: 22px;
  }

  .yt-header-inner.yt-shell {
    margin-inline: 22px;
  }
}

@media (max-width: 768px) {
  .yt-nav-desktop,
  .yt-search-desk {
    display: none;
  }

  .yt-menu-toggle {
    display: inline-flex;
  }

  .yt-header-inner {
    padding: 4px 0;
  }

  .yt-header-logo {
    height: 38px;
    max-width: min(280px, 58vw);
  }

  html {
    scroll-padding-top: 80px;
  }

  .yt-shell {
    width: min(calc(100% - 34px), var(--max));
  }

  .bnp_bc {
    margin-inline: 17px;
  }

  .yt-header-inner.yt-shell {
    margin-inline: 17px;
  }
}

@media (min-width: 769px) {
  .yt-drawer,
  .yt-drawer-backdrop,
  .yt-menu-toggle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .yt-drawer {
    transition: none;
  }
}
