/**
 * Conecta Frontend App Template
 * v2.35.7
 *
 * Dedicated template adapter for fresh WordPress installs.
 *
 * This file deliberately restores the approved v2.32 public layout ruler instead
 * of creating a new visual system. The active theme is removed by the template;
 * the Conecta modules keep their original markup, cards and feature CSS.
 */

html:has(body.conecta-app-template-page),
body.conecta-app-template-page {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 100% !important;
  background: var(--conecta-bg, #F6F7F3) !important;
  overflow-x: hidden !important;
}

body.conecta-app-template-page {
  --conecta-app-template-page-max: 1180px;
  --conecta-app-template-page-gutter: 32px;
  --conecta-app-template-shell-width: min(var(--conecta-app-template-page-max), calc(100vw - (var(--conecta-app-template-page-gutter) * 2)));

  /* Front typography guardrails. These mirror the approved compact rhythm and
     prevent clean installs from inheriting oversized theme typography. */
  --conecta-page-title-size: clamp(28px, 2.35vw, 38px);
  --conecta-section-title-size: clamp(20px, 1.45vw, 26px);
  --conecta-card-title-size: clamp(16px, 1.05vw, 19px);
  --conecta-card-text-size: 13.5px;
  --conecta-nav-font-size: 13px;
  --conecta-button-font-size: 13px;
  --conecta-tag-font-size: 11px;
  --conecta-date-font-size: 12px;
}

body.conecta-app-template-page #conecta-public-app-template {
  width: 100% !important;
  min-height: 100vh !important;
  background: var(--conecta-bg, #F6F7F3) !important;
  overflow-x: hidden !important;
}

body.conecta-app-template-page #conecta-public-app-template > * {
  margin-top: 0 !important;
}

/* Restore the approved Conecta public canvas. The original CSS was designed to
   escape theme wrappers; in the dedicated template it still gives the correct
   spacing, footer behavior and stable page rhythm. */
body.conecta-app-template-page .conecta-app,
body.conecta-app-template-page .conecta-community-view,
body.conecta-app-template-page .conecta-profile-edit-view,
body.conecta-app-template-page .conecta-profile-public-view,
body.conecta-app-template-page .conecta-profile-directory-view {
  width: 100vw !important;
  max-width: none !important;
  min-height: 100vh !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding: 24px 24px 0 !important;
  box-sizing: border-box !important;
  background: var(--conecta-bg, #F6F7F3) !important;
  color: var(--conecta-text, #525751) !important;
  overflow-x: hidden !important;
  --conecta-page-max: var(--conecta-app-template-page-max) !important;
  --conecta-page-gutter: var(--conecta-app-template-page-gutter) !important;
  --conecta-shell-width: var(--conecta-app-template-page-max) !important;
}


/* v2.35.7 — Community routes own their sticky/overflow geometry.
   The generic application template must not create an overflow ancestor for
   the Community shell, otherwise CSS position: sticky cannot attach to the
   viewport consistently. */
body.conecta-app-template-page[class*="conecta-product-route-comunidade"] #conecta-public-app-template,
body.conecta-app-template-page[class*="conecta-product-route-comunidade"] .conecta-app.conecta-community-view {
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  contain: none !important;
  transform: none !important;
}

body.conecta-app-template-page[class*="conecta-product-route-comunidade"] .conecta-app.conecta-community-view {
  width: 100vw !important;
  max-width: none !important;
  min-height: 100vh !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding: 24px 24px 0 !important;
  box-sizing: border-box !important;
}

/* Single ruler. Header, body sections and module shells must share the same
   design width. This is intentionally based on the v2.32 public layout system. */
body.conecta-app-template-page .conecta-header:not(.cc-portal-header),
body.conecta-app-template-page .conecta-front-header:not(.cc-portal-header),
body.conecta-app-template-page .conecta-hero,
body.conecta-app-template-page .conecta-page-heading,
body.conecta-app-template-page .conecta-card-grid,
body.conecta-app-template-page .conecta-dashboard-grid,
body.conecta-app-template-page .conecta-dashboard-hero,
body.conecta-app-template-page .conecta-home-banner,
body.conecta-app-template-page .conecta-home-section,
body.conecta-app-template-page .conecta-section,
body.conecta-app-template-page .conecta-docs-heading,
body.conecta-app-template-page .conecta-docs-title,
body.conecta-app-template-page .conecta-docs-layout,
body.conecta-app-template-page .conecta-docs-grid,
body.conecta-app-template-page .conecta-comunicados-layout,
body.conecta-app-template-page .conecta-documents-wrap,
body.conecta-app-template-page .conecta-docs-page,
body.conecta-app-template-page .conecta-comunicados-page,
body.conecta-app-template-page .conecta-profile-hero,
body.conecta-app-template-page .conecta-profile-grid,
body.conecta-app-template-page .conecta-profile-wall,
body.conecta-app-template-page .conecta-profile-edit-shell,
body.conecta-app-template-page .conecta-profile-shell,
body.conecta-app-template-page .conecta-profile-directory,
body.conecta-app-template-page .conecta-security-shell,
body.conecta-app-template-page .conecta-security-grid,
body.conecta-app-template-page .conecta-notes-shell,
body.conecta-app-template-page .conecta-notes-board-shell,
body.conecta-app-template-page .conecta-notes-section,
body.conecta-app-template-page .conecta-score-modern-shell,
body.conecta-app-template-page .conecta-pessoas-companies,
body.conecta-app-template-page .conecta-people-layout,
body.conecta-app-template-page .conecta-people-shell,
body.conecta-app-template-page .conecta-people-directory,
body.conecta-app-template-page .conecta-community-linkedin .conecta-community-shell,
body.conecta-app-template-page .conecta-community-shell {
  width: var(--conecta-app-template-shell-width) !important;
  max-width: var(--conecta-app-template-page-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* Header: legacy renderers retain their original ruler. The canonical Portal
   Header is excluded deliberately and owns its geometry in Frontend Shell. */
body.conecta-app-template-page .conecta-header:not(.cc-portal-header),
body.conecta-app-template-page .conecta-front-header:not(.cc-portal-header) {
  min-height: 68px !important;
  padding: 12px 18px !important;
  margin-top: 0 !important;
  margin-bottom: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 20px !important;
}

body.conecta-app-template-page .conecta-header:not(.cc-portal-header) .conecta-brand,
body.conecta-app-template-page .conecta-front-header:not(.cc-portal-header) .conecta-brand {
  min-width: 0 !important;
  flex: 0 0 auto !important;
}

body.conecta-app-template-page .conecta-header:not(.cc-portal-header) .conecta-nav,
body.conecta-app-template-page .conecta-front-header:not(.cc-portal-header) .conecta-nav {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  justify-content: center !important;
}

body.conecta-app-template-page .conecta-header:not(.cc-portal-header) .conecta-header-actions,
body.conecta-app-template-page .conecta-front-header:not(.cc-portal-header) .conecta-header-actions,
body.conecta-app-template-page .conecta-user-actions {
  min-width: 0 !important;
  flex: 0 0 auto !important;
  justify-content: flex-end !important;
}

/* Preserve approved page-specific grids. Only correct the ruler and obvious
   clean-install drift; do not redesign feature modules. */
body.conecta-product-route-inicio .conecta-card-grid,
body.conecta-product-route-home .conecta-card-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 22px !important;
  align-items: stretch !important;
}

body.conecta-app-template-page .conecta-comunicados-layout {
  grid-template-columns: 250px minmax(0, 1fr) !important;
  gap: 28px !important;
  align-items: start !important;
}

body.conecta-app-template-page .conecta-community-linkedin .conecta-community-shell,
body.conecta-app-template-page .conecta-community-shell {
  grid-template-columns: 250px minmax(0, 610px) 280px !important;
  gap: 22px !important;
  align-items: start !important;
}

body.conecta-product-route-comunidade-espacos .conecta-community-shell,
body.conecta-product-route-comunidade-eventos .conecta-community-shell {
  grid-template-columns: 250px minmax(0, 1fr) 280px !important;
}

/* Footer: restore v2.32 behavior. The bar is full-bleed, but its internal
   content follows the same 1180px visual ruler as the rest of the app. */
body.conecta-app-template-page .conecta-footer,
body.conecta-app-template-page .conecta-app-footer,
body.conecta-app-template-page .conecta-app > .conecta-footer,
body.conecta-app-template-page .conecta-community-view .conecta-footer,
body.conecta-app-template-page .conecta-profile-edit-view .conecta-footer,
body.conecta-app-template-page .conecta-profile-public-view .conecta-footer,
body.conecta-app-template-page .conecta-profile-directory-view .conecta-footer {
  width: 100vw !important;
  max-width: none !important;
  min-height: 84px !important;
  margin: 70px calc(50% - 50vw) 0 !important;
  padding: 34px max(24px, calc((100vw - var(--conecta-app-template-page-max)) / 2 + 24px)) !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
}

body.conecta-app-template-page .conecta-app-footer .conecta-footer-inner,
body.conecta-app-template-page .conecta-footer-inner {
  width: min(var(--conecta-app-template-page-max), calc(100vw - 64px)) !important;
  max-width: var(--conecta-app-template-page-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Compact typography pass scoped to the isolated template. */
body.conecta-app-template-page .conecta-hero h1,
body.conecta-app-template-page .conecta-page-heading h1,
body.conecta-app-template-page .conecta-dashboard-hero h1,
body.conecta-app-template-page .conecta-docs-title h1,
body.conecta-app-template-page .conecta-community-directory h2 {
  font-size: var(--conecta-page-title-size) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.7px !important;
}

body.conecta-app-template-page .conecta-section-title h2,
body.conecta-app-template-page .conecta-home-block h2,
body.conecta-app-template-page .conecta-profile-grid h2,
body.conecta-app-template-page .conecta-profile-wall h2,
body.conecta-app-template-page .conecta-security-shell h2,
body.conecta-app-template-page .conecta-notes-shell h2,
body.conecta-app-template-page .conecta-score-modern-shell h2 {
  font-size: var(--conecta-section-title-size) !important;
  line-height: 1.22 !important;
  letter-spacing: -0.35px !important;
}

body.conecta-app-template-page .conecta-dashboard-card h2,
body.conecta-app-template-page .conecta-home-card h3,
body.conecta-app-template-page .conecta-doc-card h2,
body.conecta-app-template-page .conecta-document-item h2,
body.conecta-app-template-page .conecta-filter-sidebar h2,
body.conecta-app-template-page .conecta-community-widget h3,
body.conecta-app-template-page .conecta-directory-card h3,
body.conecta-app-template-page .conecta-profile-card h3 {
  font-size: var(--conecta-card-title-size) !important;
  line-height: 1.25 !important;
  letter-spacing: -0.2px !important;
}

body.conecta-app-template-page .conecta-nav a,
body.conecta-app-template-page .conecta-user-menu-toggle,
body.conecta-app-template-page .conecta-button,
body.conecta-app-template-page button,
body.conecta-app-template-page input,
body.conecta-app-template-page select,
body.conecta-app-template-page textarea {
  font-size: var(--conecta-button-font-size) !important;
}

body.conecta-app-template-page .conecta-dashboard-card p,
body.conecta-app-template-page .conecta-home-card p,
body.conecta-app-template-page .conecta-doc-card p,
body.conecta-app-template-page .conecta-document-item p,
body.conecta-app-template-page .conecta-community-widget p,
body.conecta-app-template-page .conecta-profile-grid p,
body.conecta-app-template-page .conecta-security-shell p,
body.conecta-app-template-page .conecta-notes-shell p {
  font-size: var(--conecta-card-text-size) !important;
  line-height: 1.48 !important;
}

/* Card alignment guardrails. */
body.conecta-app-template-page .conecta-dashboard-card,
body.conecta-app-template-page .conecta-home-card,
body.conecta-app-template-page .conecta-home-doc-card,
body.conecta-app-template-page .conecta-filter-sidebar,
body.conecta-app-template-page .conecta-timeline-shell,
body.conecta-app-template-page .conecta-doc-section,
body.conecta-app-template-page .conecta-community-widget,
body.conecta-app-template-page .conecta-community-composer,
body.conecta-app-template-page .conecta-social-post-card,
body.conecta-app-template-page .conecta-profile-card,
body.conecta-app-template-page .conecta-security-card,
body.conecta-app-template-page .conecta-notes-compose-card,
body.conecta-app-template-page .conecta-notes-board-card,
body.conecta-app-template-page .conecta-saved-boards-card {
  box-sizing: border-box !important;
}

/* Prevent SVG/image utilities from exploding in clean installs. */
body.conecta-app-template-page .conecta-app svg:not(.cc-org-visual-connectors),
body.conecta-app-template-page .conecta-community-view svg:not(.cc-org-visual-connectors),
body.conecta-app-template-page .conecta-profile-edit-view svg:not(.cc-org-visual-connectors) {
  max-width: 40px !important;
  max-height: 40px !important;
}

body.conecta-app-template-page .conecta-app button svg,
body.conecta-app-template-page .conecta-app a svg,
body.conecta-app-template-page .conecta-bell .dashicons,
body.conecta-app-template-page .conecta-a11y .dashicons {
  max-width: 20px !important;
  max-height: 20px !important;
}

@media (max-width: 1200px) {
  body.conecta-app-template-page {
    --conecta-app-template-page-gutter: 24px;
  }

  body.conecta-app-template-page .conecta-community-linkedin .conecta-community-shell,
  body.conecta-app-template-page .conecta-community-shell,
  body.conecta-app-template-page .conecta-comunicados-layout {
    grid-template-columns: 1fr !important;
  }

  body.conecta-app-template-page .conecta-community-left,
  body.conecta-app-template-page .conecta-community-right {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  body.conecta-app-template-page {
    --conecta-app-template-page-gutter: 20px;
  }

  body.conecta-product-route-inicio .conecta-card-grid,
  body.conecta-product-route-home .conecta-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 700px) {
  body.conecta-app-template-page {
    --conecta-app-template-page-gutter: 14px;
  }

  body.conecta-app-template-page .conecta-app,
  body.conecta-app-template-page .conecta-community-view,
  body.conecta-app-template-page .conecta-profile-edit-view,
  body.conecta-app-template-page .conecta-profile-public-view,
  body.conecta-app-template-page .conecta-profile-directory-view {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  body.conecta-product-route-inicio .conecta-card-grid,
  body.conecta-product-route-home .conecta-card-grid,
  body.conecta-app-template-page .conecta-community-left,
  body.conecta-app-template-page .conecta-community-right {
    grid-template-columns: 1fr !important;
  }

  body.conecta-app-template-page .conecta-header:not(.cc-portal-header),
  body.conecta-app-template-page .conecta-front-header:not(.cc-portal-header) {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  body.conecta-app-template-page .conecta-footer,
  body.conecta-app-template-page .conecta-app-footer {
    padding: 30px 24px !important;
    text-align: center !important;
  }
}


/* v2.34.2.4 — Spaces ADS width alignment.
   Espaços must follow the same approved horizontal ruler as the public header.
   Do not use a wider 1240px canvas here: it breaks the Admin/Product Design
   System rhythm and makes the content pass the top navigation limits. */
body.conecta-app-template-page.conecta-product-route-comunidade-espacos {
  --conecta-space-shell-max: 1184px;
  --conecta-space-shell-gutter: var(--conecta-app-template-page-gutter, 32px);
  --conecta-space-left-rail: 250px;
  --conecta-space-shell-gap: 22px;
}

body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-shell.conecta-community-shell--spaces,
body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-view .conecta-community-shell.conecta-community-shell--spaces,
body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-linkedin .conecta-community-shell.conecta-community-shell--spaces {
  width: min(var(--conecta-space-shell-max), calc(100vw - (var(--conecta-space-shell-gutter) * 2))) !important;
  max-width: var(--conecta-space-shell-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: grid !important;
  grid-template-columns: var(--conecta-space-left-rail) minmax(0, 1fr) !important;
  gap: var(--conecta-space-shell-gap) !important;
  align-items: start !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-shell.conecta-community-shell--spaces .conecta-community-feed {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Espaços is a two-column experience. A generic right rail must not reserve
   space on this route, otherwise the official width is exceeded. */
body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-shell.conecta-community-shell--spaces > .conecta-community-right {
  display: none !important;
}

/* Ensure the Spaces list/detail cards stay inside the official content column. */
body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-shell.conecta-community-shell--spaces .conecta-community-feed > *,
body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-space-detail,
body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-space-detail-shell,
body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-space-context-layout,
body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-space-context-main {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 1100px) {
  body.conecta-app-template-page.conecta-product-route-comunidade-espacos {
    --conecta-space-shell-gutter: 20px;
  }

  body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-shell.conecta-community-shell--spaces,
  body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-view .conecta-community-shell.conecta-community-shell--spaces,
  body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-linkedin .conecta-community-shell.conecta-community-shell--spaces {
    width: min(760px, calc(100vw - 40px)) !important;
    max-width: 760px !important;
    grid-template-columns: 1fr !important;
  }

  body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-shell.conecta-community-shell--spaces .conecta-community-left {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    position: static !important;
  }
}

@media (max-width: 760px) {
  body.conecta-app-template-page.conecta-product-route-comunidade-espacos .conecta-community-shell.conecta-community-shell--spaces .conecta-community-left {
    grid-template-columns: 1fr !important;
  }
}


/* v2.35.9 — Community legacy sticky guard.
   The Community page owns its sticky geometry. The app template must not create
   overflow/contain/transform ancestors around it, regardless of the route slug
   (including nested space/event detail pages). */
@media (min-width: 1181px) {
  body.conecta-app-template-page:has(.conecta-community-view.conecta-community-linkedin),
  body.conecta-app-template-page:has(.conecta-community-view.conecta-community-linkedin) #conecta-public-app-template,
  body.conecta-app-template-page:has(.conecta-community-view.conecta-community-linkedin) .conecta-app.conecta-community-view {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    contain: none !important;
    transform: none !important;
  }
}
