/**
 * @file
 * AVQS horoscope category page.
 *
 * Loaded only on blog category pages, via the avqs/horoscope library attached in
 * avqs_horoscopo_preprocess_views_view() when the horoscope layout is used.
 *
 * Everything is scoped to .avqs-category-page so none of it leaks into the
 * rest of the site. Colours are the ones already used by the theme:
 * #295b95 primary, #da1a80 accent, #e4e7e9 border, #a4a4a4 metadata.
 */

.avqs-category-page .avqs-horoscope__intro {
  color: #555;
  margin-bottom: 1rem;
  max-width: 60ch;
}

/* Sign jump chips */
.avqs-category-page .avqs-horoscope__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 22px;
}

.avqs-category-page .avqs-horoscope__chips a {
  border: 1px solid #295b95;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  color: #295b95;
  white-space: nowrap;
}

/* Featured article */
.avqs-category-page .avqs-horoscope__featured .cat {
  color: #329ed6;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.avqs-category-page .avqs-horoscope__title {
  font-size: 2rem;
  font-weight: 600;
  margin: 4px 0 6px;
  line-height: 1.25;
}

.avqs-category-page .avqs-horoscope__title a {
  color: #295b95;
}

.avqs-category-page .avqs-horoscope__meta {
  font-size: 12px;
  color: #555;
  margin-bottom: 1rem;
}

.avqs-category-page .avqs-horoscope__meta em {
  color: #295b95;
  font-style: normal;
}

.avqs-category-page .avqs-horoscope__hero {
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  background: #f4f6f8;
}

.avqs-category-page .avqs-horoscope__hero img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.avqs-category-page .avqs-horoscope__general {
  font-size: 1.05rem;
  line-height: 1.6;
}

.avqs-category-page .avqs-horoscope__subhead {
  margin-top: 18px;
  font-size: 1.25rem;
  font-weight: 600;
}

/* The twelve sign cards */
.avqs-category-page .avqs-horoscope__signs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.avqs-category-page .avqs-horoscope__sign {
  border: 1px solid #e4e7e9;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.avqs-category-page .avqs-horoscope__sign:target {
  outline: 2px solid #295b95;
  background: #f7fafd;
}

/* Cards that deep link to the sign's section of the post. The anchor stays in
   the heading and is stretched over the card, so the whole card is clickable
   while the link remains a single, correctly labelled element. */
.avqs-category-page .avqs-horoscope__sign--linked {
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.avqs-category-page .avqs-horoscope__sign--linked:hover {
  border-color: #295b95;
  box-shadow: 0 2px 8px rgba(41, 91, 149, 0.14);
}

.avqs-category-page .avqs-horoscope__sign-name a {
  text-decoration: none;
}

.avqs-category-page .avqs-horoscope__sign-name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.avqs-category-page .avqs-horoscope__sign-name a:focus-visible {
  outline: 2px solid #295b95;
  outline-offset: 3px;
  border-radius: 3px;
}

.avqs-category-page .avqs-horoscope__sign-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: #295b95;
}

.avqs-category-page .avqs-horoscope__sign-range {
  display: block;
  color: #6d9ca2;
  font-size: 13px;
  margin: 2px 0 8px;
}

.avqs-category-page .avqs-horoscope__sign-text {
  font-size: 15px;
  line-height: 1.55;
  color: #3c3c3c;
  margin: 0;
}

/* Previous predictions */
.avqs-category-page .avqs-horoscope__previous-title {
  margin-top: 34px;
  font-size: 1.5rem;
  font-weight: 600;
}

@media (max-width: 767px) {
  .avqs-category-page .avqs-horoscope__signs {
    grid-template-columns: 1fr;
  }

  .avqs-category-page .avqs-horoscope__hero img {
    height: 200px;
  }
}

/* Ads.
 *
 * Positions and sizes follow "front designs/horoscopo.html": a leaderboard above
 * the content and a rectangle at the top of the sidebar column.
 *
 * The body.path-blog prefix is required, not decorative. Category pages live
 * under /blog/{slug}, so root_path is "blog" and the body gets the path-blog
 * class, which makes the generic blog ad rules in style.css match this page
 * too. That file and this one are separate libraries with no guaranteed load
 * order, so the specificity has to win on its own.
 */
body.path-blog .avqs-category-page .avqs-horoscope__leaderboard .avqs-ad {
  width: 64%;
  min-height: 90px;
  margin: 0 auto 1.5rem;
}

body.path-blog .avqs-category-page .avqs-horoscope__sidebar-ad .avqs-ad {
  width: 100%;
  min-height: 250px;
  margin: 0 0 1.5rem;
}

/* 64% of a phone leaves a container too narrow for any AdSense size, so the
   leaderboard goes full width on small screens, as the design's .ad.l does. */
@media (max-width: 767px) {
  body.path-blog .avqs-category-page .avqs-horoscope__leaderboard .avqs-ad {
    width: 100%;
  }
}
