/* Base skeleton style: show the background color */
img:not(.fancybox-container img):not(.block_db_img img):not(.no_sceleton) {
  background-color: #EEE7DD;
  display: block;
  width: 100%; /* or a fixed width, or a container with fixed dimensions */
  height: auto;
  object-fit: cover;
  position: relative;
  z-index: 1;
  font-size: 0; /* hides broken icon text */
  text-indent: -9999px; /* hides any text */
  transition: opacity 0.3s ease; /* optional fade */
  opacity: 1; /* Show by default */
}

/* Once loaded, we can either remove the skeleton or fade the real image in */
img:not(.fancybox-container img):not(.block_db_img img)[data-loaded="true"] {
  opacity: 1; /* The real image will appear (if you want a fade-in) */
  background-color: transparent; /* Remove skeleton color if you prefer */
}

/* If the image fails to load, show fallback (already done in your code) */
img:not(.fancybox-container img):not(.block_db_img img)[data-loaded="failed"] {
  opacity: 1; 
  background-color: #EEE7DD;
  background-image: url('https://carnewschina.com/wp-content/themes/capybara/assets/img/skeleton_img.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}






.wp-block-table th,
.wp-block-table td {
  margin: 0;
  padding: 0;
  border: none;
  text-align: left;
}

.wp-block-table {
  display: block; /* Makes the table behave like a block-level element */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling for mobile devices */
  max-width: 100%; /* Prevents the table from exceeding the viewport width */
  width: 100%;
  overflow-x: scroll;
}

@media (max-width:650px) {
  .wp-block-table,
  .wp-block-table.aligncenter,
  .wp-block-table.alignleft,
  .wp-block-table.alignright {
    display: block;
    max-width: none;
    width: calc(100vw - 2rem);
  }
}

.wp-block-table table {
  min-width: 600px; /* Ensures the table content is legible on smaller screens */
  width: 100%; /* Allows the table to take up available space */
  border-collapse: collapse;
  overflow-x: auto; /* Enables horizontal scrolling */
}


/* Table styles */
.wp-block-table table {
  border-collapse: collapse;
  width: 100%;
  border: 1px solid var(--brand--brown-default);
  font-family: var(--fonts--default);
  font-size: 1rem;
}

.wp-block-table th {
  font-weight: var(--fonts--styles--bold);
  font-family: var(--fonts--default);
  font-size: var(--fonts--sizes--x-small-12);
  padding: var(--spacing--xxs-4);
  border-right: 0.5px dashed var(--brand--beige-light);
  text-align: left;
  background-color: var(--brand--primary);
  color: var(--basic--white);
}

.wp-block-table tr {
  border-bottom: 0.5px solid var(--brand--brown-default);
}

.wp-block-table td {
  font-weight: var(--fonts--styles--regular);
  color: var(--basic--black);
  font-family: var(--fonts--default);
  font-size: 0.875rem;
  padding: 0.5rem;
  border-right: 0.5px dashed var(--brand--brown-default);
  vertical-align: top;
}

.wp-block-table tr:nth-child(odd) {
  background-color: #f6efe2;
}

.wp-block-table tr:nth-child(even) {
  background-color: var(--brand--beige-standard);
}

.wp-block-table td:last-child,
.wp-block-table th:last-child {
  border-right: none; /* Remove the border on the last cell */
}



/* Newsletter block styles for single post */ 
.block__newsletter.nwsl__single .block__newsletter_ico {
  display: none;
}

.block__newsletter.nwsl__single .block__newsletter_content {
  max-width: 100%;
}


.block__newsletter.nwsl__single .block__newsletter_top {
  padding-right: 0;
}

@media screen and (min-width: 1280px) {
  .block__newsletter.nwsl__single .form__nwsl_signup {
      max-width: 100%;
  }
}

/* Load More Loader */
.loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #554039;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Tags */
.article_detail__tag_item[href*="featured0"],
.article_detail__tag_item[href*="popular0"] {
    display: none !important;
}

/* Wrapper tags */
.wp-block-embed__wrapper {
  text-align: center;
}

/* Figcaption */
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
  z-index: 10;
}

.wp-block-image {
    align-items: center;
    justify-content: center;
}

/* Algolia Search Modification 
ol li.ais-Hits-item {
  list-style-type: none;
  padding: 0;
}

ol.ais-Hits-list {
  list-style-type: none;
  padding: 0;
}

mark.ais-Highlight-highlighted, mark.ais-Snippet-highlighted {
  background: #2090b4;
  padding: 0 0.25rem;
  color: #fff;
} */

.cnc-algolia-is-open .cnc-search {
    z-index: 99999;
}

/*YT video Size */
.wp-block-embed__wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* Aspect ratio (16:9) */
  height: 0;
}

.wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Page */
.page_detail__content.full_width  {
  max-width: 80% !important;
}

.page_detail__content.full_width table {
  overflow: hidden;
}


/* For large mobile devices up to 767px wide */
@media screen and (max-width: 767px) {
  .page_detail__content.full_width  {
    max-width: 100% !important;
  }

  .page_detail__content.full_width table {
    min-width: 240px !important;
  }

}

/* LOAD MORE */
.next-post {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 1px;
}
.next-post__loader {
  display: none
}
.next-post.loading .next-post__loader,
.next-post.loading .next-post__loader.next-post:after {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%
}
.next-post.loading .next-post__loader.next-post:after {
  content: ''
}
.next-post.loading .next-post__loader {
  position: absolute;
  left: 50%;
  top: 20px;
  z-index: 15;
  display: block;
  width: 40px;
  height: 40px;
  margin-left: -30px;
  padding: 10px;
  font-size: 10px;
  text-indent: -9999em;
  border-top: 1.1em solid rgba(0,0,0,0.1);
  border-right: 1.1em solid rgba(0,0,0,0.1);
  border-bottom: 1.1em solid rgba(0,0,0,0.1);
  border-left: 1.1em solid rgba(0,0,0,0.3);
  background: var(--brand--beige-light);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-animation: loading 1.1s infinite linear;
  animation: loading 1.1s infinite linear
}

@-webkit-keyframes loading {
  0% {
    -webkit-transform: rotate(0);
    transform: rotate(0)
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg)
  }
}

@keyframes loading {
  0% {
    -webkit-transform: rotate(0);
    transform: rotate(0)
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg)
  }
}

body.single-post .section__body {
  overflow: hidden;
}
.js-main-post article.post {
  position: relative;
  margin: 40px 0 0;
}
.js-main-post article.post:first-of-type {
  margin-top: 0;
}
@media (min-width: 768px) {
  .js-main-post article.post {
    margin-top: 80px;
  }
}
.section__comments .article_detail__content {
  flex: 1 0 auto;
}
.b-comments .button {
  display: inline-block;
}

/* ALGOLIA */
.ais-SearchBox-form {
  height: auto;
  background: none;
}
.ais-SearchBox-form:before {
  display: none;
}
.ais-SearchBox-input {
  border-color: var(--brand--brown-default);
  border-radius: 0;
  box-shadow: none;
  caret-color: auto;
}
.ais-SearchBox-input:focus {
  box-shadow: none;
  border-color: var(--brand--brown-default);
}
.header_search__content {
  width: 100%;
}

@media screen and (max-width: 767px) {
  .header__search_area {
    height: 100vh;
    padding-bottom: 0;
  }
  .header_search__content {
    padding-bottom: 0;
  }
  .header_search_results_wrapper .content__wrapper {
    height: 100%;
  }
  .header_search__results {
    height: 100%;
  }
  .search_meta_tags {
    width: calc(100vw - 1rem);
    margin-right: -1rem;
  }
  .search_meta_sorty_by {
    display: block;
  }
}

@media screen and (max-width: 991px) {
  .header_search__content {
    padding-bottom: 0;
  }
  .header_search_results_wrapper .content__wrapper {
    height: 100%;
  }
  .header_search__results {
    height: 100%;
  }
    .w-form {
    margin: 0;
  }
  .ais-SearchBox-input,
  .ais-SearchBox-input:focus {
    height: 40px;
    border-color: var(--brand--brown-default);
  }
  .search__results_meta {
    gap: 0;
  }
  .dynamic-tags-section {
    position: relative;
  }
  .dynamic-tags-section::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 5px;
    width: 50px;
    height: 30px;
    background: linear-gradient(to right, transparent 10%, #ffffff 80%);
    pointer-events: none;
  }
  .tags_list {
    padding-bottom: 5px;
  }
}

@media (min-width:800px) {
  .header__search_area {
    height: calc(100vh - 52px);
  }
  .header_search_results_wrapper {
    height: auto;
    display: flex;
    flex: 1;
    overflow: hidden;
  }
  .header_search_results_wrapper > .content__wrapper {
    height: 100%;
  }
  .header_search__results {
    display: flex;
    flex-direction: row;
    height: 100%;
    grid-column-gap: 3rem;
    grid-row-gap: 3rem;
    overflow: auto;
  }
  .search__results_meta {
    height: 100%;
    padding: 0 0 40px;
    flex: 1 0 25%;
    flex-direction: column;
    justify-content: flex-start;
    flex-shrink: 0;
    gap: 30px;
    overflow: hidden;
    overflow-y: auto;
  }
  .search_meta_tags {
    order: 2;
  }
  .search_meta_sorty_by {
    display: block;
    width: 100%;
    order: 1;
  }
  .search__results_items {
    flex: 1 1 auto;
    height: 100%;
    overflow: hidden;
    overflow-y: auto;
  }
  .header_search__content {
    height: 100%;
    padding: 0;
  }
}

@media (min-width:1280px) {
  .article_detail__top_heading {
    font-size: 2rem;
    line-height: 40px;
  }
}

.sort-title,
.filter-title {
  margin: 0 0 .15rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #000;
  text-align: left;
}

.dynamic-tag-button {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}
.ais-SortBy-select {
  height: 30px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--brand--brown-default);
  border-radius: 0;
  background-image: url('data:image/svg+xml;utf8,<svg width="14" height="24" xmlns="http://www.w3.org/2000/svg"><g stroke="%23554039" stroke-width="2" fill="none" fill-rule="evenodd"><path d="M13 7L7 1 1 7M1 17l6 6 6-6"/></g></svg>');
  color: var(--brand--brown-default);
}
.ais-SortBy-select:hover,
.ais-SortBy-select:active,
.ais-SortBy-select:focus {
  border: 1px solid var(--brand--brown-default);
  background-image: url('data:image/svg+xml;utf8,<svg width="14" height="24" xmlns="http://www.w3.org/2000/svg"><g stroke="%23554039" stroke-width="2" fill="none" fill-rule="evenodd"><path d="M13 7L7 1 1 7M1 17l6 6 6-6"/></g></svg>');
  box-shadow: none;
}

.ais-Hits-item,
.ais-InfiniteHits-item,
.ais-FrequentlyBoughtTogether-item,
.ais-LookingSimilar-item,
.ais-RelatedProducts-item,
.ais-TrendingItems-item {
  margin: 0 0 1rem;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.item__search_result {
  margin: 0;
  padding: 0 0 1rem;
}

.ais-Highlight-highlighted,
.ais-Snippet-highlighted {
  padding-right: var(--spacing--xxs-4);
  padding-left: var(--spacing--xxs-4);
  background: var(--brand--secondary);
  color: var(--basic--white);
}

@media (min-width:768px) {
  .item_search__img_container {
    width: 200px;
    max-width: 200px;
    min-width: 200px;
    height: 120px;
    min-height: 120px;
    max-height: 120px;
  } 
}
.item_search__title {
  font-size: 16px;
  line-height: 24px;
}

.ais-InfiniteHits-loadMore {
  border: 1px solid var(--brand--brown-default);
  background: #fff;
  color: var(--brand--brown-default);
  box-shadow: none;
}

.ais-InfiniteHits-loadMore:hover,
.ais-InfiniteHits-loadMore:focus,
.ais-InfiniteHits-loadMore:active {
  border: 1px solid var(--brand--brown-default);
  background: #fff;
  box-shadow: none;
}

.header__mobile_social_media .footer__social_media_list,
.footer__content .footer__social_media_list {
  flex-wrap: wrap;
}