/* ============================================================
   BARRELBITE HOMEPAGE V1
   ============================================================ */

.bb-home {
    padding-top: 34px;
    padding-bottom: 60px;
}

.bb-section {
    margin-bottom: 56px;
}

.bb-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.bb-section-heading h2 {
    margin: 0;
    color: #f4f6fa;
    font-size: 25px;
    font-weight: 700;
}

.bb-section-link,
.bb-card-link {
    color: #e7ad22;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.bb-section-link:hover,
.bb-card-link:hover {
    color: #ffd36d;
}

/* NEWS */

.bb-news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.bb-news-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    min-height: 160px;
    background: #161a20;
    border: 1px solid #2a303a;
    border-radius: 12px;
    transition: border-color .2s, transform .2s;
}

.bb-news-card:hover {
    border-color: #b98a21;
    transform: translateY(-2px);
}

.bb-card-date {
    color: #8c98a9;
    font-size: 12px;
    margin-bottom: 12px;
}

.bb-news-title {
    color: #f1f3f7;
    font-size: 16px;
    line-height: 1.55;
    font-weight: 600;
    margin: 0 0 18px;
}

.bb-news-title a {
    color: inherit;
    text-decoration: none;
}

.bb-news-title a:hover {
    color: #e7ad22;
}

.bb-news-card .bb-card-link {
    margin-top: auto;
}

/* ANALYSIS */

.bb-analysis-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.bb-analysis-card {
    display: flex;
    flex-direction: column;
    min-height: 300px;
    padding: 24px;
    background: #161a20;
    border: 1px solid #2a303a;
    border-radius: 12px;
    transition: border-color .2s, transform .2s;
}

.bb-analysis-card:hover {
    border-color: #b98a21;
    transform: translateY(-2px);
}

.bb-analysis-edition {
    color: #e7ad22;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 10px;
}

.bb-analysis-card h3 {
    font-size: 18px;
    line-height: 1.5;
    color: #f4f6fa;
    margin: 0 0 14px;
}

.bb-analysis-preview {
    color: #aeb6c3;
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 22px;
    overflow-wrap: anywhere;
}

.bb-analysis-card .bb-card-link {
    margin-top: auto;
}

.bb-empty {
    color: #aeb6c3;
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .bb-analysis-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .bb-home {
        padding-top: 24px;
    }

    .bb-news-grid,
    .bb-analysis-grid {
        grid-template-columns: 1fr;
    }

    .bb-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .bb-section-heading h2 {
        font-size: 22px;
    }

    .bb-section {
        margin-bottom: 42px;
    }

    .bb-analysis-card {
        min-height: auto;
    }
}


/* ============================================================
   BARRELBITE HOMEPAGE INTRODUCTION
   ============================================================ */

.bb-home-intro {
    margin-bottom: 36px;
}

.bb-home-intro h1 {
    color: #f4f6fa;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px;
}

.bb-home-intro p {
    color: #aeb8c6;
    font-size: 14px;
    line-height: 1.8;
    max-width: 900px;
    margin: 0;
}


/* ============================================================
   INFORMATION SECTIONS
   ============================================================ */

.bb-info-section {
    margin-top: 36px;
}

.bb-info-content {
    max-width: 1050px;
}

.bb-info-content p {
    color: #aeb8c6;
    font-size: 15px;
    line-height: 1.9;
    margin-bottom: 17px;
}

.bb-info-content h3 {
    color: #e7ad22;
    font-size: 18px;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 13px;
    line-height: 1.5;
}


/* ============================================================
   EXPLORE ENERGY INTELLIGENCE
   ============================================================ */

.bb-explore-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.bb-explore-card {
    display: block;
    padding: 26px;
    background: #161a20;
    border: 1px solid #2a303a;
    border-radius: 12px;
    text-decoration: none;
    transition:
        border-color 0.2s ease,
        transform 0.2s ease;
}

.bb-explore-card:hover {
    border-color: #b98a21;
    transform: translateY(-2px);
}

.bb-explore-card h3 {
    color: #f4f6fa;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 14px;
}

.bb-explore-card p {
    color: #aeb8c6;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.bb-explore-card span {
    color: #e7ad22;
    font-size: 14px;
    font-weight: 600;
}

.bb-explore-card:hover span {
    color: #ffd36d;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 700px) {

    .bb-home-intro h1 {
        font-size: 23px;
    }

    .bb-info-content p {
        font-size: 14px;
    }

    .bb-info-content h3 {
        font-size: 17px;
    }

    .bb-explore-grid {
        grid-template-columns: 1fr;
    }

    .bb-explore-card {
        padding: 22px;
    }

}

/* ===== Latest X updates popup (reused from News) ===== */
    .x-notification {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 1200;

    display: inline-flex;
    align-items: center;
    gap: 5px;

    width: auto;
    min-width: 0;
    height: 32px;

    padding: 3px 7px;

    border: 1px solid rgba(201, 162, 39, 0.55);
    border-radius: 6px;

    background: rgba(12, 12, 12, 0.96);
    color: #f4f4f4;

    cursor: pointer;
    white-space: nowrap;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.30);
}


        .x-notification:hover {

            transform: translateY(-2px);

            border-color: #c9a227;

            box-shadow:
                0 8px 28px rgba(0, 0, 0, 0.45);

        }


       .x-notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    border-radius: 50%;
    background: #050505;

    font-size: 9px;
    line-height: 1;
}


.x-notification-title {
    font-size: 12px;
    font-weight: 600;
}


.x-notification-count {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 17px;
    height: 17px;

    padding: 0 3px;

    border-radius: 50%;

    background: #c9a227;
    color: #080808;

    font-size: 7px;
    font-weight: 700;
}



        /* =====================================================
           BACKDROP
           ===================================================== */

        .x-overlay {

            position: fixed;

            inset: 0;

            z-index: 1250;

            background:
                rgba(0, 0, 0, 0.54);

            backdrop-filter: blur(2px);

            opacity: 0;

            visibility: hidden;

            transition:
                opacity 0.25s ease,
                visibility 0.25s ease;

        }


        .x-overlay.active {

            opacity: 1;
            visibility: visible;

        }



        /* =====================================================
           CENTER POPUP
           ===================================================== */

        .x-popup {

            position: fixed;

            top: 50%;
            left: 50%;

            z-index: 1300;

            width:
                min(680px, calc(100vw - 40px));

            max-height: 72vh;

            display: flex;
            flex-direction: column;

            background: #0c0c0c;

            border:
                1px solid rgba(201, 162, 39, 0.30);

            border-radius: 14px;

            box-shadow:
                0 25px 80px rgba(0, 0, 0, 0.65);

            opacity: 0;

            visibility: hidden;


            /*
             * Starts toward the bottom-right,
             * then expands diagonally toward center.
             */

            transform:
                translate(
                    calc(-50% + 240px),
                    calc(-50% + 190px)
                )
                scale(0.25);

            transform-origin:
                bottom right;


            transition:
                transform
                    0.34s
                    cubic-bezier(.2, .8, .2, 1),

                opacity
                    0.22s ease,

                visibility
                    0.22s ease;

        }


        .x-popup.active {

            opacity: 1;

            visibility: visible;

            transform:
                translate(-50%, -50%)
                scale(1);

        }



        /* =====================================================
           POPUP HEADER
           ===================================================== */

        .x-popup-header {

            display: flex;

            align-items: center;

            justify-content:
                space-between;

            padding:
                14px 18px;

            border-bottom:
                1px solid rgba(255, 255, 255, 0.07);

        }


        .x-popup-title {

            color: #f0f0f0;

            font-size: 15px;

            font-weight: 650;

        }


        .x-popup-close {

            border: 0;

            background: transparent;

            color: #777;

            font-size: 24px;

            line-height: 1;

            cursor: pointer;

            padding: 0;

        }


        .x-popup-close:hover {

            color: #ffffff;

        }



        /* =====================================================
           POPUP BODY
           ===================================================== */

        .x-popup-body {

            overflow-y: auto;

            padding:
                0 18px 18px;

        }



        /* =====================================================
           INDIVIDUAL POST
           ===================================================== */

        .x-post-item {

            padding:
                18px 0;

            border-bottom:
                1px solid rgba(255, 255, 255, 0.06);

        }


        .x-post-item:last-child {

            border-bottom: 0;

        }


        .x-post-text {

            color: #d6d6d6;

            font-size: 13px;

            line-height: 1.65;

            overflow-wrap: anywhere;

        }



        /* =====================================================
           POST FOOTER
           ===================================================== */

        .x-post-footer {

            display: flex;

            align-items: center;

            justify-content:
                space-between;

            gap: 15px;

            margin-top: 13px;

        }


        .x-post-date {

            color: #666;

            font-size: 10px;

        }


        .x-post-source {

            color: #727272;

            font-size: 10px;

            white-space: nowrap;

        }


        .x-post-source a {

            color: #c9a227;

            font-weight: 600;

            text-decoration: none;

        }


        .x-post-source a:hover {

            text-decoration: underline;

        }



        /* =====================================================
           PREVENT PAGE SCROLL WHEN OPEN
           ===================================================== */

        body.x-popup-open {

            overflow: hidden;

        }



        /* =====================================================
           MOBILE
           ===================================================== */

        @media (max-width: 600px) {


            .x-notification {

                right: 14px;
                bottom: 14px;

            }


            .x-popup {

                width:
                    calc(100vw - 24px);

                max-height:
                    80vh;


                transform:
                    translate(
                        calc(-50% + 90px),
                        calc(-50% + 220px)
                    )
                    scale(0.25);

            }


            .x-popup.active {

                transform:
                    translate(-50%, -50%)
                    scale(1);

            }


            .x-popup-header {

                padding:
                    13px 15px;

            }


            .x-popup-body {

                padding:
                    0 15px 15px;

            }


            .x-post-text {

                font-size: 12px;

            }


            .x-post-footer {

                align-items:
                    flex-start;

            }

        }




/* ============================================================
   HOMEPAGE: LATEST ABOVE ASK BARRELBITE AI
   ============================================================ */
.x-notification {
    position: fixed;
    left: auto;
    right: 30px;
    bottom: 105px;
    z-index: 1200;
}
@media (max-width: 600px) {
    .x-notification {
        left: auto;
        right: 14px;
        bottom: 90px;
    }
}


/* ============================================================
   HOMEPAGE ENERGY MARKET (same visual treatment as News page)
   ============================================================ */
.bb-market-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}
.bb-market-card {
    min-width: 0;
    background: #15191f;
    border: 1px solid #272c34;
    border-radius: 10px;
    padding: 20px;
}
.bb-market-instrument {
    color: #a0a7b1;
    font-size: 14px;
}
.bb-market-price {
    margin-top: 10px;
    color: #eee;
    font-size: 30px;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.bb-market-unit {
    margin-top: 4px;
    color: #747d88;
    font-size: 12px;
}
.bb-market-contract {
    margin-top: 10px;
    color: #d6a43c;
    font-size: 12px;
}
.bb-market-updated {
    margin-top: 8px;
    color: #838d9b;
    font-size: 11px;
    line-height: 1.5;
}
@media (max-width: 1100px) {
    .bb-market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .bb-market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bb-market-card { padding: 16px; }
    .bb-market-price { font-size: 24px; }
}
@media (max-width: 420px) {
    .bb-market-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   HOMEPAGE: UKMTO MARITIME SECURITY ALERTS
   Only routes with UKMTO reports in the past 7 days are shown.
   ============================================================ */
.bb-maritime-alerts-caption {
    margin: -7px 0 18px;
    color: #aeb8c6;
    font-size: 13px;
    line-height: 1.6;
}
.bb-maritime-alerts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.bb-maritime-alert-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 82px;
    min-width: 0;
    padding: 17px 18px;
    border: 1px solid #2a303a;
    border-radius: 10px;
    background: #15191f;
    text-decoration: none;
    transition: border-color .2s ease, transform .2s ease, background-color .2s ease;
}
.bb-maritime-alert-card:hover {
    border-color: #b98a21;
    background: #181d24;
    transform: translateY(-2px);
}
.bb-maritime-alert-card:focus-visible {
    outline: 2px solid #d6a900;
    outline-offset: 3px;
}
.bb-maritime-alert-name {
    min-width: 0;
    color: #f4f6fa;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.bb-maritime-alert-trailing {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: #d6a900;
}
.bb-maritime-alert-bell {
    display: block;
    width: 18px;
    height: 18px;
}
.bb-maritime-alert-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 11px;
    background: #d6a900;
    color: #0c0d0e;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}
.bb-maritime-alert-arrow {
    margin-left: 5px;
    font-size: 19px;
    line-height: 1;
}
.bb-maritime-alerts-source {
    margin: 13px 0 0;
    color: #7e8993;
    font-size: 11px;
    line-height: 1.5;
}
@media (max-width: 1100px) {
    .bb-maritime-alerts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 800px) {
    .bb-maritime-alerts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .bb-maritime-alerts-grid {
        grid-template-columns: 1fr;
    }
    .bb-maritime-alert-card {
        min-height: 70px;
        padding: 15px 16px;
    }
}