/* ============================================================================
   XYZ BIM — the portable site chrome
   v1 · the header and footer any project can wear.

   WHY THIS FILE EXISTS

   brand.css gives a project the house colour, type and rhythm. It does not
   give it the house *header* — and a shared palette with a different header
   still reads as a different company. chrome.css looked like it should cover
   that, but it is 31 KB of the home page specifically: .hero, .mark-big,
   .compare, .pmodal, the project grid. A project cannot adopt those without
   adopting the home page's markup and its JavaScript.

   So this is the missing layer: two components, no dependencies, no JS
   required, and markup short enough to paste. Load it after brand.css and
   your page has the mother site's header.

       <link rel="stylesheet" href="https://brand.xyzbim.eu/v1/brand.css">
       <link rel="stylesheet" href="https://brand.xyzbim.eu/v1/site.css">
       <link rel="stylesheet" href="/your-project.css">   <!-- optional -->

   The markup is in site.html next to this file. Copy it verbatim; the only
   thing you change is the project name in .xsite-nav__where and the links.

   It deliberately does NOT style your page body. Bring your own layout - this
   only claims .xsite-* class names, so it cannot collide with what you have.
   ========================================================================= */

/* ---------------------------------------------------------------- header -- */

.xsite-nav{
  position: sticky;
  top: 0;
  /* Nao herdar o line-height do corpo da pagina que hospeda o cabecalho.
     Duas paginas do monumentos usam 1.7 para o texto corrido, e o mesmo
     cabecalho saia 48px la e 45px no resto: um componente que muda de
     tamanho consoante a pagina ainda nao e portatil. */
  line-height: 1.3;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: 12px var(--pad, 24px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-2);
  font-family: var(--f-sans);
}
/* color-mix is recent; this is what older engines get. */
@supports not (background: color-mix(in srgb, red 50%, blue)){
  .xsite-nav{ background: var(--bg); }
}

.xsite-nav__mark{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}
.xsite-nav__mark svg{
  width: 26px;
  height: auto;
  display: block;
  color: currentColor;
}

.xsite-nav__word{ display: flex; flex-direction: column; line-height: 1.05; }
.xsite-nav__word b{
  font-weight: 500;          /* the wordmark is medium, never bold */
  font-size: 13px;
  letter-spacing: .01em;
}
.xsite-nav__word em{
  font-style: normal;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Which project this is. The one line each site changes. */
.xsite-nav__where{
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-left: clamp(10px, 2vw, 18px);
  border-left: 1px solid var(--rule);
  align-self: stretch;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.xsite-nav__links{
  display: flex;
  gap: clamp(12px, 2vw, 26px);
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}
.xsite-nav__links a{
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--tr-fast), border-color var(--tr-fast);
}
.xsite-nav__links a:hover{ color: var(--ink); border-bottom-color: var(--accent); }
.xsite-nav__links a[aria-current]{ color: var(--ink); border-bottom-color: var(--ink-3); }
.xsite-nav a:focus-visible,
.xsite-foot a:focus-visible{ outline: 2px solid var(--accent); outline-offset: 3px; }

.xsite-nav__home{
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.xsite-nav__home:hover{ color: var(--accent); }

/* Language switcher. Optional - a single-language project just omits it.
   The active language is marked with aria-current, not only with colour. */
.xsite-nav__lang{
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--rule);
  flex: 0 0 auto;
}
.xsite-nav__lang a{
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--ink-3);
  text-decoration: none;
  padding: 3px 6px;
  border: 1px solid transparent;
  transition: color var(--tr-fast), border-color var(--tr-fast);
}
.xsite-nav__lang a:hover{ color: var(--ink); }
.xsite-nav__lang a[aria-current]{
  color: var(--ink);
  border-color: var(--rule);
}

/* Interruptor claro/escuro: a nossa marca, normal num tema e vazada de um
   quadrado cheio no outro.

   A chapa e sempre var(--ink) e a marca sempre var(--bg), e como os dois
   tokens trocam com o tema, a chapa fica sempre no oposto da pagina: preta
   com marca branca no tema claro, branca com marca preta no escuro. Solida
   e legivel dos dois lados - a primeira versao deixava o tema claro sem
   chapa, so com o traco fino da marca, e lia-se como um quadrado vazio.

   Custo assumido: o botao mostra o tema para onde vais, nao aquele em que
   estas. E a convencao mais comum e o unico modo de ter as duas versoes
   solidas.

   A marca vem por mask-image, nao por markup, para que as paginas que ja
   emitem <button class="xsite-nav__toggle"></button> vazio - os layouts Astro,
   o chrome.js, o pipeline do precoobra - herdem o desenho sem mudar uma linha
   de HTML. */
:root{ --xyz-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='102.542 120.452 25.680 26.355' fill='%23000'%3E%3Cpath d='M 115.600 133.702 L 119.313 138.634 L 122.858 133.924 L 123.809 133.924 L 119.789 139.266 L 119.313 139.898 L 114.649 133.702 Z'/%3E%3Cpath d='M 124.097 144.990 L 123.145 144.990 L 119.313 139.898 L 115.480 144.990 L 114.528 144.990 L 119.313 138.634 L 119.789 139.266 Z'/%3E%3Cpath d='M 114.833 133.702 L 114.833 128.137 L 110.416 122.270 L 111.399 122.270 L 115.209 127.331 L 119.019 122.270 L 120.002 122.270 L 115.600 128.117 L 115.600 133.702 Z'/%3E%3Cpath d='M 115.600 133.702 L 115.529 133.797 L 115.457 133.892 L 115.314 134.082 L 110.010 141.129 L 115.600 141.129 L 115.600 141.513 L 115.600 141.896 L 108.853 141.896 L 108.610 141.896 L 114.201 134.469 L 108.610 134.469 L 108.610 134.085 L 108.610 133.702 Z'/%3E%3C/svg%3E"); }
.xsite-nav__toggle{
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: 10px;
  border: 1px solid var(--ink);
  background: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
  transition: background var(--tr-fast), border-color var(--tr-fast);
}
.xsite-nav__toggle::before{
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--bg);
  -webkit-mask: var(--xyz-mark) center / contain no-repeat;
  mask: var(--xyz-mark) center / contain no-repeat;
  transition: background var(--tr-fast);
}
.xsite-nav__toggle:hover{ border-color: var(--accent); }
.xsite-nav__toggle:focus-visible{ outline: 2px solid var(--accent); outline-offset: 3px; }

/* 900px, nao 720: e o limite que o chrome.css usa para o nav antigo, e
   medido com 14 links o .xsite-nav empilhava ate 172px na faixa dos 721
   aos 900. Colapsar ate aos 900 fixa-o em 88px, e o nav curto tambem
   melhora (95 -> 88). Nao subir para 1024: ai o nav curto piorava,
   de 52px para 88. */
@media (max-width: 900px){
  .xsite-nav{ flex-wrap: wrap; gap: 10px 16px; }
  .xsite-nav__where{ border-left: 0; padding-left: 0; }

  /* Uma linha que se arrasta, em vez de varias linhas que empilham.
     Um site com muitos links dava um cabecalho de quatro linhas num
     telemovel: o monumentos, com 14, ocupava 133px de um ecra de 812 - 16%
     do que ha, e nas paginas que sao aplicacoes de viewport inteiro esse
     espaco sai directamente ao mapa. Uma fila rolavel custa uma linha, diz
     que ha mais para o lado com o esbatimento da direita, e nao esconde
     nada. */
  .xsite-nav__links{
    width: 100%; margin-left: 0; order: 3; gap: 14px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* o esbatimento e a unica pista de que a fila continua */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
  }
  .xsite-nav__links::-webkit-scrollbar{ display: none; }
  .xsite-nav__links a{ white-space: nowrap; flex: 0 0 auto; }
}

/* ---------------------------------------------------------------- footer -- */

.xsite-foot{
  margin-top: clamp(48px, 8vw, 120px);
  padding: clamp(28px, 5vw, 56px) var(--pad, 24px);
  border-top: 1px solid var(--rule);
  background: var(--bg-2);
  font-family: var(--f-sans);
  color: var(--ink-2);
}
.xsite-foot__grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: clamp(20px, 3vw, 44px);
  max-width: var(--max, 1680px);
  margin: 0 auto;
}
.xsite-foot__tag{
  display: block;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.xsite-foot a{
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color var(--tr-fast);
}
.xsite-foot a:hover{ border-bottom-color: var(--accent); }
.xsite-foot ul{ list-style: none; margin: 0; padding: 0; }
.xsite-foot li{ padding: 3px 0; font-size: 13.5px; }
.xsite-foot p{ margin: 0; font-size: 13.5px; }

.xsite-foot__mail{
  font-size: clamp(15px, 2vw, 20px);
  color: var(--ink);
  border-bottom-width: 1px;
}

.xsite-foot__bottom{
  max-width: var(--max, 1680px);
  margin: clamp(24px, 4vw, 44px) auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule-2);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@media print{
  .xsite-nav{ position: static; background: none; backdrop-filter: none; }
}
