/* =========================================================================
 * SATA Layout & Stability Fixes
 *
 * Purpose: prevent the "divs colliding" / "posts overlapping" issues the
 * client reported, give every dynamic section a predictable grid, and apply
 * a clean reset for box-sizing, gaps and image overflow.
 *
 * This file is loaded LAST so it can safely override the older CSS without
 * having to rewrite blog.css / responsive.css from scratch.
 * ========================================================================= */

/* ---------- 0. Global reset for SATA-owned sections ---------- */

/* Box-sizing on every dynamic block we render via shortcodes. */
.sponsors-wrap, .sponsors-wrap *,
.roles-wrapper, .roles-wrapper *,
.gallery-wrapper, .gallery-wrapper *,
.homegallery-wrap, .homegallery-wrap *,
.videos-wrap, .videos-wrap *,
.blog-wrap, .blog-wrap *,
.banner-wrap, .banner-wrap *,
.latestnews-wrap, .latestnews-wrap *,
.events-wrap, .events-wrap *,
.sidebar-wrap, .sidebar-wrap *,
.blogs-banner, .blogs-banner *,
.event-banner, .event-banner *,
.gallery-banner, .gallery-banner *,
.single-post-container, .single-post-container *,
.search-results-wrap, .search-results-wrap * {
    box-sizing: border-box;
}

/* Stop runaway widths from images/videos in our blocks. */
.sponsors-wrap img,
.roles-wrapper img,
.gallery-wrapper img,
.homegallery-wrap img,
.videos-wrap img,
.videos-wrap video,
.blog-wrap img,
.banner-wrap img,
.events-wrap img,
.blogs-item img,
.event-item img,
.gallery-item img,
.role-item img,
.sponsor-item img,
.blog-thumbnail img,
.event-thumbnail img,
.gallery-content-wrap img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* ---------- 1. Blog / News listing (index.php) ----------
 * NOTE: blog.css has older rules with higher specificity (display:flex,
 * 2-col forced via body.blog .blog-warp, etc.) — we override with !important
 * + body-class scoped selectors so the news page lays out correctly without
 * having to rewrite blog.css.
 */

html body .blog-wrap.blogs-page,
html body.archive .blog-wrap.blogs-page,
html body.blog .blog-wrap.blogs-page {
    width: 100% !important;
    display: block !important;
    flex-direction: unset !important;
    padding: 0 !important;
    gap: 0 !important;
}

html body .blog-wrap.blogs-page .posts-wrapper,
html body.archive .blog-wrap.blogs-page .posts-wrapper,
html body.blog .blog-wrap.blogs-page .posts-wrapper,
html body:not(.nv-blog-default) .blog-wrap.blogs-page .posts-wrapper {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 28px !important;
    margin: 0 0 32px 0 !important;
    padding: 0 !important;
    width: 100% !important;
    flex-wrap: unset !important;
    order: unset !important;
}

.blog-wrap.blogs-page .blogs-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.blog-wrap.blogs-page .blogs-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

html body .blog-wrap.blogs-page .blogs-img {
    width: 100% !important;
    aspect-ratio: 16 / 10 !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    background: #f5f5f5 !important;
    display: block !important;
    align-items: unset !important;
}

html body .blog-wrap.blogs-page .blogs-img a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    align-items: unset !important;
}

html body .blog-wrap.blogs-page .blogs-img img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.4s ease;
}

.blog-wrap.blogs-page .blogs-item:hover .blogs-img img {
    transform: scale(1.04);
}

.blog-wrap.blogs-page .blogs-item .content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 18px 18px 14px;
}

.blog-wrap.blogs-page .blogs-item .content-wrapper {
    flex-grow: 1;
}

.blog-wrap.blogs-page .blogs-item .category {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.blog-wrap.blogs-page .blogs-item .category span {
    display: inline-block;
    padding: 3px 10px;
    background: #eef3ff;
    color: #2f4596;
    font-size: 12px;
    font-weight: 500;
    border-radius: 999px;
    line-height: 1.4;
}

.blog-wrap.blogs-page .blogs-item .blogs-title {
    margin: 0 0 10px;
    min-height: 50px;
}

.blog-wrap.blogs-page .blogs-item .blog-name {
    font-size: 18px;
    line-height: 1.35;
    font-weight: 600;
    color: #2f4596;
    text-decoration: none;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.blog-wrap.blogs-page .blogs-item .post-content p {
    color: #555;
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0 0 12px;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.blog-wrap.blogs-page .blogs-item .post-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed #e6e8ee;
}

/* The old blog.css has a `body .post-date` rule that uses height:25px with
 * padding-bottom:15px — pushing the date text OUT of its 25px box. Reset it
 * here so the date is actually readable. We keep the SATA green branding
 * but render it as a properly-sized pill button. */
html body .blog-wrap.blogs-page .blogs-item .post-date,
html body .blog-wrap.home-blogs .blogs-item .post-date {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 30px !important;
    padding: 6px 14px !important;
    margin: 0 !important;
    background: #148e29 !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: nowrap !important;
    font-family: inherit !important;
    box-shadow: 0 2px 6px rgba(20, 142, 41, 0.18) !important;
}

html body .blog-wrap.blogs-page .blogs-item .post-date::before,
html body .blog-wrap.home-blogs .blogs-item .post-date::before {
    content: "\f073";       /* fa-calendar */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 11px;
    margin-right: 2px;
    opacity: 0.95;
}

html body .blog-wrap.blogs-page .blogs-item .post-date b,
html body .blog-wrap.home-blogs .blogs-item .post-date b {
    font-weight: 500 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    display: inline !important;
    border-top: 0 !important;
}


/* ---------- 1a. Owl carousel slide-height equaliser ---------- */
/* Owl gives each .owl-item its own height; cards inside end up uneven when
 * titles differ. Force a flex layout so every card stretches to the tallest. */

.blog-wrap.home-blogs.owl-carousel .owl-stage,
.events-wrap.owl-carousel .owl-stage,
.homegallery-wrap.owl-carousel .owl-stage {
    display: flex;
}

.blog-wrap.home-blogs.owl-carousel .owl-item,
.events-wrap.owl-carousel .owl-item,
.homegallery-wrap.owl-carousel .owl-item {
    display: flex;
    height: auto;
}

.blog-wrap.home-blogs.owl-carousel .owl-item > div,
.events-wrap.owl-carousel .owl-item > div,
.homegallery-wrap.owl-carousel .owl-item > div {
    width: 100%;
    display: flex;
    flex-direction: column;
}


/* ---------- 1b. Home "Latest News & Blogs" carousel ---------- */

/* The home carousel uses .home-blogs class (different from archive). Same
 * card pattern but constrained to fixed heights so the carousel rows align. */

.blog-wrap.home-blogs .blogs-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    height: 100%;          /* fill the carousel slide height */
    min-height: 480px;     /* keep cards a consistent visual size */
}

.blog-wrap.home-blogs .blogs-img {
    width: 100%;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.blog-wrap.home-blogs .blogs-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-wrap.home-blogs .blogs-item:hover .blogs-img img {
    transform: scale(1.04);
}

.blog-wrap.home-blogs .blogs-item .content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 16px 20px 22px;
    gap: 12px;
}

.blog-wrap.home-blogs .blogs-item .category {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.blog-wrap.home-blogs .blogs-item .category span {
    display: inline-block;
    padding: 5px 14px;
    background: #ff8a00;
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 999px;
    line-height: 1.4;
}

.blog-wrap.home-blogs .blogs-item .blogs-title {
    margin: 0;
    min-height: 56px;     /* reserve room for ~2 lines so all cards align */
}

.blog-wrap.home-blogs .blogs-item .blog-name {
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    color: #1d2c5e;
    text-decoration: none;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;          /* hard cap at 2 lines */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.blog-wrap.home-blogs .blogs-item .post-content {
    margin: 0;
    flex-grow: 1;
}

.blog-wrap.home-blogs .blogs-item .post-content p {
    color: #555;
    font-size: 14.5px;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* When titles run long (Telugu wraps wider than English), make sure the
 * card body never bleeds into the next card via a hard inner wrapper. */
.blog-wrap.home-blogs .blogs-item > * {
    min-width: 0;
}

/* Smaller screens — slightly shorter min-height to avoid awkward whitespace */
@media (max-width: 720px) {
    .blog-wrap.home-blogs .blogs-item {
        min-height: 440px;
    }
    .blog-wrap.home-blogs .blogs-item .blogs-title {
        min-height: 50px;
    }
}


/* ---------- 2. Page banner / breadcrumb ---------- */

.blogs-banner,
.event-banner,
.gallery-banner {
    width: 100%;
    min-height: 220px;
    padding: 60px 0;
    background-color: #1d2c5e;
    color: #fff;
    margin-bottom: 32px;
}

/* News & Blogs banner — photo background, text anchored to the BOTTOM.
 * Overlay is warm maroon (matching the site header), NOT navy — it fades
 * from near-solid at the bottom to almost clear at the top, so the photo
 * stays visible up top while the heading/breadcrumb stay readable below.
 * The maroon background-color is the fallback while the image loads. */
.blogs-banner {
    display: flex;
    align-items: flex-end;
    min-height: 360px;
    padding: 90px 0 0;
    background-color: #2a1410;
    background-image:
        linear-gradient(to top,
            rgba(35, 15, 12, 0.96) 0%,
            rgba(35, 15, 12, 0.86) 22%,
            rgba(35, 15, 12, 0.55) 55%,
            rgba(35, 15, 12, 0.15) 100%),
        url('https://sata-ksa.org/wp-content/uploads/2026/05/DSC9547-scaled.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
}

.blogs-banner .content {
    width: 100%;
    padding-bottom: 34px;
}

.blogs-banner .container,
.event-banner .container,
.gallery-banner .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.blogs-banner .bread,
.event-banner .bread,
.gallery-banner .bread {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin: 0 0 14px;
}

.blogs-banner .bread a,
.event-banner .bread a,
.gallery-banner .bread a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.blogs-banner .bread a:hover,
.event-banner .bread a:hover,
.gallery-banner .bread a:hover {
    opacity: 0.8;
}

.blogs-banner .bread .current,
.event-banner .bread .current,
.gallery-banner .bread .current {
    color: rgba(255, 255, 255, 0.75);
}

.blogs-banner .page-heading,
.event-banner .page-heading,
.gallery-banner .page-heading {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: #fff;
}

.gradient-text {
    background: linear-gradient(135deg, #f9b949 0%, #ff8a00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}


/* =========================================================================
 * SECTION: SINGLE POST (single.php) — new design v2
 * Matches the /news-blogs/ archive banner style (gradient blue → maroon)
 * and a clean 2-column main + sidebar layout that stacks on mobile.
 * ========================================================================= */

/* ---- Banner ---- */
.sata-page-banner {
    width: 100%;
    min-height: 280px;
    padding: 80px 0 60px;
    background:
        radial-gradient(ellipse at top left, #2a3a78 0%, transparent 60%),
        linear-gradient(135deg, #1d2c5e 0%, #2a1410 100%);
    color: #fff;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.sata-page-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.sata-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.7);
}

.sata-breadcrumb a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.sata-breadcrumb a:hover {
    opacity: 0.85;
}

.sata-breadcrumb .current {
    color: #ff8a00;
    font-weight: 500;
    max-width: 60ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sata-breadcrumb i {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.sata-page-banner__title {
    margin: 0;
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    word-break: break-word;
    overflow-wrap: anywhere;
}


/* ---- 2-column shell ---- */
.sata-single-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

.sata-single-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 36px;
    align-items: start;
}


/* ---- Main article ---- */
.sata-single-main {
    min-width: 0;
}

.sata-single-article {
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04);
}

.sata-single-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid #eef0f5;
}

.sata-single-meta__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sata-single-meta__cats a {
    display: inline-block;
    padding: 5px 14px;
    background: #ff8a00;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s;
}

.sata-single-meta__cats a:hover {
    background: #e57600;
}

.sata-single-meta__row {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    font-size: 14px;
    color: #666;
}

.sata-single-meta__row i {
    margin-right: 6px;
    color: #2f4596;
}

.sata-single-thumb {
    margin: 0 0 24px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
}

.sata-single-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.sata-single-content {
    font-size: 16px;
    line-height: 1.75;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.sata-single-content > * {
    max-width: 100%;
}

.sata-single-content p {
    margin: 0 0 18px;
}

.sata-single-content h2,
.sata-single-content h3,
.sata-single-content h4 {
    color: #1d2c5e;
    margin: 28px 0 14px;
    line-height: 1.3;
}

.sata-single-content h2 { font-size: 24px; }
.sata-single-content h3 { font-size: 20px; }
.sata-single-content h4 { font-size: 18px; }

.sata-single-content a {
    color: #2f4596;
    text-decoration: underline;
}

.sata-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.sata-single-content ul,
.sata-single-content ol {
    margin: 0 0 18px;
    padding-left: 22px;
}

.sata-single-content blockquote {
    border-left: 4px solid #ff8a00;
    background: #fff8ef;
    padding: 14px 18px;
    margin: 16px 0;
    border-radius: 4px;
    color: #444;
    font-style: italic;
}


/* ---- Sidebar ---- */
.sata-single-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
    position: sticky;
    top: 24px;
}

.sata-side-card {
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.sata-side-card__title {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ff8a00;
    font-size: 18px;
    font-weight: 700;
    color: #1d2c5e;
}

.sata-side-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sata-side-list li {
    padding: 0;
    border-bottom: 1px solid #f0f2f7;
}

.sata-side-list li:last-child {
    border-bottom: 0;
}

.sata-side-list li a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 0;
    color: #333;
    text-decoration: none;
    font-size: 14.5px;
    line-height: 1.5;
    transition: color 0.2s;
}

.sata-side-list li a i {
    color: #ff8a00;
    margin-top: 4px;
    flex-shrink: 0;
    font-size: 12px;
}

.sata-side-list li a:hover {
    color: #2f4596;
}

.sata-side-list--recent li a {
    word-break: break-word;
    overflow-wrap: anywhere;
}


/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .sata-single-grid {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 28px;
    }
    .sata-single-article {
        padding: 26px;
    }
}

@media (max-width: 860px) {
    .sata-single-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .sata-single-sidebar {
        position: static;
    }
    .sata-page-banner {
        min-height: 200px;
        padding: 60px 0 40px;
    }
}

@media (max-width: 560px) {
    .sata-single-wrap {
        padding: 0 16px 40px;
    }
    .sata-single-article {
        padding: 20px;
        border-radius: 8px;
    }
    .sata-single-content { font-size: 15.5px; }
    .sata-single-content h2 { font-size: 21px; }
    .sata-single-content h3 { font-size: 18px; }
    .sata-page-banner__inner { padding: 0 16px; }
    .sata-breadcrumb { font-size: 13.5px; gap: 8px; }
    .sata-breadcrumb .current { max-width: 30ch; }
}


/* ---------- 3. Single post / event / gallery (LEGACY older v1) ---------- */

.single-post-container {
    padding-bottom: 40px;
}

.single-post-container .blog-page,
.single-post-container .event-page,
.single-post-container .gallery-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.single-post-container .row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.single-post-container .nv-index-posts {
    flex: 1 1 65%;
    min-width: 0;        /* prevents flex item from overflowing */
}

.single-post-container .sidebar-wrap {
    flex: 1 1 28%;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.single-post-container .nv-single-post-wrap.col {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.single-post-container .head-wrap {
    margin-bottom: 22px;
}

.single-post-container .post-title {
    font-size: 26px;
    line-height: 1.3;
    color: #1d2c5e;
    margin: 0 0 14px;
    font-weight: 700;
}

.single-post-container .post-title a {
    color: inherit;
    text-decoration: none;
}

.single-post-container .auther-category-wrap,
.single-post-container .blog-category-title {
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
}

.single-post-container .blog-thumbnail,
.single-post-container .event-thumbnail {
    margin: 18px 0 22px;
    border-radius: 8px;
    overflow: hidden;
}

.single-post-container .blog-content,
.single-post-container .event-content,
.single-post-container .gallery-content {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    word-wrap: break-word;
}

.single-post-container .blog-content p,
.single-post-container .event-content p,
.single-post-container .gallery-content p {
    margin: 0 0 16px;
}


/* =========================================================================
 * SECTION: GALLERY LISTING PAGE — v2
 * Polished card design used by [gallery_cards] shortcode.
 * Each card shows: title, date/location chips, 6-photo grid, "More Photos" CTA.
 * ========================================================================= */

.gallery-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
    margin-top: 8px;
}

.gallery-wrapper .gallery-item {
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 14px;
    padding: 28px 30px 26px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.gallery-wrapper .gallery-item:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Header row: title left, date+location chips right (wraps on mobile) */
.gallery-wrapper .gallery-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 2px solid #fff3e3;
}

.gallery-wrapper .gallery-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    color: #148e29;     /* matches the dark green you used in the screenshot */
    flex: 1 1 auto;
    min-width: 200px;
}

.gallery-wrapper .gallery-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.gallery-wrapper .gallery-title a:hover {
    color: #094914;
}

.gallery-wrapper .gallery-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-wrapper .gallery-details > div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #fff8ef;
    color: #b35e00;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid #ffe3b8;
}

.gallery-wrapper .gallery-details i {
    color: #ff8a00;
    font-size: 13px;
}

/* 6-photo grid — fills row width, no gaps in layout */
.gallery-wrapper .images-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.gallery-wrapper .gallery-images {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    background: #f5f5f5;
    cursor: zoom-in;
    isolation: isolate;
}

.gallery-wrapper .gallery-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-wrapper .gallery-images::after {
    content: "\f00e";    /* fa-magnifying-glass-plus */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    background: rgba(20, 142, 41, 0.0);
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.gallery-wrapper .gallery-images:hover img {
    transform: scale(1.08);
}

.gallery-wrapper .gallery-images:hover::after {
    opacity: 1;
    background: rgba(20, 142, 41, 0.55);
}

/* "More Photos" CTA — a real button */
.gallery-wrapper .more-photos-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #ff8a00 0%, #f4d331 100%);
    color: #fff;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(255, 138, 0, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-wrapper .more-photos-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 138, 0, 0.35);
}

.gallery-wrapper .more-photos-link i {
    transition: transform 0.2s;
}

.gallery-wrapper .more-photos-link:hover i {
    transform: translateX(4px);
}

/* Photos/Videos tab pills (Elementor outputs them as buttons inside the page) */
.elementor-tab-title,
.tab-pill {
    display: inline-flex;
    align-items: center;
    padding: 10px 28px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #ffe3b8;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.elementor-tab-title.elementor-active,
.tab-pill.is-active {
    background: linear-gradient(135deg, #ff8a00 0%, #f4d331 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(255, 138, 0, 0.3);
}


/* ============= GALLERY LISTING — Responsive ============= */
@media (max-width: 720px) {
    .gallery-wrapper .gallery-item {
        padding: 22px 18px 20px;
    }
    .gallery-wrapper .gallery-title { font-size: 22px; }
    .gallery-wrapper .images-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .gallery-wrapper .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 420px) {
    .gallery-wrapper .images-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .gallery-wrapper .gallery-title { font-size: 20px; }
}


/* =========================================================================
 * SECTION: SINGLE GALLERY PAGE (single-gallery.php) — v2
 * Banner + meta + full photo grid with hover overlay.
 * Reuses .sata-page-banner from the single-post styles for consistency.
 * ========================================================================= */

.gallery-content-wrap .head-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 2px solid #fff3e3;
}

.gallery-content-wrap .head-wrap .post-title {
    margin: 0;
    color: #148e29;
    font-size: 28px;
    font-weight: 700;
    flex: 1 1 auto;
}

.gallery-content-wrap .gallery-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-content-wrap .gallery-details > div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #fff8ef;
    color: #b35e00;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid #ffe3b8;
}

.gallery-content-wrap .gallery-details i {
    color: #ff8a00;
}

/* Full photo grid (single gallery view) */
.gallery-content-wrap .images-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 8px 0 30px;
}

.gallery-content-wrap .gallery-image {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background: #f5f5f5;
    cursor: zoom-in;
    isolation: isolate;
}

.gallery-content-wrap .gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-content-wrap .gallery-image::after {
    content: "\f00e";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    background: rgba(20, 142, 41, 0);
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.gallery-content-wrap .gallery-image:hover img {
    transform: scale(1.08);
}

.gallery-content-wrap .gallery-image:hover::after {
    opacity: 1;
    background: rgba(20, 142, 41, 0.55);
}

@media (max-width: 960px) {
    .gallery-content-wrap .images-wrapper {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .gallery-content-wrap .images-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .gallery-content-wrap .head-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
    .gallery-content-wrap .head-wrap .post-title {
        font-size: 23px;
    }
}


/* =========================================================================
 * SECTION: EVENTS LISTING — v2
 * Premium card design with image (top), date ribbon, title, meta chips, CTA.
 * Used by [Events_Home_card] and [Events_Cards_page] shortcodes.
 * ========================================================================= */

.events-wrap:not(.owl-carousel):not(.slick) {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    margin-top: 8px;
}

@media (max-width: 991px) {
    .events-wrap:not(.owl-carousel):not(.slick) {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .events-wrap:not(.owl-carousel):not(.slick) {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

.events-wrap .event-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    isolation: isolate;
}

.events-wrap .event-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
}

/* Image — fixed aspect ratio + subtle zoom on hover */
.events-wrap .event-item .image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #1d2c5e 0%, #2f4596 100%);
    position: relative;
}

.events-wrap .event-item .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.events-wrap .event-item:hover .image img {
    transform: scale(1.05);
}

/* Soft gradient over the image bottom for date-ribbon legibility */
.events-wrap .event-item .image::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 50%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.events-wrap .event-item:hover .image::after {
    opacity: 1;
}

/* Body */
.events-wrap .event-item .content {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-grow: 1;
}

.events-wrap .event-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
}

.events-wrap .event-title a {
    color: #1d2c5e;
    text-decoration: none;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.events-wrap .event-title a:hover {
    color: #ff8a00;
}

/* Meta — date / time / location as soft chips on their own line */
.events-wrap .event-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13.5px;
    color: #555;
}

.events-wrap .event-details p {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 6px 12px 6px 0;
    background: transparent;
    border-radius: 6px;
}

.events-wrap .event-details i {
    color: #ff8a00;
    width: 16px;
    text-align: center;
    font-size: 13px;
    flex-shrink: 0;
}

/* CTA */
.events-wrap .details-btn {
    margin-top: auto;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    background: linear-gradient(135deg, #2f4596 0%, #1d2c5e 100%);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    box-shadow: 0 4px 12px rgba(47, 69, 150, 0.2);
}

.events-wrap .details-btn::after {
    content: "\f178";  /* fa-arrow-right-long */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform 0.2s;
}

.events-wrap .details-btn:hover {
    background: linear-gradient(135deg, #ff8a00 0%, #f4d331 100%);
    box-shadow: 0 8px 18px rgba(255, 138, 0, 0.3);
    transform: translateY(-2px);
}

.events-wrap .details-btn:hover::after {
    transform: translateX(4px);
}

/* Empty state */
.events-wrap > p {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: #888;
    font-size: 16px;
    background: #fafbfd;
    border: 1px dashed #d5dbe8;
    border-radius: 10px;
}


/* ============= EVENTS — Home carousel variant ============= */
.events-wrap.home-wrap.owl-carousel .event-item {
    margin: 0;
}

/* ============= EVENTS — Responsive ============= */
@media (max-width: 720px) {
    .events-wrap:not(.owl-carousel):not(.slick) {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .events-wrap .event-item .content {
        padding: 18px 18px 20px;
    }
    .events-wrap .event-title {
        font-size: 17px;
    }
}


/* ---------- 5. Gallery listing ---------- */

.gallery-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.gallery-wrapper .gallery-item {
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 8px;
    padding: 20px;
}

.gallery-wrapper .gallery-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef0f5;
}

.gallery-wrapper .gallery-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.gallery-wrapper .gallery-title a {
    color: #1d2c5e;
    text-decoration: none;
}

.gallery-wrapper .gallery-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13.5px;
    color: #555;
}

.gallery-wrapper .gallery-details > div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gallery-wrapper .images-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.gallery-wrapper .gallery-images {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
}

.gallery-wrapper .gallery-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.gallery-wrapper .gallery-images:hover img {
    transform: scale(1.06);
}

.gallery-wrapper .more-photos-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: #2f4596;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.gallery-wrapper .more-photos-link:hover {
    text-decoration: underline;
}


/* ---------- 6. Single Gallery — image grid ---------- */

.gallery-content-wrap .images-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 18px 0 24px;
}

.gallery-content-wrap .gallery-image {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
}

.gallery-content-wrap .gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ---------- 7. Roles cards ---------- */

.roles-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

.roles-wrapper .role-item {
    background: #fff;
    padding: 20px;
    border: 1px solid #e6e8ee;
    border-radius: 8px;
    text-align: center;
}

.roles-wrapper .role-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 14px;
    color: #2f4596;
}

.roles-wrapper .role-img {
    margin: 0 auto 14px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
}

.roles-wrapper .role-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.roles-wrapper .role-content {
    font-size: 14px;
    line-height: 1.55;
    color: #555;
}


/* ---------- 8. Sponsors carousel ---------- */

.sponsors-wrap .sponsor-item {
    padding: 10px;
}

.sponsors-wrap .sponsor-item .image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 2;
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 6px;
    padding: 10px;
}

.sponsors-wrap .sponsor-item img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    filter: grayscale(20%);
    transition: filter 0.3s;
}

.sponsors-wrap .sponsor-item:hover img {
    filter: grayscale(0);
}


/* ---------- 9. Pagination ---------- */

.pagination-custom {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 32px 0 20px;
}

.pagination-custom .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d5dbe8;
    border-radius: 6px;
    color: #2f4596;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.pagination-custom .page-numbers.current,
.pagination-custom .page-numbers:hover {
    background: #2f4596;
    color: #fff;
    border-color: #2f4596;
}


/* ---------- 10. Sidebar widgets ---------- */

.sidebar-wrap > div {
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 8px;
    padding: 18px;
}

.sidebar-wrap h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1d2c5e;
}

.sidebar-wrap ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-wrap ul li {
    border-bottom: 1px solid #f0f2f7;
    padding: 8px 0;
}

.sidebar-wrap ul li:last-child {
    border-bottom: 0;
}

.sidebar-wrap ul li a {
    color: #2f4596;
    text-decoration: none;
    font-size: 14px;
}

.sidebar-wrap ul li a:hover {
    text-decoration: underline;
}


/* ---------- 11. Loader ----------
 * Superseded by the "ROUND 16 — LOADING SCREEN" section in css/cpt-modern.css,
 * which loads after this file. Only the wrapper's positioning + fade-out live
 * here now; the old .loader/.flower/.nameste rules were removed with the
 * markup they styled (see header.php).
 * ------------------------------------------------------------------------- */

.loader-wrapper {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-wrapper.is-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}


/* ---------- 12. Search results ---------- */

.search-results-wrap .content-wrap {
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 18px;
    align-items: start;
}

.search-results-wrap .post-img {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: #f5f5f5;
}

.search-results-wrap .post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-results-wrap .post-title a {
    font-size: 18px;
    font-weight: 600;
    color: #1d2c5e;
    text-decoration: none;
}


/* ---------- 13. Responsive guards ---------- */

@media (max-width: 960px) {
    .single-post-container .row {
        flex-direction: column;
    }
    .single-post-container .nv-index-posts,
    .single-post-container .sidebar-wrap {
        flex: 1 1 100%;
    }
}

@media (min-width: 721px) {
    /* Force the news/blogs archive into a real responsive grid up to and past tablet sizes. */
    html body .blog-wrap.blogs-page .posts-wrapper,
    html body.archive .blog-wrap.blogs-page .posts-wrapper,
    html body.blog .blog-wrap.blogs-page .posts-wrapper {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    html body .blog-wrap.blogs-page .posts-wrapper,
    html body.archive .blog-wrap.blogs-page .posts-wrapper,
    html body.blog .blog-wrap.blogs-page .posts-wrapper {
        grid-template-columns: 1fr !important;
    }
    .events-wrap:not(.owl-carousel):not(.slick) {
        grid-template-columns: 1fr;
    }
    .roles-wrapper {
        grid-template-columns: 1fr;
    }
    .search-results-wrap .content-wrap {
        grid-template-columns: 1fr;
    }
    .gallery-wrapper .gallery-header {
        flex-direction: column;
    }
    .blogs-banner,
    .event-banner,
    .gallery-banner {
        padding: 40px 0;
        min-height: 160px;
    }
}

@media (max-width: 480px) {
    .gallery-wrapper .images-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-content-wrap .images-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ---------- 14. Stop clearing collisions / float bugs ---------- */

.posts-wrapper::before,
.posts-wrapper::after,
.row::before,
.row::after,
.blog-wrap::before,
.blog-wrap::after {
    content: none !important;
    display: none !important;
}


/* ---------- 15. Container max-width safety ---------- */

.blog-page,
.event-page,
.gallery-page {
    width: 100%;
}

.blog-page > *,
.event-page > *,
.gallery-page > * {
    max-width: 100%;
}

.posts-wrapper>article {
    width: 100% !important;
}