@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;
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

#footer a:hover {
  color: #ffecec; /* 白のまま薄く変化（赤系と相性良い） */
  background-color: rgba(255,255,255,0.1);
}

#footer a:visited {
  color: #fff; /* visited 色は統一して消す */
}

/* リスト */
#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.5em 1.8em;
  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:#FFFFFF;
}

#main article th,
#main article td {
  border: 1px solid #ddd;
  padding: 0.6em;
}

#main article th {
  background: #f0f4ff;
  font-weight: 600;
}

#main tr:nth-child(even) {
background-color: #eff6fb;
}

/* 投稿日 */
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;
}

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

/* --------------------------------------------------
   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: 8px 12px;
  border-left: 3px solid var(--tk-accent); /* ブランドカラーに変更 */
  margin-bottom: 6px;
  background: #fafafa;
}

#links li a {
  display: block;
  padding: 4px 0;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease, padding-left 0.15s ease;
}

#links li a:hover {
  background-color: rgba(0,0,0,0.04); /* ごく薄いグレー */
  padding-left: 4px;
}


/* --------------------------------------------------
   5. Headings / Titles
-------------------------------------------------- */
#main .head a,
#head {
  color: var(--tk-accent);
  position: relative;
  font-size: 1.1em;
  font-weight: 700;
  margin: .5em 0;
  padding: .5em .5em .5em 1.8em;
  display: block;
}

#main .head a::before {
  content: "\25A0";
  position: absolute;
  left: 0.3em;
  top: 0.3em;
  font-size: 1.1em;
  color: var(--tk-accent);
}

#main 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::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: 0.95em;
  padding: 10px 12px;
  background: linear-gradient(to bottom, #fff, #ffecec);
  border-radius: 6px;
  border: 1px solid #ffb5b5;
  display: block;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.date a:hover {
  background: linear-gradient(to bottom, #ffe5e5, #ffd4d4);
  border-color: #ff8a8a;
  color: var(--tk-accent);
}

.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: 5px;
  display: block;
  color: #000;
  text-decoration: none;
  text-align: center;
  text-shadow: 1px 1px 0 rgba(255,255,255,.3);
  transition: all 0.1s linear;
  border: 2px solid grey;
  background: linear-gradient(top, white, gray);
  border-radius: 6px;
}

.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: bold;
  color: #2BB25C; /* Temple Knights のテーマカラー */
  width: 2.2em;
  text-align: right;
}

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

/* --------------------------------------------------
   12. Media Queries（まとめ）
-------------------------------------------------- */

/* PC hover */
@media (min-width: 992px) {
  .navbar .nav-link:hover,
  .navbar .nav-link:focus {
    background-color: #fff;
    color: var(--tk-primary);
  }
  #main .head 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 .head 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);
  }

}

/* SP layout */
@media (max-width: 991px) {
#main {
  padding-left: 0;
}
  .navbar .dropdown-menu {
    width: 100%;
  }

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

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

.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;
  }
}

.row > * {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

@media (prefers-color-scheme: dark) {
  body {
    background: #111;
    color: #eee;
  }
  a { color: #9cf; }
}