/* The concierge's side panel (Views/Shared/_ConciergePanel.cshtml, js/odoardo-concierge.js): the one place the
   concierge lives, on every page, opened by every way to it. It slides in from the right like the basket's drawer
   (cart.css) and shares its height above the page: the two are never open together. Everything here is scoped to the
   panel, so no page's own stylesheet can reach into the conversation. */

/* #region Shell */
.concierge-overlay {
    position: fixed;
    inset: 0;
    z-index: 1240;
    background: var(--overlay);
    opacity: 1;
    transition: opacity .4s var(--ease-house);
}

    .concierge-overlay.is-hidden {
        opacity: 0;
        pointer-events: none;
    }

/* Above the dock and the basket's bag (900) and the partner's consent bar (1200), level with the basket's drawer. */
.concierge-panel {
    --concierge-gutter: clamp(1.5rem, 4vw, 2.4rem);
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1250;
    display: flex;
    flex-direction: column;
    width: min(96vw, 600px);
    height: 100vh;
    height: 100dvh;
    background: var(--black);
    border-left: 1px solid var(--line);
    color: var(--white);
    transform: translateX(100%);
    /* Hidden for real when closed — off-screen alone still leaves its controls in the tab order. The visibility
       change waits for the slide out, so the panel never vanishes mid-motion. */
    visibility: hidden;
    transition: transform .5s var(--ease-house), visibility 0s linear .5s;
    padding-right: env(safe-area-inset-right, 0px);
}

    .concierge-panel.open {
        transform: translateX(0);
        visibility: visible;
        transition: transform .5s var(--ease-house), visibility 0s linear 0s;
    }
/* #endregion */

/* #region Head */
/* The right padding clears the close button, which a narrow panel otherwise lays over the heading. */
.concierge-head {
    position: relative;
    flex: 0 0 auto;
    padding: 1.8rem calc(1.6rem + 40px + .75rem) 1.5rem var(--concierge-gutter);
    border-bottom: 1px solid var(--line);
}

    .concierge-head .h-tag {
        margin-bottom: .9rem;
    }

    .concierge-head h2 {
        margin: 0;
        color: var(--white);
        font-family: var(--font-display);
        font-size: clamp(1.65rem, 2.6vw, 2.2rem);
        font-weight: 300;
        letter-spacing: -.02em;
        line-height: 1.14;
        text-wrap: balance;
    }

        .concierge-head h2 i {
            color: var(--gold);
            font-weight: 300;
        }

.concierge-close {
    position: absolute;
    top: 1.6rem;
    right: 1.6rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--white);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color .3s var(--ease-house), color .3s var(--ease-house);
}

    .concierge-close:hover,
    .concierge-close:focus-visible {
        border-color: var(--gold);
        color: var(--gold);
    }

    .concierge-close:focus-visible {
        outline: 1px solid var(--gold-mid);
        outline-offset: 3px;
    }
/* #endregion */

/* #region Conversation */
/* The conversation scrolls on its own; the head and the field stay where they are. The suggestions stand at its foot,
   just above the field, where the hand that types finds them. */
.concierge-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem var(--concierge-gutter) 1.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.concierge-panel .canvas-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.concierge-panel .voice-line-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1.1rem;
}

.concierge-panel .voice-line-icon {
    display: block;
    width: 10px;
    height: 10px;
    opacity: .85;
}

/* The mark is the drawing, white, at its cap height — see the note on .logo in site.css. It matches 10px type
   beside the 10px glyph, so the drawing is 0.72 × 10. */
.concierge-panel .voice-line-wordmark {
    display: block;
    width: auto;
    height: 7.2px;
}

/* The visitor's last question, a quiet line above the answer: the conversation shows only the concierge's latest
   reply, so this line is the one trace of what was asked — and of what the microphone heard. */
.concierge-panel .voice-question {
    max-width: 100%;
    margin: 0 0 .9rem;
    color: var(--text-muted);
    font-size: .62rem;
    font-weight: 300;
    letter-spacing: 3px;
    line-height: 1.6;
    text-transform: uppercase;
    opacity: .7;
}

    .concierge-panel .voice-question[hidden] {
        display: none;
    }

/* The answer arrives with a short rise; the script sets the opacity and the transform it lands on. */
.concierge-panel .voice-line {
    align-self: stretch;
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 1.5vw, 1.32rem);
    font-weight: 300;
    line-height: 1.6;
    text-align: left;
    overflow-wrap: break-word;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity .5s var(--ease-house), transform .5s var(--ease-house);
}

    .concierge-panel .voice-line i {
        color: var(--gold);
        font-style: italic;
    }

    /* The concierge writes an address when it cannot answer — a mailto in the browser's own blue would be the one
       place the panel stops looking like the house. */
    .concierge-panel .voice-line a {
        color: var(--white);
        text-decoration: underline;
        text-underline-offset: 2px;
        transition: color var(--motion-quick) var(--ease-house);
    }

        .concierge-panel .voice-line a:hover,
        .concierge-panel .voice-line a:focus-visible {
            color: var(--gold);
        }

/* The wait: three small gold points breathing one beat apart, and above them, while a capability runs, the word for
   what is being done, in the answer's own face. */
.concierge-panel .voice-thinking {
    display: inline-flex;
    align-items: center;
    gap: .45em;
}

    .concierge-panel .voice-thinking span {
        width: .34em;
        height: .34em;
        border-radius: 50%;
        background: var(--gold);
        opacity: .25;
        animation: concierge-thinking 1.4s ease-in-out infinite;
    }

        .concierge-panel .voice-thinking span:nth-child(2) {
            animation-delay: .2s;
        }

        .concierge-panel .voice-thinking span:nth-child(3) {
            animation-delay: .4s;
        }

.concierge-panel .voice-working {
    margin-right: .6em;
    font: inherit;
    font-style: italic;
    opacity: .7;
}

@keyframes concierge-thinking {
    0%, 70%, 100% {
        opacity: .25;
    }

    35% {
        opacity: 1;
    }
}

/* The works the concierge shows under its answer: square, like every image of the house, three in a row, each
   leading to its artist's page. */
.concierge-panel .voice-artworks {
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 1.4rem;
}

    .concierge-panel .voice-artworks[hidden] {
        display: none;
    }

.concierge-panel .voice-artwork {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--white);
    text-decoration: none;
    animation: concierge-artwork-in .5s var(--ease-house) both;
}

    .concierge-panel .voice-artwork img {
        display: block;
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border: 1px solid var(--hairline-mid);
        transition: border-color var(--motion-quick) var(--ease-house);
    }

    .concierge-panel .voice-artwork:hover img,
    .concierge-panel .voice-artwork:focus-visible img {
        border-color: var(--gold);
    }

.concierge-panel .voice-artwork-title {
    font-family: var(--font-display);
    font-size: .92rem;
    font-weight: 300;
    line-height: 1.35;
}

.concierge-panel .voice-artwork-artist {
    color: var(--text-muted);
    font-size: .6rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

    .concierge-panel .voice-artwork:hover .voice-artwork-title,
    .concierge-panel .voice-artwork:focus-visible .voice-artwork-title {
        color: var(--gold);
    }

@keyframes concierge-artwork-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* #endregion */

/* #region Suggestions */
.concierge-panel .whispers-wrapper {
    margin-top: auto;
}

.concierge-panel .whisper-label {
    margin-bottom: .7rem;
    color: rgba(245, 245, 245, .5);
    font-family: var(--font-mono);
    font-size: .62rem;
    font-weight: 300;
    letter-spacing: 5px;
    text-transform: uppercase;
    transition: opacity .3s ease;
}

.concierge-panel .whispers-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
    transition: opacity .3s ease;
}

.concierge-panel .hidden {
    opacity: 0;
    pointer-events: none;
}

/* A suggestion is a naked line of text with the house's arrow after it, so the words are the whole target; the
   padding separates one from the next without moving the text off the column's edge. */
.concierge-panel .whisper-tag {
    display: inline-flex;
    align-items: baseline;
    gap: 14px;
    padding: .5rem 0;
    border: 0;
    background: transparent;
    color: var(--white);
    font-family: var(--font-sans);
    font-size: .86rem;
    font-weight: 400;
    letter-spacing: .03em;
    line-height: 1.6;
    text-align: left;
    cursor: pointer;
    transition: color var(--motion-quick) var(--ease-house), gap var(--motion-quick) var(--ease-house);
}

    .concierge-panel .whisper-tag > span:last-child {
        color: var(--gold);
    }

    .concierge-panel .whisper-tag:hover,
    .concierge-panel .whisper-tag:focus-visible {
        gap: 20px;
        color: var(--gold);
    }

    .concierge-panel .whisper-tag:focus-visible {
        outline: 1px solid var(--gold-mid);
        outline-offset: 3px;
    }
/* #endregion */

/* #region Field */
/* The field at the panel's foot, on the panel's own ground so the conversation scrolls under a clean edge. */
.concierge-foot {
    flex: 0 0 auto;
    padding: 1rem var(--concierge-gutter) calc(1.25rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--black);
}

.concierge-panel .input-container {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--hairline-mid);
    transition: border-color .35s var(--ease-house);
}

    .concierge-panel .input-container:focus-within {
        border-color: var(--gold);
    }

/* Above 16 px, or a phone zooms the whole page in when the field takes the focus. */
.concierge-panel .terminal-input {
    min-width: 0;
    flex: 1;
    padding: .9rem .25rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--white);
    caret-color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-style: italic;
}

    /* An invitation to type, not a label: ordinary words, the way every other field of the house shows them. */
    .concierge-panel .terminal-input::placeholder {
        color: var(--white-ghost);
        font-family: var(--font-sans);
        font-size: .86rem;
        font-style: normal;
        letter-spacing: .02em;
    }

    .concierge-panel .terminal-input:disabled {
        opacity: .5;
    }

.concierge-panel .send-btn,
.concierge-panel .mic-btn,
.concierge-panel .tts-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .9rem .55rem;
    border: 0;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    transition: opacity var(--motion-quick) var(--ease-house), color var(--motion-quick) var(--ease-house), transform var(--motion-quick) var(--ease-house);
}

.concierge-panel .send-btn {
    padding-right: .25rem;
    opacity: .7;
}

.concierge-panel .mic-btn,
.concierge-panel .tts-btn {
    opacity: .45;
}

    .concierge-panel .mic-btn[hidden],
    .concierge-panel .tts-btn[hidden] {
        display: none;
    }

    .concierge-panel .send-btn:hover,
    .concierge-panel .send-btn:focus-visible,
    .concierge-panel .mic-btn:hover,
    .concierge-panel .mic-btn:focus-visible,
    .concierge-panel .tts-btn:hover,
    .concierge-panel .tts-btn:focus-visible {
        color: var(--gold);
        opacity: 1;
    }

    .concierge-panel .send-btn:hover,
    .concierge-panel .send-btn:focus-visible {
        transform: translateX(3px);
    }

    .concierge-panel .send-btn:focus-visible,
    .concierge-panel .mic-btn:focus-visible,
    .concierge-panel .tts-btn:focus-visible {
        outline: 1px solid var(--gold);
        outline-offset: 3px;
    }

    .concierge-panel .send-btn:disabled {
        opacity: .25;
        transform: none;
    }

    .concierge-panel .send-btn svg,
    .concierge-panel .mic-btn svg,
    .concierge-panel .tts-btn svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 1.5;
    }

    .concierge-panel .send-btn svg {
        width: 22px;
        height: 22px;
    }

    .concierge-panel .mic-btn svg,
    .concierge-panel .tts-btn svg {
        width: 19px;
        height: 19px;
    }

    /* Listening is a slow breath of the light, never a beat of the size. */
    .concierge-panel .mic-btn.listening {
        color: var(--gold);
        opacity: 1;
        animation: concierge-listening 2.4s ease-in-out infinite;
    }

    .concierge-panel .tts-btn.active {
        color: var(--gold);
        opacity: 1;
    }

@keyframes concierge-listening {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .45;
    }
}

/* The sentence saying that a machine writes these answers is the one statement the law requires a visitor to be able
   to read: a readable size at full contrast, a step above the quieter line about keeping the conversation. */
.concierge-panel .ai-label {
    margin-top: .75rem;
    color: var(--white-soft);
    font-family: var(--font-sans);
    text-align: left;
}

    .concierge-panel .ai-label .ai-statement {
        display: block;
        margin-bottom: .25rem;
        font-size: .72rem;
        letter-spacing: .04em;
        line-height: 1.5;
    }

    .concierge-panel .ai-label .ai-secondary {
        display: block;
        font-size: .66rem;
        letter-spacing: .04em;
        line-height: 1.5;
        opacity: .85;
    }

    /* Both links — the voice's name and the privacy policy — carry their sentence's colour and answer a hover the
       same way. */
    .concierge-panel .ai-label a {
        color: inherit;
        text-decoration: underline;
        text-underline-offset: 2px;
        transition: color .3s ease;
    }

        .concierge-panel .ai-label a:hover,
        .concierge-panel .ai-label a:focus-visible {
            color: var(--gold);
        }

/* A person, quietly, under the machine: the house's address and number, the same as the footer's. */
.concierge-human {
    margin: .85rem 0 0;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 300;
    line-height: 1.7;
}

.concierge-human-ways {
    display: inline-block;
}

    .concierge-human a {
        color: var(--white);
        text-decoration: none;
        border-bottom: 1px solid var(--hairline-strong);
        white-space: nowrap;
        transition: color .3s var(--ease-house), border-color .3s var(--ease-house);
    }

        .concierge-human a:hover,
        .concierge-human a:focus-visible {
            color: var(--gold);
            border-color: var(--gold);
        }

    .concierge-human b {
        margin: 0 .55rem;
        color: var(--gold);
        font-weight: 400;
    }
/* #endregion */

/* #region Responsive & reduced motion */
/* Where the dock stands (site.css, .odo-orb) the panel takes the whole screen, over the dock, so nothing floats over
   the field. */
@media (max-width: 780px) {
    .concierge-panel {
        width: 100%;
        border-left: 0;
        padding-left: env(safe-area-inset-left, 0px);
    }

    .concierge-head {
        padding-top: calc(1.4rem + env(safe-area-inset-top, 0px));
        padding-bottom: 1.2rem;
    }

    .concierge-close {
        top: calc(1.2rem + env(safe-area-inset-top, 0px));
        right: 1.2rem;
    }

    .concierge-body {
        gap: 1.6rem;
        padding-top: 1.6rem;
    }
}

/* A finger needs more than a pointer between one suggestion and the next. */
@media (hover: none) {
    .concierge-panel .whisper-tag {
        padding-block: .7rem;
    }
}

@media (max-width: 420px) {
    .concierge-panel .voice-artworks {
        gap: 10px;
    }
}

/* On a screen this short the head gives up a little of its air for the conversation. */
@media (max-height: 560px) {
    .concierge-head {
        padding-top: 1rem;
        padding-bottom: .9rem;
    }

    .concierge-close {
        top: .8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .concierge-overlay,
    .concierge-panel .voice-line,
    .concierge-panel .whispers-box,
    .concierge-panel .whisper-label {
        transition: none;
    }

    /* With no slide there is nothing to wait for: the panel hides the instant it closes. */
    .concierge-panel {
        transition: visibility 0s linear 0s;
    }

        .concierge-panel.open {
            transition: none;
        }

    .concierge-panel .voice-thinking span {
        animation: none;
        opacity: .5;
    }

    .concierge-panel .voice-artwork,
    .concierge-panel .mic-btn.listening {
        animation: none;
    }
}

/* A hover-only tooltip is unreachable on a touch screen. */
@media (hover: none) {
    .concierge-panel [data-tooltip]::after {
        display: none;
    }
}
/* #endregion */
