/* =============================================
   Bulletin Board Manager – Frontend Styles
   ============================================= */

/* ---- Board Wrapper ---- */
.bbm-board-wrap {
    width: 100%;
    padding: var(--bbm-pad-top, 0) var(--bbm-pad-right, 0) var(--bbm-pad-bottom, 0) var(--bbm-pad-left, 0);
    margin-top:    var(--bbm-mar-top,    0);
    margin-right:  var(--bbm-mar-right,  0);
    margin-bottom: var(--bbm-mar-bottom, 0);
    margin-left:   var(--bbm-mar-left,   0);
    box-sizing: border-box;
}
@media ( max-width: 768px ) {
    .bbm-board-wrap {
        padding: var(--bbm-pad-top-mob, var(--bbm-pad-top, 0)) var(--bbm-pad-right-mob, var(--bbm-pad-right, 0)) var(--bbm-pad-bottom-mob, var(--bbm-pad-bottom, 0)) var(--bbm-pad-left-mob, var(--bbm-pad-left, 0));
        margin-top:    var(--bbm-mar-top-mob,    var(--bbm-mar-top,    0));
        margin-right:  var(--bbm-mar-right-mob,  var(--bbm-mar-right,  0));
        margin-bottom: var(--bbm-mar-bottom-mob, var(--bbm-mar-bottom, 0));
        margin-left:   var(--bbm-mar-left-mob,   var(--bbm-mar-left,   0));
    }
}

/* ---- Front-End Upload Section (admin only) ---- */
.bbm-fe-upload-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.bbm-fe-upload-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.bbm-pin-icon {
    width: 24px; height: 24px;
    flex-shrink: 0;
    color: #c0392b;
}
.bbm-fe-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}
.bbm-fe-divider {
    border: none;
    border-top: 2px dashed #e0e0e0;
    margin-bottom: 36px;
}

/* ---- Fields Grid (shared with admin.css on front end) ---- */
.bbm-upload-form .bbm-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
    margin-bottom: 20px;
}
.bbm-upload-form .bbm-field-full { grid-column: 1 / -1; }
.bbm-upload-form label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}
.bbm-upload-form .bbm-req { color: #cc0000; }
.bbm-upload-form .bbm-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    padding: 8px 11px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    transition: border-color .2s;
}
.bbm-upload-form .bbm-input:focus {
    border-color: #c0392b;
    outline: none;
    box-shadow: 0 0 0 2px rgba(192,57,43,.15);
}
textarea.bbm-input { resize: vertical; min-height: 80px; }

/* ---- Dropzone ---- */
.bbm-upload-form .bbm-dropzone {
    border: 2px dashed #b0b8c1;
    border-radius: 10px;
    background: #fafafa;
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    margin-bottom: 0;
}
.bbm-upload-form .bbm-dropzone:hover,
.bbm-upload-form .bbm-dropzone.bbm-drag-over {
    border-color: #c0392b;
    background: #fdf0ef;
}
.bbm-drop-icon { width: 40px; height: 40px; display: block; margin: 0 auto 10px; color: #c0392b; }
.bbm-drop-label { font-size: 15px; font-weight: 600; color: #333; margin: 0 0 5px; }
.bbm-drop-hint  { font-size: 12px; color: #888; margin: 0; }

/* ---- Progress ---- */
.bbm-progress-wrap { margin: 14px 0 0; }
.bbm-progress-bar  { height: 7px; background: #e8e8e8; border-radius: 4px; overflow: hidden; }
.bbm-progress-fill { height: 100%; width: 0; background: #c0392b; border-radius: 4px; transition: width .25s ease; }
.bbm-progress-label { margin: 6px 0 0; font-size: 13px; color: #555; }

/* ---- Results preview ---- */
.bbm-upload-form .bbm-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.bbm-result-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.bbm-result-item img { width: 100%; height: 100px; object-fit: cover; display: block; }
.bbm-result-meta { padding: 6px 8px; }
.bbm-result-title { font-size: 12px; font-weight: 700; margin: 0 0 2px; }
.bbm-result-msg   { font-size: 11px; color: #555; margin: 0 0 3px; }
.bbm-result-meta a { font-size: 11px; color: #c0392b; }
.bbm-result-error { padding: 10px; font-size: 12px; color: #cc0000; }

/* =============================================
   Masonry Gallery Grid
   ============================================= */
.bbm-masonry-grid {
    columns: 4 200px;
    column-gap: 16px;
}

@media ( max-width: 1100px ) { .bbm-masonry-grid { columns: 3 180px; } }
@media ( max-width: 720px )  { .bbm-masonry-grid { columns: 2 150px; } }
@media ( max-width: 420px )  { .bbm-masonry-grid { columns: 1; } }

/* ---- Flyer Cards ---- */
.bbm-flyer-card {
    break-inside: avoid;
    margin-bottom: 16px;
}

.bbm-flyer-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.bbm-flyer-img-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: box-shadow .25s, transform .25s;
}

.bbm-flyer-img-wrap:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    transform: translateY(-3px);
}

.bbm-flyer-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .4s ease;
}

.bbm-flyer-img-wrap:hover .bbm-flyer-img {
    transform: scale(1.03);
}

/* Overlay — defensive rules to survive theme resets and plugin CSS conflicts */
.bbm-flyer-overlay {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: flex !important;
    flex-direction: column;
    justify-content: var(--bbm-ov-justify, flex-end);
    gap: 5px;
    padding: 14px;
    text-align: var(--bbm-ov-align, left);
    font-family: var(--bbm-ov-font, inherit);
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 60%);
    /* hover mode: hidden by default */
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
    z-index: 1;
}

/* always-visible mode: shown at reduced opacity, full on hover */
.bbm-board-wrap[data-bbm-visibility="always"] .bbm-flyer-overlay {
    opacity: 0.85;
}
.bbm-board-wrap[data-bbm-visibility="always"] .bbm-flyer-img-wrap:hover .bbm-flyer-overlay {
    opacity: 1;
}

/* hover mode: reveal on hover */
.bbm-flyer-img-wrap:hover .bbm-flyer-overlay {
    opacity: 1 !important;
    pointer-events: auto;
}

/* Adjust gradient direction based on vertical position — uses data attr, not style substring */
.bbm-board-wrap[data-bbm-valign="top"] .bbm-flyer-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 60%);
}
.bbm-board-wrap[data-bbm-valign="center"] .bbm-flyer-overlay {
    background: rgba(0,0,0,.45);
}
/* bottom (default) uses the base gradient defined above */

.bbm-flyer-overlay-title {
    color: #fff;
    font-size: var(--bbm-ov-title-size, clamp(12px, 2.8vw, 16px));
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.bbm-flyer-overlay-date {
    color: rgba(255,255,255,.85);
    font-size: var(--bbm-ov-date-size, clamp(10px, 2.2vw, 13px));
    font-weight: 500;
}

/* Newly injected card animation */
.bbm-card-new {
    animation: bbm-pop-in .4s cubic-bezier(.175,.885,.32,1.275) both;
}
@keyframes bbm-pop-in {
    from { opacity:0; transform: scale(.88); }
    to   { opacity:1; transform: scale(1); }
}

.bbm-empty {
    color: #888;
    font-style: italic;
    padding: 24px 0;
    text-align: center;
}

/* =============================================
   Single Flyer Detail Page
   ============================================= */
.bbm-single-wrap {
    display: grid;
    grid-template-columns: var(--bbm-layout-cols, 1fr 1fr);
    gap: 48px;
    align-items: start;
    max-width: var(--bbm-layout-max, 1100px);
    margin-top:    var(--bbm-single-mar-top,    0);
    margin-right:  var(--bbm-single-mar-right,  auto);
    margin-bottom: var(--bbm-single-mar-bottom, 0);
    margin-left:   var(--bbm-single-mar-left,   auto);
    padding-top:    var(--bbm-single-pad-top,    32px);
    padding-right:  var(--bbm-single-pad-right,  20px);
    padding-bottom: var(--bbm-single-pad-bottom, 60px);
    padding-left:   var(--bbm-single-pad-left,   20px);
    box-sizing: border-box;
}

/* Left column: image */
.bbm-single-image-col { position: sticky; top: 40px; }

/* ---- Image zoom button — wraps the flyer image ---- */
.bbm-img-zoom-btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    border-radius: 12px;
    overflow: hidden;
}
.bbm-img-zoom-btn .bbm-single-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.14);
    transition: transform .3s ease, box-shadow .3s ease;
}
.bbm-img-zoom-btn:hover .bbm-single-image {
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(0,0,0,.22);
}
/* Zoom hint pill — appears bottom-right on hover */
.bbm-img-zoom-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,.55);
    color: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.bbm-img-zoom-btn:hover .bbm-img-zoom-hint,
.bbm-img-zoom-btn:focus .bbm-img-zoom-hint {
    opacity: 1;
}
.bbm-img-zoom-btn:focus { outline: 3px solid #c0392b; outline-offset: 3px; }

/* ---- Save to Device / Save to Photos button ---- */
.bbm-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding: 10px 18px;
    border-radius: var(--bbm-dl-radius, 8px);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .2s, background .2s, color .2s, border-color .2s;
    letter-spacing: .01em;
    /* default / fallback appearance */
    border: 2px solid #d0d0d0;
    background: #fff;
    color: #444;
}
.bbm-download-btn:hover { opacity: .82; }
.bbm-download-btn:focus { outline: 3px solid var(--bbm-dl-color, #444); outline-offset: 2px; }

/* Style variants — mirror the other button systems */
.bbm-dl-style-solid    .bbm-download-btn { background: var(--bbm-dl-color,#444); color:#fff; border-color: var(--bbm-dl-color,#444); }
.bbm-dl-style-outlined .bbm-download-btn { background: transparent; color: var(--bbm-dl-color,#444); border: 2px solid var(--bbm-dl-color,#444); }
.bbm-dl-style-ghost    .bbm-download-btn { background: color-mix(in srgb, var(--bbm-dl-color,#444) 10%, transparent); color: var(--bbm-dl-color,#444); border: none; }
.bbm-dl-style-pill     .bbm-download-btn { background: var(--bbm-dl-color,#444); color:#fff; border-color: var(--bbm-dl-color,#444); border-radius: 999px; }
.bbm-dl-style-flat     .bbm-download-btn { background: transparent; color: var(--bbm-dl-color,#444); border: none; box-shadow: none; }

/* Label visibility — desktop shows desktop label, mobile shows mobile label */
.bbm-dl-label-mobile  { display: none; }
.bbm-dl-label-desktop { display: inline; }

@media ( max-width: 768px ) {
    .bbm-download-btn    { width: 100%; justify-content: center; }
    .bbm-dl-label-mobile  { display: inline; }
    .bbm-dl-label-desktop { display: none; }
}

/* =============================================
   Lightbox overlay
   ============================================= */
.bbm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    /* manipulation removes the 300ms tap delay while still allowing scroll */
    touch-action: manipulation;
    /* Kill iOS tap highlight flash */
    -webkit-tap-highlight-color: transparent;
}

.bbm-lightbox-inner {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbm-lightbox-img {
    display: block;
    max-width: min(92vw, 1400px);
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 24px 80px rgba(0,0,0,.6);
    /* allow native pinch zoom on the image itself */
    touch-action: pinch-zoom;
    user-select: none;
}

.bbm-lightbox-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(4px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    z-index: 100000;
    /* Eliminate the 300ms tap delay on mobile */
    touch-action: manipulation;
    /* Ensure the hit target is always tappable */
    -webkit-tap-highlight-color: transparent;
}
.bbm-lightbox-close:hover  { background: rgba(255,255,255,.32); }
.bbm-lightbox-close:active { background: rgba(255,255,255,.45); }
.bbm-lightbox-close:focus  { outline: 2px solid #fff; outline-offset: 3px; }

@media ( max-width: 768px ) {
    .bbm-lightbox { padding: 12px; }
    .bbm-lightbox-img {
        max-width: 100vw;
        max-height: 92vh;
        border-radius: 4px;
    }
    .bbm-lightbox-close {
        top: 10px;
        right: 10px;
    }
}

.bbm-single-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.14);
}

/* Right column: details */
.bbm-single-details { display: flex; flex-direction: column; gap: 20px; }

.bbm-single-title {
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

/* Event date/time block — styled via CSS custom properties from admin settings */
.bbm-event-datetime {
    display: flex;
    gap: 6px;
    font-family: var(--bbm-dt-font, inherit);
    margin: 0;
}

/* Stacked: date above time */
.bbm-dt-stacked {
    flex-direction: column;
    align-items: flex-start;
}

/* Inline: date and time side by side, with a subtle divider */
.bbm-dt-inline {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}
.bbm-dt-inline .bbm-dt-date::after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 1em;
    background: currentColor;
    opacity: .3;
    margin: 0 12px;
    vertical-align: middle;
}

.bbm-dt-date,
.bbm-dt-time {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--bbm-dt-size, clamp(13px, 2.8vw, 16px));
    color: var(--bbm-dt-color, #666);
    font-weight: var(--bbm-dt-fw, 600);
    line-height: 1.4;
}

.bbm-dt-date svg,
.bbm-dt-time svg {
    flex-shrink: 0;
    opacity: .75;
}

/* Mobile: always stack regardless of admin setting */
@media (max-width: 600px) {
    .bbm-dt-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .bbm-dt-inline .bbm-dt-date::after {
        display: none;
    }
    .bbm-dt-date,
    .bbm-dt-time {
        font-size: clamp(13px, 3.5vw, 15px);
    }
}

.bbm-single-description {
    font-size: 16px;
    line-height: 1.75;
    color: #333;
    margin: 0;
    white-space: pre-wrap;
}

/* ---- Button grid: ticket + up to 3 extra buttons ----
   Row 1: button 1 (ticket) + button 2 (extra 1) side by side
   Row 2: extra buttons 3 and 4 side by side
   On mobile: stacks to single column
---------------------------------------------------------------- */
.bbm-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: start;
}
/* Single button: don't stretch across both columns */
.bbm-btn-grid > .bbm-single-ticket:only-child {
    grid-column: 1;
    justify-self: start;
    width: auto;
}
/* Multiple buttons: fill their cell */
.bbm-btn-grid .bbm-single-ticket {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}
@media ( max-width: 600px ) {
    .bbm-btn-grid {
        grid-template-columns: 1fr;
    }
    .bbm-btn-grid > .bbm-single-ticket:only-child {
        width: 100%;
    }
}

/* ---- Get Tickets button — styles driven by CSS vars + modifier class ---- */
.bbm-single-ticket {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--bbm-btn-radius, 8px);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    align-self: flex-start;
    text-decoration: none;
    transition: filter .2s, transform .15s, box-shadow .15s;
    /* solid (default) */
    background: var(--bbm-btn-color, #c0392b);
    color: #fff;
    border: 2px solid var(--bbm-btn-color, #c0392b);
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
}
/* outlined */
.bbm-btn-style-outlined .bbm-single-ticket {
    background: transparent;
    color: var(--bbm-btn-color, #c0392b);
    border: 2px solid var(--bbm-btn-color, #c0392b);
    box-shadow: none;
}
/* ghost */
.bbm-btn-style-ghost .bbm-single-ticket {
    background: color-mix(in srgb, var(--bbm-btn-color, #c0392b) 10%, transparent);
    color: var(--bbm-btn-color, #c0392b);
    border: 2px solid transparent;
    box-shadow: none;
}
/* pill — radius overridden by inline --bbm-btn-radius:999px */
/* (no extra rules needed — border-radius var handles it) */

/* flat */
.bbm-btn-style-flat .bbm-single-ticket {
    background: var(--bbm-btn-color, #c0392b);
    color: #fff;
    border: 2px solid transparent;
    box-shadow: none;
}
/* default — restores the original built-in look, ignores CSS vars */
.bbm-btn-style-default .bbm-single-ticket {
    background: #c0392b;
    color: #fff;
    border: 2px solid #c0392b;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(192,57,43,.3);
}
.bbm-btn-style-default .bbm-single-ticket:hover {
    background: #a93226;
    border-color: #a93226;
    box-shadow: 0 5px 16px rgba(192,57,43,.4);
    filter: none;
}
.bbm-btn-style-default .bbm-single-ticket:focus {
    outline-color: #c0392b;
}
/* hover — darken for all styles */
.bbm-single-ticket:hover {
    filter: brightness(0.88);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(0,0,0,.18);
    color: inherit;
    text-decoration: none;
}
.bbm-btn-style-outlined .bbm-single-ticket:hover,
.bbm-btn-style-ghost    .bbm-single-ticket:hover,
.bbm-btn-style-flat     .bbm-single-ticket:hover {
    box-shadow: none;
}
.bbm-single-ticket:focus {
    outline: 3px solid var(--bbm-btn-color, #c0392b);
    outline-offset: 3px;
}

.bbm-expired-notice {
    grid-column: 1 / -1;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

/* ---- Fixed Back Button ---- */
/* Back button — old fixed pill (element removed from HTML, kept for safety) */
.bbm-back-btn { display: none; }

/* Inline "Back to Flyers" link — sits in the content flow below the description */
.bbm-back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color .15s, gap .15s;
    line-height: 1;
}
.bbm-back-link svg {
    display: block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform .15s;
}
.bbm-back-link:hover {
    color: #c0392b;
    text-decoration: none;
    gap: 8px;
}
.bbm-back-link:hover svg {
    transform: translateX(-3px);
}
.bbm-back-link:focus {
    outline: 3px solid #c0392b;
    outline-offset: 3px;
    border-radius: 3px;
}

/* ---- iFrame layout ---- */
/* Desktop: image sticky left, iframe fills the right column.         */
/* Mobile:  iframe on top, flyer image below.                         */
/* No shadow, no border-radius — content appears part of the page.    */

.bbm-iframe-image-col {
    position: sticky;
    top: 40px;
    align-self: start;
}

/* When flyer image is hidden — iframe wrap spans the entire grid width */
.bbm-iframe-fullwidth {
    grid-template-columns: 1fr !important;
}
.bbm-iframe-fullwidth .bbm-single-iframe-wrap {
    grid-column: 1 / -1;
}

.bbm-single-iframe-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0; /* prevent iframe overflowing grid column */
}

.bbm-iframe-meta {
    margin: 0;
}

.bbm-single-iframe {
    width: 100%;
    /* Start at 100vh so the page doesn't collapse before JS measures content.
       JS replaces this with the exact content height once the iframe loads. */
    height: 100vh;
    min-height: 400px;
    border: none;
    background: transparent;
    display: block;
    overflow: hidden;
}

/* ---- Mobile: details on top, image below ---- */
@media ( max-width: 768px ) {
    .bbm-single-wrap {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top:    var(--bbm-single-pad-top-mob,    var(--bbm-single-pad-top,    20px));
        padding-right:  var(--bbm-single-pad-right-mob,  var(--bbm-single-pad-right,  16px));
        padding-bottom: var(--bbm-single-pad-bottom-mob, var(--bbm-single-pad-bottom, 40px));
        padding-left:   var(--bbm-single-pad-left-mob,   var(--bbm-single-pad-left,   16px));
        margin-top:    var(--bbm-single-mar-top-mob,    var(--bbm-single-mar-top,    0));
        margin-right:  var(--bbm-single-mar-right-mob,  var(--bbm-single-mar-right,  auto));
        margin-bottom: var(--bbm-single-mar-bottom-mob, var(--bbm-single-mar-bottom, 0));
        margin-left:   var(--bbm-single-mar-left-mob,   var(--bbm-single-mar-left,   auto));
    }
    .bbm-single-image-col {
        position: static;
        order: 2;
    }
    .bbm-single-details {
        order: 1;
        gap: 14px;
    }
    /* iframe wrap already spans full width — just ensure min-height holds on mobile */
    .bbm-single-iframe-wrap {
        order: 1;
        gap: 8px;
    }
    .bbm-iframe-image-col {
        position: static;
        order: 2;
    }
    .bbm-single-iframe {
        min-height: 300px;
    }
    .bbm-expired-notice { order: 0; }
    .bbm-fe-upload-section { padding: 20px 16px; }
    .bbm-upload-form .bbm-fields-grid { grid-template-columns: 1fr; }
    .bbm-upload-form .bbm-field-full { grid-column: 1; }
}

/* =============================================
   Share Button
   ============================================= */
.bbm-share-wrap {
    position: relative;
    align-self: flex-start;
}

/* Share Button — styles driven by CSS vars + modifier classes */
.bbm-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--bbm-share-radius, 8px);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: .02em;
    transition: filter .2s, transform .15s, box-shadow .15s;
    white-space: nowrap;
    /* outlined (default) */
    background: transparent;
    color: var(--bbm-share-color, #444);
    border: 2px solid var(--bbm-share-color, #d0d0d0);
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
/* solid */
.bbm-share-style-solid .bbm-share-btn {
    background: var(--bbm-share-color, #444);
    color: #fff;
    border: 2px solid var(--bbm-share-color, #444);
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
}
/* ghost */
.bbm-share-style-ghost .bbm-share-btn {
    background: color-mix(in srgb, var(--bbm-share-color, #444) 10%, transparent);
    color: var(--bbm-share-color, #444);
    border: 2px solid transparent;
    box-shadow: none;
}
/* flat */
.bbm-share-style-flat .bbm-share-btn {
    background: var(--bbm-share-color, #444);
    color: #fff;
    border: 2px solid transparent;
    box-shadow: none;
}
/* default — restores the original built-in look, ignores CSS vars */
.bbm-share-style-default .bbm-share-btn {
    background: transparent;
    color: #444;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.bbm-share-style-default .bbm-share-btn:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: rgba(192,57,43,.05);
    box-shadow: 0 4px 12px rgba(192,57,43,.15);
    filter: none;
}
/* pill — radius set by --bbm-share-radius:999px from template */
.bbm-share-btn svg { flex-shrink: 0; }

/* hover */
.bbm-share-btn:hover {
    filter: brightness(0.88);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    text-decoration: none;
}
.bbm-share-style-ghost .bbm-share-btn:hover,
.bbm-share-style-flat  .bbm-share-btn:hover {
    box-shadow: none;
}
.bbm-share-btn:focus {
    outline: 3px solid var(--bbm-share-color, #c0392b);
    outline-offset: 2px;
}

/* ---- Icon colour overrides ---- */
/* Get Tickets icon */
.bbm-btn-icon-white .bbm-single-ticket svg { stroke: #fff !important; fill: none !important; }
.bbm-btn-icon-black .bbm-single-ticket svg { stroke: #000 !important; fill: none !important; }
/* color = no override — currentColor inherits from button text */

/* Share button icon */
.bbm-share-icon-white .bbm-share-btn svg { stroke: #fff !important; color: #fff !important; }
.bbm-share-icon-black .bbm-share-btn svg { stroke: #000 !important; color: #000 !important; }
/* color = no override */

/* Share dropdown options — icon colour overrides */
.bbm-share-icon-white .bbm-share-option svg { color: #fff !important; }
.bbm-share-icon-black .bbm-share-option svg { color: #000 !important; }
.bbm-share-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,.13);
    padding: 6px;
    margin: 0;
    list-style: none;
    min-width: 200px;
    /* Animate in */
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease;
}
.bbm-share-dropdown.bbm-share-open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.bbm-share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s;
    box-sizing: border-box;
}
.bbm-share-option svg { flex-shrink: 0; color: #666; }
.bbm-share-option:hover {
    background: #f5f5f5;
    color: #c0392b;
    text-decoration: none;
}
.bbm-share-option:hover svg { color: #c0392b; }

@media ( max-width: 768px ) {
    .bbm-share-dropdown {
        /* On mobile the dropdown could clip off-screen — keep it left-aligned
           but let it grow rightward. The native share sheet will normally be
           used on mobile anyway so this is rarely seen. */
        min-width: 180px;
    }
}

/* =============================================
   Category Filter Bar
   ============================================= */
/* =============================================
   Filter + Sort Toolbar
   ============================================= */
.bbm-toolbar {
    display: inline-flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: 28px;
    flex-wrap: wrap;
    /* No overflow:hidden — it clips native <select> dropdowns at OS level */
}

.bbm-toolbar-group {
    display: flex;
    align-items: center;
    gap: 0;
}

.bbm-toolbar-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px 0 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #888;
    white-space: nowrap;
    user-select: none;
}

.bbm-toolbar-label svg {
    opacity: .7;
    flex-shrink: 0;
}

.bbm-toolbar-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bbm-toolbar-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    border-left: 1px solid #e8e8e8;
    padding: 12px 34px 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
    outline: none;
    min-width: 0;
}

.bbm-toolbar-select:hover {
    background: #fdf5f5;
    color: #c0392b;
}

.bbm-toolbar-select:focus {
    background: #fdf5f5;
    color: #c0392b;
}

/* Remove default focus ring — we handle it on the group */
.bbm-toolbar-group:focus-within {
    background: #fdf5f5;
}
.bbm-toolbar-group:focus-within .bbm-toolbar-chevron {
    color: #c0392b;
}
.bbm-toolbar-group:focus-within .bbm-toolbar-label {
    color: #c0392b;
}

.bbm-toolbar-chevron {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: #aaa;
    flex-shrink: 0;
    transition: color .15s;
}

.bbm-toolbar-divider {
    width: 1px;
    background: #e8e8e8;
    align-self: stretch;
    flex-shrink: 0;
}

@media ( max-width: 600px ) {
    .bbm-toolbar {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .bbm-toolbar-group {
        width: 100%;
        border-bottom: 1px solid #e8e8e8;
    }
    .bbm-toolbar-group:last-child {
        border-bottom: none;
    }
    .bbm-toolbar-select {
        flex: 1;
        width: 100%;
    }
    .bbm-toolbar-divider {
        display: none;
    }
}

/* Keep old class names working (backwards compat for themes that may reference them) */
.bbm-filter-bar { display: none; }
.bbm-filter-select { display: none; }

/* ── Multi-category pill picker (frontend upload form) ── */
.bbm-cat-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0 4px;
}
.bbm-cat-pill {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.bbm-cat-pill input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.bbm-cat-pill span {
    display: inline-block;
    padding: 6px 14px;
    border: 2px solid #d0d0d0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    background: #fafafa;
    transition: background .15s, border-color .15s, color .15s;
    line-height: 1.4;
}
.bbm-cat-pill:hover span {
    border-color: #c0392b;
    color: #c0392b;
    background: #fff5f4;
}
.bbm-cat-pill input:checked + span {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}


/* ── TinyMCE editor integration (frontend upload form) ── */
.bbm-upload-form .wp-editor-wrap {
    width: 100%;
}
.bbm-upload-form .mce-tinymce,
.bbm-upload-form .wp-editor-container {
    border: 1px solid #ddd !important;
    border-radius: 6px;
    overflow: hidden;
}
.bbm-upload-form .wp-editor-container:focus-within {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 1px rgba(192,57,43,.3);
}
.bbm-upload-form .mce-toolbar-grp {
    background: #f8f8f8 !important;
    border-bottom: 1px solid #e0e0e0 !important;
}
.bbm-upload-form .wp-editor-area {
    min-height: 160px !important;
}
.bbm-upload-form .quicktags-toolbar {
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
    padding: 4px 6px;
}
.bbm-upload-form .mce-statusbar {
    background: #f8f8f8 !important;
    border-top: 1px solid #e8e8e8 !important;
    font-size: 11px !important;
    color: #888 !important;
}

/* =============================================
   [bbm_directory] shortcode styles
   ============================================= */

/* ---- Filter pill bar ---- */
.bbm-dir-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    align-items: center;
}

.bbm-dir-pill {
    padding: 7px 16px;
    border-radius: 999px;
    border: 2px solid #d0d0d0;
    background: #fff;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}
.bbm-dir-pill.bbm-dir-pill-active {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}
.bbm-dir-pill:hover:not(.bbm-dir-pill-active) {
    border-color: #c0392b;
    color: #c0392b;
}
.bbm-dir-pill:focus { outline: 3px solid #c0392b; outline-offset: 2px; }

/* ---- Section container ---- */
.bbm-dir-section {
    margin-bottom: 48px;
}
.bbm-dir-section:last-child {
    margin-bottom: 0;
}

/* ---- Section heading — typography driven by CSS vars from settings ---- */
.bbm-dir-section-heading {
    margin: 0 0 18px;
    font-size: var(--bbm-dir-hsize, 22px);
    font-family: var(--bbm-dir-hfamily, inherit);
    text-align: var(--bbm-dir-halign, left);
    color: var(--bbm-cat-color, var(--bbm-dir-hcolor, #222));
    font-weight: 700;
    line-height: 1.2;
}

/* Plain */
.bbm-dir-hstyle-plain .bbm-dir-section-heading {
    padding-bottom: 0;
}

/* Underline */
.bbm-dir-hstyle-underline .bbm-dir-section-heading {
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bbm-cat-color, var(--bbm-dir-hcolor, #c0392b));
    display: inline-block;
}

/* Pill badge */
.bbm-dir-hstyle-pill .bbm-dir-section-heading {
    display: inline-block;
    background: var(--bbm-cat-color, var(--bbm-dir-hcolor, #c0392b));
    color: #fff;
    padding: 5px 18px;
    border-radius: 999px;
    font-size: clamp(13px, 1.8vw, 16px);
}

/* Line rule */
.bbm-dir-hstyle-line .bbm-dir-section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}
.bbm-dir-hstyle-line .bbm-dir-section-heading::after {
    content: '';
    display: block;
    flex: 1;
    height: 2px;
    background: var(--bbm-cat-color, var(--bbm-dir-hcolor, #e0e0e0));
    min-width: 20px;
}

/* ---- Directory grid — CSS multi-column masonry (same as main board) ---- */
.bbm-dir-grid {
    column-gap: 16px;
}
/* Column counts — cards nest naturally by height, just like .bbm-masonry-grid */
.bbm-dir-cols-2 { columns: 2 150px; }
.bbm-dir-cols-3 { columns: 3 180px; }
.bbm-dir-cols-4 { columns: 4 180px; }

/* Cards inside directory sections use the same break-inside rule */
.bbm-dir-grid .bbm-flyer-card {
    break-inside: avoid;
    margin-bottom: 16px;
}

@media ( max-width: 1100px ) {
    .bbm-dir-cols-4 { columns: 3 180px; }
}
@media ( max-width: 720px ) {
    .bbm-dir-cols-3,
    .bbm-dir-cols-4 { columns: 2 150px; }
}
@media ( max-width: 480px ) {
    .bbm-dir-cols-2,
    .bbm-dir-cols-3,
    .bbm-dir-cols-4 { columns: 2 140px; }
}
