/* ==========================================================================
   Casa do Poço — header
   The deconstructed wordmark header (CASA / DO / POÇO) and its nav overlay.
   ========================================================================== */

/* --- Skip link ------------------------------------------------------------ */

.skip-link {
    position: absolute;
    left: 12px;
    top: -100px;
    z-index: 100;
    padding: 0.5em 0.75em;
    background: var(--color-text);
    color: var(--color-bg);
    text-decoration: none;
    transition: top 200ms;
}

.skip-link:focus {
    top: 12px;
}

/* --- Header: deconstructed wordmark logo ----------------------------------- */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px var(--page-gutter) 14px;
    gap: var(--grid-gap);
    background-color: rgba(255, 255, 255, 0);
    transition: background-color 300ms 100ms ease, backdrop-filter 300ms 100ms ease;
    z-index: 10;
}

.header.is-open {
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Header: Logo */

/* Full-viewport grid the three wordmark words are placed on; sits behind
   page content and never intercepts clicks except on the words themselves. */
.header-logo {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 8px 12px 10px;
    pointer-events: none;
}

.header-logo-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.header-logo-lines line {
    stroke: var(--color-line);
    stroke-width: 1px;
}

.header-logo-word {
    position: relative;
    grid-row: var(--row, 2);
    grid-column: var(--col, 2);
    align-self: var(--align-v, center);
    justify-self: var(--align-h, center);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: var(--text-h2);
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    pointer-events: auto;
}

/* Grid position modifiers — row/col are 1 (top/left) through 3 (bottom/right) */
.header-logo-word[data-row="1"] { --row: 1; }
.header-logo-word[data-row="2"] { --row: 2; }
.header-logo-word[data-row="3"] { --row: 3; }
.header-logo-word[data-col="1"] { --col: 1; --align-h: start; }
.header-logo-word[data-col="2"] { --col: 2; --align-h: center; }
.header-logo-word[data-col="3"] { --col: 3; --align-h: end; }
.header-logo-word[data-row="1"] { --align-v: start; }
.header-logo-word[data-row="2"] { --align-v: center; }
.header-logo-word[data-row="3"] { --align-v: end; }


/* Header: Nav toggle */
.header-nav-button {
    position: fixed;
    font-size: var(--text-p);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: fixed;
    top: 0;
    right: 0;
    padding: 0.75rem;
    opacity: 0.6;
    z-index: 3;
}

.header-nav-button:hover {
    opacity: 1;
    
}

.header-nav-button-close {
    display: none;
    color: currentColor;
}

.header-nav-button-close svg {
    display: block;
    width: 14px;
    height: 14px;
}

.header.is-open .header-nav-button-open {
    display: none;
}

.header.is-open .header-nav-button-close {
    display: block;
}

/* Header nav overlay (opened by MENU) */

.header-nav {
    position: fixed;
    top: 4rem;
    right: 1rem;
    text-align: right;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transition: opacity 300ms var(--easing-gentle), visibility 0s 300ms;
}

.header.is-open .header-nav {
    opacity: 1;
    visibility: visible;
    transition: opacity 300ms var(--easing-gentle);
}

.header-nav-menu {
    padding-bottom: 2rem !important;
}

.header-nav-link {
    font-weight: 500;
    font-size: var(--text-h2);
    letter-spacing: -0.03em;
}

.header-nav-item.is-active .header-nav-link {
    font-style: italic;
}

.header-nav-link:hover {
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.header-nav-languages {

    font-family: var(--font-sans);
    font-weight: 500;
    font-size: var(--text-h2);
}

.header-nav-languages-link {
    color: var(--color-muted);
    text-decoration: none;
}

.header-nav-languages-item.is-active .header-nav-languages-link {
    color: var(--color-text);
}


@media screen and (min-width: 768px) {
    .header-nav-link {
        font-size: var(--text-p)
    }

    .header-nav-languages-link {
        font-size: var(--text-p)
    }
}