/*
 * FC Blog sidebar widgets — 6.0.698
 *
 * These widgets are designed to live inside a Bricks sidebar Container/Block.
 * They never impose a page-column width. width:100%, min-width:0 and container
 * queries make them follow the real sidebar width as Bricks flex/grid layouts
 * shrink or stack across breakpoints.
 */

.fcbls-bricks-element,
.fcqp-bricks-element {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.fcbls,
.fcqp {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  container-type: inline-size;
}

/* ---------- FC Blog Live Search ---------- */

/* 6.0.698 — state visibility is explicit. Bricks/theme author CSS must never
 * resurrect dormant search content into the empty-search preview. */
.fcbls__browse[hidden],
.fcbls__results[hidden],
.fcbls__empty[hidden] {
  display: none !important;
}

.fcbls {
  background: var(--fcbls-bg, #dce7da);
  border-radius: var(--fcbls-radius, 7px);
  padding: var(--fcbls-pad, 18px);
  overflow: hidden;
}

.fcbls__search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: var(--fcbls-search-h, 38px);
  box-sizing: border-box;
  border: var(--fcbls-search-border-w, 1px) solid var(--fcbls-search-border, #5e665f);
  border-radius: var(--fcbls-search-radius, 7px);
  background: var(--fcbls-search-bg, #5e665f);
  overflow: hidden;
}

.fcbls__search:focus-within {
  border-color: var(--fcbls-search-focus, #173d32);
}

.fcbls__search > input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 40px 0 40px;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  background: transparent !important;
  color: var(--fcbls-search-text, #fff);
  font: inherit;
  font-size: var(--fcbls-search-size, 15px);
  line-height: 1;
  box-shadow: none !important;
}

.fcbls__search > input[type="search"]::placeholder { color: var(--fcbls-search-placeholder, #fff); opacity: 1; }
.fcbls__search > input[type="search"]::-webkit-search-cancel-button { display: none; }

.fcbls__search-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--fcbls-search-text, #fff);
  pointer-events: none;
  transform: translateY(-50%);
}

.fcbls__clear {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fcbls-search-text, #fff);
  line-height: 0;
  cursor: pointer;
  transform: translateY(-50%);
}

.fcbls__clear[hidden] {
  display: none !important;
}

.fcbls__clear svg {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0;
  pointer-events: none;
}

.fcbls__divider {
  height: 1px;
  margin: 24px 0 22px;
  background: var(--fcbls-divider, #718176);
}

.fcbls__heading {
  margin: 0 0 14px;
  color: var(--fcbls-heading, #101111);
  font-size: var(--fcbls-heading-size, 18px);
  line-height: 1.15;
}

.fcbls__results {
  display: flex;
  flex-direction: column;
  gap: var(--fcbls-gap, 12px);
  min-width: 0;
}

.fcbls__result {
  display: grid;
  grid-template-columns: var(--fcbls-img-w, 80px) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--fcbls-result, #173d32);
  text-decoration: none;
  transition: color .18s ease, transform .18s ease;
}

.fcbls__result:hover,
.fcbls__result:focus-visible {
  color: var(--fcbls-result-hover, #2f5a49);
  transform: translateX(2px);
}

.fcbls__thumb {
  display: block;
  width: var(--fcbls-img-w, 80px);
  height: var(--fcbls-img-h, 48px);
  object-fit: cover;
  background: rgba(23,61,50,.08);
}

.fcbls__title {
  min-width: 0;
  font-size: var(--fcbls-result-size, 14px);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.fcbls__empty {
  margin: 0;
  color: var(--fcbls-result, #173d32);
  font-size: var(--fcbls-result-size, 14px);
}

/* ---------- FC Blog Quick Preview ---------- */
.fcqp {
  --fcqp-tile-w-fluid: var(--fcqp-tile-w, 118px);
  --fcqp-tile-h-fluid: var(--fcqp-tile-h, 74px);
  padding: var(--fcqp-pad, 14px);
  border-radius: var(--fcqp-radius, 7px);
  background: var(--fcqp-bg, #dce7da);
  overflow: hidden;
}

.fcqp__featured {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  margin: 0 0 14px;
  overflow: hidden;
  background: var(--fcqp-card-bg, #fff);
}

.fcqp__image-link {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--fcqp-image-radius, 7px);
  text-decoration: none;
}

.fcqp__main-image {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: var(--fcqp-ratio, 16 / 9);
  object-fit: cover;
  object-position: center;
  background: rgba(23,61,50,.08);
}

.fcqp__copy {
  display: flex;
  flex-direction: column;
  gap: var(--fcqp-content-gap, 12px);
  min-width: 0;
  padding: 12px 2px 4px;
}

.fcqp__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--fcqp-meta, #607269);
  font-size: var(--fcqp-meta-size, 11px);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.fcqp__title {
  margin: 0;
  color: var(--fcqp-title, #101111);
  font-size: var(--fcqp-title-size, 18px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.fcqp__title-link {
  color: inherit;
  text-decoration: none;
}

.fcqp__title-link:hover,
.fcqp__title-link:focus-visible {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fcqp__summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  margin: 0;
  color: var(--fcqp-summary, #173d32);
  font-size: var(--fcqp-summary-size, 14px);
  line-height: 1.5;
}

.fcqp__read {
  align-self: flex-start;
  color: var(--fcqp-read, #173d32);
  font-size: var(--fcqp-summary-size, 14px);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fcqp__rail {
  display: grid;
  grid-template-rows: repeat(2, var(--fcqp-tile-h-fluid));
  grid-auto-columns: var(--fcqp-tile-w-fluid);
  grid-auto-flow: column;
  gap: var(--fcqp-tile-gap, 8px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x pan-y;
  cursor: grab;
}

.fcqp__rail::-webkit-scrollbar { display: none; }
.fcqp__rail.is-dragging { cursor: grabbing; user-select: none; }

.fcqp__tile {
  position: relative;
  width: var(--fcqp-tile-w-fluid);
  height: var(--fcqp-tile-h-fluid);
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: var(--fcqp-tile-border-w, 1px) solid var(--fcqp-tile-border, #9eaea4);
  border-radius: var(--fcqp-tile-radius, 7px);
  background: rgba(23,61,50,.08);
  scroll-snap-align: start;
  cursor: pointer;
}

.fcqp__tile.is-active { border-color: var(--fcqp-tile-active, #173d32); }
.fcqp__tile:focus-visible { outline: 2px solid var(--fcqp-tile-active, #173d32); outline-offset: 2px; }

.fcqp__tile-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .22s ease;
}

.fcqp__tile:hover .fcqp__tile-image,
.fcqp__tile:focus-visible .fcqp__tile-image { transform: scale(1.035); }

.fcqp__tile-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.28), rgba(0,0,0,0) 55%);
  pointer-events: none;
}

.fcqp__tile-cta {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  min-width: 72%;
  height: var(--fcqp-preview-h, 26px);
  padding: 0 10px;
  background: var(--fcqp-preview-bg, #101111);
  color: var(--fcqp-preview-text, #fff);
  font-size: var(--fcqp-preview-size, 11px);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .06em;
  transform: translateX(102%);
  transition: transform .22s ease;
  pointer-events: none;
}

.fcqp__tile:hover .fcqp__tile-cta,
.fcqp__tile:focus-visible .fcqp__tile-cta,
.fcqp__tile.is-active .fcqp__tile-cta { transform: translateX(0); }

/* Sidebar-width responsive behavior. This follows the actual Bricks column width,
 * so it works when a desktop/laptop sidebar simply gets narrower before a
 * viewport breakpoint is reached. */
@container (max-width: 360px) {
  .fcbls__result { grid-template-columns: min(68px, 25cqw) minmax(0, 1fr); gap: 8px; }
  .fcbls__thumb { width: min(68px, 25cqw); height: 44px; }

  .fcqp {
    --fcqp-tile-w-fluid: min(var(--fcqp-tile-w, 118px), 31cqw);
    --fcqp-tile-h-fluid: min(var(--fcqp-tile-h, 74px), 20cqw);
  }
  .fcqp__copy { padding-top: 10px; }
  .fcqp__summary { -webkit-line-clamp: 3; }
}

@container (max-width: 290px) {
  .fcbls { padding: min(var(--fcbls-pad, 18px), 14px); }
  .fcbls__divider { margin: 18px 0; }
  .fcbls__title { line-height: 1.25; }

  .fcqp { padding: min(var(--fcqp-pad, 14px), 10px); }
  .fcqp__title { font-size: max(14px, calc(var(--fcqp-title-size, 18px) - 2px)); }
  .fcqp__summary { font-size: max(12px, calc(var(--fcqp-summary-size, 14px) - 1px)); }
  .fcqp__tile-cta { min-width: 82%; }
}

/* Bricks default viewport breakpoints: base desktop, tablet <992, mobile
 * landscape <768, mobile portrait <478. Parent layout/stacking remains owned by
 * Bricks; these rules only refine internal spacing after the parent has shrunk. */
@media (max-width: 991px) {
  .fcbls-bricks-element,
  .fcqp-bricks-element { min-width: 0; }
}

/* 6.0.733 — On phones, PREVIEW is an explicit tap state. Do not use the
 * browser's sticky/emulated :hover state or the widget's article-selection
 * .is-active state to reveal tile labels. */
@media (max-width: 767px),
       (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {
  .fcqp__tile-cta {
    min-width: auto;
    transform: translateX(102%) !important;
    opacity: .92;
  }

  .fcqp__tile:hover .fcqp__tile-cta,
  .fcqp__tile:focus-visible .fcqp__tile-cta,
  .fcqp__tile.is-active .fcqp__tile-cta {
    transform: translateX(102%) !important;
  }

  .fcqp__tile.is-preview-tapped .fcqp__tile-cta {
    transform: translateX(0) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fcbls__result,
  .fcqp__tile-image,
  .fcqp__tile-cta { transition: none !important; }
}
.fcbls__result + .fcbls__result {
  border-top: 1px solid var(--fcbls-result-border, #cbd7cf);
  padding-top: var(--fcbls-gap, 12px);
}

/* 6.0.697 — Live Search owns a rich empty-search preview instead of the old
 * plain Latest Post row list. It deliberately reuses the Quick Preview visual
 * system inside the Live Search box so the large image follows the real Bricks
 * sidebar/container width and the lower rail remains two rows. */
.fcbls__browse {
  width: 100%;
  min-width: 0;
}

.fcbls__browse-preview.fcqp {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.fcbls__browse-preview .fcqp__featured {
  background: transparent;
}
