/* ===================
   BANNER STYLES

   ⚠️ THE BOX IS NOT DEFINED HERE ANY MORE. `.ff-banner` also carries
   `.tft-panel` from the shared `tft-panels` mu-plugin, which owns the radius,
   the clipping, the full-column height and the flex column — and
   `.tft-panel-body` owns the padding. Those declarations were DELETED rather
   than left here to win: a 12px radius here against SpeedQuizzing's 18px is
   the drift the shared file exists to end, and a local copy that agrees today
   is a local copy that stops agreeing on the next change.

   `position: relative` DOES stay. It is not panel geometry — it is the
   containing block for this module's own scrim, and if it depended on the
   shared file the scrim would escape onto the page the day that file failed
   to load. Everything else below is colour, photography and type, and is
   untouched.
   =================== */
.ff-banner {
    position: relative;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
}

.ff-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0.5) 100%);
}

/* Padding comes from `.tft-panel-body`. Direction, gap and alignment are the
   module's, and this is where they changed.

   ⚠️ A COLUMN, NOT A ROW — the mark sits ABOVE the copy as a masthead. It was
   a row, and the row is the single cause behind all three faults Leigh
   reported on 18 Sep. `.ff-left` is a fixed 120px plus a 32px gap, which is
   31% of this panel's inner width at 1280px, 35% at 1024px and 42% at 880px;
   the copy column it leaves is 342px, 284px and 212px. The date pill needs
   332px on one line, so it was 39px tall on a wide screen, 61px at 1024px and
   84px at 880px — "Friday 18th September / 2026" breaking mid-phrase. The
   trader's name did the same, one line becoming three. And a 57px-tall mark
   centred in a 351px column leaves 147px of nothing above it and 147px below,
   which is the dead bottom-left corner.

   Stacking it gives the copy the panel's FULL width at every size — the pill
   fits on one line from 380px up — and turns dead width into used height:
   the content now measures ~348px against the panel's 351px, so there is
   almost no slack left to read as a void.

   ⚠️ THE BRAND IS UNTOUCHED. Dark ground, the photograph, the scrim, the
   wordmark, the teal eyebrow, the white pill — every colour and every
   typeface below is exactly as it was. This is the arrangement only. */
.ff-banner-inner {
    position: relative;
    z-index: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

/* The mark caps the panel at its own width, top left. */
.ff-left {
    flex-shrink: 0;
    align-self: flex-start;
}

.ff-logo {
    width: 120px;
    height: auto;
    display: block;
}

/* A column still, and still spanning: the trader row deliberately runs the
   full width, which is what keeps the trader's logo out at the right edge.
   ⚠️ `0 1 auto`, NOT `1`. It used to grow into the panel's spare height so
   the button could be pushed to the bottom of it; nothing is pushed any more
   (see `.ff-actions`), so it takes its own height and the slack falls at the
   bottom of the panel as padding. */
.ff-right {
    flex: 0 1 auto;
    min-width: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.ff-eyebrow {
    display: inline-block;
    align-self: flex-start;
    background: #2A686E;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.ff-trader-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.ff-trader-info {
    flex: 1;
}

.ff-trader-name {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 2px 0;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.ff-cuisine {
    font-size: 14px;
    color: #ccc;
}

.ff-trader-logo-wrap {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.ff-trader-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ⚠️ IT WRAPS BETWEEN THE TWO, NEVER INSIDE EITHER. A date is one phrase and
   a time is another; when the pill was too narrow it broke them internally
   instead — "Friday 18th September / 2026" beside "17:00 - / 20:00" (Leigh,
   18 Sep). `nowrap` on each part and `wrap` on the pill means the only break
   available is the one that reads correctly, and it is needed at 380px.

   ⚠️ NO `margin-bottom` EITHER. It was 14px, and the button below it now adds
   the shared gap as well, so the space between the pill and View Menu was
   31.6px against 17.6px in the other two panels — 14px of the panel's height
   that nobody had chosen. The gap above a call to action is one number. */
.ff-details {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    padding: 8px 16px;
    border-radius: 6px;
}

.ff-date {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.ff-time {
    font-size: 15px;
    font-weight: 700;
    color: #2A686E;
    padding-left: 8px;
    border-left: 2px solid #ddd;
    white-space: nowrap;
}

/* ⚠️ NOT `auto`. Dropping the button to the bottom of the panel is what put
   65px of nothing between the date pill and View Menu — the button sat away
   from the content it belongs to (Leigh, 18 Sep). It takes the shared gap
   instead, the same number the other two panels' buttons use, so the copy and
   its call to action stay one block. The fallback is for the panel rendered
   outside a page carrying the shared stylesheet. */
.ff-actions {
    align-self: flex-start;
    margin-top: var(--tft-panel-cta-gap, 1.1rem);
}

/* ⚠️ SHAPE, PADDING AND THE 44px HIT AREA COME FROM `.tft-panel-cta` on the
   banner's button — this rule keeps the colour, the weight and the copy,
   which are Foodie Friday's. `display` and `padding` stay here because the
   GRID CARDS below use `.ff-btn` too and they are not panels. */
.ff-btn {
    display: inline-block;
    background: #2A686E;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.ff-btn:hover {
    background: #1F4F54;
    color: #fff !important;
}

.ff-btn-disabled {
    background: #555;
    cursor: default;
}

.ff-btn-disabled:hover {
    background: #555;
}

.ff-btn-small {
    font-size: 13px;
    padding: 8px 16px;
}

/* ===================
   PAGE LAYOUT
   =================== */
.ff-page {
    max-width: 1200px;
    margin: 0 auto;
}

.ff-featured {
    margin-bottom: 40px;
}

.ff-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #2A686E;
    display: inline-block;
}

.ff-no-events {
    text-align: center;
    padding: 60px 20px;
    background: #f5f5f5;
    border-radius: 12px;
    color: #666;
}

/* ===================
   GRID & CARDS
   =================== */
.ff-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.ff-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ff-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.ff-card-image {
    position: relative;
    height: 140px;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
}

.ff-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.4) 100%);
}

.ff-card-logo-wrap {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.ff-card-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ff-card-content {
    padding: 16px;
}

.ff-card-date {
    font-size: 12px;
    font-weight: 600;
    color: #2A686E;
    margin-bottom: 4px;
}

.ff-card-name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 4px 0;
}

.ff-card-cuisine {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.ff-card-time {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

/* ===================
   MODAL
   =================== */
.ff-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.ff-modal-overlay.active {
    display: flex;
}

.ff-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ff-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.ff-modal-close:hover {
    transform: scale(1.1);
}

.ff-modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.ff-modal-hero {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.ff-modal-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

.ff-modal-body {
    padding: 0 24px 24px;
    margin-top: -40px;
    position: relative;
}

.ff-modal-header {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}

.ff-modal-logo-wrap {
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 2px solid #f0f0f0;
}

.ff-modal-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ff-modal-title-wrap {
    flex: 1;
    padding-bottom: 4px;
}

.ff-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.ff-modal-cuisine {
    font-size: 14px;
    color: #2A686E;
    font-weight: 600;
}

.ff-modal-gallery {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ff-modal-gallery-img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.ff-modal-desc {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
    margin: 0 0 20px 0;
}

.ff-modal-event {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 20px;
}

.ff-modal-event-icon {
    width: 44px;
    height: 44px;
    background: #2A686E;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.ff-modal-event-details {
    flex: 1;
}

.ff-modal-event-date {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.ff-modal-event-time {
    font-size: 15px;
    font-weight: 600;
    color: #2A686E;
}

.ff-modal-actions {
    text-align: center;
}

.ff-modal-btn {
    display: inline-block;
    background: #2A686E;
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 40px;
    border-radius: 10px;
    text-decoration: none !important;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(42,104,110,0.3);
}

.ff-modal-btn:hover {
    background: #1F4F54;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(42,104,110,0.4);
    color: #fff !important;
}

.ff-modal-btn-disabled {
    background: #999;
    box-shadow: none;
    cursor: default;
}

.ff-modal-btn-disabled:hover {
    background: #999;
    transform: none;
    box-shadow: none;
}

/* ===================
   RESPONSIVE
   =================== */
@media (max-width: 900px) {
    .ff-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Centring only. The mark already sits above the copy at every width — see
   `.ff-banner-inner` — so this no longer has a direction to change, and the
   width at which PANELS stack is still not decided here; it is written once,
   in tft-panel.css. Padding is not repeated either: the shared file already
   narrows it. */
@media (max-width: 640px) {
    .ff-banner-inner {
        text-align: center;
        align-items: center;
    }

    .ff-left {
        align-self: center;
    }

    /* Centred copy means centred pieces — the column alignment above is for
       the desktop row. */
    .ff-right {
        align-items: center;
    }

    .ff-eyebrow,
    .ff-details,
    .ff-actions {
        align-self: center;
    }
    
    .ff-logo {
        width: 100px;
    }
    
    .ff-trader-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .ff-trader-logo-wrap {
        width: 80px;
        height: 80px;
    }
    
    .ff-trader-name {
        font-size: 22px;
    }
    
    /* ⚠️ THE DIVIDER GOES WHEN THE PILL CAN WRAP. `.ff-time` carries a rule on
       its left edge to separate it from the date, and at 380px the pill wraps
       between the two — leaving that rule stranded at the start of the second
       line, a tick in front of nothing. A wider gap says the same thing and
       says it correctly on one line or two. */
    .ff-details {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px 14px;
    }

    .ff-time {
        padding-left: 0;
        border-left: 0;
    }
    
    .ff-grid {
        grid-template-columns: 1fr;
    }
    
    /* Modal mobile fixes */
    .ff-modal-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .ff-modal {
        max-width: 100%;
        max-height: calc(100vh - 60px);
    }
    
    .ff-modal-content {
        max-height: calc(100vh - 60px);
    }
    
    .ff-modal-hero {
        height: 180px;
    }
    
    .ff-modal-body {
        padding: 0 20px 24px;
        margin-top: -30px;
    }
    
    .ff-modal-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
    
    .ff-modal-logo-wrap {
        width: 70px;
        height: 70px;
        margin-top: 0;
    }
    
    .ff-modal-title {
        font-size: 22px;
    }
    
    .ff-modal-cuisine {
        font-size: 14px;
    }
    
    .ff-modal-desc {
        font-size: 14px;
        text-align: center;
    }
    
    .ff-modal-event {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 16px;
    }
    
    .ff-modal-event-icon {
        width: 40px;
        height: 40px;
    }
    
    .ff-modal-event-date {
        font-size: 15px;
    }
    
    .ff-modal-event-time {
        font-size: 14px;
    }
    
    .ff-modal-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .ff-modal-gallery {
        justify-content: center;
    }
    
    .ff-modal-gallery-img {
        width: 100px;
        height: 75px;
    }
}