:root{
  --ih-blue:#4CCDED;
  --ih-orange:#F3A08A;
  --ih-font:'Roboto';
  --ih-shadow:0 12px 28px rgba(0,0,0,.18);

  --panel-radius: 26px;

  --ih-toc-fill: 0px;

  /* shift tuning */
  --ih-panel-left: 20px;

  /* controlled gap */
  --ih-gap-between: clamp(14px, 1.1vw, 22px);

  /* right breathing space (safe for text) */
  --ih-right-gap: 30px;

  /* panel width responsive (desktop) */
  --panel-w: clamp(260px, 20vw, 320px);

  /* shift cap */
  --ih-shift-max: clamp(110px, calc(180px - ((1536px - 100vw) * 0.12)), 180px);
}

#ihTocTab{ display:none; }

/* ✅ hide ONLY below 1024 */
@media(max-width:1023px){
  .ih-toc-tab,
  .ih-toc-panel{ display:none !important; }
}

/* TAB */
.ih-toc-tab{
  position: fixed;
  left: 0;
  top: 52%;
  transform: translateY(-50%);
  z-index: 999999;

  background: var(--ih-blue);
  border: 3px solid var(--ih-orange);
  border-left: 0;
  border-radius: 0 14px 14px 0;

  padding: 15px;
  display:flex;
  align-items:center;
  gap: 12px;

  box-shadow: var(--ih-shadow);
  cursor:pointer;

  transition: opacity .22s ease, transform .22s ease;
  will-change: opacity, transform;
}

.ih-toc-tab.is-hidden{
  opacity: 0;
  transform: translate(-18px, -50%);
  pointer-events: none;
}

.ih-toc-tab__text{
  font-family: var(--ih-font);
  font-weight: 400;
  font-size: 18px;
  color:#fff;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* PANEL */
.ih-toc-panel{
  position: fixed;
  left: var(--ih-panel-left);
  top: 170px;
  width: var(--panel-w);
  max-width: calc(100vw - 90px);
  z-index: 999998;

  opacity: 0;
  transform: translateX(-25px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}

body.ih-toc-open .ih-toc-panel{
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* card */
.ih-toc-panel__inner{
  background: var(--ih-blue);
  border-radius: var(--panel-radius);
  padding: 22px 0 18px 0;
  position: relative;

  max-height: calc(100vh - 220px);
  overflow: hidden;
}

/* header */
.ih-toc-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 0 22px;
  margin-bottom: 18px;
}

.ih-toc-title{
  font-family: var(--ih-font);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 10px;

  text-align:left;
  margin:0;
  flex:1;
}

/* X */
.ih-toc-x{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.35);
  color:#fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform .15s ease, background .15s ease;
}
.ih-toc-x:hover{
  transform: scale(1.05);
  background: var(--ih-orange);
}

/* list scroll */
.ih-toc-listwrap{
  position: relative;
  margin-top: 6px;
  padding-right: 6px;
  max-height: calc(100vh - 330px);
  overflow: auto;
  --ih-track-h: 100%;
}
.ih-toc-listwrap::-webkit-scrollbar{ width: 8px; }
.ih-toc-listwrap::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.35);
  border-radius: 20px;
}

/* white track */
.ih-toc-listwrap::before{
  content:"";
  position:absolute;
  left: 22px;
  top: 0;
  width: 3px;
  height: var(--ih-track-h);
  background: #fff;
  border-radius: 10px;
}

/* orange fill */
.ih-toc-listwrap::after{
  content:"";
  position:absolute;
  left: 22px;
  top: 0;
  width: 3px;
  height: var(--ih-toc-fill);
  background: var(--ih-orange);
  border-radius: 10px;
  z-index: 1;
  transition: height .18s ease;
  will-change: height;
}

.ih-toc-list{
  list-style:none !important;
  margin:0;
  padding:0;
}

.ih-toc-item{ margin: 0 0 18px; position: relative; }

.ih-toc-item a{
  display:block;
  font-family: var(--ih-font);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.28;
  color:#fff;
  text-decoration:none;
  padding: 6px 10px 6px 40px;
  position: relative;
  z-index: 3;
}
.ih-toc-item a:hover {
    color: #fff;
    font-weight: 700;
}
.ih-toc-item.is-active a{
  background:#fff;
  color: var(--ih-blue);
  border-right: 8px solid var(--ih-orange);
  border-top-left-radius: 50px;
  border-bottom-left-radius: 50px;
  box-shadow: var(--ih-shadow);
}

.ih-toc-item.is-active a::before{
  content:"";
  position:absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 47px;
  background: var(--ih-blue);
}

.ih-toc-item::after,
.ih-toc-item a::after{ display:none !important; }

/* =========================================================
   SHIFT CONTENT (ONE stable formula)
   ========================================================= */

.ih-main-shift{
  transition: transform .22s ease, padding-left .22s ease, padding-right .22s ease;
  will-change: transform, padding-left, padding-right;
}

body.ih-toc-open .ih-main-shift{
  transform: translate3d(
    min(calc(var(--panel-w) + var(--ih-gap-between)), var(--ih-shift-max)),
    0, 0
  ) !important;

  padding-left: var(--ih-gap-between) !important;
  padding-right: var(--ih-right-gap) !important;
}

/* ✅ Common Elementor cut fix (safe): transform + overflow hidden issue */
.ih-main-shift,
body.ih-toc-open .ih-main-shift{
  overflow: visible !important;
}

/* ✅ 1024–1279: panel chota + shift cap lower + more right space */
@media (min-width:1024px) and (max-width:1279.98px){
  :root{
    --panel-w: 270px;
    --ih-gap-between: 16px;
    --ih-right-gap: 36px;   /* extra safety so text never cuts */
    --ih-shift-max: 145px;
  }

  .ih-toc-panel{ top: 150px; }
}

/* ✅ 1280–1439 */
@media (min-width:1280px) and (max-width:1439.98px){
  :root{
    --panel-w: 300px;
    --ih-gap-between: 20px;
    --ih-right-gap: 30px;
    --ih-shift-max: 180px;
  }
}
