/*
 * mod_grid_card — front-end styles
 * (C) 2026 Morrison Web Design
 * Intentionally minimal for now; layout is handled by Bootstrap utility classes.
 */
:root {
    --shadow-none:none;
    --shadow-light:0.3px 0.5px 0.7px rgba(0, 0, 0, 0.07), 0.8px 1.6px 2px -0.8px rgba(0, 0, 0, 0.07), 2.1px 4.1px 5.2px -1.7px rgba(0, 0, 0, 0.07), 5px 10px 12.6px -2.5px rgba(0, 0, 0, 0.07);
    --shadow-medium:0.3px 0.6px 0.8px rgba(0, 0, 0, 0.08), 0.9px 1.9px 2.5px -0.6px rgba(0, 0, 0, 0.08), 2.3px 4.6px 6px -1.1px rgba(0, 0, 0, 0.08), 5px 10px 13px -1.7px rgba(0, 0, 0, 0.08), 10.5px 21px 27.3px -2.3px rgba(0, 0, 0, 0.08);
    --shadow-bold:0.4px 0.7px 0.9px rgba(0, 0, 0, 0.1), 1px 2px 2.6px -0.4px rgba(0, 0, 0, 0.1), 2.1px 4.2px 5.5px -0.9px rgba(0, 0, 0, 0.1), 4px 8px 10.4px -1.3px rgba(0, 0, 0, 0.1), 7.5px 15px 19.5px -1.8px rgba(0, 0, 0, 0.1), 14px 28px 36.4px -2.2px rgba(0, 0, 0, 0.1);
}
.card-item {
    display:grid;
    &.card-item--image-top {
        .card-item__inner {
           display:grid;
            background: var(--white-1);
            transition: all 0.3s;
            height: 100%;
            padding: var(--mgc-padding, 20px);
            gap: 1rem;
            justify-content: space-between;

        }
    }
}
.card-item__inner {
    border-radius: var(--mgc-radius, 5px);
    background: var(--white-1);
    box-shadow: var(--mgc-shadow, var(--shadow-light));
    transition: all 0.3s;
    height: 100%;
    padding: var(--mgc-padding, 20px);
    .card-item__media {
        display:grid;
        grid-row:span 1;
        grid-template-rows:subgrid;
        figure {
            margin-bottom:0;
        }
        picture {
           display:block;
        }
        img {
           margin-inline:auto;
        }
    }
    .card-item__body {
        display:grid;
        grid-row: span var(--mgc-body-rows, 3);
        grid-template-rows:subgrid;
    }
    &:has(.card-item__media) {

    }
}
.mod-grid-card__filter {
    align-items:center;
    label {
        margin-right:1rem;
    }
}

/* --- Carousel --------------------------------------------------------- */
.mgc-carousel {
    position: relative;
    /* gutter -> gap: map Bootstrap's g-* to a px/rem value */
    --mgc-gap: 1rem;
}
.mgc-carousel.g-0 { --mgc-gap: 0; }
.mgc-carousel.g-1 { --mgc-gap: 0.25rem; }
.mgc-carousel.g-2 { --mgc-gap: 0.5rem; }
.mgc-carousel.g-3 { --mgc-gap: 1rem; }
.mgc-carousel.g-4 { --mgc-gap: 1.5rem; }
.mgc-carousel.g-5 { --mgc-gap: 3rem; }

.mgc-carousel__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;           /* Firefox */
    -ms-overflow-style: none;        /* IE/Edge legacy */
}
.mgc-carousel__viewport::-webkit-scrollbar { display: none; }

.mgc-carousel__track {
    display: flex;
    gap: var(--mgc-gap);
}
/* Each direct child is a card cell. Base = phone columns. */
.mgc-carousel__track > * {
    flex: 0 0 calc((100% - (var(--mgc-cols) - 1) * var(--mgc-gap)) / var(--mgc-cols));
    scroll-snap-align: start;
}
@media (min-width: 768px) {
    .mgc-carousel__track > * {
        flex-basis: calc((100% - (var(--mgc-cols-md) - 1) * var(--mgc-gap)) / var(--mgc-cols-md));
    }
}
@media (min-width: 992px) {
    .mgc-carousel__track > * {
        flex-basis: calc((100% - (var(--mgc-cols-lg) - 1) * var(--mgc-gap)) / var(--mgc-cols-lg));
    }
}

/* Arrows */
.mgc-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--white-1, #fff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.mgc-carousel__arrow:disabled { opacity: 0.4; cursor: default; }
.mgc-carousel__arrow--prev { left: -8px; }
.mgc-carousel__arrow--next { right: -8px; }
.mgc-carousel__arrow::before {
    content: "";
    width: 10px;
    height: 10px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}
.mgc-carousel__arrow--prev::before { transform: rotate(-135deg); margin-left: 3px; }
.mgc-carousel__arrow--next::before { transform: rotate(45deg); margin-right: 3px; }

/* Dots */
.mgc-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}
.mgc-carousel__dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
}
.mgc-carousel__dot.is-active { background: rgba(0, 0, 0, 0.75); }

/* --- Article card metadata (article data source) --------------------- */
.card-item__body .list-inline { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
.card-item__body .list-unstyled { margin: 0 0 .5rem; padding: 0; list-style: none; }

/* --- Lightbox trigger ------------------------------------------------ */
.card-item__media { position: relative; }
.mgc-lightbox__trigger {
    position: absolute; top: .5rem; right: .5rem;
    display: grid; place-items: center;
    width: 2.25rem; height: 2.25rem;
    padding: 0; border: 0; border-radius: 50%;
    background: rgba(0, 0, 0, .55); color: #fff;
    cursor: pointer; opacity: .85; transition: opacity .2s ease;
}
.mgc-lightbox__trigger:hover,
.mgc-lightbox__trigger:focus-visible { opacity: 1; }

.card-item__body dd { margin: 0; }

/* --- GLightbox skin: mgc (fullscreen; layout follows image_position) ---
   GLightbox marks description position on .ginner-container (.desc-left /
   .desc-right / .desc-bottom) and on .gslide-description (.description-left
   etc.). Everything here is scoped to our skin class so no other GLightbox
   instance is affected. */

/* Fully opaque backdrop: GLightbox's default rgba(0,0,0,.92) lets bright page
   content (site header) ghost through wherever the media doesn't cover the
   viewport (notably the top/bottom caption layout). The element-opacity fade
   GLightbox animates is unaffected, so the open transition still fades in. */
.glightbox-mgc .goverlay { background-color: #0b0b0b; }

/* Left/Right: image and text share the viewport 50/50. */
.glightbox-mgc .ginner-container.desc-left,
.glightbox-mgc .ginner-container.desc-right {
    width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; align-items: stretch;
}
.glightbox-mgc .ginner-container.desc-left .gslide-media,
.glightbox-mgc .ginner-container.desc-right .gslide-media {
    flex: 0 0 50%; max-width: 50%; width: 50%; height: 100vh; align-items: center;
}
.glightbox-mgc .ginner-container.desc-left .gslide-media img,
.glightbox-mgc .ginner-container.desc-right .gslide-media img {
    width: 100%; height: 100%; object-fit: cover; max-height: 100vh;
}
.glightbox-mgc .gslide-description.description-left,
.glightbox-mgc .gslide-description.description-right {
    flex: 0 0 50%; max-width: 50%; width: 50%; height: 100vh;
    display: flex; flex-direction: column; justify-content: flex-start;
    overflow: auto; padding: clamp(1rem, 4vw, 3rem); background: var(--white-1, #fff);
}

/* Top: image with a centered title caption below (description = title only). */
.glightbox-mgc .gslide-description.description-bottom {
    text-align: center; padding: 0 1.25rem 1rem; background: transparent;
    color:rgba(225, 225, 225, 1);
}
.glightbox-mgc .gdesc-inner .mgc-lightbox__title { margin-block:1em; }

/* Description body / actions spacing (left/right layouts). */
.glightbox-mgc .gdesc-inner .mgc-lightbox__body { line-height: 1.6; }
.glightbox-mgc .gdesc-inner .mgc-lightbox__actions { margin-top: 1rem; }

/* Controls (close / prev / next): GLightbox scopes the button *positioning*
   under its built-in 'clean' skin only; naming a custom skin ('mgc') opts out
   of that, leaving the buttons position:static and stacked off-screen. Re-declare
   the positioning here. Icons are left transparent-backed and white-filled as a
   neutral default; per-site skins tune contrast for their own colour scheme. */
.glightbox-mgc .gclose,
.glightbox-mgc .gprev,
.glightbox-mgc .gnext {
    position: absolute;
    border-radius: 4px;
    opacity: .85;
    transition: opacity .2s ease;
    background:transparent;
}
.glightbox-mgc .gclose:hover,
.glightbox-mgc .gprev:hover,
.glightbox-mgc .gnext:hover { opacity: 1; }
.glightbox-mgc .gprev { top: 45%; left: 30px; width: 40px; height: 50px; }
.glightbox-mgc .gnext { top: 45%; right: 30px; width: 40px; height: 50px; }
.glightbox-mgc .gclose { top: 15px; right: 20px; width: 40px; height: 40px; }
.glightbox-mgc svg {
    path {
        fill:white;
    }
}

/* Responsive: stack the split vertically (image above text) on narrow screens. */
@media (max-width: 768px) {
    .glightbox-mgc .ginner-container.desc-left,
    .glightbox-mgc .ginner-container.desc-right { flex-direction: column; height: auto; }
    .glightbox-mgc .ginner-container.desc-left .gslide-media,
    .glightbox-mgc .ginner-container.desc-right .gslide-media,
    .glightbox-mgc .gslide-description.description-left,
    .glightbox-mgc .gslide-description.description-right {
        flex-basis: auto; max-width: 100%; width: 100%; height: auto; max-height: none;
    }
    .glightbox-mgc .ginner-container.desc-left .gslide-media img,
    .glightbox-mgc .ginner-container.desc-right .gslide-media img { max-height: 45vh; }
}