/**
 * MB Weekender Shortcodes — live rates table + inline data tags.
 * Palette mirrors the booking-form/quote-builder tokens (brand teal
 * #0099c5 / #007a9e, Montserrat) so this reads as the same product on a
 * staff-built landing page.
 *
 * @since 1.7.0
 */
.mb-weekender-rates {
    --mbwr-brand: #0099c5;
    --mbwr-brand-dark: #007a9e;
    --mbwr-ink: #1a1a2e;
    --mbwr-muted: #6c757d;
    --mbwr-border: #e0e0e0;
    --mbwr-surface: #f0f9fc;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
}
/* Brand accent — set per-shortcode-render off the package's own is_weekender
 * value (2 = LIU, everything else = MBT), never guessed. MBT keeps the
 * standard teal already used above; LIU swaps in the LIU pink/magenta used
 * everywhere else LIU trips are branded in this codebase. */
.mb-weekender-rates.mb-weekender-rates-liu {
    --mbwr-brand: #c4006a;
    --mbwr-brand-dark: #8f004d;
    --mbwr-surface: #fdf0f6;
}
.mb-weekender-rates-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--mbwr-border);
    border-radius: 12px;
    overflow: hidden;
}
.mb-weekender-rates-table th,
.mb-weekender-rates-table td {
    padding: 12px 14px;
    text-align: center;
    font-size: 14px;
}
.mb-weekender-rates-table thead th {
    background: var(--mbwr-brand);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 12px;
}
.mb-weekender-rates-table thead th:first-child,
.mb-weekender-rates-table tbody th {
    text-align: left;
}
.mb-weekender-rates-table tbody th {
    font-weight: 700;
    color: var(--mbwr-ink);
    background: var(--mbwr-surface);
}
.mb-weekender-rates-table tbody tr:nth-child(even) td,
.mb-weekender-rates-table tbody tr:nth-child(even) th {
    background: #fafcfd;
}
.mb-weekender-rates-table tbody tr:nth-child(odd) th {
    background: var(--mbwr-surface);
}
.mb-weekender-rates-table td {
    color: var(--mbwr-ink);
    font-weight: 600;
}
/* Non-occupancy categories (Youth/Child/etc.) — pulled out of the table
 * entirely, rendered as one plain text line, same layout the old weekender
 * rates page used for these. */
.mb-weekender-rates-flat-list {
    margin: 14px 4px 0;
    padding: 10px 14px;
    background: var(--mbwr-surface);
    border-radius: 8px;
    font-size: 14px;
    color: var(--mbwr-ink);
}
.mb-weekender-rates-flat-list strong { color: var(--mbwr-brand-dark); }
.mb-weekender-rates-note {
    margin: 10px 4px 0;
    font-size: 12px;
    color: var(--mbwr-muted);
    font-style: italic;
}
.mb-weekender-tag-empty {
    display: inline-block;
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
}
.mb-weekender-rates-empty {
    padding: 16px 18px;
    background: #f0f9fc;
    border: 1px dashed #e0e0e0;
    border-radius: 10px;
    text-align: center;
}

@media (max-width: 480px) {
    .mb-weekender-rates-table th,
    .mb-weekender-rates-table td { padding: 9px 8px; font-size: 12.5px; }
}

/* ---------------------------------------------------------------------
 * [mb_weekender_cards] — the hub-page auto-listing grid.
 * --------------------------------------------------------------------- */
.mb-weekender-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
    padding: 12px;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
@media (max-width: 900px) {
    .mb-weekender-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .mb-weekender-cards { grid-template-columns: 1fr; }
}
.mb-weekender-cards-empty {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}
/* Replicates the original hand-built weekender landing-page card as closely
 * as possible: full-bleed background photo (the package's picked image),
 * a solid brand-color tint over the whole card (not just a header strip),
 * a thick dark-teal outline, everything — price, title, dates, tags, CTA —
 * stacked directly on the tinted photo rather than in a separate white
 * inset panel. */
.mb-weekender-card {
    --mbwc-brand: #0099c5;
    --mbwc-brand-tint: rgba(0, 153, 197, 0.86);
    --mbwc-glow: rgba(0, 153, 197, 0.55);
    position: relative;
    border: 7px solid #0d2b33;
    border-radius: 16px;
    overflow: hidden;
    background: var(--mbwc-brand) center/cover no-repeat;
    color: #fff;
    /* Fixed, not min-height — two cards with different title/tag text
       lengths could otherwise render 1-2px apart from each other (content-
       driven flex height), which showed up as a visible mismatch between
       cards sitting side by side. overflow:hidden above already clips
       anything that doesn't fit, so a fixed height is safe here. */
    height: 460px;
    display: flex;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    will-change: transform;
}
.mb-weekender-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 0 0 0 transparent, 0 22px 45px -10px var(--mbwc-glow), 0 0 40px 6px var(--mbwc-glow);
    z-index: 2;
}
/* Admin-only "export this card as an image" button — server-gated by
   current_user_can('manage_options'), so this markup is never present
   for a customer at all (not just visually hidden). */
.mb-weekender-card-export-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(13, 43, 51, 0.75);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.mb-weekender-card-export-btn:hover { background: rgba(13, 43, 51, 0.95); transform: scale(1.08); }
.mb-weekender-card-export-btn:disabled { cursor: wait; opacity: 0.7; }
.mb-weekender-card.mb-weekender-card-liu {
    --mbwc-brand: #c4006a;
    --mbwc-brand-tint: rgba(196, 0, 106, 0.86);
    --mbwc-glow: rgba(196, 0, 106, 0.55);
}
.mb-weekender-card-tint {
    background: var(--mbwc-brand-tint);
    width: 100%;
    /* Was sized to its own content only, so any card shorter than the
     * parent's min-height (e.g. no tags, no price) left the bottom of the
     * card showing the plain background image through instead of the
     * tint (reported). flex:1 fills the parent's full flex-row height;
     * justify-content spreads the head/title/button across it instead of
     * packing everything at the top with dead space below. */
    flex: 1 1 auto;
    box-sizing: border-box;
    padding: 24px 26px 26px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    text-align: center;
    gap: 14px;
    /* The card's rendered width varies by ~10px between page-builder
     * sections/columns even at the "same" 1/3-grid width — at a fixed
     * 40px title size that was sometimes JUST enough for a long word like
     * "WEEKENDER" to overflow past the box's right edge (text-align:center
     * can't apply a negative offset, so overflow bleeds one direction
     * only, reading as "off-center"). Sizing the title/date off the
     * card's own measured width via a container query keeps it fitting
     * regardless of which section/page it's placed on. */
    container-type: inline-size;
}
.mb-weekender-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    font-weight: 800;
}
.mb-weekender-card-price {
    font-size: 19px;
    line-height: 1.15;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-align: left;
}
.mb-weekender-card-nights {
    font-size: 17px;
    text-align: right;
    line-height: 1.35;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.mb-weekender-card .mb-weekender-card-title {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    text-align: center !important;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(26px, 13.5cqi, 40px);
    font-weight: 900;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: normal;
    overflow-wrap: normal;
    word-break: normal;
    font-kerning: none;
    text-rendering: optimizeSpeed;
}
.mb-weekender-card .mb-weekender-card-dates {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    text-align: center !important;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(17px, 9.5cqi, 26px);
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.mb-weekender-card-tags {
    display: flex;
    width: 100%;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
}
.mb-weekender-card-tag {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.2px;
    color: #fff;
}
.mb-weekender-card-tag i { font-size: 24px; }
.mb-weekender-card-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    background: #0d2b33;
    color: #fff !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-decoration: none !important;
    transition: filter 0.15s ease, transform 0.12s ease;
}
.mb-weekender-card-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.mb-weekender-card-btn-disabled {
    background: #cbd5e1;
    color: #64748b !important;
    cursor: default;
}

/* ---------------------------------------------------------------------
 * Sold out → waitlist. Card and rates-table variants share the same
 * waitlist widget markup/JS (.mb-weekender-waitlist), just placed
 * differently — a ribbon+greyscale on the card, a banner above the table.
 * --------------------------------------------------------------------- */
.mb-weekender-card.mb-weekender-card-soldout {
    background: #55606a center/cover no-repeat;
}
.mb-weekender-card.mb-weekender-card-soldout .mb-weekender-card-tint {
    background: rgba(30, 38, 44, 0.82);
}
.mb-weekender-card.mb-weekender-card-soldout:hover {
    transform: none;
    box-shadow: none;
}
.mb-weekender-card-soldout-ribbon {
    position: absolute;
    top: 18px;
    right: -34px;
    width: 150px;
    padding: 6px 0;
    background: #b91c1c;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-align: center;
    transform: rotate(40deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.mb-weekender-rates.mb-weekender-rates-soldout .mb-weekender-rates-table {
    filter: grayscale(0.9);
    opacity: 0.55;
}
.mb-weekender-rates-soldout-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px 18px;
    border-radius: 10px;
    background: var(--mbwr-brand-dark);
    color: #fff;
}
.mb-weekender-rates-soldout-label {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 14px;
}

.mb-weekender-waitlist { min-width: 220px; }
.mb-weekender-waitlist-btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: #0d2b33;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.mb-weekender-waitlist-btn:hover { filter: brightness(1.2); }
.mb-weekender-card .mb-weekender-waitlist { width: 100%; }
.mb-weekender-card .mb-weekender-waitlist-btn { width: 100%; box-sizing: border-box; text-align: center; }

.mb-weekender-waitlist-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    text-align: left;
}
.mb-weekender-rates-soldout-banner .mb-weekender-waitlist-form,
.mb-weekender-rates-soldout-banner .mb-weekender-waitlist { min-width: 260px; flex: 1; }
.mb-weekender-waitlist-count {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.85;
}
.mb-weekender-waitlist-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mb-weekender-waitlist-input {
    flex: 1;
    min-width: 110px;
    padding: 9px 10px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    color: #1a1a2e;
    font-family: inherit;
}
.mb-weekender-waitlist-party { flex: 0 0 90px; }
.mb-weekender-waitlist-submit {
    flex: 1;
    min-width: 120px;
    padding: 9px 14px;
    border: none;
    border-radius: 6px;
    background: #0d2b33;
    color: #fff;
    font-weight: 800;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
}
.mb-weekender-waitlist-submit:disabled { opacity: 0.6; cursor: default; }
.mb-weekender-waitlist-submit:hover:not(:disabled) { filter: brightness(1.15); }
.mb-weekender-waitlist-error {
    font-size: 12px;
    font-weight: 700;
    color: #ffb4b4;
}
.mb-weekender-waitlist-success {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .mb-weekender-cards { grid-template-columns: 1fr; }
}
