/* ================================================================
   Quilts Gallery Shortcode – Stylesheet
   Plugin: quilts-gallery-shortcode
   ================================================================ */

/* ---------- Filter Bar ---------- */
.qgs-filter-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    justify-content: center;
}

/* Dynamic field rows inside card */
.qgs-card-field {
    display: flex;
    gap: 6px;
    font-size: 13px;
    line-height: 1.5;
    flex-wrap: wrap;
}

.qgs-lb-entry-desc {
    margin-top: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
}

.qgs-field-label, .qgs-field-value {
    font-weight: 700;
    color: black !important;
    font-size: 15px;
    font-family: inherit;
}

.qgs-lb-caption .qgs-lb-field-row .qgs-lb-field-label,
.qgs-lb-caption .qgs-lb-field-row .qgs-lb-field-value {
    color: white;
}

.qgs-field-label::after {
    content: ":";
}

.qgs-field-value {
    color: #333;
}

.qgs-filter-btn {
    padding: 10px 15px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
    background-color: #f4f4f4;
    color: #D1D3D4;
    border: unset;
    font-family: inherit;
}

.qgs-filter-btn.active {
    background: #e87722;
    border-color: #e87722;
    color: #ffffff;
}

.qgs-filter-btn:hover {
    background: #f4f4f4;
    border-color: #f4f4f4;
    color: #D1D3D4;
}

/* ---------- Grid – Masonry via CSS columns ---------- */
.qgs-grid {
    columns: 4;
    column-gap: 20px;
    min-height: 200px;
    position: relative;
}

@media (max-width: 1100px) {
    .qgs-grid { columns: 3; }
}
@media (max-width: 768px) {
    .qgs-grid { columns: 2; }
}
@media (max-width: 480px) {
    .qgs-grid { columns: 1; }
}

/* ---------- Card ---------- */
.qgs-card {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .10);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    padding: 6px;
    background-color: #f4f4f4;
    margin-bottom: 20px;
}

.qgs-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
}

.qgs-card-img-wrap {
    overflow: hidden;
    background: #f4f6f9;
}

.qgs-card-img-wrap img {
    width: 100%;
    height: auto;
    object-fit: unset;
    display: block;
    transition: transform .35s ease;
}

.qgs-card:hover .qgs-card-img-wrap img {
    transform: scale(1.03);
}

.qgs-card-body {
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.qgs-card-title {
    text-transform: uppercase;
    color: #EF7622 !important;
    font-family: 'Tungsten', Helvetica, Arial, Lucida, sans-serif;
    font-weight: 400;
    font-size: 34px;
    line-height: normal;
}

.qgs-card-meta {
    font-family: inherit;
    font-weight: 700;
    color: black;
    font-size: 15px;
    margin-top: 7px;
    line-height: 20px;
}

.qgs-description {
    color: rgb(0, 46, 93);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
}

.qgs-card-ribbon {
    display: inline-block;
    padding: 0px 0px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #f4f6f9;
    color: #003087;
    width: fit-content;
}

/* ---------- DSM Caption ---------- */
.dsm-caption {
    font-size: 15px;
    font-weight: 700;
    color: #000;
    font-family: inherit;
    line-height: 1.5;
}

/* ---------- Loading Overlay ---------- */
.qgs-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, .75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.qgs-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top-color: #e87722;
    border-radius: 50%;
    animation: qgs-spin .7s linear infinite;
}

@keyframes qgs-spin {
    to { transform: rotate(360deg); }
}

/* ---------- No Results ---------- */
.qgs-no-results {
    width: 100%;
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: #777;
    font-size: 16px;
}

/* ---------- Pagination ---------- */
.qgs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.qgs-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ddd;
    background: #dddddd;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qgs-page-btn:hover,
.qgs-page-btn.active {
    background: #f4f4f4;
    border-color: solid;
    color: #000;
}

.qgs-page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ---------- Lightbox ---------- */
/* FIX: position:fixed keeps overlay locked to the viewport at all times.
   Prevents image/text drifting off-screen on desktop resize, and ensures
   touch/swipe events keep working after the user scrolls down on mobile. */
.qgs-lb-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .92);
    z-index: 999999;
    overflow-y: auto;
}

.qgs-lb-overlay.open {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Image – centred, large */
.qgs-lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50%;
    padding: 20px 10px 20px;
    box-sizing: border-box;
    flex: inherit;
    flex-direction: column;
}

.qgs-lb-caption .qgs-description,
.qgs-lb-caption .qgs-lb-meta {
    color: #bdbdbd;
    display: block;
    font-size: 12px;
    line-height: 14px;
}

.qgs-lb-img-wrap img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    animation: qgs-lb-in .25s ease;
}

@keyframes qgs-lb-in {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* Caption bar */
.qgs-lb-caption {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 2px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.qgs-lb-caption-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.qgs-lb-title {
    text-align: left;
    line-height: 18px;
    color: #f3f3f3;
    word-wrap: break-word;
    padding-right: 36px;
    font-family: inherit;
    font-weight: 500;
}

.qgs-lb-meta {
    font-size: 13px;
    color: rgba(255, 255, 255, .75);
}

.qgs-lb-counter {
    font-size: 13px;
    color: rgba(255, 255, 255, .65);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Close button */
.qgs-lb-close {
    position: fixed;
    top: 14px;
    right: 20px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000000;
    padding: 0;
    transition: color .2s, transform .15s;
}
.qgs-lb-close:hover {
    color: #e87722;
}

/* Prev / Next arrows */
.qgs-lb-nav {
    position: fixed;
    transform: translate(-50%, -50%);
    top: 50%;
    background: none;
    border: none;
    color: #989797;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    padding: 0 10px;
    transition: color .2s;
    opacity: .85;
}

.qgs-lb-nav:hover {
    color: #ffffff;
    opacity: 1;
}

.qgs-lb-prev { left: 25px; }
.qgs-lb-next { right: 25px; }

/* ---------- Mobile Lightbox Fixes ---------- */
/* FIX: Stack caption vertically so title/fields get full width.
   Counter pushed to bottom via order:99 so text content comes first. */
@media (max-width: 768px) {
    .qgs-lb-img-wrap {
        width: 95%;
    }

    .qgs-lb-caption {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .qgs-lb-counter {
        order: 99;
        align-self: flex-end;
        font-size: 12px;
        margin-top: 4px;
    }
	
	.qgs-lb-next , .qgs-lb-prev  {
		right: -23px;
		top: 35%;
	}
}