/* =============================================================================
   Njoyland Portfolio Filters — stylesheet
   Covers:
     - Inline ACF filter groups (portfolio page, alongside Salient's bar)
     - Locations page layout (two-column: sidebar + grid)
     - Sidebar accordion groups
     - Mobile responsive behaviour
   ============================================================================= */

/* =============================================================================
   INLINE FILTER BAR ADDITIONS
   .njoyland-acf-filters-inline is a sibling of .portfolio-filters-inline,
   so it inherits the same page-level context without overriding Salient styles.
   Each ACF group is rendered as its own row: [LABEL] [item | item | item …]
   ============================================================================= */

.njoyland-acf-filters-inline {
    display: flex;
    flex-direction: column;   /* one row per filter group */
    padding: 4px 0;
}

/* Each group: label on the left (fixed min-width), items flex-wrap on the right. */
.njoyland-filter-group {
    display: flex;
    align-items: flex-start;  /* label stays at top when items wrap */
    flex-wrap: nowrap;
}

/* Small muted label, fixed width so all groups' items start at the same column. */
.njoyland-filter-group-label {
    flex: 0 0 auto;
    min-width: 170px;          /* accommodate "SERVIZI SU RICHIESTA" + breathing room */
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    white-space: nowrap;
    padding-top: 7px;          /* align label baseline with the first link row */
    padding-right: 12px;
    border-right: 1px solid rgba(0, 0, 0, 0.15);
}

/* ---- List reset ----
   Use the full ancestor chain + !important to beat any theme ul/li rules. */
.njoyland-acf-filters-inline ul {
    display: flex !important;
    flex-wrap: wrap !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.njoyland-acf-filters-inline ul li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Links match .portfolio-filters-inline .container > ul a exactly:
   padding, font-size, font-weight, line-height, display.
   A right-border separator sits between items (removed on the last one). */
.njoyland-acf-filters-inline ul li a {
    display: inline-block;
    padding: 0 10px;
    margin: 7px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 14px;
    color: #999;
    text-decoration: none;
    white-space: nowrap;
    border-right: 1px solid rgba(0, 0, 0, 0.12);
    transition: color 0.2s;
}

.njoyland-acf-filters-inline ul li:last-child a {
    border-right: none;
}

.njoyland-acf-filters-inline ul li a:hover {
    color: #333;
}

.njoyland-acf-filters-inline ul li a.active {
    color: #1a1a1a;
}


/* =============================================================================
   LOCATIONS PAGE — empty-state (zero filter results)
   ============================================================================= */

#njoyland-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

/* [hidden] attribute hides it; remove the attribute to show it. */
#njoyland-empty-state[hidden] {
    display: none !important;
}

.njoyland-empty-state__message {
    font-size: 16px;
    opacity: 0.6;
    margin: 0 0 20px;
}

#njoyland-clear-all {
    display: inline-block;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    cursor: pointer;
    color: inherit;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

#njoyland-clear-all:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: transparent;
}


/* =============================================================================
   LOCATIONS PAGE — clickable cards + thin border
   ============================================================================= */

/* .inner-wrap must be the positioning context for the overlay anchor. */
#njoyland-locations-grid .inner-wrap {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;        /* clips the thumbnail to the rounded corners */
    padding: 0 0 12px;       /* breathing room below the title/excerpt */
    /* Thin border via inset box-shadow: immune to theme outline resets and
       has zero effect on box-model / Isotope layout calculations. */
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.09);
    transition: box-shadow 0.2s;
}

#njoyland-locations-grid .col.element:hover .inner-wrap {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2),
                0 4px 16px rgba(0, 0, 0, 0.08);
}

#njoyland-locations-grid .work-meta {
    padding: 10px 14px 0;
}

/* Overlay anchor: absolutely covers the full .inner-wrap so the entire card
   (image + title + excerpt) is one click target. z-index 10 sits above the
   image and meta; .work-info is display:none so no nested-anchor conflict. */
#njoyland-locations-grid .njoyland-card-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: block;
    cursor: pointer;
}


/* =============================================================================
   LOCATIONS PAGE — hide love icon and hover CTAs on portfolio items
   ============================================================================= */

#njoyland-locations-grid .nectar-love-wrap,
#njoyland-locations-grid .work-info,
#njoyland-locations-grid .work-info-bg {
    display: none !important;
}


/* =============================================================================
   LOCATIONS PAGE LAYOUT
   Two-column flex: sidebar (fixed width) + portfolio grid (fluid).
   ============================================================================= */

#njoyland-locations-wrap {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    position: relative;
}

/* Sidebar */
#njoyland-sidebar {
    flex: 0 0 260px;
    width: 260px;
    position: sticky;
    top: 100px; /* clear the fixed Salient header */
    align-self: flex-start; /* shrink to content, don't stretch to grid height */
}

/* Grid area */
#njoyland-locations-grid {
    flex: 1 1 auto;
    min-width: 0; /* prevent flex overflow */
}


/* =============================================================================
   SIDEBAR ACCORDION GROUPS
   ============================================================================= */

.njoyland-sidebar-filters {
    border-top: 1px solid #e0e0e0;
}

.njoyland-sidebar-group {
    border-bottom: 1px solid #e0e0e0;
}

/* Header / toggle row */
.njoyland-sidebar-group__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 0;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    gap: 8px;
}

.njoyland-sidebar-group__header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* +/× indicator */
.njoyland-sidebar-group__header::after {
    content: '+';
    font-size: 18px;
    line-height: 1;
    font-weight: 400;
    opacity: 0.5;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.njoyland-sidebar-group.is-open .njoyland-sidebar-group__header::after {
    transform: rotate(45deg);
}

/* Collapsible body */
.njoyland-sidebar-group__body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s ease;
}

.njoyland-sidebar-group.is-open .njoyland-sidebar-group__body {
    max-height: 800px;
}

/* Reset / "Tutti" button */
.njoyland-sidebar-group__clear {
    display: inline-block;
    padding: 3px 10px;
    margin-bottom: 8px;
    font-size: 11px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    color: inherit;
    transition: background 0.15s, color 0.15s;
}

.njoyland-sidebar-group__clear:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: transparent;
}

/* Badge (count of active filters in a group) */
.njoyland-sidebar-group__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #1a1a1a;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.njoyland-sidebar-group__badge.is-hidden {
    display: none;
}

/* Empty state */
.njoyland-sidebar-group__empty {
    font-size: 12px;
    opacity: 0.5;
    padding: 4px 0 10px;
    margin: 0;
}

/* Checkbox list */
.njoyland-sidebar-group__list {
    list-style: none !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
}

.njoyland-sidebar-group__list li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.njoyland-sidebar-group__list label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    font-size: 13px;
    cursor: pointer;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
}

.njoyland-sidebar-group__list input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #1a1a1a;
}


/* =============================================================================
   SIDEBAR INSTANT SEARCH
   ============================================================================= */

.njoyland-search-wrap {
    padding-bottom: 16px;
}

.njoyland-location-search {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.4;
    color: inherit;
    background: transparent;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    outline: none;
    transition: border-color 0.2s;
    /* Cancel any theme button/input resets */
    -webkit-appearance: none;
    appearance: none;
}

.njoyland-location-search:focus {
    border-color: #888;
}

.njoyland-location-search::placeholder {
    color: #aaa;
}


/* =============================================================================
   MOBILE SIDEBAR TOGGLE
   ============================================================================= */

#njoyland-filters-toggle {
    display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
    #njoyland-locations-wrap {
        flex-direction: column;
        gap: 0;
    }

    #njoyland-sidebar {
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
        display: none; /* hidden until toggled */
        margin-bottom: 24px;
    }

    #njoyland-sidebar.is-visible {
        display: block;
    }

    #njoyland-filters-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 12px 16px;
        margin-bottom: 16px;
        background: #f5f5f5;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        color: inherit;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    #njoyland-filters-toggle::before {
        content: attr(data-label-show);
    }

    #njoyland-filters-toggle.is-active::before {
        content: attr(data-label-hide);
    }

    /* Already column-direction on desktop; label shrinks on narrow screens. */
    .njoyland-filter-group-label {
        min-width: 110px;
    }

    .njoyland-filter-group {
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        padding-top: 4px;
        margin-top: 4px;
    }

    .njoyland-filter-group:first-child {
        border-top: none;
        padding-top: 0;
        margin-top: 0;
    }
}
