/* Wrapper */
.bbw-catlines {
    --pane: 460px;
    --gap: 40px;
    --bar-w: 72px;
    --bar-h: 567px;
    --step: 44px;
    display: flex;
    align-items: flex-end;
    position: relative;
    gap: 40px;
    width: 100%;
    overflow: visible;
}

.bbw-catlines .catline:nth-child(1) {
    --offsetY: 70px;
}

.bbw-catlines .catline:nth-child(2) {
    --offsetY: 100px;
}

.bbw-catlines .catline:nth-child(3) {
    --offsetY: 50px;
}

.bbw-catlines .catline:nth-child(4) {
    --offsetY: 0;
}

.bbw-catlines .catline:nth-child(5) {
    --offsetY: 60px;
}

.bbw-catlines .catline:nth-child(6) {
    --offsetY: 100px;
}

/* Single bar column */
.bbw-catlines .catline {
    position: relative;
    height: var(--bar-h);
    width: var(--bar-w);
    /* combine permanent per-item Y offset with JS-driven X shift */
    transform: translate(var(--shiftX, 0px), var(--offsetY, 0px));
    transition: transform 300ms ease;
}

/* Vertical button / bar */
.bbw-catlines .cat-btn {
    width: var(--bar-w);
    height: var(--bar-h);
    background: var(--bar-color, #999);
    color: #fff;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 13px 30px 13px;
    border-radius: 0 !important;
}

.bbw-catlines .cat-btn:hover, .bbw-catlines .cat-btn:focus, .bbw-catlines .cat-btn:active {
    background: var(--bar-color, #999) !important;
    opacity: 0.9;
}

.bbw-catlines .cat-btn span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: 48px;
    font-family: "Playfair Display", Sans-serif;
}

/* The post panel (appears to the right of active bar) */
.bbw-catlines .cat-post {
    position: absolute;
    left: calc(100% + 0px);
    top: 0;
    width: var(--pane);
    max-width: min(46vw, var(--pane));
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity .25s ease, transform .25s ease;
    border-width: 2px;
    border-style: solid;
    border-left: none;
        height: 100%;
}

/* Activate */
.bbw-catlines .catline.active .cat-post {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

/* Card look inside panel */
.bbw-catlines .post-card {
    background: #fff;

    padding: 18px;
}

.bbw-catlines .post-card .thumb-wrap {
    display: block;
    margin-bottom: 14px;
    line-height: 0;
}

.bbw-catlines .post-card .thumb {
    width: 100%;
    height: auto;
    display: block;
}

.bbw-catlines .post-card .title {
    
    
    margin: 0 0 10px;
}

.bbw-catlines .post-card .title a {
    color: #222;
    text-decoration: none;
        font-size: 24px;
        line-height: 1.25;
}

.bbw-catlines .post-card .excerpt {
    color: #2f2f2f;
    margin: 0 0 12px;
    font-size: 18px;
}

.bbw-catlines .post-card .readmore {
    font-weight: 500;
    text-decoration: none;
    color: #2f2f2f;
    border-bottom: 1px solid #2f2f2f;
}

/* Responsive
@media (max-width: 900px) {
    .bbw-catlines {
        --pane: 380px;
        --bar-w: 64px;
        --bar-h: 300px;
        --step: 28px;
        gap: 10px;
    }
}

@media (max-width: 680px) {
    .bbw-catlines {
        --pane: 88vw;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 14px 10px;
    }

    .bbw-catlines .catline {
        margin-top: 0;
    }

    .bbw-catlines .cat-post {
        position: relative;
        left: auto;
        top: auto;
        max-width: 100%;
        width: 100%;
    }

    .bbw-catlines .catline.active~.catline {
        transform: none !important;
    }
} */


/* =========================================
   CatLines Responsive (Tablet + Mobile)
   Layout like your second screenshot
   ========================================= */
@media (max-width: 991px) {

  /* wrapper becomes stacked */
  .bbw-catlines {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    --bar-w: 100%;
    --bar-h: auto;
    --pane: 100%;
  }

  /* every category becomes a horizontal bar */
  .bbw-catlines .catline {
    width: 100%;
    height: auto;
    transform: none !important;   /* kills translateX + offsetY */
    transition: none;
    order: 0;
  }

  /* horizontal button */
  .bbw-catlines .cat-btn {
    width: 100%;
    height: 65px;
    padding: 10px 16px;
    align-items: center;
    justify-content: flex-end;
  }

  /* make text horizontal */
  .bbw-catlines .cat-btn span {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 32px;
    letter-spacing: .12em;
    line-height: 1;
  }

  /* panel becomes normal block under active bar */
  /* Accordion panel */
  .bbw-catlines .cat-post{
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    max-width: 100%;
    height: auto;

    border-width: 2px;
    border-style: solid;

    transform: none;
    opacity: 1;
    pointer-events: auto;

    /* accordion animation */
    display: block;          /* keep in flow */
    overflow: hidden;
    max-height: 0;
    margin-top: 0;
    transition: max-height .35s ease, margin-top .35s ease;
  }

  .bbw-catlines .catline.active .cat-post{
    max-height: 1200px;      /* big enough (JS will handle exact height) */
    margin-top: 10px;
  }

  .bbw-catlines .post-card .thumb {
    width: 75%;
    margin: 0 auto;
  }

  .bbw-catlines .catline.active .cat-post {
    text-align: center;
   }
}

@media (max-width: 768px) {
    .bbw-catlines .cat-btn span {
        font-size: 24px;
    }

    .bbw-catlines .post-card .title a {
        font-size: 18px;
        text-align: center;
    }

    .bbw-catlines .cat-btn {
        height: 45px;
    }

    .bbw-catlines .catline.active .cat-post {
        text-align: center;
    }

    .bbw-catlines .post-card .excerpt {
        font-size: 14px;
    }

    .bbw-catlines .post-card .title {
        line-height: 18px;
    }
}
