/* ============================
   GALLERY LAYOUT
   ============================ */

/* Center website */
.main {
    max-width: 1000px;
    margin: auto;
}

.gallery.row {
    margin: 10px -16px;
}

/* Add padding BETWEEN each column */
.gallery.row,
.gallery.row > .column {
    padding: 8px;
}

/* Create three equal columns */
.column {
    float: left;
    width: 33.33%;
    display: none; /* Hidden by default */
}

/* The "show" class is added to the filtered elements */
.show {
    display: block;
}

/* Clear floats after rows */
.gallery.row:after {
    content: "";
    display: table;
    clear: both;
}

/* Course Cards */
.gallery.card {
    box-shadow: 0 4px 4px rgba(0,0,0,0.1), 0 4px 4px rgba(0,0,0,0.1);
    margin-left: 10px;
    margin-top: 10px;
    height: 284px;
    display: inline-block;
    overflow: hidden;
    background: white;
    border-radius: 10px;
}

.gallery.card:hover {
    box-shadow: 0 10px 10px rgba(0,0,0,0.12), 0 10px 10px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    cursor: pointer;
}

/* Mobile cards – full width, auto height */
@media (max-width: 575px) {
    .gallery.card {
        height: auto !important;
        min-height: 180px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        display: block;
    }

    .gallery.card .card-body {
        padding: 10px 12px !important;
    }
}

.card-image-wrapper {
    position: relative;
    overflow: hidden;
}

.course-image {
    width: 100%;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}

/* Dark overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
}

/* Hover effects */
.course-card:hover .course-image {
    transform: scale(1.05);
}

.course-card:hover .image-overlay {
    opacity: .12;
}

/* Default (desktop / large screens) */
.card-data {
    padding: 8px;
}

/* Small–medium phones (401–575px) */
@media (max-width: 575px) {
    .card-data {
        padding: 6px 8px;  /* tighter vertically, keep side room */
    }
}

/* Very small phones (up to 400px) */
@media (max-width: 400px) {
    .card-data {
        padding: 4px 6px;  /* compact but still readable */
    }
}

.gallery h4 {
    font-size: 0.9rem;
    margin-top: 5px;
}

.level {
    display: inline;
    margin-top: 8px;
    float: right;
}

.offering {
    float: left;
    margin-top: 8px;
}

.offering span {
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #383838;
    font-size: 0.75rem;
}

.card-date {
    display: block;
    color: gray;
    font-size: .65rem;
    margin-top: -5px;
}

/* --- Difficulty pill default (desktop/tablet) --- */
.level {
    float: right;
    margin-top: 6px;
}

.level img {
    display: none; /* Hide the SVG entirely */
}

.level p {
    display: inline-block;
    background: #f1f1f1;
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 999px;
    margin: 0;
    text-transform: capitalize;
    color: #444;
}

/* --- Mobile version: smaller, tighter pill --- */
@media (max-width: 575px) {
    .level {
        float: none;
        margin-top: 4px;
    }

    .level p {
        font-size: 0.65rem;
        padding: 2px 6px;
        margin-top: 4px;
    }
}

/* Base pill */
.language-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: #10285D;   /* default: dark blue */
    margin-top: 6px;
}

/* Optional color coding */
.language-pill[data-lang="fr"] {
     background: #10285D;
}

.language-pill[data-lang="en"] {
    background: #6F613F;
}

/* Mobile refinement */
@media (max-width: 575px) {
    .language-pill {
        font-size: 0.6rem;
        padding: 2px 6px;
        margin-top: 4px;
    }
}

img {
    -webkit-transition: all .4s ease-in-out;
    -moz-transition: all .4s ease-in-out;
    -o-transition: all .4s ease-in-out;
    -ms-transition: all .4s ease-in-out;
}

/* ===== VERY SMALL PHONES (up to 400px) ===== */
@media (max-width: 400px) {
    .gallery h4 {
        font-size: 0.60rem;
        line-height: 1.15;
    }

    .offering span,
    .card-date {
        font-size: 0.55rem; /* ~65% */
    }

    .level {
        zoom: 85%;
        float: left;
    }
}


/* ===== SMALL–MEDIUM PHONES (401–575px) ===== */
@media (min-width: 401px) and (max-width: 575px) {
    .gallery h4 {
        font-size: 0.70rem;
        line-height: 1.2;
    }

    .offering span,
    .card-date {
        font-size: 0.65rem; /* ~75% */
    }

    .level {
        zoom: 95%;
        float: right;
    }
}

/* ============================
   FILTER BUTTON BAR
   ============================ */

#mybtngContainer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1.5rem;
}

/* Language switcher – sits on the right on desktop */
#languageSwitch {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

/* Base style for all filter buttons (categories + languages) */
.gallery.btng,
.gallery.btngl {
    border: 1px solid #ddd;
    outline: none;
    padding: 8px 14px;
    cursor: pointer;
    color: #222;
    background-color: #fff;
    border-radius: 999px;          /* pill style */
    display: inline-block !important;
    width: auto !important;
    margin: 4px 6px 4px 0;
    font-size: 0.9rem;
    white-space: nowrap;
    transition:
        background-color .2s,
        border-color .2s,
        box-shadow .2s,
        transform .1s,
        color .2s;
}

/* Hover (generic) */
.gallery.btng:hover,
.gallery.btngl:hover {
    background-color: #e4e8f5;
    border-color: #c0c7dd;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

/* Active (generic) */
.gallery.btng.active,
.gallery.btngl.active {
    background: linear-gradient(135deg, #10285D, #a39161);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(16, 40, 93, 0.35);
}

/* On mobile, center buttons + tighten spacing */
@media (max-width: 768px) {
    #mybtngContainer {
        text-align: center;
    }

    .gallery.btng,
    .gallery.btngl {
        font-size: 0.8rem;
        padding: 6px 10px;
        margin: 3px 5px;
    }
}

/* Decorative accent dot */
.gallery.btng::before,
.gallery.btngl::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c4c9d8;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}

.gallery.btng.active::before,
.gallery.btngl.active::before {
    background: #ffffff;
}

/* ============================
   LANGUAGE BUTTON SPECIAL STYLE
   ============================ */

.gallery.btngl {
    background: #f4f4f4;
    border: 1px solid #b8c1d1;
    color: #1f2a44;
    font-weight: 500;
    opacity: 0.95;
    letter-spacing: 0.3px;
}

.gallery.btngl:hover {
    background: #e6e9ef;
    border-color: #8fa0bf;
    color: #0f1c33;
}

/* Active language button */
.gallery.btngl.active {
    background: #10285D;
    border-color: #10285D;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(16, 40, 93, 0.25);
}