/* Public hubs share their navigation and geometry with the social homepage. */
.pg-has-explore-shell {
  --pg-explore-header-offset: calc(var(--pg-brand-header-height, 134px) + var(--wp-admin--admin-bar--height, 0px));
}
html body.wp-theme-psyguild-theme .pg-explore-page {
  width: 94%; max-width: 1600px; margin: 24px auto 56px; padding: 0;
  font-family: var(--pg-interface-font);
}
.pg-explore-layout { display: grid; grid-template-columns: 352px minmax(0, 1fr); align-items: start; gap: 22px; }
.pg-explore-content { min-width: 0; }
.pg-explore-global .pg-explore-content { container: pg-explore-content / inline-size; }
.pg-explore-rail { position: sticky; top: calc(var(--pg-explore-header-offset, 134px) + 18px); min-width: 0; max-height: calc(100dvh - var(--pg-explore-header-offset, 134px) - 36px); overflow-y: auto; scrollbar-width: thin; }
.pg-explore-content > :is(.pg-app-intro, .pg-service-intro, .pg-event-intro, .pg-community-hero, .pg-knowledge-intro) {
  gap: 24px; padding-top: 8px; padding-bottom: 26px; margin-bottom: 24px;
}
html body.wp-theme-psyguild-theme .pg-explore-page .pg-explore-content > :is(header, .pg-knowledge-header) h1 {
  font-family: var(--pg-interface-font) !important; font-size: clamp(30px, 3vw, 42px) !important;
  line-height: 1.2 !important; letter-spacing: -.025em; margin-top: 12px !important;
}
.pg-explore-content :is(.pg-app-art, .pg-service-art, .pg-event-art, .pg-community-art, .pg-knowledge-art) { flex-basis: 170px; margin-right: 0; }
/* Category controls belong to the content area, leaving one primary rail. */
.pg-explore-content :is(.pg-app-workbench, .pg-service-workbench, .pg-event-workbench) { grid-template-columns: minmax(0, 1fr); gap: 24px; }
.pg-explore-content :is(.pg-app-navigation, .pg-service-navigation, .pg-event-navigation) {
  padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--pg-border); border-radius: 0; background: transparent; box-shadow: none;
}
.pg-explore-content :is(.pg-app-navigation, .pg-service-navigation, .pg-event-navigation) > :is(h2, p) { display: none; }
.pg-explore-content :is(.pg-app-navigation, .pg-service-navigation, .pg-event-navigation) > span { padding: 0; margin-bottom: 10px; }
.pg-explore-content :is(.pg-hub-tabs, .pg-event-category-tabs) { flex-direction: row; flex-wrap: wrap; gap: 8px; }
html body.wp-theme-psyguild-theme .pg-explore-content :is(.pg-hub-tabs > .pg-hub-tab-btn, .pg-event-category-tabs > .pg-event-tab-btn) {
  width: auto; min-height: 40px; padding: 9px 12px; white-space: nowrap; font-size: 12px;
}
.pg-explore-content .pg-hub-games-link { display: inline-flex; width: auto; margin-top: 12px; }
.pg-explore-content .pg-community-layout { display: flex; flex-direction: column; gap: 22px; }
.pg-explore-content .pg-community-sidebar { display: contents; }
.pg-explore-content .pg-community-sidebar > section { width: 100%; margin: 0; padding: 0; border: 0; }
.pg-explore-content :is(.pg-community-views, .pg-community-topics nav) { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; width: 100%; margin: 0; }
.pg-explore-content .pg-community-feed { width: 100%; order: 1; }
.pg-explore-content .pg-community-guide { order: 2; width: 100%; }

@media (min-width: 1024px) and (max-width: 1279px) {
  .pg-explore-layout { grid-template-columns: 300px minmax(0, 1fr); gap: 18px; }
  .pg-explore-content :is(.pg-app-art, .pg-service-art, .pg-event-art, .pg-community-art, .pg-knowledge-art) { display: none; }
}
@media (max-width: 1023px) {
  .pg-explore-layout { display: block; }
  .pg-explore-rail { display: none; }
  html body.wp-theme-psyguild-theme .pg-explore-page { width: calc(100% - 40px); margin-top: 24px; }
}
@media (max-width: 767px) {
  html body.wp-theme-psyguild-theme .pg-explore-page { width: calc(100% - 32px) !important; max-width: none !important; margin: 20px 16px 0 !important; padding: 0 0 calc(88px + env(safe-area-inset-bottom)) !important; }
  .pg-explore-content > :is(.pg-app-intro, .pg-service-intro, .pg-event-intro, .pg-community-hero, .pg-knowledge-intro) { padding: 0 0 20px; margin-bottom: 20px; }
  .pg-explore-content :is(.pg-app-art, .pg-service-art, .pg-event-art, .pg-community-art, .pg-knowledge-art) { display: none; }
  html body.wp-theme-psyguild-theme .pg-explore-page .pg-explore-content > :is(header, .pg-knowledge-header) h1 { font-size: 30px !important; }
  .pg-explore-content :is(.pg-hub-tabs, .pg-event-category-tabs) { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .pg-explore-content :is(.pg-hub-tab-btn, .pg-event-tab-btn) { flex: 0 0 auto; }
  .pg-explore-content :is(.pg-community-views, .pg-community-topics nav) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pg-explore-content :is(.pg-community-views, .pg-community-topics nav) a { flex: 0 0 auto; white-space: nowrap; }
}
@layer psyguild-opaque-surfaces {
  html body.wp-theme-psyguild-theme .pg-explore-content :is(.pg-app-navigation, .pg-service-navigation, .pg-event-navigation) { background-color: transparent !important; background-image: none !important; }
}
/* The legacy mobile Blog canvas has important dimensions. Keep the new shell
   in its own layout layer so its outer gutter stays consistent across hubs. */
@layer psyguild-explore-layout {
  html body.wp-theme-psyguild-theme .pg-explore-global > .pg-explore-layout > .pg-explore-content > main {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
  }
  @media (max-width: 767px) {
    html body.wp-theme-psyguild-theme main.pg-explore-page {
      box-sizing: border-box !important;
      width: calc(100% - 32px) !important;
      max-width: none !important;
      margin: 20px 16px 0 !important;
      padding: 0 0 calc(88px + env(safe-area-inset-bottom)) !important;
    }
  }
}

/* Public detail layouts respond to their content area beside the shared rail. */
@container pg-explore-content (max-width: 850px) {
 html body.wp-theme-psyguild-theme .pg-explore-global .pg-author-directory-page .pg-authors-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .pg-explore-global .pg-academic-layout { grid-template-columns:180px minmax(0,1fr); gap:24px; }
 .pg-explore-global .pg-author-studio-me { grid-template-columns:minmax(0,1fr); }
}
@container pg-explore-content (max-width: 760px) {
 .pg-explore-global .pg-single-grid, .pg-explore-global .pg-personal-layout { grid-template-columns:minmax(0,1fr); }
 .pg-explore-global .pg-single-sidebar { position:static; }
}
@container pg-explore-content (max-width: 600px) {
 html body.wp-theme-psyguild-theme .pg-explore-global .pg-author-directory-page .pg-authors-grid { grid-template-columns:minmax(0,1fr); }
 .pg-explore-global .pg-academic-layout { display:block; }
 .pg-explore-global .pg-academic-rail { margin-bottom:24px; }
 .pg-explore-global .pg-academic-photo { max-width:180px; }
}
