/* cctrl buddyboss overrides - widgets/sidofalt syns i vanligt lage (ReadyLaunch av).
 * Laddas via enqueue.php. Overskrider .in-bbapp #secondary { display: none }.
 */

/* ===================================================================
   GEMENSKAP-NAVBAR – under app header (samma look som AKADEMI/BIBLIOTEKET)
   =================================================================== */
.gemenskap-nav-wrap {
	background: var(--ctp-surface-alt);
	border-bottom: 1px solid var(--outline);
	padding: 10px clamp(16px, 4vw, 24px) 10px 24px;
}
.gemenskap-nav-wrap .akademi-nav-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	max-width: 1400px;
	margin: 0;
}
.gemenskap-nav-wrap .akademi-nav {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}
.gemenskap-nav-wrap .akademi-nav-context {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--muted);
	text-transform: uppercase;
}
.gemenskap-nav-wrap .akademi-nav-link {
	color: var(--text);
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 500;
}
.gemenskap-nav-wrap .akademi-nav-link:hover {
	text-decoration: underline;
}
.gemenskap-nav-wrap .akademi-nav-sep {
	color: var(--muted);
	font-weight: 300;
	user-select: none;
}

/* ===================================================================
   ACTIVITY FEED: Visa widgets/sidofält på webb
   BuddyBoss Platform (buddypress.css) har .in-bbapp #secondary { display: none }
   för in-app webview. På vanlig webb ska sidofält synas när widgets är
   konfigurerade (body har has-sidebar). Se ACTIVITY-FEED-WIDGETS-ANALYSIS.md.
   =================================================================== */
/* Visa sidofält när body har activity-sidebar-klass (widgets konfigurerade) */
body.buddypress.activity.has-sidebar #secondary,
body.buddypress.activity.has-sidebar #secondary-right,
body.buddypress.has-sidebar.activity-sidebar-left #secondary,
body.buddypress.has-sidebar.activity-sidebar-left #secondary-right,
body.buddypress.has-sidebar.activity-sidebar-right #secondary,
body.buddypress.has-sidebar.activity-sidebar-right #secondary-right {
  display: block !important;
}
/* Överstyrt tutor.css (body.app-shell-header #secondary { display: none }): Activity-widgets ska synas */
body.buddypress.has-sidebar.app-shell-header #secondary,
body.buddypress.has-sidebar.app-shell-header #secondary-right {
  display: block !important;
}

/* Activity med BÅDA sidofält (vänster + höger): 3-kolumns-grid så vänster widgetyta inte kollapsar */
body.app-header-buddyboss.has-sidebar.activity-sidebar-left.activity-sidebar-right .site-content-grid {
  display: grid !important;
  grid-template-columns: minmax(200px, 280px) 1fr minmax(220px, 300px);
  gap: 24px;
  align-items: start;
}
body.app-header-buddyboss.has-sidebar.activity-sidebar-left.activity-sidebar-right #secondary.sidebar-left {
  order: -1;
  min-width: 0;
}
body.app-header-buddyboss.has-sidebar.activity-sidebar-left.activity-sidebar-right #primary {
  min-width: 0;
}
body.app-header-buddyboss.has-sidebar.activity-sidebar-left.activity-sidebar-right #secondary-right {
  min-width: 0;
}

@media only screen and (max-width: 1024px) {
  body.app-header-buddyboss.has-sidebar.activity-sidebar-left.activity-sidebar-right .site-content-grid {
    grid-template-columns: 1fr minmax(220px, 300px);
  }
  body.app-header-buddyboss.has-sidebar.activity-sidebar-left.activity-sidebar-right #secondary.sidebar-left {
    order: 2;
    grid-column: 1 / -1;
  }
}

/* #1529 krav 4 — mobilen: flödet ska vara EN kolumn under 768 px.
   Rotorsak (mätt): blocket ovan är sista breakpointen, så tvåkolumnsregeln gällde ända
   ner till 0 px. Vid 390 px blir 1fr = 390 − 300 − 24 = 66 px, dvs ungefär en bokstav
   per rad, med höger widgetkolumn ovanpå flödet. Uppmätt: "66px 300px", #primary 66 px.
   768 px är gränsen där 1fr + minmax(220px,300px) + 24px gap fortfarande lämnar
   innehållet >= 440 px. Blocken på rad 71-76 och 88-96 står kvar ordagrant — 1024-regeln
   är korrekt för surfplatta och ska inte städas ihop med denna. */
@media only screen and (max-width: 767px) {
  body.app-header-buddyboss.has-sidebar.activity-sidebar-left.activity-sidebar-right .site-content-grid {
    grid-template-columns: 1fr;
  }
  body.app-header-buddyboss.has-sidebar.activity-sidebar-left.activity-sidebar-right #secondary-right {
    order: 2;
    grid-column: 1 / -1;
  }
  body.app-header-buddyboss.has-sidebar.activity-sidebar-left.activity-sidebar-right #secondary.sidebar-left {
    order: 3;
    grid-column: 1 / -1;
  }
}

/* ===================================================================
   GRUPP STARTSIDA: Ta bort "kort"-utseende (vit ruta med skugga/rundning)
   Parent BuddyBoss-tema ger #buddypress / .bp-wrap / #item-body bakgrund
   och border-radius. Vi vill att innehållet flyter med sidan, inte i en kort.
   =================================================================== */
body.single-item.groups #buddypress .bp-wrap,
body.single-item.groups #buddypress #item-body,
.bb-template-v2.single-item.groups #buddypress .bp-wrap,
.bb-template-v2.single-item.groups #buddypress #item-body {
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Grupp-sidan: nav-länkar (Feed, Discussions, Members, etc.) – mellanrum och läsbar stil */
body.single-item.groups #buddypress nav#object-nav.bp-navs ul,
body.single-item.groups #buddypress nav#object-nav .bp-navs ul,
body.single-item.groups #buddypress .bp-navs.group-subnav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
body.single-item.groups #buddypress nav#object-nav.bp-navs ul li,
body.single-item.groups #buddypress nav#object-nav .bp-navs ul li,
body.single-item.groups #buddypress .bp-navs.group-subnav ul li {
  margin: 0;
}
body.single-item.groups #buddypress nav#object-nav a,
body.single-item.groups #buddypress .bp-navs.group-subnav a {
  padding: 0.35em 0.6em;
  text-decoration: none;
  border-radius: 4px;
}
body.single-item.groups #buddypress nav#object-nav a:hover,
body.single-item.groups #buddypress .bp-navs.group-subnav a:hover {
  text-decoration: none;
  background-color: var(--bb-content-alternate-background-color, rgba(0, 0, 0, 0.05));
}
body.single-item.groups #buddypress nav#object-nav .selected a,
body.single-item.groups #buddypress nav#object-nav .current a,
body.single-item.groups #buddypress .bp-navs.group-subnav .selected a,
body.single-item.groups #buddypress .bp-navs.group-subnav .current a {
  font-weight: 600;
}

/* ===================================================================
   FORUM: Alla forum (lista) + ett forum (enskild sida)
   Ta bort kort-känsla: lista = ljusare kort, enskild = transparent wrapper.
   =================================================================== */
/* Forum-lista: dämpa stora kort med mörka gradienter */
body.buddypress.forums #bbpress-forums .bs-forums-items .bs-forums-item,
body.bbpress #bbpress-forums .bs-forums-items .bs-forums-item {
  background: var(--bb-content-background-color, #fff);
  border: 1px solid var(--bb-content-border-color, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
body.buddypress.forums #bbpress-forums .bs-forums-item .bs-forum-cover,
body.buddypress.forums #bbpress-forums .bs-forums-item .bs-cover-wrap,
body.bbpress #bbpress-forums .bs-forums-item .bs-forum-cover,
body.bbpress #bbpress-forums .bs-forums-item .bs-cover-wrap {
  background: var(--bb-content-alternate-background-color, #f5f5f5);
}
/* Enskild forum-sida: ta bort vit kort-wrapper runt innehållet */
body.single-forum #bbpress-forums,
body.forum #bbpress-forums,
body.bbpress.single-forum #bbpress-forums,
body.buddypress.forum #bbpress-forums {
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Forumarkiv (loop-forums): ul är bara flex-grid – ingen egen yta; korten är .bb-cover-list-item */
#bbpress-forums ul.bb-forums-list.bs-card-list.bb-grid,
#bbpress-forums ul.grid-view.bb-forums-list.bs-card-list {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
}

/* ===================================================================
   DARK MODE – BuddyBoss aktivitetsflöde, widgets, post-form
   BuddyPress core sätter bl.a. #whats-new-form { background:#fff }.
   =================================================================== */

html[data-theme="dark"] body.buddypress #primary .entry-title,
html[data-theme="dark"] body.buddypress.activity #primary h1.entry-title,
html[data-theme="dark"] body.buddypress #primary article .entry-title,
html[data-theme="dark"] body.buddypress #buddypress .entry-header .entry-title,
html[data-theme="dark"] body.buddypress #buddypress > .buddypress-wrap h1 {
  color: var(--text) !important;
}

/* Breadcrumbs: BuddyBoss wrapper .bb-yoast-breadcrumbs + vanliga SEO-plugin-klasser */
html[data-theme="dark"] body.app-header-buddyboss .bb-yoast-breadcrumbs,
html[data-theme="dark"] body.app-header-buddyboss .bb-yoast-breadcrumbs span,
html[data-theme="dark"] body.app-header-buddyboss .bb-yoast-breadcrumbs strong,
html[data-theme="dark"] body.buddypress .bb-yoast-breadcrumbs,
html[data-theme="dark"] body.buddypress .bb-yoast-breadcrumbs span,
html[data-theme="dark"] body.buddypress .bb-yoast-breadcrumbs strong,
html[data-theme="dark"] body.app-header-buddyboss .bb-yoast-breadcrumbs a,
html[data-theme="dark"] body.buddypress .bb-yoast-breadcrumbs a,
html[data-theme="dark"] body.buddypress .yoast-breadcrumb,
html[data-theme="dark"] body.buddypress .yoast-breadcrumb a,
html[data-theme="dark"] body.app-header-buddyboss .yoast-breadcrumb,
html[data-theme="dark"] body.app-header-buddyboss .yoast-breadcrumb a,
html[data-theme="dark"] body.buddypress .rank-math-breadcrumb,
html[data-theme="dark"] body.buddypress .rank-math-breadcrumb a,
html[data-theme="dark"] body.buddypress .bb-breadcrumb,
html[data-theme="dark"] body.buddypress .bb-breadcrumb a,
html[data-theme="dark"] body.buddypress nav[aria-label*="readcrumb"] a,
html[data-theme="dark"] body.buddypress .breadcrumb,
html[data-theme="dark"] body.buddypress .breadcrumb span,
html[data-theme="dark"] body.buddypress .breadcrumb a,
html[data-theme="dark"] body.buddypress #buddypress .breadcrumb,
html[data-theme="dark"] body.buddypress #buddypress .breadcrumb a,
html[data-theme="dark"] body.buddypress #breadcrumbs,
html[data-theme="dark"] body.buddypress #breadcrumbs a,
html[data-theme="dark"] body.app-header-buddyboss #breadcrumbs,
html[data-theme="dark"] body.app-header-buddyboss #breadcrumbs a,
html[data-theme="dark"] body.buddypress strong.breadcrumb_last,
html[data-theme="dark"] body.buddypress .breadcrumb_last,
html[data-theme="dark"] body.app-header-buddyboss strong.breadcrumb_last,
html[data-theme="dark"] body.app-header-buddyboss .breadcrumb_last,
html[data-theme="dark"] body.buddypress .aioseo-breadcrumbs,
html[data-theme="dark"] body.buddypress .aioseo-breadcrumbs a,
html[data-theme="dark"] body.app-header-buddyboss .aioseo-breadcrumbs,
html[data-theme="dark"] body.app-header-buddyboss .aioseo-breadcrumbs a {
  color: var(--text, #f0f2ff) !important;
}

html[data-theme="dark"] body.buddypress .bb-yoast-breadcrumbs a:hover,
html[data-theme="dark"] body.app-header-buddyboss .bb-yoast-breadcrumbs a:hover,
html[data-theme="dark"] body.buddypress .yoast-breadcrumb a:hover,
html[data-theme="dark"] body.buddypress .breadcrumb a:hover,
html[data-theme="dark"] body.buddypress .bb-breadcrumb a:hover,
html[data-theme="dark"] body.buddypress #breadcrumbs a:hover,
html[data-theme="dark"] body.app-header-buddyboss #breadcrumbs a:hover {
  color: var(--lav-200, #d0d1e8) !important;
}

/* „Vad tänker du på“ / activity post form */
html[data-theme="dark"] body.buddypress #whats-new-form,
html[data-theme="dark"] body.buddypress .bp-nouveau-activity-form-placeholder,
html[data-theme="dark"] body.buddypress .activity-update-form {
  background-color: var(--bg-elev) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form #whats-new-form-placeholder,
html[data-theme="dark"] body.buddypress .activity-update-form #whats-new-form.activity-form {
  background-color: var(--bg-elev) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form .bb-model-header {
  background-color: var(--bg-elev) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form .bb-model-header .bb-icon-close {
  color: rgba(255, 255, 255, 0.75) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form .whats-new-title {
  color: var(--text) !important;
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form #whats-new-toolbar,
html[data-theme="dark"] body.buddypress .activity-update-form .whats-new-form-footer {
  background-color: rgba(0, 0, 0, 0.28) !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form #whats-new,
html[data-theme="dark"] body.buddypress .activity-update-form #whats-new-content {
  color: var(--text) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form #user-status-huddle .user-name {
  color: var(--text) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form .medium-editor-element {
  color: var(--text) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form .medium-editor-placeholder:after {
  color: var(--muted) !important;
  opacity: 1 !important;
}

/* BuddyBoss buddypress.css: placeholder via :empty:before använder --bb-body-text-color-rgb → låg kontrast med vårt tema */
html[data-theme="dark"] body.buddypress #whats-new-textarea-placeholder [contenteditable="true"]:empty:before,
html[data-theme="dark"] body.buddypress #whats-new-textarea [contenteditable="true"]:empty:before,
html[data-theme="dark"] body.buddypress #whats-new-form #whats-new-content [contenteditable="true"]:empty:before,
html[data-theme="dark"] body.buddypress #whats-new-form-placeholder #whats-new-content [contenteditable="true"]:empty:before {
  color: var(--muted, #a3a8c2) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] body.buddypress #whats-new-form-placeholder .username,
html[data-theme="dark"] body.buddypress #whats-new-form .username {
  color: var(--text) !important;
}

html[data-theme="dark"] body.buddypress #whats-new-form-placeholder .username:hover,
html[data-theme="dark"] body.buddypress #whats-new-form .username:hover {
  color: var(--lav-300, #b8b9d9) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form .emojionearea {
  background: var(--bg-elev) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

html[data-theme="dark"] body.buddypress .activity-update-form .emojionearea .emojionearea-editor {
  background: transparent !important;
  color: var(--text) !important;
}

html[data-theme="dark"] body.buddypress #whats-new-form.focus-in #bp-activity-privacy-point {
  color: var(--muted) !important;
}

html[data-theme="dark"] body.buddypress #whats-new-form.focus-in--attm #editor-toolbar,
html[data-theme="dark"] body.buddypress #whats-new-form.focus-in--scroll #editor-toolbar {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* Sidofält: profil completion, senaste händelser m.m. */
html[data-theme="dark"] body.buddypress #secondary .widget,
html[data-theme="dark"] body.buddypress #secondary-right .widget {
  background: var(--bg-elev) !important;
  background-color: var(--bg-elev) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--text) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] body.buddypress #secondary .widget-title,
html[data-theme="dark"] body.buddypress #secondary-right .widget-title,
html[data-theme="dark"] body.buddypress .widget .widget-title {
  color: var(--text) !important;
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

/* (BB) Profile completion */
html[data-theme="dark"] body.buddypress .widget_bp_profile_completion_widget .profile_completion_wrap {
  color: var(--text) !important;
}

html[data-theme="dark"] body.buddypress .profile_completion_wrap .progress_text_wrap h3,
html[data-theme="dark"] body.buddypress .profile_completion_wrap .progress_text_label {
  color: var(--text) !important;
}

html[data-theme="dark"] body.buddypress .profile_completion_wrap .single_section_wrap {
  color: var(--muted) !important;
}

html[data-theme="dark"] body.buddypress .profile_completion_wrap .section_name .group_link {
  color: var(--text) !important;
}

html[data-theme="dark"] body.buddypress .profile_completion_wrap svg.pc_progress_graph > path:first-of-type {
  stroke: rgba(255, 255, 255, 0.22) !important;
}

html[data-theme="dark"] body.buddypress .profile_completion_wrap .pc_progress_rate {
  stroke: var(--lav-400) !important;
}

html[data-theme="dark"] body.buddypress .profile_completion_wrap .section_ico .bb-icon-check {
  color: var(--lav-400) !important;
}

/* (BB) Latest activities */
html[data-theme="dark"] body.buddypress .bp-latest-activities .bp-activity-info {
  color: var(--text) !important;
}

html[data-theme="dark"] body.buddypress .bp-latest-activities .bp-activity-info a {
  color: var(--lav-300) !important;
}

html[data-theme="dark"] body.buddypress .bp-latest-activities .time-since,
html[data-theme="dark"] body.buddypress .bp-latest-activities time.time-since,
html[data-theme="dark"] body.buddypress .bp-latest-activities .activity-date,
html[data-theme="dark"] body.buddypress .bp-latest-activities .activity-date a,
html[data-theme="dark"] body.buddypress .bp-latest-activities a.activity-time-since,
html[data-theme="dark"] body.buddypress .bp-latest-activities .activity-time-since .time-since {
  color: var(--muted, #a3a8c2) !important;
}

html[data-theme="dark"] body.buddypress #secondary .groups-list .group-details .meta,
html[data-theme="dark"] body.buddypress #secondary .groups-list .item-meta,
html[data-theme="dark"] body.buddypress #secondary .groups-list .last-activity,
html[data-theme="dark"] body.buddypress #secondary-right .groups-list .group-details .meta,
html[data-theme="dark"] body.buddypress #secondary-right .groups-list .item-meta,
html[data-theme="dark"] body.buddypress #secondary-right .groups-list .last-activity {
  color: var(--muted, #a3a8c2) !important;
}

html[data-theme="dark"] body.buddypress .bp-latest-activities .widget-error,
html[data-theme="dark"] body.buddypress .bp-latest-activities .bp-template-notice,
html[data-theme="dark"] body.buddypress .bp-latest-activities .bp-feedback {
  color: var(--muted) !important;
}

/* Gemenskap-nav under app header */
html[data-theme="dark"] .gemenskap-nav-wrap {
  background: var(--bg-elev);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .gemenskap-nav-wrap .akademi-nav-context {
  color: var(--muted);
}

html[data-theme="dark"] .gemenskap-nav-wrap .akademi-nav-link {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .gemenskap-nav-wrap .akademi-nav-link:hover {
  color: #ffffff;
}

html[data-theme="dark"] .gemenskap-nav-wrap .akademi-nav-sep {
  color: var(--muted);
}

/* #66: ta bort BuddyBoss/Yoast-breadcrumben på alla inloggade BB-sidor (Pia) */
.bb-yoast-breadcrumbs{display:none !important;}
