@charset "UTF-8";
/*
 * 旧レイアウトページ共通スタイル
 *   トップ(index.html) / 研究ノート(kenq) / 漢字一覧(kanji) / ピグモ00(pigmo)
 * 使われていないテンプレート由来のルール（スライダー・isotope・ナビの旧版など）は削除済み
 */

/* ==================== 基本 ==================== */

/* ふつうのゴシック体（TOP・メニューなどで使う） */
:root {
  --font-gothic: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', YuGothic, Meiryo, sans-serif;
}

body {
  background: #fff;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-gothic);
}

h1,
h2,
h3,
h4,
h5 {
  color: rgba(130, 0, 104, 0.8);
  font-weight: normal;
}

.mgb {
  margin-bottom: 20px;
}

.container {
  padding: 0 20px;
}

.f1 {
  font-size: 6px;
}

.paren {
  font-size: 90%;
  color: #444;
}

.st {
  font-weight: bold;
}

/* ==================== サイトヘッダー（新） ==================== */
/* PC：ロゴ＋横並びメニュー ／ 767px以下：ハンバーガーで開閉 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.site-header__logo img {
  display: block;
  width: 44px;
  height: 44px;
}

.site-menu ul {
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-menu a {
  color: #555;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}

.site-menu a:hover,
.site-menu a:focus-visible {
  color: #00b8d9;
}

.site-menu__note a {
  font-size: 10px;
  color: #999;
}

/* ハンバーガーボタン（PCでは非表示） */
.site-header__toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.site-header__toggle span,
.site-header__toggle span::before,
.site-header__toggle span::after {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 1px;
  transition: transform 0.3s, background-color 0.3s;
}

.site-header__toggle span {
  top: 21px;
}

.site-header__toggle span::before,
.site-header__toggle span::after {
  content: '';
  left: 0;
}

.site-header__toggle span::before {
  transform: translateY(-7px);
}

.site-header__toggle span::after {
  transform: translateY(7px);
}

.site-header.is-open .site-header__toggle span {
  background-color: transparent;
}

.site-header.is-open .site-header__toggle span::before {
  transform: rotate(45deg);
}

.site-header.is-open .site-header__toggle span::after {
  transform: rotate(-45deg);
}

@media (max-width: 767px) {
  .site-header {
    height: 56px;
    padding: 0 16px;
  }

  .site-header__logo img {
    width: 40px;
    height: 40px;
  }

  .site-header__toggle {
    display: block;
  }

  /* 開閉パネル：高さ 0fr ⇔ 1fr でなめらかに開く */
  .site-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: grid;
    grid-template-rows: 0fr;
    background: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    visibility: hidden;
    transition: grid-template-rows 0.3s ease, visibility 0.3s;
  }

  .site-header.is-open .site-menu {
    grid-template-rows: 1fr;
    visibility: visible;
  }

  .site-menu ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    overflow: hidden;
  }

  .site-menu li {
    border-top: 1px solid #f0f0f0;
  }

  .site-menu a {
    display: block;
    padding: 16px 20px;
    font-size: 16px;
    color: #333;
  }

  .site-menu__note a {
    padding: 12px 20px 16px;
    font-size: 11px;
    color: #999;
  }
}

/* ==================== サイトフッター（新） ==================== */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: #fff253;
  color: #666;
  font-size: 12px;
}

.site-footer p {
  margin: 0;
}

/* ページトップへ戻るボタン（コンテンツページの #back-to-top と同じ見た目・動き） */
#back-to-top {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 50;
  display: none; /* 500px 以上スクロールしたら site.js が表示する */
  width: 40px;
  padding: 10px;
  background-color: #e4e4e4;
  border: none;
  cursor: pointer;
}

/* ==================== ヘッダー・ナビ（研究ノート・漢字一覧・ピグモ00の旧ヘッダー） ==================== */

.selectnav-container {
  padding: 4px 0;
  font-size: 10px;
  font-size: 1rem;
}

.sf-menu,
.sf-menu * {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sf-menu li {
  position: relative;
}

.sf-menu > li {
  float: left;
  width: 8%;
  padding: 10px 0;
}

.sf-menu a {
  display: block;
  position: relative;
  text-decoration: none;
  color: #666;
}

.sf-menu li:hover > a {
  color: #00dcff;
}

/* サブメニュー（漢字一覧ページ）：ホバーで下に開く */
.sf-menu ul {
  position: absolute;
  display: none;
  margin-top: 7%;
  left: 10%;
  z-index: 99;
  border-radius: 3px;
  background-color: rgba(0, 0, 0, 0.7);
}

.sf-menu li:hover > ul {
  display: block;
  animation: sf-menu-open 0.2s ease-out;
}

@keyframes sf-menu-open {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.sf-menu ul li {
  padding: 0 10px;
  min-width: 60px;
}

.sf-menu ul a {
  left: 0;
  border-top: 1px solid #000;
  padding: 7px 0;
  color: #fff;
  transition: left 0.2s;
}

.sf-menu ul a:hover {
  left: 5px;
}

/* スマホ幅ではナビをセレクトボックス（site.js が生成）に切り替え */
.selectnav {
  display: none;
}

@media screen and (max-width: 767px) {
  .js #nav {
    display: none;
  }
  .js .selectnav {
    display: block;
    width: 100%;
    margin: 0;
  }
  .selectnav-container {
    margin: 0;
    padding: 0;
  }
}

@media (max-width: 768px) {
  .brand {
    display: block;
    width: 200px;
    margin: 0 auto;
    text-align: center;
  }
}

ul.item-filters {
  margin: 0;
  padding: 0 30px;
  list-style: none;
  display: block;
  background: #f5f5f5;
  height: 36px;
  line-height: 36px;
}

/* ==================== トップページのタイル一覧 ==================== */
/*
 * 列数 = ceil(コンテナ幅 / 600px)、タイルは 600:467。
 * --cols / --tile-w / --tile-h は site.js がコンテナ幅から計算する（旧 isotope と同じ切り捨て）。
 * 下のメディアクエリと aspect-ratio は JavaScript が動かないときの代わり。
 */
#items_grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), var(--tile-w, 1fr));
  grid-auto-rows: var(--tile-h, auto);
}

@media (min-width: 601px) {
  #items_grid {
    --cols: 2;
  }
}
@media (min-width: 1201px) {
  #items_grid {
    --cols: 3;
  }
}
@media (min-width: 1801px) {
  #items_grid {
    --cols: 4;
  }
}
@media (min-width: 2401px) {
  #items_grid {
    --cols: 5;
  }
}

#items_grid:not([style]) .item-portfolio {
  aspect-ratio: 600 / 467;
}

.item-portfolio {
  position: relative;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.item-portfolio a,
.item-portfolio a img {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

/* タイル枠と画像の縦横比が少し違うので、引き伸ばさずに枠いっぱいに収める */
.item-portfolio a img {
  object-fit: cover;
}

.item-portfolio a {
  overflow: hidden;
}

/* ホバーで差し込むキャプション
   マウスが入ってきた辺から滑り込み、出ていった辺へ抜ける（向きは site.js が決める）。
   transform のトランジションなので、途中で向きが変わってもその位置から滑らかに続く */
.item-portfolio a > div {
  position: absolute;
  inset: -16px; /* カーソルについて少し動いても端がのぞかないよう、ひと回り大きく */
  background: rgba(255, 242, 83, 0.85);
  opacity: 0;
  transform: translate3d(0, 110%, 0);
  /* ゆっくり減速して止まる動き＝ふわっと。数値を大きくするとよりゆったり */
  transition:
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.45s ease-out;
  will-change: transform, opacity;
  pointer-events: none;
}

.item-portfolio.is-hover a > div {
  opacity: 1;
}

.item-portfolio a > div span {
  display: block;
  padding: 20px 0;
  margin: 76px 36px 20px 36px; /* 上の inset: -16px 分を足して、文字の位置は前と同じ */
  font-weight: bold;
  color: rgb(23, 23, 23);
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 -10px 0 rgba(255, 255, 255, 0.1);
  /* 文字は帯より少し遅れて浮かび上がる */
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 0.5s ease-out 0.08s,
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.08s;
}

.item-portfolio.is-hover a > div span {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* 種別ラベル（OPEN SOURCE / FREE FONT / FREE）：角丸の四角で囲む */
.item-portfolio .tag {
  display: table; /* 1行を占めて中央寄せ（＝ラベルの後で改行） */
  margin: 8px auto 6px;
  padding: 3px 9px 2px;
  border-radius: 4px;
  background: #222;
  color: #fff;
  font-style: normal;
  font-size: 0.8em;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-shadow: none;
}

/* ラベルの下の概要（商用可など）：やや小さめに */
.item-portfolio .note {
  display: block;
  font-size: 0.85em;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .item-portfolio a > div,
  .item-portfolio a > div span {
    transition-duration: 0.01s;
    transition-delay: 0s;
  }
}

/* 「NEW」バッジ：タイルに class="is-new" を付けると左上に表示 */
.item-portfolio.is-new::after {
  content: 'NEW';
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2; /* ホバーの黄色い帯より手前 */
  padding: 5px 10px 4px;
  background: #222;
  color: #fff253;
  font-family: var(--font-gothic);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.12em;
  line-height: 1;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

/* ==================== フッター ==================== */

#footer {
  background: #f2f2f2;
  padding: 20px 30px;
  text-align: left;
  bottom: 0;
  margin: 0;
}

#footer,
#footer p,
#footer a {
  color: #222 !important;
}

#footer a:hover {
  color: #fff;
}

#footer h3 {
  padding: 2px 0 !important;
  margin-bottom: 10px;
  color: #222;
}

#under-footer {
  padding: 0 20px;
  min-height: 50px;
  background: #fff253;
  color: #666;
}

#under-footer-logo {
  height: 46px;
}

#under-footer-logo a {
  color: #999;
  text-decoration: none;
  line-height: 48px;
  margin-left: 5px;
  font-size: 16px;
}

#under-footer-copyright {
  margin: 17px 0 0 0;
  font-size: 10px;
}

#under-footer-copyright a {
  color: #999;
}

#under-footer-back-to-top {
  margin: 10px;
  z-index: 999;
}

#under-footer-back-to-top a {
  width: 30px;
  height: 30px;
  display: block;
  background: #b0b0b0 url(../img/scroll-top-top.png) no-repeat 50%;
  transition: all 0.1s ease-in-out;
}

#under-footer-back-to-top a:hover {
  background-color: #aaa;
}

/* ==================== 本文パーツ ==================== */

.next {
  font-size: 14px;
  font-size: 1.4rem;
  font-weight: bold;
  margin-top: 24px;
  text-align: center;
}

.next a {
  float: left;
  margin-right: 20px;
  display: block;
  color: #ffff25;
  background: #666;
  border-radius: 5px;
  padding: 14px;
  width: 130px;
}

.next a:hover {
  color: #00dcff;
  background: #0039b6;
  text-decoration: none;
  border: none;
}

#kumi h5 {
  font-size: 10rem;
  font-weight: normal;
  color: #666;
  margin-top: 200px;
  text-align: center;
}

#kumi h5 a {
  color: #222;
}

#kumi h5 a:hover {
  color: #1cc2dd;
  text-decoration: none;
}

@media (max-width: 480px) {
  #kumi h5 a {
    font-size: 6rem;
  }
}
