/* V39.1 (docs/V39.1/PB_V39_1_154553Z/V39.1.Patch Fix/V39.1 FINAL PATCH) -- Home hero + Discover, the seven content mascots and
   the /AdminModules screen. SCOPED ONLY: every rule starts with a pb391- class (theme switches read html[data-theme] / the system
   scheme for THESE classes only); no element / global selector, no change to the shell, sidebar (240/80), logo or footer.
   Colours come from the PB tokens (Content/pb-tokens.css); no animation anywhere. */

/* ------------------------------------------------------------------ home: container + theme surfaces */
.pb391-home {
    container-type: inline-size;
    container-name: pb391home;
    --pb391-hero-bg: linear-gradient(135deg, #FFF8EE 0%, #FFF3F0 52%, #FFF0F6 100%);
    --pb391-hero-edge: rgba(252, 167, 30, 0.28);
    --pb391-art-shadow: 0 18px 40px rgba(23, 26, 31, 0.14);
    --pb391-card-bg: var(--pb-surface, #FFFFFF);
    --pb391-card-edge: var(--pb-divider, #E4E7EC);
    margin-bottom: 24px;
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]):not([data-theme="black"]) .pb391-home {
        --pb391-hero-bg: linear-gradient(135deg, #1E2430 0%, #262230 55%, #2B1F2C 100%);
        --pb391-hero-edge: rgba(252, 167, 30, 0.22);
        --pb391-art-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    }
}
html[data-theme="dark"] .pb391-home {
    --pb391-hero-bg: linear-gradient(135deg, #1E2430 0%, #262230 55%, #2B1F2C 100%);
    --pb391-hero-edge: rgba(252, 167, 30, 0.22);
    --pb391-art-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
html[data-theme="black"] .pb391-home {
    --pb391-hero-bg: linear-gradient(135deg, #0F1115 0%, #15141B 55%, #1B1218 100%);
    --pb391-hero-edge: rgba(252, 167, 30, 0.30);
    --pb391-art-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

/* ------------------------------------------------------------------ hero: mobile first = one column, copy BEFORE the art */
.pb391-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    padding: 24px 16px;
    border-radius: 24px;
    background: var(--pb391-hero-bg);
    border: 1px solid var(--pb391-hero-edge);
    color: var(--pb-text-primary, #171A1F);
}
.pb391-hero__copy { min-width: 0; }
.pb391-hero__title {
    margin: 0 0 12px;
    font-size: clamp(28px, 6.4cqi, 46px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--pb-text-primary, #171A1F);
    overflow-wrap: anywhere;
}
.pb391-hero__lead {
    margin: 0 0 20px;
    max-width: 38em;
    font-size: 18px;
    line-height: 28px;
    color: var(--pb-text-secondary, #667085);
}
.pb391-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.pb391-hero__actions .pb-btn { max-width: 100%; white-space: normal; }
.pb391-hero__art { justify-self: center; width: min(100%, 260px); }
.pb391-hero__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1122 / 1402;
    object-fit: contain;          /* the whole approved image: never cropped */
    border-radius: 20px;
    box-shadow: var(--pb391-art-shadow);
    -webkit-user-drag: none;
}

/* two columns only when the CONTENT width allows it (after the 240 / 80 sidebar): the art is PHYSICALLY RIGHT in both languages
   (LTR track order on the grid only), the copy keeps the page direction */
@container pb391home (min-width: 680px) {
    .pb391-hero {
        direction: ltr;
        grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
        gap: 32px;
        padding: 32px 36px;
    }
    .pb391-hero__copy { direction: ltr; text-align: left; }
    [dir="rtl"] .pb391-hero__copy { direction: rtl; text-align: right; }
    .pb391-hero__art { justify-self: end; width: min(100%, 416px); }   /* 416 x 1402/1122 = 520 px tall at most: no fixed height */
}

/* ------------------------------------------------------------------ Discover: two separate blocks, real data / empty state */
.pb391-discover { display: grid; gap: 28px; }
.pb391-discover__title { margin: 0; font-size: 22px; line-height: 30px; font-weight: 600; color: var(--pb-text-primary, #171A1F); }
.pb391-discover__block { min-width: 0; }
.pb391-discover__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.pb391-discover__head h3 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; color: var(--pb-text-primary, #171A1F); }
.pb391-empty {
    margin: 0;
    padding: 16px;
    border: 1px dashed var(--pb391-card-edge);
    border-radius: 12px;
    color: var(--pb-text-secondary, #667085);
}
.pb391-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
@container pb391home (min-width: 680px) {
    .pb391-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
}
.pb391-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--pb391-card-edge);
    border-radius: 14px;
    overflow: hidden;
    background: var(--pb391-card-bg);
    color: var(--pb-text-primary, #171A1F);
    text-decoration: none;
}
.pb391-card:hover { border-color: var(--pb-action-border, #BD006E); }
.pb391-card:focus-visible { outline: 2px solid var(--pb-focus, #BD006E); outline-offset: 2px; }
.pb391-card__media { display: block; aspect-ratio: 1 / 1; background: var(--pb-media-matte, #FAFAFA); }
.pb391-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pb391-card__noimg { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--pb-text-muted, #667085); }
.pb391-card__body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; min-width: 0; }
.pb391-card__title { font-weight: 600; font-size: 15px; line-height: 21px; overflow-wrap: anywhere; }
.pb391-card__meta { font-size: 13px; line-height: 19px; color: var(--pb-text-secondary, #667085); overflow-wrap: anywhere; }
.pb391-card__price { font-size: 15px; line-height: 21px; font-weight: 700; }
.pb391-chip {
    align-self: flex-start;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 18px;
    background: var(--pb-neutral-surface, #F2F4F7);
    color: var(--pb-neutral-text, #344054);
}

/* ------------------------------------------------------------------ the seven content mascots (Views/Shared/_PbMascot.cshtml) */
/* Decorative only: reserved box (no CLS), object-fit contain, never mirrored / recoloured / animated, not interactive; logical
   inline-end of the intro / confirmation copy (RTL and LTR move naturally), gap 16 desktop / 12 mobile; hidden when no room. */
.pb391-flow { display: flow-root; }
.pb391-mascot {
    float: inline-end;
    display: block;
    margin-inline-start: 16px;
    margin-bottom: 8px;
    pointer-events: none;
    user-select: none;
    line-height: 0;
}
.pb391-mascot img { display: block; object-fit: contain; max-width: none; }
.pb391-mascot--d80 img { width: 80px; height: 80px; }
.pb391-mascot--d96 img { width: 96px; height: 96px; }
@media (max-width: 767.98px) {
    .pb391-mascot { margin-inline-start: 12px; }
    .pb391-mascot--m64 img { width: 64px; height: 64px; }
    .pb391-mascot--m80 img { width: 80px; height: 80px; }
}
@media (max-width: 299.98px) {
    .pb391-mascot { display: none; }   /* fewer than ~180 px would be left for the copy: keep the text, drop the art */
}
.pb-empty-state > .pb391-mascot { float: none; margin: 0 auto 8px; }

/* ------------------------------------------------------------------ /AdminModules (admin page: no mascot) */
.pb391-adm-lead { max-width: 60em; }
.pb391-adm-simple {
    margin: 16px 0 24px;
    padding: 16px;
    border: 1px solid var(--pb-divider, #E4E7EC);
    border-radius: 12px;
    background: var(--pb-surface-raised, #F7F7F7);
    max-width: 760px;
}
.pb391-adm-simple h2 { margin: 0 0 6px; font-size: 18px; line-height: 26px; }
.pb391-adm-summary summary { cursor: pointer; font-weight: 600; }
.pb391-adm-summary p { margin: 8px 0; }
.pb391-adm-confirm { display: inline-flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.pb391-adm-group { margin: 20px 0 8px; font-size: 18px; line-height: 26px; }
.pb391-adm-table { max-width: 760px; }
.pb391-adm-sw { width: 84px; text-align: center; }
.pb391-adm-desc { display: block; margin-top: 2px; }
.pb391-adm-block { display: block; margin-top: 4px; color: var(--pb-warning-text, #B54708); }
