/* EECG shared left rail navigation (desktop) + header fallback (mobile) */

:root {
  --eecg-rail-w: 100px;
  --eecg-green: #FF5E14;
  --eecg-green-dark: #e0520d;
}

.eecg-rail,
.eecg-panel {
  display: none;
}

@media (min-width: 992px) {
  /* hide the original top header on desktop */
  body > header.header,
  body > .header {
    display: none !important;
  }

  /* header is hidden on desktop — drop the offset pages used to clear it */
  .cardsec,
  .cardwhole {
    margin-top: 0 !important;
  }

  body {
    padding-left: var(--eecg-rail-w);
  }


  .eecg-rail {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    width: var(--eecg-rail-w);
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 18px 8px;
    background: #f1f2f1;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
  }

  .eecg-rail__logo img {
    max-width: 68px;
    height: auto;
    display: block;
    transition: transform 0.35s ease;
  }
  .eecg-rail__logo:hover img {
    transform: scale(1.06);
  }

  .eecg-rail__toggle {
    background: none;
    border: 0;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font: inherit;
    color: #1b1b1b;
  }

  .eecg-rail__bars {
    position: relative;
    width: 30px;
    height: 20px;
  }
  .eecg-rail__bars span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: #1b1b1b;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease,
      background 0.3s ease;
  }
  .eecg-rail__bars span:nth-child(1) {
    top: 0;
  }
  .eecg-rail__bars span:nth-child(2) {
    top: 8.5px;
  }
  .eecg-rail__bars span:nth-child(3) {
    top: 17px;
  }

  .eecg-rail__label {
    font-size: 13px;
    letter-spacing: 0.02em;
  }

  body.eecg-open .eecg-rail__bars span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
  }
  body.eecg-open .eecg-rail__bars span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.4);
  }
  body.eecg-open .eecg-rail__bars span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
  }

  .eecg-rail__bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.16em;
    color: #6b6b6b;
    text-align: center;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
  }

  /* sliding panel */
  .eecg-panel {
    display: block;
    position: fixed;
    top: 0;
    left: var(--eecg-rail-w);
    z-index: 9999;
    width: calc(100vw - var(--eecg-rail-w));
    height: 100vh;
    padding: 64px 0 64px 70px;
    overflow-y: auto;
    background: var(--eecg-green);
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.35s ease, visibility 0.35s;
  }
  body.eecg-open .eecg-panel {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .eecg-panel__inner {
    max-width: 720px;
  }

  .eecg-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .eecg-panel__item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    opacity: 0;
    transform: translateY(14px);
  }
  body.eecg-open .eecg-panel__item {
    animation: eecgItemIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes eecgItemIn {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .eecg-panel__item > a {
    display: block;
    padding: 14px 4px;
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  .eecg-panel__item > a:hover {
    transform: translateX(8px);
    opacity: 0.85;
    color: #fff;
  }

  .eecg-panel__sub {
    padding: 4px 0 16px 24px !important;
  }
  .eecg-panel__sub li a {
    display: block;
    padding: 5px 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 17px;
    font-style: italic;
    text-decoration: none;
    transition: transform 0.25s ease, color 0.25s ease;
  }
  .eecg-panel__sub li a:hover {
    transform: translateX(6px);
    color: #fff;
  }
}

/* ============ global mobile responsiveness fixes ============ */
@media (max-width: 991px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  img, video, iframe, table { max-width: 100%; }

  .headingcard { display: block !important; text-align: center; padding: 0 16px; }
  .headingcard .colum1, .headingcard .colum2 { width: 100% !important; float: none !important; }
  .strokecus {
    font-size: clamp(1.6rem, 8vw, 2.6rem) !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    text-align: center;
    margin: 18px 0 0 !important;
  }
  .cardwhole { padding-left: 12px !important; padding-right: 12px !important; }
}
