/* Override / hide AJAX-dependent widgets that cannot work on a static deploy.
 * Loaded AFTER the WP theme bundle so these win specificity.
 *
 * Strategy: hide gracefully so nothing looks broken, but keep static content
 * (article body, sidebars with static lists, theme styling) visible. Replace
 * dynamic submission UIs with static "contact us by email" copy injected via
 * site-patch.js. */

/* === Header — Entrar/Registar popup trigger === */
.login-wrapper.js-auth,
.login-wrapper { display: none !important; }

/* === Auth & subscribe popups, modal overlays === */
.bmr-auth-form-container,
.bmr-auth-form-block,
.bmr-auth-form,
.subscribe-popup,
.popup-wrapper,
.uikit-popup-container,
.overlay-white { display: none !important; }

/* === Subscribe blocks (newsletter widget inside articles + sidebar) === */
.subscribe-block,
.subscribe-forecaster,
.unsubscribe-cancel,
.unsubscribe-forecaster-confirm { display: none !important; }

/* === BMR-specific review/feedback submission form (.all-feedbacks-form) === */
#all-feedbacks-add-form,
.all-feedbacks-form,
#feedbacks-form,
#rb-forms,
.review-block.whole > .block-title + form,
.filter-form { display: none !important; }

/* === Comment system — submission form, sort dropdown, load-more button === */
.comment-form-container,
.comment-form-group,
.comment-form,
.comments-load-more,
.load-more-btn,
.comments-sort,
.comments-sort-select,
.comments-tabs .tabs-nav .comments-sort-select { display: none !important; }

/* Keep the comments title only if there are static comments; if not, hide entirely. */
.comments-area:not(:has(.comment)) { display: none !important; }

/* === Right-side filter sidebar on bookmaker listings ===
 * The checkbox filters (Legalidade / Avaliação / Bónus / Depósito / etc.)
 * trigger AJAX calls to /wp-json/ to re-render the list. Without a backend
 * they're dead UI. Hide entirely and let the main column expand. */
#bookmakers-filter-widget,
.right-sidebar #bookmakers-filter-widget,
aside.right-sidebar:has(#bookmakers-filter-widget),
.filters-container,
.single-filter-block { display: none !important; }
/* When the right sidebar is hidden, expand the main column to fill the row */
.content.inner.group.content-flexed > .content-middle { flex: 1 1 auto !important; max-width: none !important; }

/* === Left sidebar accordion submenus ===
 * Items like "Métodos de pagamento ▼", "Moeda ▼", "Línguas ▼" use theme JS to
 * toggle `.sidebar-left-menu-main-submenu` open. Without that JS the submenus
 * stay hidden. Force them open so all sub-links are visible — better than a
 * broken click. */
.sidebar-left-menu-main-submenu { display: block !important; max-height: none !important; }
.sidebar-left-menu-main-item .item-name::after { display: none !important; } /* hide ▼ arrow */

/* === Filter tabs on listings (Por avaliação / Por confiabilidade / Por bónus) ===
 * Without backend the data for non-default tabs never arrives.
 * Hide only the non-active tab so visitors see the default sort label,
 * but never tease an interaction that won't work. Keep the "Sobre a
 * avaliação do RB" info link visible (it's a static wiki link). */
.js-bookmakers-list-sort-tab:not(.active) { display: none !important; }
.tabs-nav .tab-nav-item:not(.active) { display: none !important; }
/* Cursor: no-pointer on the remaining active tab so it doesn't pretend to be clickable */
.js-bookmakers-list-sort-tab.active,
.tabs-nav .tab-nav-item.active { cursor: default !important; pointer-events: none !important; }
/* Drop client-side view-switcher button (grid/list) if it isn't both pre-rendered */
.posts-manage-menu .list-btn:not(.active) { display: none !important; }

/* === "Carregar mais" / infinite scroll triggers === */
.show-more-rows,
.load_more-comments-text,
.has-infinite-scroll .load-more,
[class*="show-more"]:not(.show-more-rows-static) { display: none !important; }

/* === "Comunicar erro" / "Encontrou um erro?" report bar — backend submit === */
.error-report-bar,
[class*="error-report"],
a[href*="report-error"] { display: none !important; }

/* === Subscribe-to-forecaster button under each forecast author block ===
 * (the orange "Assinar" button — also requires auth) */
.subscribe.button.check-before-action,
button.subscribe.check-before-action,
.author-subscribe-btn { display: none !important; }

/* === Wp-comments-post.php submission form (sometimes outside .comment-form-container) === */
form[action*="wp-comments-post.php"],
form[action*="wp-login.php"],
form[action*="lostpassword"] { display: none !important; }

/* === Tag/tag rating popovers triggered by hover (often broken) === */
.rate-popover,
.rating-popover { display: none !important; }

/* === Swiper carousels without JS init ===
 * Origin uses Swiper.js for `.swiper-container.js-carousel` on archive pages
 * (e.g. /bonuses/). Without Swiper JS the wrapper stays as a row with
 * overflow:hidden, so only the first ~4 slides are visible and the
 * "size-large" featured slide makes the row look uneven. Convert each
 * carousel to a plain flex-wrap grid so all slides are visible and uniform. */
.swiper-container.js-carousel {
  overflow: visible !important;
  height: auto !important;
}
.swiper-container.js-carousel .swiper-wrapper {
  display: flex !important;
  flex-wrap: wrap !important;
  transform: none !important;
  gap: 16px !important;
}
.swiper-container.js-carousel .swiper-slide {
  flex: 0 0 calc(25% - 12px) !important;
  width: calc(25% - 12px) !important;
  height: auto !important;
  margin: 0 !important;
}
.swiper-container.js-carousel .swiper-slide.size-large {
  flex: 0 0 calc(50% - 8px) !important;
  width: calc(50% - 8px) !important;
}
.swiper-container.js-carousel .swiper-pagination,
.swiper-container.js-carousel .swiper-button-next,
.swiper-container.js-carousel .swiper-button-prev,
.swiper-container.js-carousel .swiper-scrollbar { display: none !important; }
@media (max-width: 900px) {
  .swiper-container.js-carousel .swiper-slide,
  .swiper-container.js-carousel .swiper-slide.size-large {
    flex: 0 0 calc(50% - 8px) !important;
    width: calc(50% - 8px) !important;
  }
}
@media (max-width: 540px) {
  .swiper-container.js-carousel .swiper-slide,
  .swiper-container.js-carousel .swiper-slide.size-large {
    flex: 0 0 100% !important;
    width: 100% !important;
  }
}

/* === Site-patch contact replacement copy (injected by site-patch.js) === */
.static-replacement-notice {
  display: block;
  border: 1px solid #d6d6d6;
  background: #fafafa;
  border-radius: 4px;
  padding: 14px 18px;
  margin: 14px 0;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}
.static-replacement-notice strong { display: block; margin-bottom: 4px; color: #c00; }
.static-replacement-notice a { color: #1a73e8; text-decoration: none; }
.static-replacement-notice a:hover { text-decoration: underline; }
