/* K85 visual adjustments. Shared by the theme and local palette preview. */
:root {
  --k85-brand: #007d91;
  --k85-pickup: #286c73;
  --k85-column: #315f78;
  --k85-border: #b7cdd2;
}

#container > h1 { line-height: 1.5; }
.k85-menu-link { display: none; }
#header { position: relative; height: auto; }
#top-image {
  box-sizing: border-box;
  width: 100%;
  min-height: 100px;
  height: auto;
  padding: 10px 14px 10px 57%;
  background:
    repeating-linear-gradient(45deg, transparent 0 3px, #ffffff1c 3px 4px, #00000030 4px 6px),
    linear-gradient(135deg, #173b45, var(--k85-brand)) !important;
  border: 1px solid var(--k85-brand);
}
#top-image > a {
  top: 50%; left: 12px;
  box-sizing: border-box;
  width: 54.3%; height: auto; aspect-ratio: 519 / 73;
  border: 1px solid #777;
  transform: translateY(-50%);
  background: url('/wp-content/themes/kyotei01/image/honchan2image/k85-logo.png') center / cover no-repeat;
  /* Crop only the generated panel's extra grey background, never the lettering. */
}
#top-image p.jodan { margin: 0; font-size: 12px; line-height: 1.5; text-align: right; }
#top-image p.jodan + p.jodan { margin-top: 4px; }
#top-image .red { color: #fff; font-size: inherit; }
#nav li { background-color: var(--k85-brand) !important; background-blend-mode: luminosity; }
#nav a:link, #nav a:visited { color: #fff; }
a:link, a:visited { color: var(--k85-brand); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--k85-brand); outline-offset: 2px; }

/* Put the color on the heading itself so wrapping never leaves white text on white. */
:is(#left-nav,#site-ranking,#check,#access,#mobile,#tagcloud,#site-line,#site-line2,
    #osusume,#osusume2,#osusume5,#osusume-midashi,#loopitem,#kuchikomi,
    #kuchikomi-ichiran,#column-new,#midashi2,#midashi3,#setsumei7) {
  background-image: none !important;
  border-color: var(--k85-border) !important;
  max-width: 100%;
  box-sizing: border-box;
}
:is(#left-nav,#site-ranking,#check,#access,#mobile,#tagcloud,#site-line,#site-line2,
    #osusume,#osusume2,#osusume5,#osusume-midashi,#loopitem,#kuchikomi,
    #kuchikomi-ichiran,#column-new,#midashi2,#midashi3,#setsumei7) > :is(h2,h3) {
  background: linear-gradient(180deg, color-mix(in srgb, var(--k85-brand), white 9%), var(--k85-brand));
  color: #fff;
  box-sizing: border-box;
  min-height: 40px;
  height: auto !important;
  margin: 2px 2px 8px !important;
  padding: 10px !important;
  font-size: 14px;
  line-height: 1.6 !important;
}
:is(#osusume,#osusume2,#osusume5,#osusume-midashi,#loopitem) > :is(h2,h3) {
  background: linear-gradient(180deg, #397e83, var(--k85-pickup));
}
#column-new > h2 { background: linear-gradient(180deg, #42768b, var(--k85-column)); }
:is(#midashi2,#midashi3) { height: auto; }
:is(#midashi2,#midashi3) > h2 { margin-bottom: 2px; }
#leftnav-ul { margin-top: 12px; }
ul.left-ul li a:link, ul.left-ul li a:visited, #tagcloud p a:link, #tagcloud p a:visited { color: var(--k85-brand); }
.k85col-title,.k85race-title,.k85-topic > h3 { border-color: var(--k85-brand) !important; }
.k85col-body h3,.k85race-body h3 { border-left-color: var(--k85-brand) !important; }
.k85col-body h4::before { color: var(--k85-brand) !important; }
.k85col-body th { color: #245767 !important; background: #edf5f6 !important; }
.k85col-toplist a { min-width: 0; overflow-wrap: anywhere; }
#column-new .k85col-topdate { color: #67777e; }
#uwx .uwx-sec h3 { background: var(--k85-column) !important; line-height: 1.6; padding: 10px; }
#uwx { max-width: 100%; box-sizing: border-box; }

/* Keep every footer link inside the background as the menus grow. */
#footer { height: auto; min-height: 189px; padding-bottom: 12px; }

@media (min-width: 481px) and (max-width: 975px) {
  #container { width: calc(100% - 20px); }
  #header,#main,#nav,#top-irem { width: 100%; }
  #nav ul { display: flex; }
  #nav ul > a { flex: 1; min-width: 0; }
  #nav li { width: 100% !important; font-size: 12px !important; }
  #main { display: flex; gap: 16px; }
  #left-box { width: 26%; flex-shrink: 0; }
  #right-box { width: auto; flex: 1; min-width: 0; }
  #leftnav-ul li { width: auto; margin: 0 8px 8px; padding: 4px 8px; line-height: 1.6; background-image: none; }
  #top-irem { display: flex; height: auto; gap: 10px; padding: 8px; box-sizing: border-box; }
  #top-search { width: auto; flex: 2; min-width: 0; height: auto; margin: 0; box-sizing: border-box; }
  #top-toukou { width: auto; flex: 1; min-width: 0; height: auto; margin: 0; box-sizing: border-box; }
  #top-toukou a,#top-toukou a#button2 { width: 100%; max-width: 233px; margin: 0 auto; background-size: contain; background-position: center; }
  #search-nakami { width: 96%; height: auto; }
  #top-image { padding-left: 52%; }
  #top-image > a { width: 48%; }
  #top-image p.jodan { font-size: 11px; }
  #dtnew { width: 100%; }
}

@media (max-width: 480px) {
  #container { overflow: visible; }
  #splogo { display: flex; align-items: center; min-height: 70px; padding: 8px 58px 8px 6px; margin: 0; background: repeating-linear-gradient(45deg, transparent 0 3px, #ffffff1c 3px 4px, #00000030 4px 6px), linear-gradient(135deg, #173b45, var(--k85-brand)); }
  #splogo img { display: block; box-sizing: border-box; width: 100%; height: auto; aspect-ratio: 519 / 73; object-fit: cover; object-position: center; border: 1px solid #777; }
  #header .k85-menu-link { display: block; position: absolute; top: 13px; right: 9px; width: 44px; height: 44px; z-index: 100; }
  /* Match the established 44px MENU control, in K85's marine palette. */
  #header #menuicon {
    top: 0 !important; right: 0; width: 44px; height: 44px;
    margin: 0; padding: 0; border: 0; border-radius: 3px;
    background:
      linear-gradient(#fff, #fff) 11px 12px / 22px 2px no-repeat,
      linear-gradient(#fff, #fff) 11px 18px / 22px 2px no-repeat,
      linear-gradient(#fff, #fff) 11px 24px / 22px 2px no-repeat,
      #23464f;
  }
  #header #menuicon img { display: none; }
  #header #menuicon::after {
    content: 'MENU'; position: absolute; left: 0; right: 0; bottom: 5px;
    color: #fff; font-size: 8px; font-weight: 700; line-height: 8px;
    text-align: center; letter-spacing: 0;
  }
  #header .k85-menu-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 3px; }
  #top-image { min-height: 0; padding: 9px 12px; border: 0; }
  #top-image p.jodan { text-align: center; font-size: 12px; }
  #top-image > a { display: none; }
  #main { display: flex; flex-direction: column; }
  #main > #right-box { order: 1; width: 100%; min-width: 0; padding: 0 10px; }
  #main > #left-box { order: 2; width: 100%; padding: 0 10px; margin-top: 16px; }
  #column-new { width: 100% !important; }
  #column-new h2 { font-size: 13px !important; }
  #column-new .k85col-toplist li { flex-direction: column; gap: 2px; align-items: stretch; padding: 9px 0; }
  #search-nakami { width: calc(100% - 20px); margin: 0 10px; padding: 6px; }
  #searchform .field { max-width: 75%; }
  #midashi2,#midashi3 { width: 100%; }
  #dtnew { width: 100%; }
}

/* 動作するローカル運用版のサイト導線と横断検索。 */
.k85-site-picks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:14px 12px}
.k85-site-pick{min-width:0;font-size:13px;line-height:1.7}
.k85-site-pick img{display:block;width:100%;height:110px;object-fit:cover;object-position:top;border:1px solid #ccc;box-sizing:border-box;margin-bottom:8px}
.k85-site-pick strong{display:block;font-size:14px}
.k85-site-pick p{margin:6px 0}
.k85-block-note,.k85-search-summary{padding:12px;font-size:13px;line-height:1.8;overflow-wrap:anywhere}
.k85-search-result{padding:16px 12px;border-bottom:1px dotted #aaa;line-height:1.8;overflow-wrap:anywhere}
.k85-search-result h2{font-size:17px;background:none!important;color:#286c73;margin:0 0 8px;padding:0;line-height:1.6}
.k85-search-result p{font-size:14px;margin:0}
.k85-search-result .k85-result-type{font-size:12px;color:#666;margin-bottom:4px}
@media(max-width:640px){.k85-site-picks{grid-template-columns:1fr}.k85-site-pick{border-bottom:1px dotted #ccc;padding-bottom:12px}.k85-site-pick img{float:left;width:95px;height:90px;margin:0 12px 6px 0}.k85-site-pick:after{content:'';display:block;clear:both}}

/* ------------------------------------------------------------
   星評価（WP-PostRatings 2.0系のSVG星）の見切れ対策 2026-10-07
   U85が2026-08-13に管理画面の「追加CSS」で入れた対応をK85へ移植。
   テーマは旧 stars_crystal GIF（16x16px・隙間なし）前提で、詳細ページの
   #shosai-gaiyou dl dd.hoshirank を 55x17px・overflow:hidden にしている。
   2.0系の星は既定 20px + 隙間 2px（3個で 64x20px）なので3個目が切れて
   見えていた。星の寸法を旧GIFに合わせて箱に収める。
   ------------------------------------------------------------ */
.wp-postratings,
.wp-postratings-strip {
  --wp-postratings-size: 16px;
  --wp-postratings-gap: 0px;
}

/* トップ・サイドのカード枠（loop-access-up の dd.hoshirank9）は旧GIF前提で
   星の箱を 15px 引き上げていた（style.css: margin:-15px 0 5px 0）。
   新しい星は箱の上端に描かれるため、引き上げをやめて整列させる（U85と同じ）。 */
dl dd.hoshirank9 {
  margin-top: 0;
}
