/* ==========================================================================
   Community Forum – page template styles
   Overrides wpForo's default theme to match the pdnet design system.
   Enqueue after effective-practice-hub.css so :root tokens are available.
   ========================================================================== */

/* --------------------------------------------------------------------------
   TinyMCE toolbar icon fix
   wpForo's TinyMCE skin uses a background-image sprite. The relative URLs
   in the skin CSS break when the editor is loaded outside the plugin context.
   We override the background-image with an absolute URL pointing to the
   wpForo plugin's own sprite file.
   -------------------------------------------------------------------------- */
#wpforo-pdnet .mce-ico {
  background-image: url("/wp-content/plugins/wpforo/assets/js/tinymce/skins/lightgray/img/icons.png") !important;
  background-repeat: no-repeat;
  display: inline-block;
  width: 16px;
  height: 16px;
}

/* Retina */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  #wpforo-pdnet .mce-ico {
    background-image: url("/wp-content/plugins/wpforo/assets/js/tinymce/skins/lightgray/img/icons-2x.png") !important;
    background-size: 40px 920px;
  }
}

/* --------------------------------------------------------------------------
   Outer card that wraps the entire forum
   -------------------------------------------------------------------------- */
.community-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  border-top: 8px solid var(--pd-blue);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 32px);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   wpForo general resets inside our wrapper
   -------------------------------------------------------------------------- */
#wpforo-pdnet #wpforo-wrap,
#wpforo-pdnet #wpforo-wrap * {
  font-family: inherit;
  box-sizing: border-box;
}

#wpforo-pdnet #wpforo-wrap {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Breadcrumb & subtop bar
   -------------------------------------------------------------------------- */
#wpforo-pdnet .wpforo-subtop {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

#wpforo-pdnet .wpf-breadcrumb {
  font-size: 0.82rem;
  color: var(--pd-grey);
}

#wpforo-pdnet .wpf-breadcrumb a {
  color: var(--pd-blue-dark);
  text-decoration: none;
  font-weight: 700;
}

#wpforo-pdnet .wpf-breadcrumb a:hover {
  color: var(--pd-purple);
  text-decoration: underline;
}

/* Notifications bell */
#wpforo-pdnet .wpf-notifications {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(63, 68, 72, 0.06);
}

#wpforo-pdnet .wpf-notification-head {
  color: var(--pd-blue-dark);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 10px 14px;
}

/* --------------------------------------------------------------------------
   Forum title & feed links
   -------------------------------------------------------------------------- */
#wpforo-pdnet #wpforo-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--pd-blue-dark);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 18px;
  border: none;
  padding: 0;
}

#wpforo-pdnet .wpforo-feed {
  font-size: 0.78rem;
  color: var(--pd-grey);
  font-weight: 500;
}

#wpforo-pdnet .wpforo-feed a {
  color: var(--pd-blue-dark);
  text-decoration: none;
}

#wpforo-pdnet .wpforo-feed a:hover {
  color: var(--pd-purple);
}

#wpforo-pdnet .wpforo-feed sep {
  color: var(--line);
}

/* --------------------------------------------------------------------------
   Category panel (section header)
   -------------------------------------------------------------------------- */
#wpforo-pdnet .wpforo-category {
  background: transparent;
  border: none;
  margin-bottom: 0;
}

#wpforo-pdnet .wpforo-cat-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  background: var(--pd-blue-soft);
  border: 1px solid rgba(0, 168, 232, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

#wpforo-pdnet .cat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--pd-blue-dark);
}

#wpforo-pdnet .cat-icon {
  color: var(--pd-blue);
  font-size: 1.1rem;
}

#wpforo-pdnet .wpf-head-bar-left .wpf-forums {
  color: var(--pd-blue-dark);
  cursor: pointer;
}

/* "Add topic" button */
#wpforo-pdnet .add_wpftopic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: var(--pd-blue);
  color: var(--white);
  font: 700 0.82rem/1 inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

#wpforo-pdnet .add_wpftopic:hover {
  background: var(--pd-purple);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Forum item list (sub-forums)
   -------------------------------------------------------------------------- */
#wpforo-pdnet .wpf-cat-forum-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

#wpforo-pdnet .wpf-forum-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

#wpforo-pdnet .wpf-forum-item a {
  color: var(--pd-purple);
  text-decoration: none;
  font-weight: 700;
}

#wpforo-pdnet .wpf-forum-item a:hover {
  color: var(--pd-blue-dark);
  text-decoration: underline;
}

#wpforo-pdnet .wpf-forum-item-stat {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--pd-grey);
}

#wpforo-pdnet .wpf-circle {
  color: var(--pd-blue);
  font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   Thread list header row
   -------------------------------------------------------------------------- */
#wpforo-pdnet .wpf-threads-head {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--pd-grey-soft);
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--pd-grey);
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Individual thread rows
   -------------------------------------------------------------------------- */
#wpforo-pdnet .wpf-thread {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: none;
  transition: background 0.12s ease;
}

#wpforo-pdnet .wpf-thread:last-of-type {
  border-radius: 0 0 12px 12px;
}

#wpforo-pdnet .wpf-thread:hover {
  background: var(--pd-grey-soft);
}

#wpforo-pdnet .wpf-thread.wpf-unread-topic {
  border-left: 3px solid var(--pd-blue);
}

#wpforo-pdnet .wpf-thread-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

/* Thread title & meta */
#wpforo-pdnet .wpf-thread-title {
  flex: 1;
  min-width: 0;
}

#wpforo-pdnet .wpf-thread-head {
  margin-bottom: 3px;
}

#wpforo-pdnet .wpf-thread-head a {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pd-grey-dark);
  text-decoration: none;
  line-height: 1.35;
}

#wpforo-pdnet .wpf-thread-head a:hover {
  color: var(--pd-purple);
}

#wpforo-pdnet .wpf-thread-author-name {
  font-size: 0.75rem;
  color: var(--pd-grey);
}

#wpforo-pdnet .wpf-thread-author-name a {
  color: var(--pd-blue-dark);
  text-decoration: none;
  font-weight: 600;
}

#wpforo-pdnet .wpf-thread-author-name a:hover {
  text-decoration: underline;
}

#wpforo-pdnet .wpforo-date {
  color: var(--pd-grey);
}

/* Thread stat boxes */
#wpforo-pdnet .wpf-thread-posts span,
#wpforo-pdnet .wpf-thread-views span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 26px;
  padding: 0 8px;
  background: var(--pd-grey-soft);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pd-grey-dark);
}

/* Last reply cell */
#wpforo-pdnet .wpf-thread-last-info {
  font-size: 0.75rem;
  color: var(--pd-grey);
  text-align: right;
}

#wpforo-pdnet .wpf-thread-last-user a {
  color: var(--pd-blue-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
}

#wpforo-pdnet .wpf-thread-last-user a:hover {
  text-decoration: underline;
}

#wpforo-pdnet .wpf-thread-last-date {
  color: var(--pd-grey);
  font-size: 0.7rem;
  margin-top: 2px;
}

/* Thread status icons */
#wpforo-pdnet .wpf-thread-status .wpfsq {
  background: var(--pd-purple-soft);
  color: var(--pd-purple);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* Thread author avatar */
#wpforo-pdnet .wpf-thread-users-avatars img,
#wpforo-pdnet .wpf-thread-last-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  object-fit: cover;
}

/* Forum icon in thread row */
#wpforo-pdnet .wpf-thread-forum span {
  border-color: var(--line) !important;
  color: var(--pd-grey) !important;
}

/* Mobile forum name */
#wpforo-pdnet .wpf-thread-forum-mobile {
  font-size: 0.72rem;
  color: var(--pd-grey);
  margin-top: 3px;
}

#wpforo-pdnet .wpf-thread-forum-mobile a {
  color: var(--pd-blue-dark);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   "Load More Topics" link
   -------------------------------------------------------------------------- */
#wpforo-pdnet .wpf-more-topics {
  margin-top: 14px;
}

#wpforo-pdnet .wpf-more-topics a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--pd-blue);
  border-radius: 999px;
  color: var(--pd-blue-dark);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

#wpforo-pdnet .wpf-more-topics a:hover {
  background: var(--pd-blue);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   "Select Forum" topic form dropdown
   -------------------------------------------------------------------------- */
#wpforo-pdnet .wpf-topic-form-extra-wrap {
  background: var(--pd-grey-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

#wpforo-pdnet .wpf-choose-forum {
  font-weight: 700;
  color: var(--pd-blue-dark);
  font-size: 0.85rem;
}

#wpforo-pdnet .wpf-topic-forum-wrap select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

#wpforo-pdnet .wpf-topic-forum-wrap select:focus {
  outline: 4px solid rgba(0, 168, 232, 0.25);
  border-color: var(--pd-blue);
}

/* --------------------------------------------------------------------------
   Unread posts / RSS feed links in title
   -------------------------------------------------------------------------- */
#wpforo-pdnet .wpf-unread-posts a,
#wpforo-pdnet .wpf-feed-forums a,
#wpforo-pdnet .wpf-feed-topics a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--pd-blue-dark);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--white);
  transition: background 0.15s ease, border-color 0.15s ease;
}

#wpforo-pdnet .wpf-unread-posts a:hover,
#wpforo-pdnet .wpf-feed-forums a:hover,
#wpforo-pdnet .wpf-feed-topics a:hover {
  background: var(--pd-blue-soft);
  border-color: var(--pd-blue);
}

/* --------------------------------------------------------------------------
   Font Awesome fa-rotate-180 fix (removed in FA6 – use transform instead)
   -------------------------------------------------------------------------- */
#wpforo-pdnet .fa-rotate-180 {
  transform: rotate(180deg);
  display: inline-block;
}

/* --------------------------------------------------------------------------
   Font Awesome 6 – self-contained webfont + icon definitions
   Bypasses wpForo's bundled copy and any enqueue conflicts entirely.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/webfonts/fa-solid-900.woff2") format("woff2"),
       url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/webfonts/fa-solid-900.ttf")   format("truetype");
}

@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/webfonts/fa-regular-400.woff2") format("woff2"),
       url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/webfonts/fa-regular-400.ttf")   format("truetype");
}

@font-face {
  font-family: "Font Awesome 6 Brands";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/webfonts/fa-brands-400.woff2") format("woff2"),
       url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/webfonts/fa-brands-400.ttf")   format("truetype");
}

/* Ensure all FA icon elements use the correct font */
#wpforo-pdnet .fas,
#wpforo-pdnet .far,
#wpforo-pdnet .fab,
#wpforo-pdnet [class^="fa-"],
#wpforo-pdnet [class*=" fa-"] {
  font-family: "Font Awesome 6 Free" !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  display: inline-block;
}

#wpforo-pdnet .fas { font-weight: 900 !important; }
#wpforo-pdnet .far { font-weight: 400 !important; }
#wpforo-pdnet .fab { font-family: "Font Awesome 6 Brands" !important; font-weight: 400 !important; }

/* fa-rotate-180 was removed in FA6 */
#wpforo-pdnet .fa-rotate-180 { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 680px) {
  #wpforo-pdnet .wpf-threads-head {
    display: none;
  }

  #wpforo-pdnet .wpf-thread-body {
    flex-wrap: wrap;
  }

  #wpforo-pdnet .wpf-thread-forum,
  #wpforo-pdnet .wpf-thread-posts,
  #wpforo-pdnet .wpf-thread-views,
  #wpforo-pdnet .wpf-thread-last-reply,
  #wpforo-pdnet .wpf-thread-status {
    display: none;
  }

  #wpforo-pdnet .wpf-thread-forum-mobile {
    display: block;
  }

  .community-card {
    padding: 16px;
  }
}