/* Reusable blog carousel, modal and gallery enhancements */
.blog-module .news-img {
    width: 100%;
    display: block;
    padding: 0;
    border: 0;
    cursor: pointer;
    background: transparent;
    text-align: left;
}

.blog-module .news-img:focus-visible,
.blog-module .read-more-blog:focus-visible,
.blog-media-close:focus-visible,
.blog-gallery-control:focus-visible,
.blog-gallery-thumb:focus-visible {
    outline: 3px solid #f05525;
    outline-offset: 3px;
}

.blog-play-button,
.blog-image-hover {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, opacity .25s ease, background .25s ease;
}

.blog-play-button {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    border: 3px solid #f05525;
    box-shadow: 0 8px 25px rgba(0,0,0,.28);
}

.blog-play-triangle {
    width: 0;
    height: 0;
    margin-left: 5px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 17px solid #f05525;
}

.blog-image-hover {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: #244d87;
    font-size: 20px;
    opacity: 0;
    box-shadow: 0 8px 25px rgba(0,0,0,.22);
}

.blog-module .news-img:hover .blog-play-button {
    transform: translate(-50%, -50%) scale(1.1);
    background: #fff;
}

.blog-module .news-img:hover .blog-image-hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
}

.blog-module .news-date {
    z-index: 5;
}

.blog-details-modal {
    z-index: 10050;
}

.blog-details-box {
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 28px;
}

.blog-details-box .blog-content {
    text-align: left;
}

.blog-details-box .blog-content img {
    max-width: 100%;
    height: auto;
}

.blog-modal-actions,
.blog-details-response-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
}

.blog-details-response-actions {
    justify-content: flex-end;
}

.blog-view-gallery {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 21px;
    border-radius: 30px;
    color: #fff;
    background: linear-gradient(to bottom, #4f78b4, #244d87);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 7px 16px rgba(36,77,135,.28);
}

.blog-view-gallery:hover {
    color: #fff;
    background: linear-gradient(to bottom, #f69a7e, #f05525);
}

.blog-media-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(12,12,12,.9);
}

.blog-media-modal.active {
    display: flex;
}

.blog-media-dialog {
    position: relative;
    width: min(1100px, 96vw);
    max-height: 92vh;
}

.blog-media-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
}

.blog-media-stage img,
.blog-media-stage iframe {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 18px;
    background: #000;
    box-shadow: 0 20px 55px rgba(0,0,0,.4);
}

.blog-media-stage img {
    max-height: 86vh;
    object-fit: contain;
}

.blog-media-stage iframe {
    aspect-ratio: 16 / 9;
}

.blog-media-close {
    position: absolute;
    right: -12px;
    top: -17px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: #f05525;
    background: #fff;
    font-size: 31px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 7px 18px rgba(0,0,0,.3);
}

body.blog-modal-open {
    overflow: hidden;
}

/* Dedicated gallery page */
.blog-gallery-page {
    min-height: 100vh;
    padding: 145px 0 70px;
    background: #1d1d1d;
}

.blog-gallery-wrap {
    width: min(1450px, 94%);
    margin: 0 auto;
}

.blog-gallery-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.blog-gallery-header h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 4vw, 58px);
}

.blog-gallery-header p {
    margin: 8px 0 0;
    color: rgba(255,255,255,.65);
}

.blog-gallery-back {
    flex: 0 0 auto;
}

.blog-gallery-viewer {
    position: relative;
    min-height: 620px;
    padding: 55px 75px;
    border-radius: 26px;
    background: #fff;
    overflow: hidden;
}

.blog-gallery-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 510px;
}

.blog-gallery-main img {
    display: block;
    max-width: 100%;
    max-height: 68vh;
    border-radius: 22px;
    object-fit: contain;
    box-shadow: 0 17px 45px rgba(0,0,0,.18);
}

.blog-gallery-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 52px;
    height: 52px;
    border: 2px solid #f05525;
    border-radius: 50%;
    color: #f05525;
    background: rgba(255,255,255,.95);
    font-size: 25px;
    cursor: pointer;
    transition: .2s ease;
}

.blog-gallery-control:hover {
    color: #fff;
    background: #f05525;
}

.blog-gallery-prev { left: 18px; }
.blog-gallery-next { right: 18px; }

.blog-gallery-counter {
    margin-top: 14px;
    color: #244d87;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.blog-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.blog-gallery-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 3px solid transparent;
    border-radius: 18px;
    overflow: hidden;
    background: #eee;
    cursor: pointer;
}

.blog-gallery-thumb.active {
    border-color: #f05525;
}

.blog-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-gallery-empty {
    padding: 80px 25px;
    color: #fff;
    text-align: center;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 900px) {
    .blog-gallery-page { padding-top: 105px; }
    .blog-gallery-header { align-items: flex-start; flex-direction: column; }
    .blog-gallery-viewer { min-height: 0; padding: 35px 50px; }
    .blog-gallery-main { min-height: 370px; }
    .blog-gallery-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .blog-play-button { width: 52px; height: 52px; }
    .blog-details-box { padding: 26px 18px 22px; border-radius: 18px; }
    .blog-modal-actions,
    .blog-details-response-actions { align-items: stretch; flex-direction: column-reverse; }
    .blog-modal-actions .gray-btn,
    .blog-view-gallery { width: 100%; }
    .blog-media-close { right: 0; top: -51px; }
    .blog-gallery-viewer { padding: 25px 12px 30px; border-radius: 18px; }
    .blog-gallery-main { min-height: 310px; }
    .blog-gallery-control { width: 42px; height: 42px; font-size: 21px; }
    .blog-gallery-prev { left: 7px; }
    .blog-gallery-next { right: 7px; }
    .blog-gallery-thumbs { gap: 8px; }
    .blog-gallery-thumb { border-radius: 12px; }
}

/* Gallery listing page: header + image grid + footer only */
.blog-gallery-page {
    min-height: 70vh;
    padding: 135px 0 75px;
    background: #1d1d1d;
}

.blog-gallery-title {
    margin: 0 0 22px;
    color: #fff;
    font-size: clamp(28px, 3vw, 44px);
    font-weight: 500;
}

.blog-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 34px;
    border-radius: 4px;
    background: #fff;
}

.blog-gallery-grid-item {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    background: #eee;
    cursor: zoom-in;
    aspect-ratio: 0.82 / 1;
}

.blog-gallery-grid-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.blog-gallery-grid-item:hover img {
    transform: scale(1.035);
}

/* Keep modal actions on one line: Back left, View Images right */
.blog-modal-actions {
    width: 100%;
    justify-content: space-between;
}

.blog-gallery-action-slot {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
}

.blog-details-response-actions {
    margin: 0;
}

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

@media (max-width: 600px) {
    .blog-gallery-page {
        padding: 105px 0 45px;
    }

    .blog-gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px;
    }

    .blog-modal-actions {
        align-items: center;
        flex-direction: row;
    }

    .blog-modal-actions .gray-btn,
    .blog-view-gallery {
        width: auto;
    }
}

/* Gallery page v1.3: white grid with in-page focused viewer */
.blog-gallery-body,
.blog-gallery-page {
    background: #fff;
}

.blog-gallery-page {
    min-height: 70vh;
    padding: 125px 0 75px;
}

.blog-gallery-wrap {
    width: min(1320px, 94%);
    margin: 0 auto;
}

.blog-gallery-experience {
    position: relative;
    min-height: 480px;
}

.blog-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 0;
    border-radius: 0;
    background: #fff;
    transition: filter .25s ease, opacity .25s ease;
}

.blog-gallery-grid-item {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    background: #eee;
    cursor: zoom-in;
    aspect-ratio: .82 / 1;
    box-shadow: 0 9px 24px rgba(0, 0, 0, .08);
}

.blog-gallery-grid-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.blog-gallery-grid-item:hover img {
    transform: scale(1.035);
}

.blog-gallery-focus {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 650px;
    padding: 55px 70px;
}

.blog-gallery-focus.is-active {
    display: flex;
}

.blog-gallery-experience.is-focused .blog-gallery-grid {
    filter: blur(8px);
    opacity: .58;
    pointer-events: none;
    user-select: none;
}

.blog-gallery-focus-main {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(520px, 62vw);
}

.blog-gallery-focus-main img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 22px;
    object-fit: contain;
    background: #fff;
    box-shadow: 0 18px 55px rgba(0, 0, 0, .25);
}

.blog-gallery-focus-counter {
    margin-top: 10px;
    color: #244d87;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
}

.blog-gallery-focus-back {
    position: absolute;
    top: 22px;
    left: 50%;
    z-index: 4;
    transform: translateX(-50%);
    min-width: 54px;
    padding: 8px 13px;
    border: 0;
    border-radius: 22px;
    color: #f05525;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.blog-gallery-focus-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    transform: translateY(-50%);
    border: 2px solid #f05525;
    border-radius: 50%;
    color: #f05525;
    background: rgba(255, 255, 255, .96);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}

.blog-gallery-focus-arrow:hover,
.blog-gallery-focus-back:hover {
    color: #fff;
    background: #f05525;
}

.blog-gallery-focus-prev { left: 0; }
.blog-gallery-focus-next { right: 0; }

.blog-gallery-focus-arrow:focus-visible,
.blog-gallery-focus-back:focus-visible,
.blog-gallery-grid-item:focus-visible {
    outline: 3px solid #244d87;
    outline-offset: 3px;
}

.blog-gallery-empty {
    padding: 90px 20px;
    color: #333;
    text-align: center;
}

@media (max-width: 900px) {
    .blog-gallery-page {
        padding-top: 105px;
    }

    .blog-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .blog-gallery-focus {
        min-height: 560px;
        padding: 50px 55px;
    }

    .blog-gallery-focus-main {
        width: min(500px, 72vw);
    }
}

@media (max-width: 600px) {
    .blog-gallery-page {
        padding: 92px 0 45px;
    }

    .blog-gallery-wrap {
        width: 92%;
    }

    .blog-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .blog-gallery-grid-item {
        border-radius: 20px;
    }

    .blog-gallery-focus {
        min-height: 500px;
        padding: 55px 38px 35px;
    }

    .blog-gallery-focus-main {
        width: 72vw;
    }

    .blog-gallery-focus-main img {
        max-height: 62vh;
        border-radius: 16px;
    }

    .blog-gallery-focus-arrow {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .blog-gallery-focus-prev { left: -3px; }
    .blog-gallery-focus-next { right: -3px; }

    .blog-gallery-focus-back {
        top: 12px;
    }
}


/* Gallery page v1.4 refinements */
.blog-gallery-body .header-style .header__wrap,
.blog-gallery-body #xb-header-area .header__wrap,
.blog-gallery-body #xb-header-area .xb-header-area-sticky,
.blog-gallery-body .header-transparent .header__wrap {
    background: linear-gradient(180deg, rgba(30, 69, 133, .98) 0%, rgba(18, 54, 105, .98) 100%) !important;
    border-color: rgba(255, 255, 255, .12) !important;
    box-shadow: 0 8px 24px rgba(17, 52, 103, .14);
}

.blog-gallery-focus-back {
    top: -58px;
    left: 0;
    transform: none;
    min-width: 96px;
    min-height: 42px;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 13px;
}

.blog-gallery-focus-arrow {
    width: 52px;
    height: 52px;
    border-width: 2px;
}

.blog-gallery-focus-arrow svg {
    display: block;
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.blog-gallery-focus-arrow:hover svg {
    transform: scale(1.08);
}

.blog-gallery-focus-arrow svg {
    transition: transform .2s ease;
}

@media (max-width: 600px) {
    .blog-gallery-focus-back {
        top: -50px;
        min-width: 88px;
        min-height: 38px;
        padding: 8px 18px;
    }

    .blog-gallery-focus-arrow {
        width: 44px;
        height: 44px;
    }

    .blog-gallery-focus-arrow svg {
        width: 21px;
        height: 21px;
    }
}


/* Gallery page v1.5: permanent blue-gradient header and corrected Back position */
.blog-gallery-body .xb-header,
.blog-gallery-body .xb-header.original,
.blog-gallery-body .xb-header-area-sticky,
.blog-gallery-body #xb-header-area,
.blog-gallery-body header {
    background: linear-gradient(
        180deg,
        rgb(30 69 133) 0%,
        rgba(58, 105, 168, .92) 34%,
        rgba(134, 164, 203, .64) 67%,
        rgba(255, 255, 255, .96) 100%
    ) !important;
}

.blog-gallery-body .xb-header .header__wrap,
.blog-gallery-body .xb-header.original .header__wrap,
.blog-gallery-body .xb-header-area-sticky .header__wrap,
.blog-gallery-body #xb-header-area .header__wrap,
.blog-gallery-body .header-transparent .header__wrap,
.blog-gallery-body .header-style .header__wrap {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Ensure the cloned sticky header has the same gradient before and after scroll. */
.blog-gallery-body .xb-header-area-sticky,
.blog-gallery-body .xb-header-area-sticky.xb-header-fixed {
    background: linear-gradient(
        180deg,
        rgb(30 69 133) 0%,
        rgba(58, 105, 168, .92) 34%,
        rgba(134, 164, 203, .64) 67%,
        rgba(255, 255, 255, .96) 100%
    ) !important;
}

.blog-gallery-grid-item {
    border-radius: 20px !important;
}

/* Back is positioned from the selected-image wrapper, not from the page. */
.blog-gallery-focus-main .blog-gallery-focus-back {
    top: -58px;
    left: 0;
    transform: none;
    min-width: 110px;
    min-height: 42px;
    padding: 10px 24px;
}

@media (max-width: 900px) {
    .blog-gallery-focus-main .blog-gallery-focus-back {
        top: -54px;
    }
}

@media (max-width: 600px) {
    .blog-gallery-grid-item {
        border-radius: 20px !important;
    }

    .blog-gallery-focus-main .blog-gallery-focus-back {
        top: -50px;
        left: 0;
        min-width: 96px;
    }
}
/* Keep the same news-card border on the Sports Management page */
.manage_page .blog-carousel-section .news-card {
    background: #fff !important;
    border: 1px solid rgba(30, 69, 133, 0.16) !important;
    border-radius: 28px !important;
    overflow: hidden;
    box-shadow: none;
}
.manage_page .blog-carousel-section .news-card .news-img {
    margin: 20px 20px 0;
    border-radius: 20px;
    overflow: hidden;
}

.manage_page .blog-carousel-section .news-card .news-img img {
    width: 100%;
    border-radius: 20px;
    display: block;
}
/* Match homepage card spacing on Sports Management page */
.manage_page .blog-carousel-section .news-card {
    padding: 20px !important;
    box-sizing: border-box;
}

.manage_page .blog-carousel-section .news-card .news-img {
    margin: 0 !important;
    border-radius: 20px;
    overflow: hidden;
}

.manage_page .blog-carousel-section .news-card .news-content {
    padding: 22px 0 0 !important;
}
/* Gallery page v1.6: fixed, viewport-centred viewer with page scroll locked */
.blog-gallery-body.gallery-focus-open {
    overflow: hidden !important;
    height: 100vh;
}

.blog-gallery-body.gallery-focus-open .blog-gallery-page {
    overflow: hidden;
}

.blog-gallery-focus {
    position: fixed !important;
    inset: 0 !important;
    z-index: 12000 !important;
    width: 100vw;
    height: 100vh;
    min-height: 0 !important;
    padding: 115px 78px 28px !important;
    box-sizing: border-box;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.blog-gallery-focus.is-active {
    display: flex !important;
}

.blog-gallery-focus-main {
    position: relative;
    width: min(760px, calc(100vw - 190px)) !important;
    height: calc(100vh - 143px);
    max-height: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.blog-gallery-focus-main img {
    width: auto;
    max-width: 100% !important;
    max-height: calc(100vh - 220px) !important;
    margin: 42px auto 0;
    object-fit: contain;
}

.blog-gallery-focus-main .blog-gallery-focus-back {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    margin: 0 !important;
}

.blog-gallery-focus-counter {
    flex: 0 0 auto;
}

.blog-gallery-focus-arrow {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 12002 !important;
}

.blog-gallery-focus-prev {
    left: 6% !important;
}

.blog-gallery-focus-next {
    right: 6% !important;
}

@media (max-width: 900px) {
    .blog-gallery-focus {
        padding: 100px 54px 24px !important;
    }

    .blog-gallery-focus-main {
        width: min(680px, calc(100vw - 125px)) !important;
        height: calc(100vh - 124px);
    }

    .blog-gallery-focus-main img {
        max-height: calc(100vh - 205px) !important;
    }

    .blog-gallery-focus-prev {
        left: 18px !important;
    }

    .blog-gallery-focus-next {
        right: 18px !important;
    }
}

@media (max-width: 600px) {
    .blog-gallery-focus {
        padding: 88px 18px 18px !important;
    }

    .blog-gallery-focus-main {
        width: calc(100vw - 72px) !important;
        height: calc(100vh - 106px);
    }

    .blog-gallery-focus-main img {
        max-height: calc(100vh - 178px) !important;
        margin-top: 38px;
    }

    .blog-gallery-focus-main .blog-gallery-focus-back {
        top: 0 !important;
        min-width: 92px;
    }

    .blog-gallery-focus-prev {
        left: 8px !important;
    }

    .blog-gallery-focus-next {
        right: 8px !important;
    }
}
