/* フロントの SPRO メニュー（admin/spro_drawer.php） */

:root {
  --spro-w: 360px;
  --spro-main: var(--color_main, #b8002e);
  --spro-freelance: #0a9bdc; /* sap-labo の [sap_jobs_tab] と同じ配色 */
  --spro-jobchange: #0aa094;
}

/* ---------- ツリー ---------- */
.spro-tree__list { list-style: none; margin: 0; padding-left: 0; }
.spro-tree__list--depth-0 { padding-left: 0; }
.spro-tree__list:not(.spro-tree__list--depth-0) { padding-left: 1em; border-left: 1px dotted rgba(0,0,0,.15); margin-left: .35em; }
.spro-tree__item { line-height: 1.6; margin: .15em 0; }
.spro-tree__summary { cursor: pointer; padding: .25em .25em .25em 0; font-weight: 500; }
.spro-tree__summary:hover { color: var(--spro-main); }
.spro-tree__details[open] > .spro-tree__summary { color: var(--spro-main); }
.spro-tree__leaf-link,
.spro-tree__post a { color: inherit; text-decoration: none; display: inline-block; padding: .15em 0; }
.spro-tree__leaf-link:hover,
.spro-tree__post a:hover { color: var(--spro-main); text-decoration: underline; }
.spro-tree__leaf-name { display: inline-block; padding: .15em 0; color: #666; }
.spro-tree__list--posts { padding-left: 1em; }
.spro-tree__item--active-path > .spro-tree__details > .spro-tree__summary { color: var(--spro-main); font-weight: 600; }
.spro-tree__post--active > a,
.spro-tree__leaf-link--active {
  color: var(--spro-main) !important;
  font-weight: 700;
  background: rgba(0,0,0,.04);
  border-radius: 3px;
  padding: .15em .4em;
  margin-left: -.4em;
}

/* JA / EN（html.spro-lang-en で英語） */
.spro-l-en { display: none; }
html.spro-lang-en .spro-l-ja { display: none; }
html.spro-lang-en .spro-l-en { display: inline; }

/* ---------- 表示ボタン（パネルを隠しているとき） ---------- */
.spro-drawer-toggle {
  position: fixed;
  left: 0;
  bottom: 100px; /* SWELL SNSフォローボタン・固定バナーと被らない位置 */
  z-index: 990;
  background: linear-gradient(135deg, var(--spro-main) 0%, #6a0019 100%);
  color: #fff;
  border: 2px solid rgba(255,255,255,.85);
  border-left: none;
  padding: 18px 10px 16px;
  cursor: pointer;
  border-radius: 0 14px 14px 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .18em;
  box-shadow: 5px 6px 18px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.2), inset 0 -3px 0 rgba(0,0,0,.2);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s, padding-left .25s;
  animation: spro-drawer-pulse 2.6s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 54px;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
@keyframes spro-drawer-pulse {
  0%, 100% { box-shadow: 5px 6px 18px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.2), inset 0 -3px 0 rgba(0,0,0,.2), 0 0 0 0 rgba(184,0,46,.55); }
  50%      { box-shadow: 5px 6px 18px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.2), inset 0 -3px 0 rgba(0,0,0,.2), 0 0 0 16px rgba(184,0,46,0); }
}
.spro-drawer-toggle:hover { transform: translateX(6px) scale(1.04); padding-left: 14px; animation: none; }
.spro-drawer-toggle__icon { font-size: 22px; line-height: 1; }
.spro-drawer-toggle__label { writing-mode: vertical-rl; text-orientation: mixed; line-height: 1.2; }
.spro-drawer-toggle__badge {
  background: #fff;
  color: var(--spro-main);
  font-size: 9px;
  font-weight: 900;
  padding: 3px 6px;
  border-radius: 10px;
  letter-spacing: .08em;
  line-height: 1;
  margin-top: 2px;
  text-shadow: none;
}
html.spro-open .spro-drawer-toggle { display: none; }

/* ---------- パネル本体 ---------- */
.spro-drawer {
  position: fixed;
  z-index: 990; /* 検索モーダル（1000）より下 */
  display: flex;
  flex-direction: column;
  background: #fff;
}
html.spro-ready .spro-drawer { transition: transform .3s ease; }

.spro-drawer__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 12px 16px;
  background: linear-gradient(135deg, var(--spro-main) 0%, #6a0019 100%);
  color: #fff;
}
.spro-drawer__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.spro-drawer__title::before { content: ''; width: 5px; height: 18px; background: #fff; border-radius: 2px; }
.spro-drawer__tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.spro-lang { display: inline-flex; border: 1px solid rgba(255,255,255,.75); border-radius: 999px; overflow: hidden; }
.spro-lang button,
.spro-drawer__hide {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: transparent;
  border: 0;
  padding: 5px 10px;
  cursor: pointer;
}
.spro-lang button[aria-pressed="true"] { background: #fff; color: var(--spro-main); }
.spro-drawer__hide { border: 1px solid rgba(255,255,255,.75); border-radius: 999px; white-space: nowrap; }
.spro-drawer__hide:hover,
.spro-lang button:not([aria-pressed="true"]):hover { background: rgba(255,255,255,.18); }

.spro-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 24px;
}
.spro-drawer__body::-webkit-scrollbar { width: 8px; }
.spro-drawer__body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 4px; }
.spro-drawer__body .spro-tree__list:not(.spro-tree__list--depth-0) { padding-left: .9em; margin-left: .3em; }
.spro-drawer__body .spro-tree__summary,
.spro-drawer__body .spro-tree__leaf-link,
.spro-drawer__body .spro-tree__post a { font-size: 13.5px; line-height: 1.55; }
.spro-drawer__body .spro-tree__summary { padding: .3em .25em; border-radius: 4px; }
.spro-drawer__body .spro-tree__summary:hover { background: rgba(184,0,46,.06); }
.spro-drawer__body .spro-tree__item--active-path > .spro-tree__details > .spro-tree__summary {
  background: linear-gradient(90deg, rgba(184,0,46,.08), transparent);
  border-left: 3px solid var(--spro-main);
  padding-left: .55em;
  margin-left: -.3em;
}
.spro-drawer__body .spro-tree__post--active > a,
.spro-drawer__body .spro-tree__leaf-link--active {
  background: linear-gradient(135deg, var(--spro-main), #6a0019) !important;
  color: #fff !important;
  padding: .35em .7em !important;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 0 !important;
}

/* ---------- パネル下部の導線 ---------- */
.spro-cta {
  flex: 0 0 auto;
  padding: 10px 14px 12px;
  border-top: 1px solid #eadede;
  background: #fff8f3;
}
.spro-cta__lead { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: #6b4b3e; }
.spro-cta__nudge { margin: 0 0 4px; font-size: 13px; line-height: 1.5; color: #5d3a1a; }
.spro-cta__nudge b { color: var(--spro-main); }
.spro-cta.is-nudge { background: #fff3e0; }
.spro-cta.is-nudge .spro-cta__lead { display: none; }
.spro-cta__item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e7d6cf;
  border-radius: 8px;
  color: #333;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}
.spro-cta__item:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.spro-cta__item--freelance:hover { border-color: var(--spro-freelance); }
.spro-cta__item--jobchange:hover { border-color: var(--spro-jobchange); }
.spro-cta__tag { flex: 0 0 auto; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; color: #fff; }
.spro-cta__item--freelance .spro-cta__tag { background: var(--spro-freelance); }
.spro-cta__item--jobchange .spro-cta__tag { background: var(--spro-jobchange); }
.spro-cta__main { flex: 1 1 auto; min-width: 0; line-height: 1.4; }
.spro-cta__head { display: block; font-size: 13px; }
.spro-cta__main small { display: block; overflow: hidden; font-size: 11px; color: #777; white-space: nowrap; text-overflow: ellipsis; }
.spro-cta__arrow { color: var(--spro-main); font-size: 18px; font-weight: 700; }

/* ---------- PC: 左に固定して本文と並べる ---------- */
@media (min-width: 1080px) {
  .spro-drawer {
    left: 0;
    top: 0;
    width: var(--spro-w);
    height: 100vh;
    box-shadow: 2px 0 10px rgba(0,0,0,.1);
    transform: translateX(-100%);
  }
  html.spro-open .spro-drawer { transform: none; }
  html.spro-open body { padding-left: var(--spro-w); }
  /* バナーのサイドバーは隠し（導線はパネル下部に出す）、本文を読みやすい幅で中央に */
  html.spro-open #sidebar { display: none; }
  html.spro-open .l-mainContent { width: 100%; max-width: 900px; margin-left: auto; margin-right: auto; }
  html.spro-open .c-shareBtns.-fix { left: calc(var(--spro-w) + 8px); }
  html.spro-open #footer-banner { left: var(--spro-w); width: auto; right: 0; }
}

/* ---------- タブレット・スマホ: 下から出るシート ---------- */
@media (max-width: 1079px) {
  .spro-drawer {
    left: 0;
    right: 0;
    bottom: 0;
    height: 62vh;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,.18);
    transform: translateY(105%);
    overflow: hidden;
  }
  html.spro-open .spro-drawer { transform: none; }
  html.spro-open #footer-banner { display: none !important; }
  .spro-drawer__header { padding-top: 16px; position: relative; }
  .spro-drawer__header::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 2px;
    background: rgba(255,255,255,.6);
  }
}
@media (max-width: 600px) {
  .spro-drawer-toggle { bottom: 90px; padding: 14px 8px 12px; font-size: 12px; min-width: 46px; }
  .spro-drawer-toggle__icon { font-size: 18px; }
}
