/* ============================================
   OneStream Live — Custom CSS
   Matches dashboard aesthetic (Light + Dark)
   Font: Figtree
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&display=swap');

/* ── CSS Variables ── */
:root {
  --osl-primary:        #6366f1;
  --osl-primary-dark:   #4f46e5;
  --osl-primary-light:  #e0e7ff;
  --osl-primary-rgb:    99, 102, 241;

  --osl-bg:             #f4f5f7;
  --osl-surface:        #ffffff;
  --osl-surface-alt:    #f4f5f7;
  --osl-border:         #e5e7eb;

  --osl-text:           #111827;
  --osl-text-muted:     #6b7280;
  --osl-text-subtle:    #9ca3af;

  --osl-radius:         12px;
  --osl-radius-sm:      8px;
  --osl-shadow:         0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --osl-shadow-md:      0 4px 12px rgba(0,0,0,0.08);
}

/* ── Global Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Figtree', sans-serif !important;
  font-size: 14px;
  font-weight: 400;
  background-color: var(--osl-bg) !important;
  color: var(--osl-text) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ── Hide Powered By ── */
.c-powered {
  display: none !important;
}

/* ── Hide ATOM Feed Subscribe ── */
.c-subscribe,
a[href*=".atom"],
button[title="Posts Feed"] {
  display: none !important;
}

/* ── Remove focus outline from header buttons ── */
.c-themeswitcher:focus,
.c-themeswitcher:focus-visible,
#c-header button:focus,
#c-header button:focus-visible,
#c-header a:focus,
#c-header a:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* ── Container ── */
.container {
  padding-top: 20px;
  padding-bottom: 20px;
}

/* ── Header Dropdown Z-index Fix ── */
#c-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 9999 !important;
}

.c-dropdown,
.c-dropdown__menu,
[class*="dropdown"],
[class*="c-menu"] {
  z-index: 10000 !important;
}
  background: var(--osl-surface) !important;
  border-bottom: 1px solid var(--osl-border) !important;
  box-shadow: var(--osl-shadow) !important;
  backdrop-filter: blur(8px);
}

/* ── Sidebar ── */
.c-side-menu {
  background: var(--osl-surface) !important;
  border-right: 1px solid var(--osl-border) !important;
  border-radius: var(--osl-radius) !important;
}

.c-side-menu__item {
  border-radius: var(--osl-radius-sm) !important;
  margin: 2px 6px !important;
  transition: background 0.15s ease, color 0.15s ease !important;
  font-weight: 500 !important;
}

.c-side-menu__item:hover {
  background-color: var(--osl-surface-alt) !important;
  color: var(--osl-primary) !important;
}

.c-side-menu__item--active {
  color: var(--osl-primary) !important;
  background-color: var(--osl-primary-light) !important;
  border-left: 3px solid var(--osl-primary) !important;
  font-weight: 600 !important;
}

/* ── Main Page Surface ── */
.page {
  background: var(--osl-surface) !important;
  border-radius: var(--osl-radius) !important;
  box-shadow: var(--osl-shadow) !important;
  padding: 20px !important;
  margin-top: 16px !important;
  border: 1px solid var(--osl-border) !important;
}

/* ── Welcome / Hero Column ── */
.p-home__welcome-col {
  background: var(--osl-surface) !important;
  border-radius: var(--osl-radius) !important;
  border: 1px solid var(--osl-border) !important;
  box-shadow: var(--osl-shadow) !important;
  padding: 20px !important;
}

/* ── Posts Column ── */
.p-home__posts-col {
  background: var(--osl-surface-alt) !important;
  border-radius: var(--osl-radius) !important;
  border: 1px solid var(--osl-border) !important;
  padding: 16px !important;
}

/* ── Post Items ── */
.flex-y.flex--divide-4 > * + * {
  border-top: 1px solid var(--osl-border) !important;
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}

.flex-y.flex--spacing-4 > * + * {
  margin-top: 24px !important;
}

/* ── Post Action Column (single post view) ── */
.p-show-post__action-col {
  background: var(--osl-surface-alt) !important;
  border-radius: var(--osl-radius) !important;
  border: 1px solid var(--osl-border) !important;
  padding: 16px !important;
  box-shadow: var(--osl-shadow) !important;
}

/* ── Typography ── */
.text-display2 {
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: -0.3px !important;
  color: var(--osl-text) !important;
}

.text-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--osl-text) !important;
  line-height: 1.4 !important;
}

.text-category {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.6px !important;
  text-transform: uppercase !important;
  color: var(--osl-text-muted) !important;
}

.text-muted {
  color: var(--osl-text-muted) !important;
}

.text-link {
  color: var(--osl-primary) !important;
  font-weight: 500 !important;
  transition: color 0.15s ease !important;
}

.text-link:hover {
  color: var(--osl-primary-dark) !important;
}

/* ── Primary Button ── */
.c-button--primary {
  background-color: var(--osl-primary) !important;
  border: 1px solid var(--osl-primary) !important;
  color: #ffffff !important;
  font-family: 'Figtree', sans-serif !important;
  font-weight: 600 !important;
  border-radius: var(--osl-radius-sm) !important;
  transition: background 0.15s ease, box-shadow 0.15s ease !important;
  letter-spacing: 0.1px !important;
}

.c-button--primary:hover {
  background-color: var(--osl-primary-dark) !important;
  border-color: var(--osl-primary-dark) !important;
  box-shadow: 0 4px 12px rgba(var(--osl-primary-rgb), 0.35) !important;
}

/* ── Secondary / Default Button ── */
.c-button {
  font-family: 'Figtree', sans-serif !important;
  font-weight: 500 !important;
  border-radius: var(--osl-radius-sm) !important;
  transition: all 0.15s ease !important;
}

/* ── Vote Button ── */
.c-vote-counter__button,
.c-vote-counter__button:hover,
.c-vote-counter__button--voted {
  color: var(--osl-primary) !important;
  border-color: var(--osl-primary) !important;
  border-radius: var(--osl-radius-sm) !important;
  font-family: 'Figtree', sans-serif !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}

.c-vote-counter__button--voted,
.c-vote-counter__button:hover {
  background-color: var(--osl-primary-light) !important;
}

.c-vote-counter__button--voted svg,
.c-vote-counter__button:hover svg {
  color: var(--osl-primary) !important;
}

/* ── Staff Badge ── */
.c-username--staff {
  color: var(--osl-primary) !important;
  border-color: var(--osl-primary) !important;
  background-color: var(--osl-primary-light) !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
  font-size: 11px !important;
}

/* ── Focus States ── */
*:focus {
  outline: 0 !important;
  box-shadow: 0 0 0 2px rgba(var(--osl-primary-rgb), 0.25) !important;
  border-color: var(--osl-primary) !important;
  transition: box-shadow 0.15s ease !important;
}

/* ── Hover Text Primary ── */
.hover\:text-primary-base:hover {
  color: var(--osl-primary) !important;
}

/* ── Inputs ── */
input,
textarea,
select {
  font-family: 'Figtree', sans-serif !important;
  border-radius: var(--osl-radius-sm) !important;
  border: 1px solid var(--osl-border) !important;
  background: var(--osl-surface) !important;
  color: var(--osl-text) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--osl-primary) !important;
}

/* ── Tags / Labels ── */
.c-tag {
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  font-family: 'Figtree', sans-serif !important;
}

/* ── Notification / Toast ── */
.c-notification {
  border-radius: var(--osl-radius) !important;
  box-shadow: var(--osl-shadow-md) !important;
  font-family: 'Figtree', sans-serif !important;
}

/* ── Modal ── */
.c-modal__container {
  border-radius: var(--osl-radius) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15) !important;
  border: 1px solid var(--osl-border) !important;
}

/* ── Dividers ── */
hr {
  border-color: var(--osl-border) !important;
}

/* ── Scrollbar (Webkit) ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--osl-border);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--osl-text-subtle);
}

/* ============================================
   DARK MODE
   Fider applies [data-theme="dark"] on <html>
   ============================================ */

[data-theme="dark"] {
  --osl-bg:           #0d0f14;
  --osl-surface:      #161920;
  --osl-surface-alt:  #1c2029;
  --osl-border:       #2a2d37;

  --osl-text:         #f1f3f5;
  --osl-text-muted:   #8b92a5;
  --osl-text-subtle:  #555d72;

  --osl-primary-light: rgba(99, 102, 241, 0.15);
  --osl-shadow:        0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --osl-shadow-md:     0 4px 12px rgba(0,0,0,0.4);
}

[data-theme="dark"] body {
  background-color: var(--osl-bg) !important;
  color: var(--osl-text) !important;
}

[data-theme="dark"] #c-header {
  background: var(--osl-surface) !important;
  border-bottom-color: var(--osl-border) !important;
}

[data-theme="dark"] .c-side-menu {
  background: var(--osl-surface) !important;
  border-right-color: var(--osl-border) !important;
}

[data-theme="dark"] .c-side-menu__item:hover {
  background-color: var(--osl-surface-alt) !important;
}

[data-theme="dark"] .c-side-menu__item--active {
  background-color: var(--osl-primary-light) !important;
}

[data-theme="dark"] .page,
[data-theme="dark"] .p-home__welcome-col,
[data-theme="dark"] .p-home__posts-col,
[data-theme="dark"] .p-show-post__action-col {
  background: var(--osl-surface) !important;
  border-color: var(--osl-border) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--osl-surface-alt) !important;
  border-color: var(--osl-border) !important;
  color: var(--osl-text) !important;
}

[data-theme="dark"] .c-modal__container {
  background: var(--osl-surface) !important;
  border-color: var(--osl-border) !important;
}