/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/

.xhs-blog-category-tabs {
  clear: both;
  max-width: 1110px;
  margin: 0 auto 28px;
  padding: 0 15px;
  text-align: center;
}

.xhs-blog-category-tabs > .nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: auto;
  max-width: 100%;
  margin: 0 auto 22px;
  padding: 4px;
  border: 1px solid rgba(237, 31, 36, .28);
  border-radius: 999px;
  background: #f6f6f6;
}

.xhs-blog-category-tabs > .nav > li {
  margin: 0;
}

.xhs-blog-category-tabs > .nav > li > a {
  min-height: 0;
  line-height: 1.2;
  padding: 10px 16px;
  border-radius: 999px;
  color: #777;
  font-weight: 600;
  white-space: nowrap;
}

.xhs-blog-category-tabs > .nav > li.active > a,
.xhs-blog-category-tabs > .nav > li > a:hover {
  background: #ed1f24;
  color: #fff;
}

@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/

  .xhs-blog-category-tabs {
    margin-bottom: 22px;
    padding: 0 10px;
  }

  .xhs-blog-category-tabs > .nav {
    gap: 4px;
    border-radius: 18px;
  }

  .xhs-blog-category-tabs > .nav > li > a {
    padding: 9px 12px;
    font-size: 12px;
  }

}

/*************** BLOG POSTS LAYOUT FIX ***************/

/* Force consistent 4:3 aspect ratio on blog images */
.box-blog-post .box-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #f5f5f5;
}

/* Position inner wrapper absolutely to match container dimensions */
.box-blog-post .box-image > div {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding-top: 0 !important;
}

/* Ensure the link covers the container */
.box-blog-post .box-image a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
}

/* Fit image beautifully in the aspect ratio box without distortion */
.box-blog-post .box-image img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Force consistent 4:3 aspect ratio on standard category/archive layouts (entry-image) */
.archive .entry-image a,
.category .entry-image a,
.blog .entry-image a,
.search .entry-image a {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  overflow: hidden !important;
  background-color: #f5f5f5;
}

.archive .entry-image a img,
.category .entry-image a img,
.blog .entry-image a img,
.search .entry-image a img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}


/* Align heights and bottoms of blog cards in the grid row */
.row .col.post-item {
  display: flex;
  flex-direction: column;
}

.row .col.post-item > .col-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.row .col.post-item .box-blog-post {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
}

.row .col.post-item .box-blog-post .box-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.row .col.post-item .box-blog-post .box-text-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Disable Masonry absolute positioning on blog grids and force horizontal flex layout */
.blog-wrapper .row.row-masonry,
.archive .row.row-masonry,
.blog-archive .row.row-masonry,
#post-list .row.row-masonry {
  position: static !important;
  height: auto !important;
  display: flex !important;
  flex-flow: row wrap !important;
}

.blog-wrapper .row.row-masonry > .col,
.archive .row.row-masonry > .col,
.blog-archive .row.row-masonry > .col,
#post-list .row.row-masonry > .col {
  position: static !important;
  left: auto !important;
  top: auto !important;
}


