/**
 * bcx-theme.css — sitewide theme polish (v1.7.1)
 *
 * Restyles the block theme's footer to match the Bangalore Cafe Xpress
 * palette: deep green with a tricolor accent stripe, cream text, saffron
 * hover, rounded logo badge, warmer social icons.
 *
 * Also trims any empty decorative blocks the theme injects at the very
 * end of the home page (mirror of the top-gap fix in v1.6.2).
 *
 * Scoped defensively with `body` prefixes so we only override cleanly,
 * never the block editor itself.
 */

/* ---- Shared palette fallbacks (bcx-home.css may not be loaded on
 *      pages other than the home page, so redeclare here.) -------- */
:root {
    --bcx-theme-green:    #1f3c26;
    --bcx-theme-green-2:  #11261b;
    --bcx-theme-cream:    #fbf4e0;
    --bcx-theme-cream-2:  #f6ecc7;
    --bcx-theme-saffron:  #f4c03a;
    --bcx-theme-turmeric: #d98a1a;
    --bcx-theme-tomato:   #c84b2f;
}

/* =============================================================
 * Footer — paint the black bar green, add tricolor top accent,
 * soften the logo tile, warm up nav + social links.
 * ============================================================= */

body .wp-site-blocks > footer,
body footer.wp-block-template-part,
body .wp-block-template-part[data-type="wp_template_part"][data-area="footer"],
body .site-footer {
    background: var(--bcx-theme-green) !important;
    background-image: linear-gradient(180deg,
        var(--bcx-theme-green) 0%,
        var(--bcx-theme-green-2) 100%) !important;
    color: var(--bcx-theme-cream) !important;
    position: relative;
    border: 0 !important;
}

/* Tricolor accent stripe across the top of the footer
 * (saffron / cream / turmeric — same flag the sections wear) */
body .wp-site-blocks > footer::before,
body footer.wp-block-template-part::before,
body .site-footer::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--bcx-theme-saffron) 0%, var(--bcx-theme-saffron) 33.33%,
        #ffffff 33.33%, #ffffff 66.66%,
        var(--bcx-theme-turmeric) 66.66%, var(--bcx-theme-turmeric) 100%);
    z-index: 2;
}

/* Everything inside the footer reads on dark green now */
body .wp-site-blocks > footer *,
body footer.wp-block-template-part *,
body .site-footer * {
    color: var(--bcx-theme-cream);
}

/* Nav / link hover state */
body .wp-site-blocks > footer a,
body footer.wp-block-template-part a,
body .site-footer a {
    color: var(--bcx-theme-cream) !important;
    text-decoration: none;
    transition: color .18s ease;
}
body .wp-site-blocks > footer a:hover,
body .wp-site-blocks > footer a:focus,
body footer.wp-block-template-part a:hover,
body footer.wp-block-template-part a:focus,
body .site-footer a:hover,
body .site-footer a:focus {
    color: var(--bcx-theme-saffron) !important;
}

/* Site title text (if used instead of / alongside logo) */
body .wp-site-blocks > footer .wp-block-site-title a,
body footer.wp-block-template-part .wp-block-site-title a,
body .site-footer .wp-block-site-title a {
    color: var(--bcx-theme-cream) !important;
    font-weight: 700;
}

/* Logo tile: round the white box into a cream badge so it reads as
 * an intentional circle/rounded card floating on the green, not a
 * clipped screenshot. */
body .wp-site-blocks > footer .wp-block-site-logo img,
body .wp-site-blocks > footer .custom-logo,
body footer.wp-block-template-part .wp-block-site-logo img,
body footer.wp-block-template-part .custom-logo,
body .site-footer .wp-block-site-logo img,
body .site-footer .custom-logo {
    border-radius: 14px !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28),
                0 0 0 2px rgba(251, 244, 224, 0.08);
    background: var(--bcx-theme-cream);
    padding: 4px;
}

/* Social icons: warm cream background + green icons, saffron on hover */
body .wp-site-blocks > footer .wp-block-social-links .wp-social-link,
body footer.wp-block-template-part .wp-block-social-links .wp-social-link,
body .site-footer .wp-block-social-links .wp-social-link {
    background-color: var(--bcx-theme-cream) !important;
    color: var(--bcx-theme-green) !important;
    transition: background-color .18s ease, transform .18s ease;
}
body .wp-site-blocks > footer .wp-block-social-links .wp-social-link svg,
body footer.wp-block-template-part .wp-block-social-links .wp-social-link svg,
body .site-footer .wp-block-social-links .wp-social-link svg {
    fill: var(--bcx-theme-green) !important;
}
body .wp-site-blocks > footer .wp-block-social-links .wp-social-link:hover,
body footer.wp-block-template-part .wp-block-social-links .wp-social-link:hover,
body .site-footer .wp-block-social-links .wp-social-link:hover {
    background-color: var(--bcx-theme-saffron) !important;
    transform: translateY(-2px);
}

/* Comfortable footer padding so content breathes on the new bg */
body .wp-site-blocks > footer,
body footer.wp-block-template-part,
body .site-footer {
    padding-block: 28px !important;
}

/* =============================================================
 * Home page — trim empty trailing blocks that cause the tall cream
 * gap between [bcx_home] and the footer. Mirror of the v1.6.2 top
 * fix, applied at the bottom of main. Scoped to home only.
 * ============================================================= */

body.bcx-home-page .wp-block-post-content > .wp-block-cover:last-child,
body.bcx-home-page .wp-block-post-content > .wp-block-spacer:last-child,
body.bcx-home-page .wp-block-post-content > .wp-block-group:last-child:empty,
body.bcx-home-page main > .wp-block-cover:last-child,
body.bcx-home-page main > .wp-block-spacer:last-child,
body.bcx-home-page main > .wp-block-template-part:last-child:empty,
body.bcx-home-page .entry-content > .wp-block-cover:last-child,
body.bcx-home-page .entry-content > .wp-block-spacer:last-child {
    display: none !important;
}

/* Also zero bottom padding the theme may add under main on home */
body.bcx-home-page .wp-site-blocks > main,
body.bcx-home-page .wp-block-post-content,
body.bcx-home-page .entry-content,
body.bcx-home-page .site-main,
body.bcx-home-page .site-content {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* =============================================================
 * v1.10.2 — Generic "flush top" rules, keyed to body.bcx-flush-top.
 *
 * Any page that renders a BCX presentation shortcode (home, menu,
 * catering menu, catering form, campaign, etc.) gets this body
 * class via the body_class filter in bcx-cafe.php. The rules below
 * hide the theme's empty page-title banner + cover/spacer blocks
 * and collapse the top padding so our content sits flush under
 * the site header — same treatment the home page has had since
 * v1.5.2, now reusable for every feature page.
 *
 * New shortcodes should be added to $bcx_flush_shortcodes in
 * bcx-cafe.php to opt into this behavior automatically.
 * ============================================================= */

/* Hide the theme's page title block itself. */
body.bcx-flush-top .wp-block-post-title,
body.bcx-flush-top h1.wp-block-post-title,
body.bcx-flush-top .entry-header .wp-block-post-title,
body.bcx-flush-top header.entry-header > h1,
body.bcx-flush-top .page .entry-title,
body.bcx-flush-top .wp-block-cover:has(h1.wp-block-post-title) {
    display: none !important;
}

/* Hide empty cover/spacer blocks the theme injects before content. */
body.bcx-flush-top .wp-site-blocks > main > .wp-block-cover,
body.bcx-flush-top .wp-site-blocks > main > .wp-block-spacer,
body.bcx-flush-top .wp-site-blocks > main > .wp-block-group > .wp-block-cover:first-child,
body.bcx-flush-top .wp-site-blocks > main > .wp-block-group > .wp-block-spacer:first-child,
body.bcx-flush-top .wp-site-blocks > .wp-block-group > .wp-block-cover:first-child:has(.wp-block-post-title) {
    display: none !important;
}

/* Collapse the top padding/margins so our first section hugs the header. */
body.bcx-flush-top .wp-site-blocks,
body.bcx-flush-top .wp-site-blocks > main,
body.bcx-flush-top main.wp-block-group,
body.bcx-flush-top main.is-layout-constrained,
body.bcx-flush-top .wp-block-post-content,
body.bcx-flush-top .entry-content,
body.bcx-flush-top .site-main,
body.bcx-flush-top .site-content,
body.bcx-flush-top .has-global-padding {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
body.bcx-flush-top .wp-site-blocks > main > *:first-child,
body.bcx-flush-top .wp-block-post-content > *:first-child,
body.bcx-flush-top .entry-content > *:first-child {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}

/* =============================================================
 * Mobile
 * ============================================================= */
@media (max-width: 720px) {
    body .wp-site-blocks > footer,
    body footer.wp-block-template-part,
    body .site-footer {
        padding-block: 22px !important;
    }
}
