@charset "UTF-8";

/* --------------------------------------------------
   0. Reset / Base
-------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --tk-primary: #2BB25C;
  --tk-accent: #ff6464;
  --tk-accent-strong: #ff5151;
  --tk-base: #FFF6D2;
  --tk-text: #464646;
}

body {
  margin: 0;
  padding: 0;
  line-height: 1.8;
  background: var(--tk-base);
font-family:
  -apple-system,
  BlinkMacSystemFont,
  "Segoe UI Variable",
  "Segoe UI",
  Roboto,
  "Helvetica Neue",
  Arial,
  "メイリオ",
  Meiryo,
  "ヒラギノ角ゴ ProN",
  "Hiragino Kaku Gothic ProN",
  sans-serif;

}

/* --------------------------------------------------
   1. Layout
-------------------------------------------------- */
/* 全体コンテナ */
#container {
  background-color: var(--tk-base); /* ベース色を背景に */
  color: var(--tk-text);            /* 文字色はテキストカラーに */
  margin: 16px auto 0;
  padding: 0;
}

/* ロゴ部分 */
#temple {
  height: 90px;
  background: url(image/top-348.png) no-repeat center center;
  background-size: contain;
  text-align: center;
  margin-bottom: 1rem;
}

/* メインコンテンツ */
#main {
  margin-top: 16px;
  font-size: 100%;
  padding: 0;                       /* Bootstrap と衝突しないように */
  text-align: left;
}

/* リンクボックス（旧テンプレの黄色枠） */
#links {
  margin: 16px 0;
  background-color: #fff;                   /* 黄色背景を廃止 */
  border-radius: 6px;
  padding: 1rem;
}

/* --------------------------------------------------
   2. Footer
-------------------------------------------------- */
#footer {
  width: 100%;
  max-width: 1092px; /* 旧テンプレの雰囲気を残しつつレスポンシブ化 */
  margin: 0 auto;
  padding: 1.5em 1em;
  color: #fff;
  background: var(--tk-primary); /* 緑のブランドカラー */
  border-bottom: 4px solid rgba(255,255,255,0.3);
}

/* リンク */
#footer a {
  color: #fff;
  background: transparent;
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

/* ホバー時の反転を強制（白文字×白背景の事故を防ぐ） */
#footer a:hover,
#footer li a:hover {
  color: var(--tk-primary) !important; /* 緑に反転を強制 */
  background-color: #fff !important;   /* 白背景を強制 */
}

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

/* リスト */
#footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#footer li {
  margin-bottom: .4em;
  line-height: 1.5;
}

/* 区切り線 */
#footer hr {
  margin: 1em 0 .5em;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.4);
}

.site-footer {
  background: var(--tk-primary);
  color: #fff;
  text-align: center;
  padding: 12px 0;
  font-size: .9rem;
}

.link-h2 {
  color: #fff;
  margin-bottom: .5em;
  border-bottom: 2px solid rgba(255,255,255,0.6);
  font-size: 1.1rem;
  font-weight: 700;
}

.row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 1.5rem;
}

/* --------------------------------------------------
   3. Article / Content（改善版）
-------------------------------------------------- */
#main article {
  font-size: 17px;
  line-height: 1.8;
  color: #222;
  word-break: break-word;
  background-color: #fff;
  border: 1px solid rgba(0,0,0,0.08); /* ごく薄いグレー */
  padding: 1.2em 1.6em;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04); /* 軽い影 */
}

/* 画像 */
#main article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2em auto;
  border-radius: 6px;
}

/* リスト */
#main li {
  margin: .4em 0 .4em 1.4em; /* 45px → 1.4em に */
}

#main li:first-child {
  margin-top: 1em;
}

#main li:last-child {
  margin-bottom: 1em;
}

/* リンク */
#main a {
  color: var(--tk-accent-strong);
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

#main a:hover {
  text-decoration: underline;
  background: rgba(255, 100, 100, 0.08); /* 赤系の薄い背景 */
}

/* テーブル全体 */
#main article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
  background-color: #fff;
  border: 1px solid #d8f2e4;
  border-radius: 6px;
  overflow: hidden;
}

/* セル共通 */
#main article th,
#main article td {
  padding: 0.7em 0.8em;
  border-bottom: 1px solid #e8f7ef;
}

/* 見出し（th） */
#main article th {
  background: #e6f8ef;
  color: #1d4d33;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.02em;
  border-bottom: 2px solid #2BB25C;
}

/* 偶数行（交互色） */
#main article tr:nth-child(even) td {
  background-color: #dff4e8; /* ← 濃くした */
}

/* ホバー行（PCのみ） */
@media (hover: hover) {
  #main article tr:hover td {
    background-color: #cfeede; /* ← さらに濃いホバー色 */
    transition: background-color 0.15s ease-in-out;
  }
}

/* 投稿日 */
p.posted {
  text-align: right;
  margin: 6px 0 5px;
  padding: 3px;
  border-top: 1px solid var(--tk-base);
}

/* パンくず */
#breadcrumb {
  margin-bottom: 3%;
}

#breadcrumb li {
  display: inline;
  font-size: 90%;
}

/* 記事内広告 */
#entry-ad {
  text-align: center;
}

#main .cancel {
    text-decoration: line-through;
    color: #777;
    opacity: 0.8;
}

#main blockquote {
  border-left: 4px solid #2BB25C;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background: #f8fdf9;
  color: #333;
  font-style: italic;
}

#main strong {
  font-weight: 700;
  color: var(--tk-accent);
  border-bottom: 2px solid rgba(43,178,92,0.35);
  padding-bottom: 1px;
}

#main del {
  text-decoration: line-through;
  color: #888;
  opacity: 0.75;
}

/* --------------------------------------------------
   4. Sidebar
-------------------------------------------------- */
.sidebar-block {
  margin-bottom: 1.5rem;
}

.left-ribbon {
  background: var(--tk-primary);
  margin: 8px -15px 10px -26px;
  padding: 4px 10px;
  color: #fff;
  box-shadow: inset 0 0 50px rgba(0,0,0,.1), 0 2px 3px rgba(0,0,0,.3);
  position: relative;
}

.left-ribbon::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 0;
  height: 0;
  left: -15px;
  bottom: -15px;
  border: 15px solid transparent;
  border-right-color: #666;
}
.sidebar-block p {
  color: var(--tk-text);
}
#links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#links li {
  padding: 6px 0;
  border-left: 2px solid var(--tk-accent);
  margin-bottom: 4px;
  background: #fff; /* 白に統一 */
}

#links li a {
  display: block;
  padding: 4px 8px;
  color: var(--tk-accent);
  text-decoration: none;
  transition: color .15s ease, padding-left .15s ease, background .15s ease;
}

/* 記事と同じ薄赤背景に統一 */
#links li a:hover {
  color: var(--tk-accent); /* 色は変えない（緑のまま） */
  background: rgba(255, 100, 100, 0.08); /* 記事と同じ薄赤 */
  padding-left: 12px;
}

/* --------------------------------------------------
   5. Headings / Titles
-------------------------------------------------- */
/* 記事タイトル（h1/h2 共通） */
.entry-title,
.entry-title a {
  color: var(--tk-accent);
  position: relative;
  font-size: 1.4rem;
  font-weight: 700;
  margin: .5em 0;
  padding: .5em .5em .5em 1.8em;
  display: block;
  text-decoration: none;
}

/* タイトル左の ■（大） → a のみに適用 */
.entry-title a::before {
  content: "\25A0";
  position: absolute;
  left: 0.3em;
  top: 0.2em;
  font-size: 1.1em;
  color: var(--tk-accent);
}

h1.entry-title::before {
  content: "\25A0";
  position: absolute;
  left: 0.3em;
  top: 0.2em;
  font-size: 1.1em;
  color: var(--tk-accent);
}

/* 本文 h2（entry-title を完全に除外） */
#main h2:not(.entry-title):not(.entry-title a),
#main .entry-content h2,
.headline {
  color: var(--tk-accent);
  position: relative;
  font-size: 1em;
  font-weight: 700;
  margin: .5em 0;
  padding: .5em .5em .5em 1.8em;
  border-bottom: 2px solid #ffb5b5;
  display: block;
}

#main h2:not(.entry-title):not(.entry-title a)::before,
#main .entry-content h2::before,
.headline::before {
  content: "\25A0";
  font-size: 0.9em;
  position: absolute;
  color: var(--tk-accent);
  top: 0.4em;
  left: 0.3em;
}

#main h3,
.sub-headline {
  color: var(--tk-accent);
  font-size: 1em;
  margin: .5em .1em;
  padding: .5em;
  border-left: 3px solid #ffb5b5;
  border-bottom: 1px solid #ffb5b5;
  display: block;
}

#main h4 {
  color: var(--tk-accent);
  font-size: .9em;
  margin: .5em .3em;
  padding: .5em;
  border-left: 2px dotted #ffb5b5;
  border-bottom: 1px dotted #ffb5b5;
  display: block;
}

#main h5 {
  color: var(--tk-accent);
  font-size: .9em;
  margin: .5em .5em;
  padding: .5em;
  border-bottom: 1px dotted #ffb5b5;
  display: block;
}

/* --------------------------------------------------
   6. Components
-------------------------------------------------- */
.date a {
  color: var(--tk-accent);
  font-size: 1em;
  padding: 8px 10px;
  background: #fff5f5;
  border-radius: 6px;
  border: 1px solid #ffb5b5;
  display: block;
  transition: all .2s ease;
}

.date a:hover {
  background: #ffe0e0;
  border-color: #ff8a8a;
  color: #d33;
}

.favorite {
  border: 2px solid #ffb5b5;
  margin: 0 2px 14px;
  padding: 0;
  border-radius: 6px;
}

.favorite strong {
  margin: 3px;
  font-weight: 600;
}

.item-title {
  color: var(--tk-accent);
  background: linear-gradient(top, #fff, #ffe7e7);
  padding-left: 5px;
  font-weight: 700;
  border-bottom: 2px solid #ffb5b5;
  border-radius: 6px 6px 0 0;
}

.extended a {
  margin-top: 16px;
  padding: 10px 14px;
  display: block;
  color: var(--tk-accent);
  text-decoration: none;
  text-align: center;
  background: #f7f7f7;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}

.extended a:hover {
  background: #ececec;
  border-color: #ccc;
  color: var(--tk-accent);
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  padding-top: 30px;
  height: 0;
  overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.more-btn {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 2em auto;
  padding: 0.8em 1.2em;
  background: #ffefef;
  color: #ff5151;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transition: background 0.2s ease, transform 0.2s ease;
}

.more-btn a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.more-btn:hover {
  background: #ffdadb;
  transform: translateY(-2px);
}

.more-btn:active {
  transform: translateY(0);
}

.more-btn a::after {
  content: "→";
  margin-left: 0.5em;
}

/* --------------------------------------------------
   7. Forms
-------------------------------------------------- */
input,
textarea {
  border: 1px solid #ddd;
  background-color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.95em;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus,
textarea:focus {
  border-color: var(--tk-accent);
  box-shadow: 0 0 0 3px rgba(255, 100, 100, 0.2);
  outline: none;
}

/* --------------------------------------------------
   8. Google CSE
-------------------------------------------------- */
.gsc-control-cse {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

.gsc-input-box,
.gsc-search-button {
  height: 32px !important;
}

.gsc-input {
  padding: 4px 8px !important;
}

.gsc-search-button {
  padding: 0 10px !important;
}

/* --------------------------------------------------
   9. Navbar（Bootstrap override）
   ※ 現在の Temple Knights の見た目を完全維持
-------------------------------------------------- */

.navbar {
  padding: 0;
  background-color: var(--tk-primary) !important;
}

.navbar .navbar-brand {
  background-color: var(--tk-primary);
  color: #fff;
  padding: .25rem .5rem;
}

.navbar .nav-link {
  color: #fff;
  background: transparent;
}

.navbar .dropdown-menu {
  background-color: var(--tk-primary);
  border: none;
}

.navbar .dropdown-item {
  color: #fff;
}

.navbar .dropdown-item:hover {
  background-color: #fff;
  color: var(--tk-primary);
}

.navbar-toggler {
  border-color: rgba(255,255,255,.5);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Navbar spacing overrides */
.navbar-brand,
.navbar-nav .nav-link {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
  line-height: 1.2 !important;
}

.navbar-nav {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.navbar-nav .nav-item {
  text-align: center;
}

/* --------------------------------------------------
   10. Decorative Backgrounds
-------------------------------------------------- */

.jagged-border {
  position: relative;
  width: 100%;
}

.jagged-border::before {
  content: "";
  position: absolute;
  top: -10px;
  width: 100%;
  height: 10px;
}

.vanille-bg,
.forestgreen-bg {
  width: 100%;
  background: var(--tk-primary);
}

.vanille-bg::before {
  background: linear-gradient(45deg, transparent 33.333%, #FFF6D2 33.333%, #FFF6D2 66.667%, transparent 66.667%),
              linear-gradient(-45deg, transparent 33.333%, #FFF6D2 33.333%, #FFF6D2 66.667%, transparent 66.667%);
  background-size: 20px 40px;
}

.forestgreen-bg::before {
  background: linear-gradient(45deg, transparent 33.333%, #2BB25C 33.333%, #2BB25C 66.667%, transparent 66.667%),
              linear-gradient(-45deg, transparent 33.333%, #2BB25C 33.333%, #2BB25C 66.667%, transparent 66.667%);
  background-size: 20px 40px;
}

/* --------------------------------------------------
   11. アクセスランキング
-------------------------------------------------- */

.access-ranking {
  counter-reset: rank;
}

.access-ranking .list-group-item {
  counter-increment: rank;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  padding-left: 3.2em; /* 番号のスペース */
  position: relative;
}

.access-ranking .list-group-item::before {
  content: counter(rank) "位";
  position: absolute;
  left: 0.8em;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: #777;
  opacity: 0.9;
  width: 2.2em;
  text-align: right;
}

.access-ranking .date {
  margin-left: auto;
  color: #666;
  white-space: nowrap;
}

/* --------------------------------------------------
   12. Media Queries（まとめ）
   Bootstrap順に整理：Dark → XS → SM → MD → LG
-------------------------------------------------- */


/* ----------------------------------------------
   1. Dark Mode
---------------------------------------------- */
@media (prefers-color-scheme: dark) {
  body {
    background: #111;
    color: #eee;
  }
  a { color: #9cf; }
}

/* ----------------------------------------------
   2. SP layout（〜575px）
---------------------------------------------- */

/* スマホ（〜575px）タイトル最適化 */
@media (max-width: 575.98px) {

  #main .entry-title {
    position: relative;
    margin: 0.8em 0;
    padding: 0.5em 0.5em 0.5em 1.6em;
    font-size: 1.2rem;
    line-height: 1.4;
  }

  /* タイトルリンク */
  #main .entry-title a {
    padding: 0; /* PC の hover 用 padding を無効化 */
    margin: 0;
  }

  /* ■ の位置調整（スマホ用） */
  #main .entry-title a::before {
    position: absolute;
    left: calc(-1em + 2px);
    top: 0.2em;
    font-size: 0.85em; /* ← 少し小さくして圧迫感を減らす */
    line-height: 1;
  }
}

/* ----------------------------------------------
   4. SP layout（〜991px）
   ※タブレット・スマホ共通
---------------------------------------------- */
@media (max-width: 991px) {
  .container,
  .container-sm {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  #main {
    padding-left: 0;
  }

  .navbar .dropdown-menu {
    width: 100%;
  }

  .navbar .dropdown-toggle {
    padding: 1rem 1.5rem;
  }

  .navbar-nav .nav-item {
    width: 100%;
  }
}


/* ----------------------------------------------
   5. PC hover（992px〜）
---------------------------------------------- */
@media (min-width: 992px) {

  .navbar .nav-link:hover,
  .navbar .nav-link:focus {
    background-color: #fff;
    color: var(--tk-primary);
  }

  /* 記事タイトル hover */
  #main .entry-title a:hover {
    color: #fff;
    position: relative;
    margin: 0.5em -10px;
    padding: 10px 20px 10px 40px;
    background: var(--tk-accent);
    box-shadow: 0 3px 3px rgba(0,0,0,0.1);
    border-bottom: none;
    transition: all 0.2s ease-in;
  }

  /* 左の矢印（三角形） */
  #main .entry-title a:hover::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0px;
    transform: translate(-100%, -50%);
    width: 0;
    height: 0;
    border-width: 30px;
    border-style: solid;
    border-color: transparent;
    border-right-color: var(--tk-accent);
  }
}


/* ----------------------------------------------
   6. 広告サイズ（独立）
---------------------------------------------- */
.my_adslot {
  width: 320px !important;
  height: 50px !important;
}

@media (min-width: 500px) {
  .my_adslot {
    width: 468px !important;
    height: 60px !important;
  }
}

@media (min-width: 800px) {
  .my_adslot {
    width: 728px !important;
    height: 90px !important;
  }
}


/* ----------------------------------------------
   7. Bootstrap row padding（常時）
---------------------------------------------- */
.row > * {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}