/*
 * Hero Detail — Nivel 3. Texto izq + info-card der.
 */
.hero-detail { position: relative; }

/*
 * El títol viu en mitja columna, amb la targeta "El que t'espera" al costat.
 * El tema injecta un h1 amb !important des dels ajustos d'aparença (a Terres
 * arriba fins a 6rem), i amb títols llargs com "Cellers i experiències
 * enoturístiques" el text se sortia per damunt de la targeta. Cal el
 * !important per guanyar aquella regla, i deixar que les paraules parteixin.
 */
h1.hd-title {
  font-size: clamp(2rem, 4vw, 3.5rem) !important;
  letter-spacing: 0.02em;
  line-height: 1;
  color: rgb(var(--brand-primary, 0 48 86));
  margin-bottom: 1.5rem;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

/* Sense això la meitat de text no pot encongir-se dins del flex. */
.hd-text { min-width: 0; }

.hd-emphasis {
  font-size: clamp(1.125rem, 1.6vw, 1.5rem);
  color: rgb(var(--brand-primary, 0 48 86));
  line-height: 1.3;
  margin-bottom: 1.25rem;
}

/* Los <p> se nombran aparte: el tema les fija el tamaño en la capa base y una
   regla directa gana siempre a la que heredarían del contenedor. */
.hd-body,
.hd-body p,
.hd-body li {
  font-size: 1rem;
  color: rgb(var(--neutral-text-muted, 75 85 99));
  line-height: 1.65;
}
.hd-body p + p {
  margin-top: 1rem;
}
.hd-body ul,
.hd-body ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}
.hd-body li + li {
  margin-top: 0.25rem;
}

/* Info-card derecha */
.hd-card-box {
  background-color: rgb(var(--neutral-bg, 249 250 251));
  border: 1px solid rgb(229 231 235);
  border-top: 4px solid rgb(var(--brand-accent, 243 197 0));
  border-radius: var(--radius-md, 0);
  padding: 2rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hd-card-title {
  font-size: 1.25rem;
  color: rgb(var(--brand-primary, 0 48 86));
  border-bottom: 1px solid rgb(229 231 235);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.hd-features { margin-bottom: 2rem; }

.hd-feature-bubble {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid rgb(229 231 235);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  color: rgb(var(--brand-primary, 0 48 86));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hd-feature-bubble .material-icons-outlined { font-size: 1.25rem; }

.hd-feature-label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: rgb(var(--brand-primary, 0 48 86));
}

.hd-tags-head { margin-bottom: 1rem; }
.hd-tags-icon {
  color: rgb(var(--brand-accent, 243 197 0));
  font-size: 1.25rem;
}
.hd-tags-title {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: rgb(var(--neutral-text-muted, 107 114 128));
}

.hd-tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  background: #fff;
  color: rgb(var(--neutral-text-muted, 75 85 99));
  border: 1px solid rgb(229 231 235);
  border-radius: var(--radius-pill, 0);
}
@media (min-width: 768px) {
  .hd-tag { padding: 0.5rem 1rem; font-size: 0.875rem; }
}

/* Skin Terres: card border-top olive */
body.theme-terres .hd-card-box,
.hero-detail.hd-terres .hd-card-box {
  border-top-color: rgb(var(--brand-accent, 128 186 39));
}
body.theme-terres .hd-tags-icon,
.hero-detail.hd-terres .hd-tags-icon {
  color: rgb(var(--brand-accent, 128 186 39));
}

/* Features/tags com a enllaços d'scroll (quan scroll_target està rellenat) */
.hd-feature--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}
.hd-feature--link:hover {
  transform: translateX(2px);
}
.hd-feature--link:hover .hd-feature-bubble {
  background: rgb(var(--brand-accent) / 0.15);
}
.hd-feature--link:hover .hd-feature-label {
  color: rgb(var(--brand-primary));
}
.hd-tag--link {
  cursor: pointer;
  transition: all 0.2s ease;
}
.hd-tag--link:hover {
  background: rgb(var(--brand-primary));
  color: white;
  border-color: rgb(var(--brand-primary));
}

/* Scroll suau global per ancles dins de la pàgina (cuando JS no lo intercepta). */
html {
  scroll-behavior: smooth;
}

/* Sticky de l'info-card al hero detall.
   En desktop, fem que la caixa interna (.hd-card-box) s'enganxi a l'scroll
   mentre la columna esquerra (text + body) continua avançant.
   Per a què sticky funcioni necessitem:
   - El contenidor pare (.hero-detail) NO ha de tenir overflow hidden/auto.
   - El wrapper directe (.hd-card) ha d'estirar-se per omplir la fila flex
     (no items-start exclusiu); sticky engancha dins d'aquest wrapper. */
@media (min-width: 1024px) {
  /* Estirar el wrapper a l'alçada total de la fila per a què sticky tingui marge. */
  .hero-detail .hd-card {
    align-self: stretch;
  }
  .hero-detail .hd-card-box {
    position: sticky;
    top: 96px;
  }
}
