/* Evoque Blog Grid — styles
 * Dynamic values come from CSS variables set inline on .evq-blog:
 *   --evq-color : brand colour (shortcode "color" attribute)
 *   --evq-cols  : desktop column count (shortcode "columns" attribute)
 */
.evq-blog {
  max-width: 1240px;
  margin: 0 auto;
  font-family: "allerregular", Arial, Tahoma, sans-serif;
}

.evq-blog * {
  font-family: "allerregular", Arial, Tahoma, sans-serif;
}

/* Category archive: drop the theme's transparent-overlap header + title bar
   so the grid banner starts clean (mirrors the single-post template). */
body.evqs-archive #Top_bar { position: static; }
body.evqs-archive #Header_wrapper,
body.evqs-archive #Intro { background-color: transparent; }
body.evqs-archive #Subheader { display: none; }
body.evqs-archive .evqs-archive-wrap { padding-top: 30px; padding-bottom: 70px; }

/* Category page hero banner (eyebrow + title, no background). */
.evqs-cat-banner {
  text-align: center;
  padding: 30px 20px 10px;
  margin: 0 0 34px;
}

/* Author photo in the banner. */
.evqs-cat-banner__avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #2c2f36;
  background: #1b75bc;
}

.evqs-cat-banner__avatar::before {
  content: attr(data-initial);
  color: #fff;
  font-size: 40px;
  line-height: 1;
}

.evqs-cat-banner__avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.evqs-cat-banner__eyebrow {
  display: block;
  color: #2f93dd;
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.evqs-cat-banner__title {
  color: #16181d;
  font-size: 40px;
  line-height: 1.15;
  font-weight: 400;
  margin: 0;
}

@media (max-width: 640px) {
  .evqs-cat-banner { padding: 8px 10px; }
  .evqs-cat-banner__title { font-size: 26px; }
}

/* Category slider — single scrollable row with prev/next arrows that
   float over the ends; tabs fade out under them via the edge gradients. */
.evq-blog .evq-filterbar {
  position: relative;
  margin: 0 0 30px;
  padding: 0 50px;
}

.evq-blog .evq-filters {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: 15px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 5px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* old Edge/IE */
  /* Fade the two edges so a half-scrolled tab dissolves instead of hard-cutting.
     Transparency-based, so it works on any page background. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
}

.evq-blog .evq-filters::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

/* Few tabs that fit without scrolling → centre them (toggled from JS). */
.evq-blog .evq-filters.is-centered {
  justify-content: center;
}

.evq-blog .evq-fnav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--evq-color);
  font-size: 24px;
  line-height: 29px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .16);
  transition: opacity .2s, background .2s;
}

.evq-blog .evq-fnav::after {
  display: none;
}

.evq-blog .evq-fnav--prev {
  left: 0;
}

.evq-blog .evq-fnav--next {
  right: 0;
}

.evq-blog .evq-fnav:hover {
  background: #f3f7fb;
}

.evq-blog .evq-fnav.is-disabled {
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

.evq-blog .evq-filter {
  flex: 0 0 auto;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 400;
  color: #777;
  padding: 6px 2px;
  margin: 0;
  border-bottom: 2px solid transparent;
  transition: .2s;
}

.evq-blog .evq-filter:hover {
  color: var(--evq-color);
}

.evq-blog .evq-filter:hover:after {
  display: none;
}

.evq-blog .evq-filter.is-active {
  color: var(--evq-color);
  border-bottom-color: var(--evq-color);
}

.evq-blog .evq-grid {
  display: grid;
  grid-template-columns: repeat(var(--evq-cols), 1fr);
  gap: 15px;
  transition: opacity .2s ease;
}

/* AJAX loading state — dim the grid while new cards are fetched. */
.evq-blog.is-loading .evq-grid {
  opacity: .45;
  pointer-events: none;
}

.evq-blog.is-loading .evq-filters {
  pointer-events: none;
}

/* Load more */
.evq-blog .evq-more {
  text-align: center;
  margin-top: 30px;
}

.evq-blog .evq-loadmore {
  background: var(--evq-color);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .5px;
  padding: 13px 40px;
  border-radius: 6px;
  margin: 0;
  transition: filter .2s, opacity .2s;
}

.evq-blog .evq-loadmore:hover {
  filter: brightness(1.08);
}

.evq-blog .evq-loadmore.is-hidden {
  display: none;
}

.evq-blog.is-loading .evq-loadmore {
  opacity: .6;
  pointer-events: none;
}

.evq-blog .evq-card {
  position: relative;
  height: 570px;
  border-radius: 6px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}

.evq-blog .evq-card__img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform .5s ease;
}

.evq-blog .evq-card:hover .evq-card__img {
  transform: scale(1.07);
}

.evq-blog .evq-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 74, 120, .92) 0%, rgba(27, 117, 188, .5) 40%, rgba(0, 0, 0, 0) 75%);
}

/* Full-card click target → the post (sits below the body's own links). */
.evq-blog .evq-card__cover {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.evq-blog .evq-card__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 22px 20px;
  color: #fff;
  z-index: 2;
}

.evq-blog .evq-card__titlelink {
  display: block;
  color: inherit;
  text-decoration: none;
}

.evq-blog .evq-card__title {
  display: block;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

/* Category + author links inside the card meta. */
.evq-blog .evq-card__cat,
.evq-blog .evq-card__name {
  color: inherit;
  text-decoration: none;
}

.evq-blog .evq-card__cat:hover,
.evq-blog .evq-card__name:hover {
  text-decoration: underline;
}

.evq-blog .evq-card__meta {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #eaf4fd;
  font-weight: 400;
}

.evq-blog .evq-card__dot {
  margin: 0 6px;
  opacity: .7;
}

/* Author name + photo, kept together and pushed to the right. */
.evq-blog .evq-card__author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.evq-blog .evq-card__avatar {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #fff;
  overflow: hidden;
  background: var(--evq-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Initials fallback — shown when there is no Gravatar photo
   (the <img> removes itself on a 404 via onerror). */
.evq-blog .evq-card__avatar::before {
  content: attr(data-initial);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.evq-blog .evq-card__avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media(max-width:1000px) {
  .evq-blog .evq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:640px) {
  .evq-blog .evq-grid {
    grid-template-columns: 1fr;
  }

  .evq-blog .evq-filter {
    font-size: 13px;
    padding: 0;
  }

  .evq-blog .evq-banner h2 {
    font-size: 26px;
  }

  .evq-blog .evq-card {
    height: 340px;
  }

  .evq-blog .evq-card__body {
    padding: 10px;
  }

  .evq-blog .evq-card__title {
    font-size: 16px;
    margin: 0 0 5px;
  }
  body.evqs-archive .evqs-archive-wrap {
    padding: 0 15px 30px;
}
}