.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bisbat-color-white);
  box-shadow: 0 1px 0 var(--bisbat-color-border-strong);
}

/* Franja principal del header */
.site-header__top {
  background: linear-gradient(180deg, var(--bisbat-color-primary-light) 0%, var(--bisbat-color-accent-blue) 100%);
}

.site-header__top-inner {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr) minmax(150px, 0.6fr) minmax(95px, 0.4fr);
  grid-template-areas: "branding contact social language";
  align-items: center;
  gap: 1.1rem;
  min-height: 84px;
  padding: 0.65rem 0;
}

.site-header__branding,
.site-header__contact,
.site-header__search,
.site-header__social,
.site-header__language {
  min-width: 0;
  position: relative;
}

.site-header__branding {
  grid-area: branding;
}

.site-header__contact {
  grid-area: contact;
}

.site-header__social {
  grid-area: social;
}

.site-header__language {
  grid-area: language;
}

.site-header__search {
  display: none !important;
}

.site-header__contact,
.site-header__social,
.site-header__language {
  padding-left: 1rem;
}

.site-header__contact::before,
.site-header__social::before,
.site-header__language::before {
  content: "";
  position: absolute;
  top: 18%;
  left: 0;
  width: 1px;
  height: 64%;
  background: rgba(255, 255, 255, 0.35);
}

.site-header__top .block-title,
.site-header__top h2 {
  display: none;
}

/* Wrappers de regions */
.site-header__branding > div,
.site-header__contact > div,
.site-header__social > div,
.site-header__language > div {
  width: 100%;
}

.site-header__branding .block,
.site-header__contact .block,
.site-header__social .block,
.site-header__language .block {
  margin: 0;
}

/* =========================
   Branding real
   ========================= */

#block-bisbat-marcadellloc {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

#block-bisbat-marcadellloc > a[rel="home"]:first-of-type {
  flex: 0 0 auto;
}

#block-bisbat-marcadellloc > a[rel="home"]:first-of-type img {
  display: block;
  max-height: 74px;
  width: auto;
}

#block-bisbat-marcadellloc > a[rel="home"]:last-of-type {
  color: #16314b;
  text-decoration: none;
  font-size: clamp(1.5rem, 1.9vw, 2rem);
  font-weight: 600;
  line-height: var(--bisbat-leading-tightest);
  letter-spacing: -0.02em;
  max-width: 180px;
}

#block-bisbat-marcadellloc > a[rel="home"]:last-of-type:hover {
  color: #102639;
}

/* =========================
   Contacte
   ========================= */

.site-header__contact {
  display: flex;
  align-items: center;
}

.header-contact {
  display: grid;
  gap: 0.35rem;
}

.header-contact__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  line-height: var(--bisbat-leading-tight);
}

.header-contact svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  color: #16314b;
}

.header-contact__item a {
  color: #102639;
  text-decoration: none;
  font-weight: 700;
}

.header-contact__item a:hover {
  color: #0e5675;
}

/* =========================
   Xarxes
   ========================= */

.header-social {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  flex-wrap: nowrap;
}

.header-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  color: rgba(16, 38, 57, 0.72);
  text-decoration: none;
  font-size: 1.8rem;
  line-height: var(--bisbat-leading-tightest);
  transition: color 0.2s ease, transform 0.2s ease;
}

.header-social__link:hover,
.header-social__link:focus {
  color: #102639;
  transform: translateY(-1px);
}

/* =========================
   Idiomes reals
   ========================= */

#block-bisbat-commutadordellengua .links {
  list-style: none;
  margin: 0;
  padding: 0;
}

#block-bisbat-commutadordellengua .links li {
  margin: 0;
  line-height: var(--bisbat-leading-compressed);
}

#block-bisbat-commutadordellengua .language-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #102639;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
}

#block-bisbat-commutadordellengua .language-link:hover {
  color: #0e5675;
}

#block-bisbat-commutadordellengua .language-link.is-active,
#block-bisbat-commutadordellengua li.is-active .language-link {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

#block-bisbat-commutadordellengua .language-icon {
  width: 14px;
  height: auto;
}

/* =========================
   Responsive tablet / desktop petit
   ========================= */

@media (max-width: 1200px) and (min-width: 992px) {
  .site-header__top-inner {
    grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr) minmax(130px, 0.6fr) minmax(95px, 0.4fr);
    grid-template-areas: "branding contact social language";
    gap: 0.75rem 1rem;
    min-height: 82px;
  }

  #block-bisbat-marcadellloc > a[rel="home"]:first-of-type img {
    max-height: 66px;
  }

  #block-bisbat-marcadellloc > a[rel="home"]:last-of-type {
    font-size: 1.55rem;
    max-width: 160px;
  }
}

/* =========================
   Mobile compacte
   ========================= */

@media (max-width: 991px) {
  .site-header__top-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "branding language"
      "contact contact";
    align-items: start;
    min-height: auto;
    padding: 0.45rem 0.7rem 0.5rem;
    gap: 0.3rem 0.6rem;
  }

  .site-header__contact,
  .site-header__social,
  .site-header__language {
    padding-left: 0;
  }

  .site-header__contact::before,
  .site-header__social::before,
  .site-header__language::before {
    display: none;
  }

  .site-header__social {
    display: none;
  }

  .site-header__language {
    justify-self: end;
    text-align: right;
    align-self: start;
  }

  #block-bisbat-marcadellloc {
    gap: 0.5rem;
  }

  #block-bisbat-marcadellloc > a[rel="home"]:first-of-type img {
    max-height: 44px;
  }

  #block-bisbat-marcadellloc > a[rel="home"]:last-of-type {
    font-size: 1rem;
    line-height: 1.02;
    max-width: 118px;
  }

  .site-header__contact {
    margin-top: -0.05rem;
  }

  .header-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.18rem 0.7rem;
    align-items: center;
  }

  .header-contact__item {
    gap: 0.38rem;
    font-size: 0.82rem;
    line-height: 1.15;
  }

  .header-contact svg {
    width: 0.9rem;
    height: 0.9rem;
  }

  .header-contact__item a {
    word-break: break-word;
  }

  #block-bisbat-commutadordellengua .links {
    display: flex;
    gap: 1rem;
  }

  #block-bisbat-commutadordellengua .language-link {
    font-size: 0.82rem;
    gap: 0.28rem;
    line-height: 1.1;
  }

  #block-bisbat-commutadordellengua .language-icon {
    width: 12px;
  }
}

@media (max-width: 575px) {
  .site-header__top-inner {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    width: 100% !important;
  }

  #block-bisbat-marcadellloc {
    gap: 0.42rem;
  }

  #block-bisbat-marcadellloc > a[rel="home"]:first-of-type img {
    max-height: 40px;
  }

  #block-bisbat-marcadellloc > a[rel="home"]:last-of-type {
    font-size: 0.95rem;
    max-width: 108px;
  }

  .header-contact {
    gap: 0.15rem 0.55rem;
    display: flex;
    flex-direction: column;
    align-items: start;
  }

  .header-contact__item {
    font-size: 0.78rem;
    gap: 0.32rem;
  }

  .header-contact svg {
    width: 0.82rem;
    height: 0.82rem;
  }

  #block-bisbat-commutadordellengua .language-link {
    font-size: 0.78rem;
  }
}