/* forbolu — layout: header, navigation, columns, footer */
.container { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 12px; }

/* --- Top header (logo + search + subnav) --- */
.topbar { background: #fff; border-bottom: 1px solid #e3eef1; }
.topbar .container { display: flex; align-items: center; gap: 16px; min-height: 58px; padding-top: 8px; padding-bottom: 8px; }
.logo { display: inline-flex; align-items: center; gap: 6px; text-decoration: none !important; }
.logo-mark { width: 46px; height: 34px; flex: 0 0 auto; transform-origin: 50% 90%; color: var(--fb-blue); overflow: visible; }
.logo-mark .ring { opacity: .75; }
.logo-mark .band { stroke: #000; opacity: .12; }
.logo-mark .spark { opacity: .85; }
.logo:hover .logo-mark { animation: fbsys-wiggle .6s ease-in-out; }
.logo-word { font: 800 27px/1 "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", Arial, sans-serif; letter-spacing: -.5px; color: var(--fb-blue); }
.logo small { display: block; font: 10px var(--fb-sans); letter-spacing: 0; color: var(--fb-muted); margin-top: 2px; }
.logo .logo-text { display: flex; flex-direction: column; }
@keyframes fbsys-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.globsearch { flex: 1; display: flex; justify-content: center; }
.globsearch form { display: flex; gap: 4px; align-items: center; width: 100%; max-width: 430px; }
.globsearch .lbl { font: bold 12px var(--fb-sans); color: var(--fb-orange); }
.globsearch select { width: auto; flex: 0 0 auto; padding: 4px; font-size: 11px; }
.globsearch input { padding: 5px 7px; font-size: 12px; flex: 1 1 auto; min-width: 0; }
.globsearch button { padding: 5px 9px; }
.subnav { font-size: 11px; color: #757575; white-space: nowrap; }
.subnav a, .subnav .link-btn { color: var(--fb-blue-dark); font-weight: bold; font-size: 11px; }
.subnav .pipe { margin: 0 4px; color: #aaa; }
.badge { display: inline-block; min-width: 16px; padding: 1px 5px; border-radius: 9px; background: var(--fb-orange); color: #fff; font: bold 10px/14px var(--fb-sans); text-align: center; vertical-align: 1px; }

/* --- Main nav (blue tabs) --- */
.mainnav { background: linear-gradient(#5aa8d6, #2f86b8); border-bottom: 3px solid var(--fb-blue-dark); }
.mainnav .container { display: flex; align-items: stretch; justify-content: space-between; gap: 8px; }
.mainnav ul.tabs { display: flex; flex-wrap: wrap; }
.mainnav .tabs > li { position: relative; }
.mainnav .tabs > li > a, .mainnav .tabs > li > button {
  display: block; padding: 8px 13px; color: #fff; font: bold 12px var(--fb-sans); background: none; border: 0; cursor: pointer;
  text-decoration: none; border-right: 1px solid rgba(255,255,255,.18);
}
.mainnav .tabs > li > a:hover, .mainnav .tabs > li > button:hover, .mainnav .tabs > li.active > a { background: rgba(0,0,0,.15); }
.mainnav .tabs > li.active > a { background: var(--fb-blue-dark); }
.mainnav .dropdown { display: none; position: absolute; top: 100%; left: 0; z-index: 1000; min-width: 190px; background: #fff; border: 1px solid var(--fb-border); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.mainnav .dropdown a { display: block; padding: 7px 12px; color: var(--fb-blue); border-bottom: 1px solid var(--fb-blue-light); }
.mainnav .dropdown a:hover { background: var(--fb-blue-light); text-decoration: none; }
.mainnav li:hover > .dropdown, .mainnav li:focus-within > .dropdown, .mainnav li.open > .dropdown { display: block; }
/* invisible bridge over the gap between a tab and its menu, so moving the mouse down keeps it open */
.mainnav .dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.mainnav .secondary { display: flex; align-items: center; gap: 12px; }
.mainnav .secondary a { color: #fff; font-size: 11px; font-weight: bold; }
.menu-btn, .menu-spacer { display: none; }
.menu-btn { position: relative; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--fb-blue-dark); cursor: pointer; }
.menu-dot { position: absolute; top: 8px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--fb-orange); border: 2px solid #fff; }
.navtoggle { display: none; background: none; border: 0; color: #fff; font: bold 13px var(--fb-sans); padding: 8px 4px; cursor: pointer; }

/* --- Content --- */
main { padding: 14px 0 20px; }
main.themed { padding: 0; }
.page-title { font-size: 17px; color: var(--fb-blue); margin: 0 0 10px; }
.page-title small { font-size: 12px; color: var(--fb-muted); font-weight: normal; }
.cols { display: grid; grid-template-columns: minmax(0, 1.63fr) minmax(0, 1fr); gap: 12px; align-items: start; } /* the classic 490:300 split */
.cols-rev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 12px; align-items: start; }
.cols > *, .cols-rev > * { min-width: 0; }
.narrow { max-width: 620px; margin: 0 auto; }
.narrower { max-width: 440px; margin: 0 auto; }

/* --- Footer --- */
.site-footer { border-top: 1px solid #e3eef1; padding: 14px 0 24px; text-align: center; font-size: 11px; color: #666; }
.site-footer nav a { margin: 0 6px; color: var(--fb-blue); }
.site-footer p { margin: 6px 0 0; }

/* --- Responsive: one column on phones, nav becomes a hamburger --- */
@media (max-width: 760px) {
  /* Simple phone header: ☰ on the left, logo in the middle. Everything else lives in the menu. */
  .topbar .container { display: grid; grid-template-columns: 40px 1fr 40px; gap: 8px; min-height: 54px; padding-top: 6px; padding-bottom: 6px; }
  .menu-btn { display: grid; }
  .menu-spacer { display: block; }
  .logo { justify-self: center; }
  .logo small { display: none; }
  .globsearch, .subnav { display: none; grid-column: 1 / -1; }
  .nav-open .menu-dot { display: none; }
  .globsearch .lbl { display: none; }
  .cols, .cols-rev { grid-template-columns: minmax(0, 1fr); }
  .mainnav { display: none; }
  .mainnav .container { flex-wrap: wrap; }
  .mainnav ul.tabs, .mainnav .secondary { flex-basis: 100%; }
  .mainnav ul.tabs { display: block; }
  .mainnav .secondary { display: flex; gap: 16px; padding: 0 14px 12px; }
  .mainnav .tabs > li > a, .mainnav .tabs > li > button { border-right: 0; border-top: 1px solid rgba(255,255,255,.15); }
  .mainnav .dropdown { position: static; box-shadow: none; border: 0; background: rgba(255,255,255,.95); }
  .mainnav .dropdown::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Phones, logged in: bell at the top right, Instagram-style tab bar at the bottom */
.menu-bell, .tabbar { display: none; }
@media (max-width: 760px) {
  .menu-bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; color: var(--fb-nav-text, #fff) !important; }
  .menu-bell .menu-dot { top: 7px; right: 8px; }
  /* a floating pill with a raised "+" in the middle — forbolu's own take, not a flat app bar */
  .tabbar { display: flex; position: fixed; left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 900;
    justify-content: space-around; align-items: center; height: 60px; padding: 0 6px; border-radius: 22px;
    background: rgba(255,255,255,.82); backdrop-filter: blur(16px) saturate(1.6); -webkit-backdrop-filter: blur(16px) saturate(1.6);
    box-shadow: 0 10px 30px rgba(15,50,80,.18), 0 0 0 1px rgba(255,255,255,.6) inset; }
  .tabbar a { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; color: #3b4a55 !important; text-decoration: none !important; transition: color .15s, background .15s; }
  .tabbar a.on { color: var(--fb-blue) !important; }
  .tabbar a.on::after { content: ""; position: absolute; bottom: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--fb-orange, #cc4b0c); }
  .tabbar a.on .ic { stroke-width: 2.4; }
  .tabbar .tab-new { width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; color: #fff !important;
    background: linear-gradient(140deg, #ff8a3d, var(--fb-orange, #cc4b0c)); box-shadow: 0 8px 20px rgba(204,75,12,.45), 0 0 0 5px #eef4f7; }
  .tabbar .tab-new:active { transform: scale(.94); }
  .tab-me img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #c7d3db; }
  .tab-me.on img { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--fb-blue); }
  .tab-dot { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--fb-orange, #cc4b0c); color: #fff; font: 700 10px/18px var(--fb-sans); text-align: center; box-shadow: 0 0 0 2px #fff; }
  body:has(.tabbar) { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  body.dm-open .tabbar, body.page-chat .tabbar { display: none; } /* full-screen chats keep their own composer */
  body.dm-open, body.page-chat { padding-bottom: 0; }
}

/* Phones: slide-in menu drawer */
.drawer, .drawer-backdrop { display: none; }
@media (max-width: 760px) {
  .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 1999; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .drawer { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 2000; width: min(320px, 86vw);
    background: #fff; color: #111; box-shadow: 8px 0 40px rgba(0,0,0,.25); transform: translateX(-105%); transition: transform .25s ease; overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom); }
  .nav-open .drawer { transform: none; }
  .nav-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  .nav-open { overflow: hidden; }
  .drawer-head { display: flex; align-items: center; gap: 8px; padding: 16px 12px 12px 16px; }
  .drawer-me { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; color: #111 !important; text-decoration: none !important; }
  .drawer-me img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
  .drawer-me span { display: flex; flex-direction: column; min-width: 0; }
  .drawer-me b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .drawer-me small { color: var(--fb-muted); font-size: 13px; }
  .drawer-brand { flex: 1; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
  .drawer-x { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f1f1f3; color: #111; cursor: pointer; }
  .drawer-search { display: flex; align-items: center; gap: 8px; margin: 4px 16px 10px; padding: 0 12px; border-radius: 12px; background: #f1f1f3; color: var(--fb-muted); }
  .drawer-search input { flex: 1; border: 0 !important; background: transparent !important; padding: 11px 0; font-size: 15px; box-shadow: none !important; }
  .drawer-links { display: flex; flex-direction: column; padding: 4px 8px 16px; }
  .drawer-links a, .drawer-links button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 10px; border: 0; border-radius: 12px; background: none;
    color: #111 !important; font: 600 15px var(--fb-sans); text-align: left; text-decoration: none !important; cursor: pointer; }
  .drawer-links a:active, .drawer-links button:active, .drawer-links a:hover { background: #f1f5f8; }
  .drawer-links .ic { color: #333; flex: 0 0 auto; }
  .drawer-links span { flex: 1; }
  .drawer-links em { font-style: normal; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #ff3040; color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
  .drawer-links form { margin: 0; }
  .drawer-links hr { border: 0; border-top: 1px solid #ececef; margin: 8px 10px; }
  .drawer-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 10px 0; }
  .drawer-cta .btn { text-align: center; }
}
