/* The product sub-bar (blog/subbar.py, blog/templates/app/subbar.html, docs/SUBBAR.md).
   Directly below socialify.com's top bar on Pay, Jobs, Meet and Chat pages. Glass card with the brand gradient tint,
   items centred, product pill on the left, active item as a blue->violet pill, sticky under the top bar.
   Phones: one row that scrolls sideways; the rest of the items sit in "More". Never a dark background. */
.sf-subbar {
    --sb-top: 60px;                       /* desktop: the fixed 60px rainbow top bar */
    position: -webkit-sticky; position: sticky; top: var(--sb-top); z-index: 1030;
    width: min(1180px, calc(100% - 24px)); margin: 10px auto 14px; box-sizing: border-box;
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    transition: top .25s ease;
}
.sf-subbar *, .sf-subbar *::before { box-sizing: border-box; }
.sf-subbar-in {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px;
    padding: 7px 8px; border-radius: 20px;
    background: linear-gradient(100deg, rgba(240, 62, 155, .13), rgba(196, 78, 230, .10) 35%, rgba(123, 92, 255, .12) 65%, rgba(47, 107, 255, .12)),
                rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, .75);
    box-shadow: 0 10px 30px -14px rgba(91, 76, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.sf-subbar-product {
    justify-self: start; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    padding: 8px 16px; border-radius: 999px; font-weight: 900; font-size: 15px; letter-spacing: .1px;
    color: #fff !important; text-decoration: none !important;
    background: linear-gradient(115deg, #f03e9b, #c44ee6 55%, #7b5cff);
    box-shadow: 0 6px 16px -6px rgba(196, 78, 230, .65);
}
.sf-subbar-product:hover { filter: brightness(1.06); }
.sf-subbar-items {
    display: flex; align-items: center; gap: 4px; min-width: 0; padding: 8px 4px 12px; margin: -8px 0 -12px;   /* room for the active pill's shadow */
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
}
.sf-subbar-items::-webkit-scrollbar { display: none; }
.sf-subbar-items > :first-child { margin-left: auto; }   /* centred, and still scrollable when too wide */
.sf-subbar-items > :last-child { margin-right: auto; }
.sf-subbar-side { justify-self: end; display: flex; align-items: center; }
.sf-subbar-item {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; list-style: none;
    padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 14.5px; line-height: 1.2;
    color: #2b2350 !important; text-decoration: none !important; transition: background .15s ease, color .15s ease;
}
.sf-subbar-item::-webkit-details-marker { display: none; }
.sf-subbar-item:hover { background: rgba(123, 92, 255, .12); }
.sf-subbar-item.on {
    color: #fff !important; background: linear-gradient(115deg, #2f6bff, #5b5cff 50%, #7b5cff);
    box-shadow: 0 6px 16px -6px rgba(47, 107, 255, .7);
}
.sf-subbar-item i, .sf-subbar-menu i {
    font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 999px;
    background: rgba(123, 92, 255, .14); color: #5b4cff;
}
.sf-subbar-item.on i { background: rgba(255, 255, 255, .25); color: #fff; }
.sf-subbar-more { position: relative; }
.sf-subbar-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px; border-radius: 16px;
    background: rgba(255, 255, 255, .97); border: 1px solid #ebe7fb; box-shadow: 0 18px 40px -12px rgba(60, 20, 120, .35);
    display: flex; flex-direction: column; gap: 2px; z-index: 5;
}
.sf-subbar-menu a {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 14.5px;
    color: #2b2350 !important; text-decoration: none !important;
}
.sf-subbar-menu a:hover { background: rgba(123, 92, 255, .10); }
.sf-subbar-menu a.on { color: #fff !important; background: linear-gradient(115deg, #2f6bff, #7b5cff); }

/* Sticky needs a page that is not its own scroll box (some product pages set overflow-x: hidden on html/body) */
html:has(.sf-subbar), body:has(.sf-subbar) { overflow-x: clip !important; }

/* Phones and tablets: under the app bar (it slides away on scroll, so the sub-bar moves up with it), one row */
@media (max-width: 1199.98px) {
    .sf-subbar { --sb-top: calc(var(--sf-bar-h, 58px) + var(--sf-safe-top, 0px)); width: calc(100% - 16px); margin: 8px auto 10px; }
    body.sf-bar-hidden .sf-subbar { --sb-top: var(--sf-safe-top, 0px); }
    .sf-subbar-in { grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; padding: 6px; border-radius: 18px; }
    .sf-subbar-product { padding: 7px 12px; font-size: 14px; }
    .sf-subbar-item { padding: 7px 11px; font-size: 13.5px; }
    .sf-subbar-items { mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
                       -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent); }
    .sf-subbar-items.at-end { mask-image: none; -webkit-mask-image: none; }
    .sf-subbar-side:empty { display: none; }
}
@media (max-width: 340px) {
    .sf-subbar-product b { display: none; }               /* just the icon: more room for the menu */
    .sf-subbar-more summary { padding: 7px 10px; }
}

/* Items with sub-pages (Schools, Colleges; blog/subbar.py children): a panel under the bar, opened on hover or click
   (static/app/subbar.js), same look and behaviour as the Edu sub-bar on edu.socialify.com. */
.sf-subbar-caret { font-size: 10px; opacity: .6; margin-left: 2px; font-weight: 900; }
.sf-subbar-item[aria-expanded="true"]:not(.on) { background: #fff; box-shadow: inset 0 0 0 1px rgba(123, 92, 255, .25); }
.sf-subbar-panel {
    position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); z-index: 1040;
    width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - var(--sb-top) - 120px); overflow: auto; border-radius: 22px;
    background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid #ebe7fb; box-shadow: 0 2px 6px rgba(40, 20, 90, .08), 0 26px 60px -10px rgba(60, 20, 120, .35);
    animation: sf-sb-in .2s cubic-bezier(.2, .8, .2, 1);
}
.sf-subbar-panel[hidden] { display: none; }
@keyframes sf-sb-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.sf-subbar-panel-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: center; padding: 13px 54px; color: #fff;
    background: linear-gradient(115deg, #f03e9b, #c44ee6 55%, #7b5cff); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); font-size: 16px; }
.sf-subbar-x { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .25); color: #fff; cursor: pointer; font-size: 15px; }
.sf-subbar-panel-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px 12px; padding: 14px 16px 16px; }
.sf-subbar-panel-body a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px; border-radius: 14px;
    color: #2b2350 !important; text-decoration: none !important; }
.sf-subbar-panel-body a:hover { background: rgba(123, 92, 255, .09); }
.sf-subbar-panel-body a > i { flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px; font-style: normal; font-size: 18px; background: linear-gradient(135deg, rgba(240, 62, 155, .14), rgba(123, 92, 255, .16)); }
.sf-subbar-panel-body b { display: block; font-size: 14.5px; font-weight: 800; }
.sf-subbar-panel-body small { display: block; font-size: 12.5px; color: #6b6590; line-height: 1.3; }
.sf-subbar-menu-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; font-size: 12px; font-weight: 900;
    text-transform: uppercase; letter-spacing: .4px; color: #7b5cff; }
@media (max-width: 1199.98px) {
    .sf-subbar-panel { position: fixed; left: 8px; right: 8px; top: calc(var(--sb-top) + 64px); width: auto; transform: none;
        max-height: calc(100dvh - var(--sb-top) - 150px); animation: none; }
    .sf-subbar-panel-body { grid-template-columns: 1fr; padding: 10px; }
    .sf-subbar-caret { display: none; }
}
