/* =============================================================
   Tabbed About Widget — taw-style.css  v1.1.0
   ============================================================= */

.taw-wrapper {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    position: relative;
    font-family: inherit;
    box-sizing: border-box;
}

/* ---------------------------------------------------------------
   SIDEBAR — Desktop vertical strip
--------------------------------------------------------------- */
.taw-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 54px;
    flex-shrink: 0;
    z-index: 10;
    padding: 14px 0;
    box-sizing: border-box;
}

.taw-sidebar-left  { order: 0; }
.taw-sidebar-right { order: 2; }

.taw-sidebar-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 90px;
    cursor: pointer;
    transition: opacity 0.22s ease, filter 0.22s ease, transform 0.15s ease;
    border-radius: 0 10px 10px 0;
    overflow: hidden;
    box-sizing: border-box;
}

.taw-sidebar-left .taw-sidebar-tab {
    border-radius: 10px 0 0 10px;
}

.taw-sidebar-tab span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1;
    padding: 10px 0;
}

.taw-sidebar-tab:not(.active) {
    filter: brightness(0.85);
    opacity: 0.7;
}

.taw-sidebar-tab.active {
    opacity: 1;
    filter: none;
}

.taw-sidebar-tab:hover {
    opacity: 1;
    filter: brightness(1.04);
    transform: scaleX(1.07);
    transform-origin: left center;
}

.taw-sidebar-right .taw-sidebar-tab:hover {
    transform-origin: right center;
}

/* ---------------------------------------------------------------
   PANELS
--------------------------------------------------------------- */
.taw-panels {
    order: 1;
    flex: 1;
    position: relative;
    min-width: 0;
}

.taw-panel {
    display: none;
    width: 100%;
    box-sizing: border-box;
}

.taw-panel.active {
    display: block;
}

/* ---------------------------------------------------------------
   PANEL INNER
--------------------------------------------------------------- */
.taw-panel-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    padding: 60px;
    box-sizing: border-box;
}

.taw-image-right .taw-text-col { order: 0; flex: 1; min-width: 0; }
.taw-image-right .taw-image    { order: 1; flex: 1; min-width: 0; }

.taw-image-left .taw-image    { order: 0; flex: 1; min-width: 0; }
.taw-image-left .taw-text-col { order: 1; flex: 1; min-width: 0; }

/* ---------------------------------------------------------------
   TEXT
--------------------------------------------------------------- */
.taw-badge {
    display: inline-block;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 20px;
}

.taw-heading {
    font-size: clamp(22px, 3vw, 44px);
    font-weight: 900;
    line-height: 1.1;
    margin: 0 0 24px 0;
    letter-spacing: -0.01em;
}

.taw-content {
    font-size: 15px;
    line-height: 1.8;
}

.taw-content p           { margin: 0 0 16px 0; }
.taw-content p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------
   IMAGE
--------------------------------------------------------------- */
.taw-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.taw-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: cover;
}

/* ---------------------------------------------------------------
   TABLET  769px – 1024px
--------------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1024px) {
    .taw-panel-inner {
        padding: 40px 32px;
        gap: 28px;
    }
    .taw-heading  { font-size: clamp(20px, 2.8vw, 32px); }
    .taw-sidebar  { width: 48px; gap: 8px; padding: 10px 0; }
    .taw-sidebar-tab { min-height: 80px; }
    .taw-sidebar-tab span { font-size: 9px; }
}

/* ---------------------------------------------------------------
   MOBILE  ≤ 768px
   Tab bar moves to top as a horizontal row that wraps.
   Layout: tabs → image → text
--------------------------------------------------------------- */
@media (max-width: 768px) {

    .taw-wrapper {
        flex-direction: column;
    }

    /* ── Tab bar: horizontal, wrapping ── */
    .taw-sidebar {
        flex-direction: row !important;
        flex-wrap: wrap !important;          /* KEY: wrap instead of squish */
        width: 100% !important;
        height: auto !important;
        order: 0 !important;
        gap: 4px !important;
        padding: 8px 8px 0 !important;
    }

    .taw-sidebar-tab {
        flex: 1 1 70px !important;           /* grow freely, never below 70px */
        min-width: 70px !important;
        min-height: 52px !important;
        height: auto !important;
        border-radius: 8px 8px 0 0 !important;
        transform: none !important;
        transition: opacity 0.2s, filter 0.2s;
        padding: 8px 6px;
        box-sizing: border-box;
    }

    .taw-sidebar-tab:not(.active) {
        margin-top: 5px;
        border-radius: 6px 6px 0 0 !important;
    }

    .taw-sidebar-tab span {
        writing-mode: horizontal-tb !important;
        transform: none !important;
        font-size: 10px !important;
        letter-spacing: 0.06em !important;
        text-align: center;
        padding: 0 4px;
        line-height: 1.3;
        white-space: normal !important;      /* allow text to wrap within tab */
        word-break: break-word;
        display: block;
        width: 100%;
    }

    /* ── Panels ── */
    .taw-panels {
        order: 1;
        width: 100%;
    }

    .taw-panel-inner {
        flex-direction: column !important;
        padding: 0 0 32px 0 !important;
        gap: 0;
        align-items: stretch;
    }

    /* Image always on top on mobile */
    .taw-image-right .taw-image,
    .taw-image-left  .taw-image {
        order: 0 !important;
        flex: none;
        width: 100%;
    }

    .taw-image-right .taw-text-col,
    .taw-image-left  .taw-text-col {
        order: 1 !important;
        flex: none;
        width: 100%;
        padding: 28px 20px 0;
        box-sizing: border-box;
    }

    .taw-image img {
        width: 100%;
        max-height: 400px;
        object-fit: cover;
        object-position: top center;
        border-radius: 0;
    }

    .taw-heading {
        font-size: clamp(22px, 6vw, 30px);
        margin-bottom: 16px;
    }

    .taw-badge {
        font-size: 10px;
        padding: 5px 12px;
        margin-bottom: 14px;
    }

    .taw-content {
        font-size: 14px;
        line-height: 1.75;
    }
}

/* ---------------------------------------------------------------
   SMALL MOBILE  ≤ 480px
   Further reduce tab sizing; keep labels readable.
--------------------------------------------------------------- */
@media (max-width: 480px) {
    .taw-sidebar {
        gap: 3px !important;
        padding: 6px 6px 0 !important;
    }

    .taw-sidebar-tab {
        flex: 1 1 60px !important;
        min-width: 60px !important;
        min-height: 48px !important;
        padding: 6px 4px;
    }

    .taw-sidebar-tab span {
        font-size: 9px !important;
        letter-spacing: 0.04em !important;
    }

    .taw-image-right .taw-text-col,
    .taw-image-left  .taw-text-col {
        padding: 22px 16px 0;
    }
}

/* ---------------------------------------------------------------
   VERY SMALL PHONES  ≤ 360px
--------------------------------------------------------------- */
@media (max-width: 360px) {
    .taw-sidebar-tab {
        flex: 1 1 50px !important;
        min-width: 50px !important;
    }

    .taw-sidebar-tab span {
        font-size: 8px !important;
        letter-spacing: 0.03em !important;
    }
}
