/* Add your custom styles here */
/* ===== EVENT LANDING PAGE: Events Calendar ===== */

/* =========================================================
   NEWS & EVENTS SECTION
   Article Landing Pages, Event Landing Page, Hero, Detail
   ========================================================= */


/* ===== HERO BANNERS ===== */

body.crx-articleindexpage .hero-bg,
body.crx-eventindexpage .hero-bg,
body.crx-webpage .hero-bg {
    min-height: 260px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
}

body.crx-articleindexpage .hero-bg h1,
body.crx-eventindexpage .hero-bg h1,
body.crx-webpage .hero-bg h1 {
    color: #fff;
    font-size: 2.4rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* ===== RI object / catalogue hero ===== */

.ri-object-hero {
    min-height: 260px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
}

.ri-object-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.20);
}

.ri-object-hero-fg {
    width: 100%;
    padding: 70px 0;
    background: transparent;
    position: relative;
    z-index: 1;
}

.ri-object-hero h1 {
    color: #ffffff;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

/* ===== ARTICLE LANDING PAGES: News / Calls / Announcements ===== */

body.crx-articleindexpage .crx-grid {
    max-width: 1120px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem 1.5rem;
}

/* Apply grid only to rows that contain cards */
body.crx-articleindexpage .crx-grid > .row:has(.card) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Columns that contain cards */
body.crx-articleindexpage .crx-grid > .row:has(.card) > [class*="col-"]:has(.card) {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Columns without cards: intro text, headings, explanatory blocks */
body.crx-articleindexpage .crx-grid > .row:has(.card) > [class*="col-"]:not(:has(.card)) {
    grid-column: 1 / -1;
    width: 100% !important;
    max-width: 900px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Cards */
body.crx-articleindexpage .card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 0.4rem;
    overflow: hidden;
    background: #fff;
}

body.crx-articleindexpage .card-img-top {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover;
    object-position: center;
    display: block;
}

body.crx-articleindexpage .card-body {
    flex: 1;
    padding: 1rem;
}

body.crx-articleindexpage .card-title,
body.crx-articleindexpage .card h2,
body.crx-articleindexpage .card h3,
body.crx-articleindexpage .card h4 {
    font-size: 1.15rem;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

body.crx-articleindexpage .card-text,
body.crx-articleindexpage .card-body p {
    line-height: 1.5;
}

body.crx-articleindexpage .card-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid #ddd;
    background: #f7f7f7;
}

body.crx-articleindexpage .card-footer .btn,
body.crx-articleindexpage .card .btn {
    border-radius: 0.3rem;
}


/* ===== EVENT LANDING PAGE: Events Calendar ===== */

body.crx-eventindexpage .crx-grid {
    max-width: 1120px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem 1.5rem;
}

/* Apply grid only to rows that contain cards */
body.crx-eventindexpage .crx-grid > .row:has(.card) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Columns that contain event cards */
body.crx-eventindexpage .crx-grid > .row:has(.card) > [class*="col-"]:has(.card) {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Columns without cards: intro text, headings */
body.crx-eventindexpage .crx-grid > .row:has(.card) > [class*="col-"]:not(:has(.card)) {
    grid-column: 1 / -1;
    width: 100% !important;
    max-width: 900px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.crx-eventindexpage .card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 0.4rem;
    overflow: hidden;
    background: #fff;
}

body.crx-eventindexpage .card-img-top {
    width: 100% !important;
    height: 180px !important;
    object-fit: cover;
    object-position: center;
    display: block;
}

body.crx-eventindexpage .card-body {
    flex: 1;
    padding: 1rem;
}

body.crx-eventindexpage .card-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid #ddd;
    background: #f7f7f7;
}


/* ===== Hide dates in Article Landing lists ===== */

body.crx-articleindexpage time,
body.crx-articleindexpage .date,
body.crx-articleindexpage .article-date,
body.crx-articleindexpage .article-meta,
body.crx-articleindexpage .text-muted,
body.crx-articlelandingpage time,
body.crx-articlelandingpage .date,
body.crx-articlelandingpage .article-date,
body.crx-articlelandingpage .article-meta,
body.crx-articlelandingpage .text-muted {
    display: none !important;
}


/* ===== ARTICLE DETAIL PAGES ===== */

/* ===== ARTICLE DETAIL PAGES ===== */

body.crx-articlepage #content,
body.crx-articlepage .crx-grid {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem 1.5rem;
}

body.crx-articlepage h1 {
    max-width: 1000px;
    margin-bottom: 2rem;
}

body.crx-articlepage p,
body.crx-articlepage li {
    font-size: 1.05rem;
    line-height: 1.7;
}

body.crx-articlepage .richtext-image,
body.crx-articlepage .block-image img,
body.crx-articlepage figure img {
    display: block;
    width: 100%;
    max-width: 760px;
    height: auto;
    object-fit: contain;
    margin: 2rem auto 0.75rem auto;
}

body.crx-articlepage figure {
    max-width: 760px;
    margin: 2rem auto;
}

body.crx-articlepage figcaption {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    margin-top: 0.4rem;
}


/* ===== EVENT DETAIL PAGES ===== */

/* ===== EVENT DETAIL PAGES ===== */

body.crx-eventpage #content,
body.crx-eventpage .crx-grid {
    max-width: 1120px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem 1.5rem;
}

body.crx-eventpage .hero-bg {
    min-height: 220px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
}

body.crx-eventpage .hero-bg h1 {
    color: #fff;
    font-size: 2.3rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

body.crx-eventpage img {
    max-width: 520px;
    height: auto;
}


/* ===== Responsive card grids ===== */

@media (max-width: 992px) {
    body.crx-articleindexpage .crx-grid > .row:has(.card),
    body.crx-eventindexpage .crx-grid > .row:has(.card) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body.crx-articleindexpage .crx-grid > .row:has(.card),
    body.crx-eventindexpage .crx-grid > .row:has(.card) {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   NEWS PAGE FIXES
   Fix hero title alignment and remove excessive blank card space
   ========================================================= */


/* Keep hero title aligned with the main content column */
/* ===== HERO TITLE ALIGNMENT ===== */

body.crx-webpage .hero-bg,
body.crx-articleindexpage .hero-bg,
body.crx-eventindexpage .hero-bg {
    box-sizing: border-box;
    padding-left: max(1.5rem, calc((100vw - 1120px) / 2 + 1.5rem));
    padding-right: 1.5rem;
}


/* Do not stretch article landing cards vertically */
body.crx-articleindexpage .crx-grid > .row:has(.card) {
    align-items: start;
}


/* Let cards keep natural height instead of filling the whole grid row */
body.crx-articleindexpage .card {
    height: auto;
    min-height: 0;
}


/* Let card body use natural height */
body.crx-articleindexpage .card-body {
    flex: 0 1 auto;
}


/* Do not push footer to the bottom if this creates a large blank area */
body.crx-articleindexpage .card-footer {
    margin-top: 0;
}
/* ===== DMRI footer ===== */

.dm-footer {
    margin-top: 3rem;
    padding: 1.5rem 0 !important;
    background: #0b1f3a;
    color: #ffffff;
    font-size: 0.95rem;
}

/* Reduce internal CRX spacing */
.dm-footer .container,
.dm-footer .container-fluid,
.dm-footer .crx-grid {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.dm-footer .row {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    row-gap: 0.75rem;
}

.dm-footer [class*="col"] {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Footer headings */
.dm-footer h1,
.dm-footer h2,
.dm-footer h3,
.dm-footer h4,
.dm-footer h5,
.dm-footer h6 {
    color: #ffffff;
    font-weight: 700;
    margin-top: 0 !important;
    margin-bottom: 0.45rem !important;
    line-height: 1.2;
}

/* Main footer title */
.dm-footer h2:first-child,
.dm-footer h3:first-child {
    margin-bottom: 1.2rem !important;
}

/* Footer text */
.dm-footer p {
    color: rgba(255, 255, 255, 0.86);
    margin-bottom: 0.25rem !important;
    line-height: 1.45;
}

.dm-footer a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
}

.dm-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}
/* ===== Sticky footer layout ===== */

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > nav.navbar {
    flex: 0 0 auto;
    width: 100%;
}

#content {
    flex: 0 0 auto;
    width: 100%;
}

#content-walls {
    flex: 1 0 auto;
    width: 100%;
}

footer,
.dm-footer {
    flex: 0 0 auto;
    width: 100%;
}

/* Header / navbar must keep normal layout */
body > nav.navbar {
    flex: 0 0 auto;
    width: 100%;
}

/* Empty CRX content wrapper should not take vertical space */
#content {
    flex: 0 0 auto;
    width: 100%;
}

/* Main rendered page content */
#content-walls {
    flex: 1 0 auto;
    width: 100%;
}

/* Footer */
footer,
.dm-footer {
    flex: 0 0 auto;
    width: 100%;
}
/* Hide dates in Related cards on article/service pages */

#carousel-1,
#carousel-1 .carousel-inner,
#carousel-1 .carousel-item {
    height: 480px;
}

#carousel-1 .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}
/* ===== NORMAL PAGE TITLES FOR NEWS & EVENTS INDEX PAGES ===== */

body.crx-articleindexpage #content > h1,
body.crx-articleindexpage #content > .container > h1,
body.crx-articleindexpage #content > .container-fluid > h1,
body.crx-eventindexpage #content > h1,
body.crx-eventindexpage #content > .container > h1,
body.crx-eventindexpage #content > .container-fluid > h1 {
    max-width: 1120px;
    margin: 3rem auto 2rem auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ===== Navbar alignment ===== */

body > nav.navbar {
    flex: 0 0 auto;
    width: 100%;
}

/* Keep navbar content aligned with main page container */
body > nav.navbar .container,
body > nav.navbar .container-fluid {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
/* =========================================================
   ARTICLE INDEX CHILD PAGE CARDS
   Auto-generated cards from Layout -> Show Child Pages
   ========================================================= */

body.crx-articleindexpage #content > .container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem 1.5rem;
}

/* CRX renders child articles inside one Bootstrap column.
   Make that inner column the card grid. */
body.crx-articleindexpage #content > .container > .row > [class*="col-"]:has(.card) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;

    width: 100% !important;
    max-width: none !important;
    flex: 0 0 100% !important;

    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Remove Bootstrap row side offsets */
body.crx-articleindexpage #content > .container > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Card layout */
body.crx-articleindexpage #content > .container .card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    margin: 0 !important;
    border: 1px solid #ddd;
    border-radius: 0.4rem;
    overflow: hidden;
    background: #fff;
}

/* Cover image from Article Page */
body.crx-articleindexpage #content > .container .card-img-top {
    width: 100% !important;
    height: 220px !important;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Card body */
body.crx-articleindexpage #content > .container .card-body {
    padding: 1rem;
}

/* Title */
body.crx-articleindexpage #content > .container .card-title {
    font-size: 1.15rem;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

body.crx-articleindexpage #content > .container .card-title a {
    text-decoration: none;
}

body.crx-articleindexpage #content > .container .card-title a:hover {
    text-decoration: underline;
}

/* Date */
body.crx-articleindexpage #content > .container .card-body > p.card-text:first-of-type {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.75rem;
}

/* Excerpt */
body.crx-articleindexpage #content > .container .card-body > p.card-text:nth-of-type(2) {
    line-height: 1.5;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 992px) {
    body.crx-articleindexpage #content > .container > .row > [class*="col-"]:has(.card) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body.crx-articleindexpage #content > .container > .row > [class*="col-"]:has(.card) {
        grid-template-columns: 1fr;
    }
}
/* ============================================================
   RI CONSORTIUM TEMPLATE — CUSTOM PAGE MODELS
   ============================================================ */

/* Main page container */
.ri-page {
    max-width: 1120px;
    margin: 0 auto;
    padding-top: 2.5rem;
    padding-bottom: 4rem;
}

/* Page titles */
.ri-page h1 {
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Lead text */
.ri-page .lead {
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

/* General spacing for headings inside RI pages */
.ri-page h2 {
    margin-top: 2rem;
    margin-bottom: 0.85rem;
    font-size: 1.55rem;
}

.ri-page h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Cards in index/category pages */
.ri-page .card {
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
}

.ri-page .card-body {
    padding: 1.25rem;
}

.ri-page .card h2,
.ri-page .card .h5 {
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    line-height: 1.35;
}

.ri-page .card a {
    text-decoration: none;
}

.ri-page .card a:hover {
    text-decoration: underline;
}

/* Partner logo / images in cards */
.ri-page .card-img-top {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 1rem;
}

/* Large logo on partner page */
.ri-partner-page img.img-fluid {
    max-height: 260px;
    object-fit: contain;
    display: block;
    margin: 0 auto 2rem auto;
}

/* Facts box: service category, hosting partner, facility status etc. */
.ri-facts {
    margin: 1.5rem 0 2rem 0;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-left: 4px solid #0d6efd;
    border-radius: 6px;
}

.ri-facts p {
    margin-bottom: 0.5rem;
}

.ri-facts p:last-child {
    margin-bottom: 0;
}

/* Lists on service/resource pages */
.ri-service-page ul,
.ri-resource-page ul,
.ri-facility-page ul,
.ri-partner-page ul {
    margin-bottom: 1.5rem;
}

.ri-service-page li,
.ri-resource-page li {
    margin-bottom: 0.35rem;
}

/* Long rich text areas */
.ri-service-page p,
.ri-resource-page p,
.ri-facility-page p,
.ri-partner-page p {
    line-height: 1.6;
}
/* ===== RI SERVICE PAGE COVER IMAGE ===== */

.ri-service-cover {
    max-width: 960px;
    margin: 1.5rem auto 2rem auto;
    text-align: center;
}

.ri-service-cover-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 0.35rem;
}

/* Metadata text in cards */
.ri-meta {
    font-size: 0.95rem;
    color: #555;
    margin-top: 0.75rem;
}

/* Better mobile spacing */
@media (max-width: 768px) {
    .ri-page {
        padding-top: 1.5rem;
        padding-bottom: 2.5rem;
    }

    .ri-page .card-img-top {
        height: 140px;
    }

    .ri-page h1 {
        font-size: 1.8rem;
    }
}

/* ===== RI PILOT CHAIN PAGES ===== */

.ri-pilot-chain-index-page,
.ri-pilot-chain-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem 1.5rem;
}

.ri-pilot-chain-page .ri-page-header,
.ri-pilot-chain-index-page .ri-page-header {
    margin-bottom: 2rem;
}

.ri-pilot-chain-page .ri-page-header h1,
.ri-pilot-chain-index-page .ri-page-header h1 {
    text-align: left;
    margin-bottom: 1rem;
}

.ri-page-summary,
.ri-page-intro {
    max-width: 900px;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.ri-pilot-chain-page .ri-section {
    max-width: 920px;
    margin-bottom: 2.25rem;
}

.ri-pilot-chain-page .ri-section h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.55rem;
}

.ri-pilot-chain-page .ri-section h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.ri-pilot-chain-page .ri-section p,
.ri-pilot-chain-page .ri-section li {
    line-height: 1.6;
}

.ri-linked-objects {
    max-width: 920px;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.ri-linked-group {
    margin-bottom: 1.5rem;
}

.ri-linked-group ul {
    margin-top: 0.5rem;
}

/* ===== RI PILOT CHAIN INDEX CARDS ===== */

.ri-pilot-chain-index-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem 1.5rem;
}

.ri-pilot-chain-index-page .ri-page-header {
    max-width: 900px;
    margin-bottom: 2rem;
}

.ri-pilot-chain-index-page .ri-page-header h1 {
    margin-bottom: 1rem;
}

.ri-pilot-chain-index-page .ri-page-intro {
    max-width: 900px;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Grid */
.ri-pilot-chain-index-page .ri-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

/* Card */
.ri-pilot-chain-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background: #fff;
}

/* Image area */
.ri-card-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    overflow: hidden;
}

.ri-card-image {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: contain;
}


/* Card body */
.ri-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem;
}

/* Title */
.ri-pilot-chain-card h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    line-height: 1.25;
}

/* Summary text */
.ri-pilot-chain-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.45;
}

/* Limit long summaries on cards */
.ri-pilot-chain-card .ri-card-body > p {
    display: -webkit-box;

    /* standard */
    line-clamp: 6;

    /* browser support */
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

/* Bottom link */
.ri-card-link {
    margin-top: auto;
    padding-top: 1rem;
}
@media (max-width: 992px) {
    .ri-pilot-chain-index-page .ri-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ri-pilot-chain-index-page .ri-card-grid {
        grid-template-columns: 1fr;
    }

    .ri-pilot-chain-index-page {
        padding: 2rem 1rem 3rem 1rem;
    }
}
/* ===== RI REVERSE LINKS TO PILOT CHAINS ===== */

.ri-used-in-pilot-chains {
    max-width: 920px;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.ri-used-in-pilot-chains h2 {
    margin-bottom: 1rem;
    font-size: 1.45rem;
}

.ri-used-in-pilot-chains ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
}

.ri-used-in-pilot-chains li {
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

/* ===== TRAINING CATALOGUE ===== */

.training-catalogue-page,
.training-item-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem 1.5rem;
}

.training-page-header {
    max-width: 900px;
    margin-bottom: 2rem;
}

.training-page-header h1,
.training-item-page h1 {
    margin-bottom: 1rem;
}

.training-page-intro,
.training-item-lead {
    max-width: 900px;
    font-size: 1.05rem;
    line-height: 1.6;
}

.training-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.training-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background: #fff;
    overflow: hidden;
}

.training-card-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
}

.training-card-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
}

.training-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem;
}

.training-card h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    line-height: 1.3;
}

.training-card p {
    line-height: 1.5;
}

.training-card-meta {
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.training-card-meta p {
    margin-bottom: 0.25rem;
}

.training-tags {
    margin-top: 0.75rem;
}

.training-tags span {
    display: inline-block;
    margin: 0 0.35rem 0.35rem 0;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: #f1f3f5;
    font-size: 0.85rem;
}

.training-card-link {
    margin-top: auto;
    padding-top: 1rem;
}

.training-facts {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #0d6efd;
    background: #f8f9fa;
}

.training-facts p {
    margin-bottom: 0.4rem;
}

.training-item-cover {
    display: block;
    max-width: 900px;
    width: 100%;
    height: auto;
    margin: 1rem auto 2rem auto;
}

.training-body {
    margin-top: 2rem;
}

.training-section {
    margin-top: 2rem;
}

@media (max-width: 991.98px) {
    .training-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .training-card-grid {
        grid-template-columns: 1fr;
    }

    .training-catalogue-page,
    .training-item-page {
        padding: 2rem 1rem 3rem 1rem;
    }
}
/* ===== TRAINING FILTERS ===== */

.training-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 1.5rem 0 2rem 0;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background: #f8f9fa;
}

.training-filter-input,
.training-filter-select {
    min-width: 180px;
    padding: 0.45rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 0.35rem;
}

.training-filter-input {
    flex: 1 1 240px;
}

.training-filter-button {
    padding: 0.45rem 0.9rem;
    border: 1px solid #0d6efd;
    border-radius: 0.35rem;
    background: #0d6efd;
    color: #fff;
    cursor: pointer;
}

.training-filter-reset {
    padding: 0.45rem 0.6rem;
}
/* ===== Home page: What we offer cards ===== */

.home-offer-card {
    height: 100%;
}

.home-offer-card.card,
.home-offer-card .card {
    height: 100%;
}

.home-offer-card .card-img-top,
.home-offer-card > img,
.home-offer-card img.card-img-top {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: center;
}

.home-offer-card .card-body {
    padding: 1rem;
    min-height: 80px;
}

.home-offer-card .card-footer {
    padding: 1rem;
}

/* базовий заголовок-посилання */
.home-offer-card .card-body a {
    font-size: 1.05rem;
    line-height: 1.3;
    font-weight: 700;
}

/* керування розміром заголовка з адмінки */
.offer-title-sm .card-body a {
    font-size: 0.95rem !important;
}

.offer-title-md .card-body a {
    font-size: 1.05rem !important;
}

.offer-title-lg .card-body a {
    font-size: 1.25rem !important;
}

.offer-title-xl .card-body a {
    font-size: 1.45rem !important;
}
/* ===== Pilot example cards ===== */

.pilot-example-card.card,
.pilot-example-card .card {
    height: auto !important;
    min-height: 0 !important;
}

.pilot-example-card .card-img-top,
.pilot-example-card img.card-img-top {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: center;
}

.pilot-example-card .card-body {
    padding: 1rem;
    min-height: 0 !important;
}

.pilot-example-card .card-footer {
    padding: 1rem;
}

/* Pilot example title sizes */
.pilot-title-md .card-body a,
.pilot-title-md .card-title a,
.pilot-title-md .card-title {
    font-size: 1.05rem !important;
    line-height: 1.3;
    font-weight: 700;
}

.pilot-title-lg .card-body a,
.pilot-title-lg .card-title a,
.pilot-title-lg .card-title {
    font-size: 1.2rem !important;
    line-height: 1.3;
    font-weight: 700;
}

.pilot-title-xl .card-body a,
.pilot-title-xl .card-title a,
.pilot-title-xl .card-title {
    font-size: 1.35rem !important;
    line-height: 1.3;
    font-weight: 700;
}
/* ===== Home carousel: base layout ===== */

#carousel-1,
#carousel-1 .carousel-inner,
#carousel-1 .carousel-item {
    height: 480px;
}

#carousel-1 .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* ===== Home carousel: caption base ===== */

#carousel-1 .carousel-caption {
    top: 50% !important;
    bottom: auto !important;
    left: 15% !important;
    right: 15% !important;
    transform: translateY(-50%) !important;
    text-align: center !important;
    z-index: 20 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45) !important;
}

/* ===== Home carousel: left caption ===== */

#carousel-1 .carousel-item.hero-caption-left .carousel-caption {
    left: 8% !important;
    right: auto !important;
    width: min(720px, 45vw) !important;
    max-width: 720px !important;
    text-align: left !important;
}

/* ===== Home carousel: right caption ===== */

#carousel-1 .carousel-item.hero-caption-right .carousel-caption {
    left: auto !important;
    right: 8% !important;
    width: min(720px, 45vw) !important;
    max-width: 720px !important;
    text-align: right !important;
}

/* ===== Home carousel: button ===== */

#carousel-1 .carousel-caption .btn,
#carousel-1 .carousel-caption a.btn {
    position: relative !important;
    z-index: 30 !important;
    font-size: 1.15rem !important;
    padding: 0.75rem 1.4rem !important;
    font-weight: 600 !important;
    pointer-events: auto !important;
}

/* ===== Home carousel: keep arrow zones narrow ===== */

#carousel-1 .carousel-control-prev,
#carousel-1 .carousel-control-next {
    width: 5% !important;
    z-index: 10 !important;
}
/* ===== Carousel caption left positioning ===== */

#carousel-1 .carousel-caption.hero-caption-left,
#carousel-1 .carousel-item.hero-caption-left .carousel-caption,
#carousel-1 .hero-caption-left .carousel-caption {
    left: 10% !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    text-align: left !important;
    max-width: 760px !important;
}

/* Якщо hero-caption-left потрапив не на caption, а на сам текст */
#carousel-1 .carousel-caption:has(.hero-caption-left) {
    left: 10% !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    text-align: left !important;
    max-width: 760px !important;
}

#carousel-1 .carousel-caption.hero-caption-left *,
#carousel-1 .carousel-caption:has(.hero-caption-left) *,
#carousel-1 .carousel-item.hero-caption-left .carousel-caption *,
#carousel-1 .hero-caption-left .carousel-caption * {
    text-align: left !important;
}
/* ===== Carousel caption positioning by slide class ===== */

.carousel-item.hero-caption-left .carousel-caption {
    left: 8% !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    text-align: left !important;
    max-width: 760px !important;
}

.carousel-item.hero-caption-center .carousel-caption {
    left: 15% !important;
    right: 15% !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    text-align: center !important;
}

.carousel-item.hero-caption-right .carousel-caption {
    left: auto !important;
    right: 8% !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    text-align: right !important;
    max-width: 760px !important;
}

.carousel-item.hero-caption-left .carousel-caption *,
.carousel-item.hero-caption-left .carousel-caption .rich-text,
.carousel-item.hero-caption-left .carousel-caption p,
.carousel-item.hero-caption-left .carousel-caption h1,
.carousel-item.hero-caption-left .carousel-caption h2,
.carousel-item.hero-caption-left .carousel-caption h3 {
    text-align: left !important;
}

.carousel-item.hero-caption-right .carousel-caption *,
.carousel-item.hero-caption-right .carousel-caption .rich-text,
.carousel-item.hero-caption-right .carousel-caption p,
.carousel-item.hero-caption-right .carousel-caption h1,
.carousel-item.hero-caption-right .carousel-caption h2,
.carousel-item.hero-caption-right .carousel-caption h3 {
    text-align: right !important;
}
/* ===== Ukrainian home carousel caption ===== */

.carousel-item.hero-caption-left-uk .carousel-caption {
    left: 8% !important;
    right: auto !important;
    top: 52% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    text-align: left !important;
    max-width: 980px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.carousel-item.hero-caption-left-uk .carousel-caption p,
.carousel-item.hero-caption-left-uk .carousel-caption h1,
.carousel-item.hero-caption-left-uk .carousel-caption h2,
.carousel-item.hero-caption-left-uk .carousel-caption h3 {
    font-size: clamp(2.1rem, 3.2vw, 3.6rem) !important;
    line-height: 1.12 !important;
    font-weight: 700 !important;
    text-align: left !important;
    margin-bottom: 1rem !important;
}

.carousel-item.hero-caption-left-uk .carousel-caption .btn {
    font-size: 0.95rem !important;
    padding: 0.5rem 1rem !important;
}

/* Medium screens */
@media (max-width: 1100px) {
    .carousel-item.hero-caption-left-uk .carousel-caption {
        left: 7% !important;
        top: 53% !important;
        max-width: 760px !important;
    }

    .carousel-item.hero-caption-left-uk .carousel-caption p,
    .carousel-item.hero-caption-left-uk .carousel-caption h1,
    .carousel-item.hero-caption-left-uk .carousel-caption h2,
    .carousel-item.hero-caption-left-uk .carousel-caption h3 {
        font-size: clamp(2rem, 3.8vw, 3rem) !important;
        line-height: 1.1 !important;
        margin-bottom: 0.85rem !important;
    }
}

/* Narrow preview / tablet */
@media (max-width: 900px) {
    .carousel-item.hero-caption-left-uk .carousel-caption {
        left: 6% !important;
        top: 54% !important;
        max-width: 650px !important;
    }

    .carousel-item.hero-caption-left-uk .carousel-caption p,
    .carousel-item.hero-caption-left-uk .carousel-caption h1,
    .carousel-item.hero-caption-left-uk .carousel-caption h2,
    .carousel-item.hero-caption-left-uk .carousel-caption h3 {
        font-size: 2rem !important;
        line-height: 1.08 !important;
    }

    .carousel-item.hero-caption-left-uk .carousel-caption .btn {
        font-size: 0.88rem !important;
        padding: 0.45rem 0.85rem !important;
    }
}
/* ===== Ukrainian centered carousel captions ===== */

.carousel-item.hero-caption-center-uk .carousel-caption {
    left: 12% !important;
    right: 12% !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    text-align: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.carousel-item.hero-caption-center-uk .carousel-caption p,
.carousel-item.hero-caption-center-uk .carousel-caption h1,
.carousel-item.hero-caption-center-uk .carousel-caption h2,
.carousel-item.hero-caption-center-uk .carousel-caption h3 {
    font-size: clamp(2.2rem, 4.2vw, 4.4rem) !important;
    line-height: 1.12 !important;
    font-weight: 700 !important;
    text-align: center !important;
}
/* ===== Ukrainian carousel caption: right aligned ===== */

.carousel-item.hero-caption-right-uk .carousel-caption {
    left: auto !important;
    right: 8% !important;
    top: 52% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    text-align: right !important;
    max-width: 880px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.carousel-item.hero-caption-right-uk .carousel-caption p,
.carousel-item.hero-caption-right-uk .carousel-caption h1,
.carousel-item.hero-caption-right-uk .carousel-caption h2,
.carousel-item.hero-caption-right-uk .carousel-caption h3 {
    font-size: clamp(2.1rem, 3.2vw, 3.6rem) !important;
    line-height: 1.12 !important;
    font-weight: 700 !important;
    text-align: right !important;
    margin-bottom: 1rem !important;
}

.carousel-item.hero-caption-right-uk .carousel-caption .btn {
    font-size: 0.95rem !important;
    padding: 0.5rem 1rem !important;
}

/* Medium screens */
@media (max-width: 1100px) {
    .carousel-item.hero-caption-right-uk .carousel-caption {
        right: 7% !important;
        top: 53% !important;
        max-width: 760px !important;
    }

    .carousel-item.hero-caption-right-uk .carousel-caption p,
    .carousel-item.hero-caption-right-uk .carousel-caption h1,
    .carousel-item.hero-caption-right-uk .carousel-caption h2,
    .carousel-item.hero-caption-right-uk .carousel-caption h3 {
        font-size: clamp(2rem, 3.8vw, 3rem) !important;
        line-height: 1.1 !important;
        margin-bottom: 0.85rem !important;
    }
}

/* Narrow preview / tablet */
@media (max-width: 900px) {
    .carousel-item.hero-caption-right-uk .carousel-caption {
        right: 6% !important;
        top: 54% !important;
        max-width: 650px !important;
    }

    .carousel-item.hero-caption-right-uk .carousel-caption p,
    .carousel-item.hero-caption-right-uk .carousel-caption h1,
    .carousel-item.hero-caption-right-uk .carousel-caption h2,
    .carousel-item.hero-caption-right-uk .carousel-caption h3 {
        font-size: 2rem !important;
        line-height: 1.08 !important;
    }

    .carousel-item.hero-caption-right-uk .carousel-caption .btn {
        font-size: 0.88rem !important;
        padding: 0.45rem 0.85rem !important;
    }
}
/* ===== Carousel controls clickable area ===== */

.carousel .carousel-control-prev,
.carousel .carousel-control-next {
    width: 7% !important;
    min-width: 56px !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 40 !important;
    opacity: 0.85 !important;
    cursor: pointer !important;
}

.carousel .carousel-control-prev {
    left: 0 !important;
}

.carousel .carousel-control-next {
    right: 0 !important;
}

.carousel .carousel-control-prev-icon,
.carousel .carousel-control-next-icon {
    width: 2.25rem !important;
    height: 2.25rem !important;
    pointer-events: none !important;
}

.carousel .carousel-caption {
    z-index: 10 !important;
}

.carousel .carousel-indicators {
    z-index: 30 !important;
}
/* ===== Language switcher ===== */

.navbar-tools {
    gap: 0;
}

.language-switcher {
    min-width: 2.4rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .navbar-tools {
        align-items: flex-start !important;
        flex-direction: column;
        margin-top: 0.5rem;
    }

    .language-switcher {
        margin-bottom: 0.5rem;
        width: fit-content;
    }
}
/* ===== Language switcher ===== */

.navbar-tools {
    gap: 0;
}

.language-switcher {
    min-width: 2.4rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .navbar-tools {
        align-items: flex-start !important;
        flex-direction: column;
        margin-top: 0.5rem;
    }

    .language-switcher {
        margin-bottom: 0.5rem;
        width: fit-content;
    }
}

/* =========================================================
   MOBILE HERO CAROUSEL
   ========================================================= */

@media (max-width: 767.98px) {

    /* Однакова висота hero для всіх EN та UK слайдів */
    .carousel-item.hero-mobile {
        position: relative;
        height: clamp(360px, 105vw, 460px);
        overflow: hidden;
    }

    /* Однакове заповнення області зображенням */
    .carousel-item.hero-mobile > img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center center;
    }

    /* Затемнення для читабельності напису */
    .carousel-item.hero-mobile::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background: linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.62) 0%,
            rgba(0, 0, 0, 0.35) 58%,
            rgba(0, 0, 0, 0.10) 100%
        );
    }

    /*
     * CRX використовує d-none d-md-block.
     * На телефоні примусово повертаємо caption.
     */
    .carousel-item.hero-mobile
    .carousel-caption.d-none.d-md-block {
        display: block !important;
        z-index: 2;

        top: 50% !important;
        bottom: auto !important;

        left: 7% !important;
        right: 7% !important;

        transform: translateY(-50%) !important;

        padding: 0 !important;
        text-align: left !important;
    }

    /* Розмір головного напису */
    .carousel-item.hero-mobile .carousel-caption p,
    .carousel-item.hero-mobile .carousel-caption h1,
    .carousel-item.hero-mobile .carousel-caption h2,
    .carousel-item.hero-mobile .carousel-caption h3 {
        margin: 0 0 1rem 0 !important;

        font-size: clamp(1.7rem, 7vw, 2.5rem) !important;
        line-height: 1.08 !important;
        font-weight: 700 !important;

        color: #fff !important;
        text-shadow:
            0 2px 4px rgba(0, 0, 0, 0.75),
            0 4px 12px rgba(0, 0, 0, 0.45);
    }

    /* Кнопка */
    .carousel-item.hero-mobile .carousel-caption .btn {
        padding: 0.6rem 0.9rem !important;
        font-size: 0.95rem !important;
        line-height: 1.2 !important;
    }

    /* Стрілки мають бути вище затемнення */
    .carousel-control-prev,
    .carousel-control-next {
        z-index: 3;
        width: 13%;
    }

    .carousel-indicators {
        z-index: 3;
    }

    /* Зберігаємо різні варіанти вирівнювання */
    .carousel-item.hero-mobile.hero-caption-center
    .carousel-caption {
        text-align: center !important;
    }

    .carousel-item.hero-mobile.hero-caption-right
    .carousel-caption {
        text-align: right !important;
    }

    .carousel-item.hero-mobile.hero-caption-left
    .carousel-caption {
        text-align: left !important;
    }
}
@media (max-width: 767.98px) {

    .carousel-item.hero-mobile.hero-image-left > img {
        object-position: 25% center !important;
    }

    .carousel-item.hero-mobile.hero-image-center > img {
        object-position: 50% center !important;
    }

    .carousel-item.hero-mobile.hero-image-right > img {
        object-position: 75% center !important;
    }
}