/* ==========================================================================
   friend — the friend / profile page (Pages/UserProfile.razor,
   Components/Friend/*): the approved desktop mockup "A · Profile + tabs",
   in the wine page's visual language — the header on the page, sheets (white,
   light border, card shadow, radius 14) with nothing boxed inside, hairline
   separators. One responsive tree: "Between you" stacks under 1100 px, the
   header and tiles reflow down to phone width.
   Shared tokens come from base.css, glance.css (--gl-*) and wineglance.css
   (--wg-*); the few below are new.
   ========================================================================== */

:root {
    --fp-radius: 14px;
    --fp-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);       /* DESIGN.md card shadow */
    --fp-bottle-shadow: rgba(19, 26, 23, 0.14);        /* bottle drop shadow (mockup .fb) */
    --fp-ok: #1f6b3a;                                  /* verified / "on your wishlist" ink (mockup, = app colors.successText family) */
    --fp-ok-bg: #e3f1e7;                               /* … and its fill (mockup) */
    --fp-danger: #b91c1c;                              /* Remove friend (buttons.css .btn-danger) */
    --fp-danger-bg: rgba(185, 28, 28, 0.07);
}

.fp {
    /* Full width, like every other page (the layout's .content gives the side padding). */
    padding-bottom: 3.5rem;
    color: var(--color-dark-text);
    font-size: 15px;
    line-height: 1.5;
}

/* ── Type & small parts ── */
.fp-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-muted); }
.fp-h2 { font-family: var(--font-body); font-size: 20px; font-weight: 750; letter-spacing: -0.015em; line-height: 1.25; color: var(--gl-heading); margin: 0; }
.fp-muted { color: var(--color-muted); }
.fp-small { font-size: 12.5px; }
.fp-tiny { font-size: 11.5px; line-height: 1.4; }
.fp-num { font-variant-numeric: tabular-nums; }
.fp-nowrap { white-space: nowrap; }
.fp-empty { margin: 28px 0 12px; text-align: center; color: var(--color-muted); font-size: 14px; }

.fp-sheet {
    background: var(--color-card-bg); border: 1px solid var(--gl-border-light); border-radius: var(--fp-radius);
    box-shadow: var(--fp-shadow); padding: 20px 24px; min-width: 0;
}

.fp-pill {
    display: inline-block; width: fit-content; margin-top: 6px; font-size: 10.5px; font-weight: 700; line-height: 1.5;
    padding: 1px 8px; border-radius: 999px; background: var(--color-brand-soft); color: var(--color-brand); white-space: nowrap;
}
.fp-pill.ok { background: var(--fp-ok-bg); color: var(--fp-ok); }
.fp-pill--link { text-decoration: none; }
.fp-pill--link:hover { text-decoration: underline; }
.fp-wrow-right .fp-pill { margin-top: 0; }

.fp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
    background: var(--color-secondary-bg); border: 1px solid var(--gl-border-light);
    font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--gl-text-secondary); white-space: nowrap;
}
.fp-chip.ok { background: var(--fp-ok-bg); color: var(--fp-ok); border-color: transparent; }

.fp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--gl-border);
    background: var(--color-card-bg); color: var(--color-dark-text); padding: 8px 14px; border-radius: 9px;
    font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.35; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.fp-btn:hover:not(:disabled) { border-color: var(--color-brand); color: var(--color-brand); }
.fp-btn.primary { background: var(--color-brand); color: var(--color-light-text); border-color: var(--color-brand); }
.fp-btn.primary:hover:not(:disabled) { background: var(--color-brand-dark); color: var(--color-light-text); }
.fp-btn.ghost { border-color: transparent; background: transparent; }
.fp-btn.danger { color: var(--fp-danger); border-color: var(--fp-danger); }
.fp-btn.danger:hover:not(:disabled) { background: var(--fp-danger-bg); color: var(--fp-danger); border-color: var(--fp-danger); }
.fp-btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.fp-btn:disabled { cursor: default; opacity: 0.6; }

.fp-link {
    display: inline-flex; align-items: center; gap: 4px; width: fit-content;
    font-size: 13px; font-weight: 600; color: var(--color-brand); text-decoration: none;
}
.fp-link:hover { text-decoration: underline; }

.fp :is(button, a, input):focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; border-radius: 6px; }

/* Bottles: WineBottleOrLabel draws on a 40 × 122 box; the AI image overflows it sideways. */
.fp-bottle { display: block; width: auto; overflow: visible; filter: drop-shadow(0 6px 8px var(--fp-bottle-shadow)); }
.fp-bottle--row { height: 52px; }
.fp-bottle--tile { height: 84px; }
.fp-bottle--rev { height: 64px; }

/* ── Header: on the page, no card ── */
.fp-hero { padding: 4px 0 24px; }
.fp-back { display: inline-block; margin-bottom: 14px; font-size: 12.5px; font-weight: 600; color: var(--color-muted); text-decoration: none; }
.fp-back:hover { color: var(--color-brand); }
.fp-hero-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.fp-avatar {
    width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-brand); color: var(--color-light-text); font-size: 30px; font-weight: 750; letter-spacing: 0.02em;
}
.fp-hero-text { min-width: 0; }
.fp-name { font-family: var(--font-body); font-size: 36px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 2px; color: var(--gl-heading); overflow-wrap: anywhere; }
.fp-since { color: var(--color-muted); }
.fp-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 10px; font-size: 14px; color: var(--gl-text-secondary); }
.fp-stats b { font-size: 16px; color: var(--gl-heading); }
.fp-dexchip { border-radius: 999px; padding: 4px 11px; background: var(--color-brand-soft); color: var(--color-brand); font-size: 13px; font-weight: 600; }
.fp-dexchip b { font-size: inherit; color: inherit; font-weight: 750; }
.fp-trust { margin-top: 12px; }
.fp-hero-actions { display: flex; gap: 8px; align-self: start; margin-top: 8px; }

/* "⋯" menu */
.fp-menu-wrap { position: relative; }
.fp-more { padding: 8px 10px; color: var(--gl-heading); }
.fp-more svg { fill: currentColor; width: 18px; height: 18px; }
.fp-menu-scrim { position: fixed; inset: 0; z-index: 40; }
.fp-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 41; min-width: 180px; padding: 6px;
    background: var(--color-card-bg); border: 1px solid var(--gl-border-light); border-radius: 10px;
    box-shadow: 0 8px 22px var(--gl-shadow);
}
.fp-menu-item {
    display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px; background: none;
    font: inherit; font-size: 13.5px; font-weight: 600; color: var(--gl-heading); cursor: pointer;
}
.fp-menu-item:hover { background: var(--color-secondary-bg); }
.fp-menu-item.danger { color: var(--fp-danger); }
.fp-menu-item.danger:hover { background: var(--fp-danger-bg); }
.fp-confirm-body { margin: 0; color: var(--gl-text-secondary); }

/* ── Between you: up to three sheets side by side ── */
.fp-sec-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 6px 0 12px; }
.fp-between { display: grid; grid-template-columns: repeat(var(--fp-bcols, 3), minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.fp-bcol-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.fp-wrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--gl-border-light); }
.fp-bcol-head + .fp-wrow { border-top: 0; }
.fp-wrow-img { display: flex; justify-content: center; }
.fp-wrow-body { display: flex; flex-direction: column; min-width: 0; }
.fp-wrow-name { font-size: 13.5px; font-weight: 700; color: var(--gl-heading); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-wrow-name:hover { color: var(--color-brand); }
.fp-wrow-right { display: flex; align-items: center; gap: 10px; }
.fp-price { font-size: 14px; color: var(--gl-heading); }

/* ── One sheet with tabs ── */
.fp-tabsheet { padding: 0; }
.fp-tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--gl-border-light); overflow-x: auto; scrollbar-width: none; }
.fp-tabs::-webkit-scrollbar { display: none; }
.fp-tab {
    flex-shrink: 0; padding: 14px 10px 12px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none;
    font: inherit; font-size: 14px; font-weight: 650; color: var(--color-muted); cursor: pointer; white-space: nowrap;
}
.fp-tab:hover { color: var(--gl-heading); }
.fp-tab.on { color: var(--gl-heading); border-bottom-color: var(--color-brand); }
.fp-tab-count { margin-left: 3px; font-weight: 500; color: var(--gl-placeholder); }
.fp-tabbody { padding: 18px 24px 24px; }

/* Cellars: filter + search, then region groups of tiles */
.fp-cellar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.fp-seg { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; background: var(--color-card-bg); border: 1px solid var(--gl-border-light); border-radius: 999px; }
.fp-seg::-webkit-scrollbar { display: none; }
.fp-seg button {
    flex-shrink: 0; padding: 4px 12px; border: 0; border-radius: 999px; background: none;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--color-muted); cursor: pointer; white-space: nowrap;
}
.fp-seg button:hover:not(.on) { color: var(--color-brand); }
.fp-seg button.on { background: var(--color-brand); color: var(--color-light-text); }
.fp-search {
    flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid var(--gl-border); border-radius: 9px;
    background: var(--color-card-bg); font: inherit; font-size: 15px; color: var(--color-dark-text);
}
.fp-search::placeholder { color: var(--gl-placeholder); }
.fp-rgroup { margin-top: 18px; }
.fp-rgroup-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding-bottom: 8px; border-bottom: 1px solid var(--gl-border-light); }
.fp-rgroup-head b { color: var(--gl-heading); }

.fp-tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 18px; }
.fp-tile { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gl-border-light); min-width: 0; }
.fp-tile-img { display: flex; justify-content: center; }
.fp-tile-body { display: flex; flex-direction: column; min-width: 0; }
.fp-tile-prod { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-tile-name { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--gl-heading); text-decoration: none; }
.fp-tile-name:hover, .fp-tile:hover .fp-tile-name { color: var(--color-brand); }
.fp-tile-price { color: var(--gl-text-secondary); }

/* Reviews: two columns of open rows */
.fp-revs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.fp-rev { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--gl-border-light); min-width: 0; }
.fp-rev-img { display: flex; justify-content: center; align-items: flex-start; }
.fp-rev-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fp-rev-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fp-rev-head { min-width: 0; }
.fp-rev-name { font-weight: 700; color: var(--gl-heading); text-decoration: none; }
.fp-rev-name:hover { color: var(--color-brand); }
.fp-rev-score { font-size: 20px; line-height: 1.2; color: var(--gl-heading); }
.fp-rev-text { margin: 0; font-size: 13.5px; color: var(--gl-text-secondary); white-space: pre-line; overflow-wrap: anywhere; }
.fp-blic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fp-blic > div { min-width: 0; }
.fp-blic .fp-tiny { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-bar { display: block; height: 5px; margin-top: 3px; background: var(--wg-surface-alt); border-radius: 999px; overflow: hidden; }
.fp-bar > i { display: block; height: 100%; background: var(--color-brand); border-radius: 999px; }
.fp-rev-obs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; margin: 0; font-size: 12px; }
.fp-rev-obs dt { color: var(--color-muted); }
.fp-rev-obs dd { margin: 0; font-weight: 600; color: var(--gl-heading); display: flex; align-items: center; gap: 5px; }

/* ── Skeletons (shaped like the content, .sk shimmer from patches.css) ── */
.fp-sk-backlink { display: block; width: 70px; height: 12px; margin-bottom: 18px; }
.fp-sk-avatar { display: inline-block; width: 84px; height: 84px; border-radius: 50%; }
.fp-sk-name { display: block; width: min(320px, 70%); height: 34px; border-radius: 8px; margin-bottom: 10px; }
.fp-sk-sub { display: block; width: min(380px, 85%); height: 14px; border-radius: 6px; margin-top: 8px; }
.fp-sk-sub.short { width: min(220px, 50%); }
.fp-sk-sheet { min-height: 320px; }
.fp-sk-body { display: block; height: 260px; border-radius: 10px; }
.fp-sk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 18px; }
.fp-sk-tile { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gl-border-light); }
.fp-sk-bottle { display: block; width: 26px; height: 84px; margin: 0 auto; border-radius: 6px; }
.fp-sk-lines { display: flex; flex-direction: column; gap: 8px; }
.fp-sk-line { display: block; height: 12px; border-radius: 6px; }
.fp-sk-line.short { width: 55%; }
.fp-sk-revs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 32px; }
.fp-sk-rev { height: 120px; border-radius: 10px; }

/* ── Under 1100 px: "Between you" and the reviews stack ── */
@media (max-width: 1100px) {
    .fp-between { grid-template-columns: minmax(0, 1fr); }
    .fp-revs, .fp-sk-revs { grid-template-columns: minmax(0, 1fr); }
}

/* ── Phones ── */
@media (max-width: 700px) {
    .fp-hero { position: relative; padding-bottom: 18px; }
    .fp-hero-row { grid-template-columns: auto minmax(0, 1fr); gap: 14px 16px; }
    .fp-avatar, .fp-sk-avatar { width: 64px; height: 64px; font-size: 23px; }
    .fp-name { font-size: 26px; }
    .fp-since { font-size: 13.5px; }
    .fp-stats { gap: 4px 14px; font-size: 13px; }
    .fp-stats b { font-size: 15px; }
    /* The actions move up beside "← Friends", so the name keeps the full width. */
    .fp-hero-actions { position: absolute; top: -6px; right: 0; margin: 0; }
    .fp-hero-actions .fp-btn:not(.fp-more) { padding: 6px 12px; font-size: 13px; }
    .fp-sheet { padding: 16px; }
    .fp-tabsheet { padding: 0; }
    .fp-tabs { padding: 0 8px; gap: 0; }
    .fp-tab { padding: 12px 7px 10px; font-size: 13px; }
    .fp-tabbody { padding: 14px 16px 18px; }
    .fp-search { min-width: 0; width: 100%; flex-basis: 100%; }
    .fp-tilegrid, .fp-sk-tiles { grid-template-columns: minmax(0, 1fr); }
    .fp-blic { gap: 6px; }
    .fp-rev-obs { grid-template-columns: minmax(0, 1fr); }
}
