/* Brand art (modules/brand_art.php): cards, tiles and the brand page hero painted in each brand's own colour
   (--brand / --brand-ink from the generated brand-colors.css), the plan picker (plan_picker.php) and the home's bottom sheet (home.js).
   A brand without a colour of its own (.is-plain) falls back to theme surfaces. */

/* —— The oversized mark: the brand's own mark in the card's ink —— */
.ba-mark { opacity: .92; pointer-events: none; user-select: none; }
.is-ink-dark .ba-mark { filter: brightness(0); }
.is-ink-light .ba-mark, .is-plain .ba-mark { filter: brightness(0) invert(1); }
[data-theme="light"] .is-plain .ba-mark { filter: brightness(0); }
.ba-tile { border-radius: 15px; object-fit: cover; }
.ba-mono { font: 800 64px/1 var(--font); letter-spacing: -.04em; opacity: .22; pointer-events: none; }

/* —— Brand cards (home, dashboard) —— */
.bc-grid { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 10px; }
.bc { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; min-height: 150px; padding: 14px; overflow: hidden;
  border-radius: 22px; background: var(--brand, var(--panel-2)); color: var(--brand-ink, var(--text)); transition: transform .2s var(--ease), filter .2s; }
.bc:hover { transform: translateY(-2px); }
.bc:active { transform: scale(.98); }
.bc:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.bc > .ba { position: absolute; z-index: -1; }
.bc > .ba-mark { top: -22px; inset-inline-end: -22px; width: 112px; height: 112px; }
.bc > .ba-tile { top: 14px; inset-inline-end: 14px; width: 54px; height: 54px; }
.bc > .ba-mono { top: 6px; inset-inline-end: 10px; }
.bc-flag { position: absolute; top: 12px; inset-inline-start: 12px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px;
  background: rgb(0 0 0 / .14); font-size: 11px; font-weight: 800; white-space: nowrap; }
.is-ink-light .bc-flag, .is-plain .bc-flag { background: rgb(0 0 0 / .28); }
.bc-flag.is-instant { justify-content: center; width: 26px; height: 26px; padding: 0; }
.bc-flag.is-instant span, .bc-kicker, .bc-plans { display: none; }
.bc-name { overflow: hidden; font: 700 19px/1.15 var(--font); letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
html[dir="rtl"] .bc-name { text-align: right; }
.bc-meta { margin-top: 3px; font-size: 12.5px; font-weight: 700; }
.bc.is-out, .bc.is-soon { filter: grayscale(1); opacity: .5; }
.bc.is-featured { grid-column: 1 / -1; min-height: 172px; padding: 18px; border-radius: 26px; }
.bc.is-featured > .ba-mark { top: -34px; inset-inline-end: -30px; width: 196px; height: 196px; }
.bc.is-featured > .ba-tile { width: 76px; height: 76px; border-radius: 20px; }
.bc.is-featured .bc-name { font-size: 32px; line-height: 1.1; letter-spacing: -.02em; }
.bc.is-featured .bc-kicker { display: block; font-size: 12.5px; font-weight: 800; opacity: .75; }
.bc.is-featured .bc-plans { display: inline; }
.bc.is-featured .bc-meta { margin-top: 4px; font-size: 13.5px; }
.bc.is-featured .bc-flag { top: 16px; inset-inline-start: 16px; height: 26px; padding: 0 10px; font-size: 12px; }
.bc.is-featured .bc-flag.is-instant { width: auto; }
.bc.is-featured .bc-flag.is-instant span { display: inline; }
@media (min-width: 640px) {
  .bc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bc.is-featured { grid-column: span 2; grid-row: span 2; }
  .bc.is-featured > .ba-mark { width: 260px; height: 260px; top: -44px; inset-inline-end: -40px; }
  .bc.is-featured .bc-name { font-size: 40px; }
}
@media (min-width: 1040px) { .bc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .bc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* —— Tiles: a square in the brand colour with the mark in its ink —— */
.bt { display: grid; flex: none; place-items: center; width: 52px; height: 52px; overflow: hidden; border-radius: 15px; background: var(--brand, var(--panel-3)); color: var(--brand-ink, var(--text)); }
.bt .ba-mark { width: 56%; height: 56%; object-fit: contain; opacity: 1; }
.bt .ba-tile { width: 100%; height: 100%; border-radius: 0; }
.bt .ba-mono { font-size: 15px; opacity: 1; letter-spacing: 0; }
.bt-lg { width: 66px; height: 66px; border-radius: 20px; }
.bt-sm { width: 44px; height: 44px; border-radius: 13px; }

/* —— Brand page (/c/{slug}): coloured hero, then the picker on the page background —— */
.bp { display: grid; gap: 24px; align-items: start; }
.bp-hero { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 320px; padding: 22px; overflow: hidden; border-radius: 28px;
  background: var(--brand, var(--panel-2)); color: var(--brand-ink, var(--text)); }
.bp-hero > .ba { position: absolute; z-index: -1; }
.bp-hero > .ba-mark { top: -6%; inset-inline-end: -10%; width: min(72%, 360px); height: auto; aspect-ratio: 1; opacity: .95; }
.bp-hero > .ba-tile { top: 24px; inset-inline-end: 24px; width: 104px; height: 104px; border-radius: 28px; }
.bp-hero > .ba-mono { top: 10px; inset-inline-end: 20px; font-size: 140px; }
.bp-back { position: absolute; top: 16px; inset-inline-start: 16px; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgb(0 0 0 / .18); color: inherit; }
.bp-back:hover { background: rgb(0 0 0 / .28); }
.bp-title { display: grid; justify-items: start; gap: 12px; }
.bp-title h1 { max-width: 100%; overflow-wrap: anywhere; font: 800 clamp(2.5rem, 1.8rem + 3vw, 3.6rem)/1 var(--font); letter-spacing: -.035em; }
.bp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bp-chips li { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 13px; border-radius: 999px; background: rgb(0 0 0 / .18); font-size: 13px; font-weight: 800; }
.bp-chips li.is-soft { background: rgb(255 255 255 / .5); color: #1c1c1f; }
.bp .sheet-head { display: none; }
.bp-body > .empty { margin-top: 0; }
.bp:not(.is-plain) .pk { --pick: var(--brand); --pick-ink: var(--brand-ink); }
@media (min-width: 901px) {
  .bp { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
  .bp-hero { position: sticky; top: 96px; min-height: 460px; }
}
@media (max-width: 900px) {
  .bp { gap: 0; }
  .page > .bp { margin: -20px -16px 0; } /* full bleed under the guest header */
  .app-shell .shell-stage > .bp { max-width: none; margin-inline: -16px; } /* signed in: the stage has no top padding on phones */
  .bp-hero { min-height: 400px; padding: calc(70px + env(safe-area-inset-top, 0px)) 22px 54px; border-radius: 0; }
  .bp-back { top: calc(16px + env(safe-area-inset-top, 0px)); }
  .bp-body { position: relative; margin-top: -30px; padding: 24px 16px 0; border-radius: 28px 28px 0 0; background: var(--bg); }
}
@media (max-width: 900px) {
  .has-hero .tabbar { display: none; } /* guests: the brand page has its own pinned order bar */
  .has-hero .tabbar ~ .page { padding-bottom: 0; }
}
/* A soft light follows the pointer over a card (home.js sets --mx / --my); devices that hover only */
@media (hover: hover) and (pointer: fine) {
  .bc::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; pointer-events: none; transition: opacity .3s;
    background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgb(255 255 255 / .28), transparent 65%); }
  .bc:hover::after { opacity: 1; }
}
