/*
 * Category Card — link horizontal con bg image revelable al hover.
 */
.category-card {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 7rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg, 2px);
  background: rgb(var(--brand-primary, 0 48 86));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s;
}
@media (min-width: 768px) {
  .category-card { height: 8rem; }
}
/* Variant fotogràfica (bento): imatge protagonista amb vel només a la part
   baixa per a la llegibilitat del label. Totes les cel·les, mateixa alçada. */
.category-card--photo {
  height: 13rem;
  align-items: flex-end;
}
.category-card--photo .cc-bg {
  opacity: 0.9;
}
.category-card--photo .cc-gradient {
  /* Fosc i neutre: amb el color de marca, a Terres el turquesa tenyia la
     foto sencera. Veure card-vel.css. */
  background: linear-gradient(to top,
    rgb(var(--card-vel, 4 36 64) / 0.9) 0%,
    rgb(var(--card-vel, 4 36 64) / 0.45) 45%,
    rgb(var(--card-vel, 4 36 64) / 0.12) 75%,
    transparent 100%);
  opacity: 1;
}
.category-card--photo:hover .cc-bg {
  opacity: 1;
}
.category-card--photo:hover .cc-gradient {
  opacity: 1;
}
.category-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.cc-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  transition: opacity 0.7s, transform 0.7s;
  pointer-events: none;
}
.category-card:hover .cc-bg {
  opacity: 0.5;
  transform: scale(1.05);
}

.cc-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    rgb(var(--card-vel, 4 36 64)) 0%,
    rgb(var(--card-vel, 4 36 64) / 0.6) 50%,
    transparent 100%);
  opacity: 0.9;
  transition: opacity 0.3s;
  pointer-events: none;
}
.category-card:hover .cc-gradient {
  opacity: 0.7;
}

.cc-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cc-label {
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: #fff;
  margin: 0;
}

.cc-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
  flex-shrink: 0;
  margin-left: 1rem;
  background: transparent;
  color: #fff;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.category-card:hover .cc-chevron {
  background: rgb(var(--brand-accent, 243 197 0));
  border-color: rgb(var(--brand-accent, 243 197 0));
  color: rgb(var(--on-accent, var(--brand-primary , 0 48 86)));
}

/* Skin Terres: usa olive en hover en lugar del amarillo */
body.theme-terres .category-card:hover .cc-chevron,
.category-card.cc-terres:hover .cc-chevron {
  background: rgb(var(--brand-accent, 128 186 39));
  border-color: rgb(var(--brand-accent, 128 186 39));
  color: #fff;
}

.cc-sublabel {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(255 255 255 / 0.75);
}
.category-card:hover .cc-sublabel {
  color: rgb(var(--brand-accent, 243 197 0));
}

/* Descripció curta: només visible a les cel·les grans del bento */
.cc-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 0.4rem;
  max-width: 34rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgb(255 255 255 / 0.85);
}
@media (max-width: 639px) {
  .cc-desc { display: none; }
}
