/* Underskin — FAQ page.
   Sticky chip nav for categories, one <details> accordion per Q&A.
   No JS: native disclosure elements handle open/close and are keyboard-
   accessible out of the box (Space/Enter). */

/* Body ships a page-length sunset gradient (sand → dark) which compresses
   into a visible dark band on shorter pages like FAQ. Neutralise it here
   so the FAQ page stays on solid sand until the footer takes over. */
body.page-template-page-faq {
    background-image: none;
    background-color: var(--color-sand);
}

.faq-page {
    /* bg dal body — container transparent così grain body::after è visibile. */
}

/* Site header renders with its own sticky+z-index; anchor the chip bar just
   below it so their bottoms don't overlap during scroll. Header height is
   ~92px on mobile / ~108px on desktop (72/88px logo + block padding). */
.faq-nav {
    position: sticky;
    top: 92px;
    z-index: calc(var(--z-header) - 1);
    padding-block: var(--space-sm);
    margin-bottom: var(--space-lg);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (min-width: 1024px) {
    .faq-nav {
        top: 108px;
    }
}

/* Fullbleed the sticky nav so its background reaches the viewport edges,
   even though the chips inside stay within the container width. */
.faq-nav::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    backdrop-filter: inherit;
    -webkit-backdrop-filter: inherit;
    z-index: -1;
    margin-inline: calc(50% - 50vw);
}

.faq-nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    flex-wrap: wrap;
}

.faq-nav__chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--ink);
    background: transparent;
    border: 1px solid rgba(42, 30, 20, 0.25);
    border-radius: 50px;
    text-decoration: none;
    transition:
        background-color var(--duration-fast) var(--ease-default),
        color var(--duration-fast) var(--ease-default),
        border-color var(--duration-fast) var(--ease-default);
}

.faq-nav__chip:hover,
.faq-nav__chip:focus-visible {
    background: var(--accent);
    color: var(--color-sand);
    border-color: var(--accent);
    outline: none;
}

.faq-group {
    /* Header (~92px mobile / ~108px desktop) + chip bar (~52px / ~68px) +
       breathing room so the category heading isn't clipped by the sticky
       nav on jump. */
    scroll-margin-top: 180px;
    margin-bottom: var(--space-xl);
}

@media (min-width: 1024px) {
    .faq-group {
        scroll-margin-top: 220px;
    }
}

.faq-group__title {
    font-family: var(--font-signature);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: var(--accent);
    margin: 0 0 var(--space-md);
    letter-spacing: 0.02em;
}

.faq-group__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.faq-item {
    background: transparent;
    border: 1px solid rgba(42, 30, 20, 0.15);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color var(--duration-fast) var(--ease-default);
}

.faq-item[open] {
    border-color: rgba(42, 30, 20, 0.35);
}

.faq-item__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}

.faq-item__question::-webkit-details-marker {
    display: none;
}

.faq-item__question:hover,
.faq-item__question:focus-visible {
    color: var(--accent);
    outline: none;
}

.faq-item__question-text {
    flex: 1;
    line-height: 1.35;
}

.faq-item__icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--accent);
    transition: transform var(--duration-fast) var(--ease-default);
}

.faq-item[open] .faq-item__icon {
    transform: rotate(45deg);
}

/* Height wrapper animated by faq.js. When JS is present the inline height
   is set explicitly and transitions to scrollHeight; when JS is disabled,
   this rule still lets native <details> show the answer immediately. */
.faq-item__wrapper {
    overflow: hidden;
    height: 0;
    transition: height 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item[open] .faq-item__wrapper {
    height: auto;
}

.faq-item__answer {
    padding: 0 var(--space-md) var(--space-md);
    color: var(--ink);
    line-height: 1.6;
    opacity: 0;
    transform: translateY(-4px);
    transition:
        opacity 240ms ease 60ms,
        transform 260ms cubic-bezier(0.4, 0, 0.2, 1) 60ms;
}

.faq-item[open] .faq-item__answer {
    opacity: 1;
    transform: translateY(0);
}

.faq-item__answer p:first-child { margin-top: 0; }
.faq-item__answer p:last-child { margin-bottom: 0; }

.faq-item__answer a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.faq-page__cta {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(42, 30, 20, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    text-align: center;
}

.faq-page__cta-text {
    font-family: var(--font-signature);
    font-size: clamp(1.15rem, 1.8vw, 1.5rem);
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0;
}

.faq-page__empty {
    text-align: center;
    color: var(--ink);
    opacity: 0.7;
    padding: var(--space-xl) 0;
}
