/**
 * FCA Events Spaces - Frontend Styles
 *
 * Targeted overrides for space events child routes.
 * All component CSS lives in fca-events-basic/events.css.
 *
 * @package FCA_Events_Spaces
 */

/* ── 1. Expand FC's space layout body ───────────────────────────────────────
   fhr_content_layout_body is FC's space wrapper with maxWidth:1080px.
   The route class fcom_route_fca_space_events_list sits on the parent
   fhr_content_layout element, so .route .fhr_content_layout_body reaches it.
   Expanding this unlocks the full viewport width for our content.         */
.fcom_route_fca_space_events_list .fhr_content_layout_body,
.fcom_route_fca_space_event_detail .fhr_content_layout_body {
    max-width: 100% !important;
}

/* Also expand the space container itself; zero FC's default 20px top padding
   (designed for post feeds, not needed on our events page)                  */
.fcom_route_fca_space_events_list .fcom_resp_container,
.fcom_route_fca_space_event_detail .fcom_resp_container {
    max-width:   100% !important;
    width:       100% !important;
    padding-top: 0    !important;
}

/* ── 2. Strip white card from fcom_feed_box on our routes ───────────────────
   fcom_feed_box is FC's feed column element. Without sidebar it fills the
   full space container. Remove its card styling so our content shows cleanly. */
.fcom_feed_box.fcom_route_fca_space_events_list,
.fcom_feed_box.fcom_route_fca_space_event_detail {
    background:    transparent !important;
    box-shadow:    none        !important;
    border-radius: 0           !important;
    border:        none        !important;
    padding:       0           !important;
    max-width:     100%        !important;
    width:         100%        !important;
}

/* ── 3. Position context for the floating create button ─────────────────────
   .fca-space-create-btn uses position:absolute (top:16px right:24px).
   Without a positioned ancestor it drifts up the chain. Setting relative
   on fcom_events_addon anchors it correctly within the events section.     */
.fca-space-host .fcom_events_addon {
    position: relative;
    padding-top: 16px;
}

/* ── 3b. Remove FC's 2rem margin-top on the inner events content body ───────
   FC's app_css.css applies margin-top:2rem to .fhr_content_layout_body inside
   .feeds.fcom_single_layout — creates a large gap and pushes create button
   against the space header border line.                                     */
.fca-space-host .fcom_events_addon .fhr_content_layout_body {
    margin-top: 0 !important;
}

/* ── 3c. Reposition create button: flush top-right, clear of the header ─────
   After zeroing the margin-top gap, snap the button to the top-right corner
   of the events content area with no extra inset.                           */
.fca-space-host .fca-space-create-btn {
    top:     0   !important;
    right:   0   !important;
    z-index: 100 !important;
}

/* ── 4. Hide skip-to-content link ───────────────────────────────────────────
   FC renders this for accessibility on all portal pages. In the space events
   context the space header already provides navigation context.             */
.fca-space-host .fcom_skip_link {
    display: none !important;
}

/* ── 5. Event detail page: float Edit/Delete, hide back link + header bar ───
   The detail page renders fhr_content_layout_header with the back link (h1)
   on the left and Delete/Edit buttons (.fhr_page_actions) on the right.
   In the space context the space header's Events tab IS the back navigation,
   so we hide the back link and lift the action buttons to float top-right.  */
.fca-space-host .fcom_event_single_page {
    position:    relative;
    padding-top: 16px;
}

/* Zero out FC's 2rem top margin on the inner detail content body */
.fca-space-host .fcom_event_single_page .fhr_content_layout_body {
    margin-top: 0 !important;
}

/* Hide the entire floating header bar — Edit/Delete live in the sidebar now */
.fca-space-host .fcom_event_single_page .fhr_content_layout_header {
    display: none !important;
}

/* ── 6. Create/Edit form in space context ───────────────────────────────────
   The form header is sticky by default, which overlaps with the space header.
   Make it static and hide the back link (space Events tab is the back nav).
   Target via the FC route class which is always present on space event pages. */
.fcom_route_fca_space_events_list .fhr_content_layout_header,
.fcom_route_fca_space_event_detail .fhr_content_layout_header {
    position: static !important;
}
.fcom_route_fca_space_events_list .fhr_content_layout_header .fcom_back_link,
.fcom_route_fca_space_event_detail .fhr_content_layout_header .fcom_back_link {
    display: none !important;
}
