/* Namespace prefix acf2- to avoid conflicts */

/* Container */
.acf2-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
  margin: 0;
}

/* Mobile filter toggle (hidden on desktop) */
.acf2-mobile-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.acf2-mobile-toggle .acf2-icon {
  transition: transform .2s ease;
}

/* Sidebar */
.acf2-sidebar {
  position: sticky;
  top: 24px;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}
.acf2-sidebar-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 700;
}

/* Search + suggestions */
.acf2-search {
  margin-bottom: 12px;
  position: relative;
}
#acf2-search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
}
.acf2-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  z-index: 50;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  max-height: 260px;
  overflow: auto;
}
.acf2-suggestion-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
}
.acf2-suggestion-item:hover {
  background: #f5f5f5;
}

/* Filter groups */
.acf2-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acf2-filter-group {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}

.acf2-filter-toggle {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}
.acf2-filter-toggle .acf2-chevron {
  transition: transform .2s ease;
}
.acf2-filter-toggle.open .acf2-chevron {
  transform: rotate(180deg);
}

.acf2-filter-panel {
  padding: 10px 12px 12px 12px;
  background: #fff;
  border-top: 1px solid #eee;
}
.acf2-checkbox-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
  max-height: 210px;
  overflow: auto;
}
.acf2-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.acf2-group-actions {
  display: flex;
  justify-content: flex-end;
}
.acf2-select-reset {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

/* Selected tags below each group */
.acf2-selected-tags {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.acf2-selected-tag {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
}

/* Reset all */
.acf2-reset-all {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
}

/* Grid wrap + results count */
.acf2-grid-wrap {
  min-width: 0;
}
.acf2-results-top {
  display:flex;
  justify-content:flex-end;
  margin-bottom:8px;
}
.acf2-results-count {
  font-size:14px;
  color:#444;
}
.acf2-results-number {
  font-weight:700;
}

/* Grid */
.acf2-grid-title {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 800;
}
.acf2-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  /* ensure equal height rows by letting each cell stretch */
  align-items: stretch;
}

/* Card */
.acf2-card {
  position: relative;
  border: 2px solid #e5e7eb; /* 2px outline */
  border-radius: 10px;        /* 10px rounded edges */
  overflow: hidden;
  background: #fff;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.acf2-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  border-color: #d1d5db;
}
.acf2-card-link {
  position: absolute;
  inset: 0;
  z-index: 5;
}
.acf2-card-media {
  aspect-ratio: 16 / 9;
  background: #f2f2f2;
  flex: 0 0 auto;
}
.acf2-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.acf2-card-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #999;
  font-size: 14px;
}
.acf2-card-body {
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
  flex:1 1 auto;
}
.acf2-card-title {
  margin: 0 0 4px 0;
  font-size: 16px;
  line-height: 1.25;
}
.acf2-card-excerpt {
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}

/* taxonomy label + tags line inside card */
.acf2-card-taxgroup {
  margin-top: auto;
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  font-size: 13px;
  color:#444;
}
.acf2-card-taxlabel {
  font-weight:700;
  margin-right:4px;
}
.acf2-card-taxtags {
  color:#555;
  font-weight:400;
}

/* Loading more */
.acf2-loading-more {
  margin-top: 12px;
  text-align: center;
  color: #666;
}

/* Empty state */
.acf2-grid-empty {
  margin-top: 12px;
  color: #666;
}

/* Responsive */
@media (max-width: 1279px) {
  .acf2-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .acf2-container {
    grid-template-columns: 1fr;
  }

  /* Show mobile toggle button */
  .acf2-mobile-toggle {
    display: inline-flex;
  }

  /* Sidebar collapsible on mobile */
  .acf2-sidebar {
    position: static;
    margin-top: 8px;
    display: none;
  }
  .acf2-sidebar.open {
    display: block;
  }

  .acf2-grid { grid-template-columns: 1fr; }
}

/* Accessibility helper */
.screen-reader-text {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}
