/**
 * BridgeWorks — Pagina guida Community (area candidato)
 * Estende come_funziona.css con adattamenti per candidate shell.
 */

/* ——— Pagina e animazioni ——— */
body.community-guide-page {
  --cg-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body.community-guide-page .cg-section {
  position: relative;
}

body.community-guide-page .how-block-header .how-block-kicker {
  position: relative;
  padding-bottom: 0.55rem;
}

body.community-guide-page .how-block-header .how-block-kicker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2.5rem;
  height: 2px;
  border-radius: 999px;
  background: rgba(106, 171, 138, 0.55);
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.6s var(--cg-ease);
}

body.community-guide-page .how-block-header.is-visible .how-block-kicker::after,
body.community-guide-page .how-page-hero .how-block-kicker::after {
  transform: translateX(-50%) scaleX(1);
}

body.community-guide-page .how-page-hero h1 .how-gradient {
  background: linear-gradient(120deg, var(--verde, #2a5c47) 0%, var(--verde-m, #3d7260) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.community-guide-page .cg-reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.65s var(--cg-ease),
    transform 0.65s var(--cg-ease);
}

body.community-guide-page .cg-reveal.is-visible {
  opacity: 1;
  transform: none;
}

body.community-guide-page .cg-feature-cards .how-card.cg-reveal:nth-child(1) { transition-delay: 0.04s; }
body.community-guide-page .cg-feature-cards .how-card.cg-reveal:nth-child(2) { transition-delay: 0.1s; }
body.community-guide-page .cg-feature-cards .how-card.cg-reveal:nth-child(3) { transition-delay: 0.16s; }
body.community-guide-page .cg-feature-cards .how-card.cg-reveal:nth-child(4) { transition-delay: 0.22s; }

body.community-guide-page .how-values-grid .how-value-card.cg-reveal:nth-child(2) { transition-delay: 0.05s; }
body.community-guide-page .how-values-grid .how-value-card.cg-reveal:nth-child(3) { transition-delay: 0.1s; }
body.community-guide-page .how-values-grid .how-value-card.cg-reveal:nth-child(4) { transition-delay: 0.15s; }
body.community-guide-page .how-values-grid .how-value-card.cg-reveal:nth-child(5) { transition-delay: 0.2s; }
body.community-guide-page .how-values-grid .how-value-card.cg-reveal:nth-child(6) { transition-delay: 0.25s; }

body.community-guide-page .how-faq-list .how-faq-item.cg-reveal:nth-child(2) { transition-delay: 0.04s; }
body.community-guide-page .how-faq-list .how-faq-item.cg-reveal:nth-child(3) { transition-delay: 0.08s; }
body.community-guide-page .how-faq-list .how-faq-item.cg-reveal:nth-child(4) { transition-delay: 0.12s; }
body.community-guide-page .how-faq-list .how-faq-item.cg-reveal:nth-child(5) { transition-delay: 0.16s; }
body.community-guide-page .how-faq-list .how-faq-item.cg-reveal:nth-child(6) { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  body.community-guide-page .cg-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Hero con foto — anche area candidato */
body.community-guide-page .how-page-hero.bw-hero--with-photo {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

body.community-guide-page .how-page-hero.bw-hero--with-photo .bw-hero-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

body.community-guide-page .how-page-hero.bw-hero--with-photo .bw-hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% center;
  opacity: 0.34;
  transform: scale(1.02);
}

body.community-guide-page .how-page-hero.bw-hero--with-photo .bw-hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(248, 250, 249, 0.9) 0%, rgba(255, 255, 255, 0.82) 50%, rgba(245, 248, 246, 0.88) 100%);
  pointer-events: none;
}

body.community-guide-page .how-page-hero.bw-hero--with-photo > .container {
  position: relative;
  z-index: 2;
}

body.community-guide-page .how-page-eyebrow {
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
  letter-spacing: 0.08em;
}

body.community-guide-page .how-page-eyebrow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.75rem;
  height: 2px;
  border-radius: 999px;
  background: rgba(106, 171, 138, 0.6);
}

body.community-guide-page .how-page-lead {
  max-width: 42rem;
  font-size: clamp(1.02rem, 1.5vw, 1.12rem);
  line-height: 1.75;
  color: var(--ink-soft, #64748b);
}

body.community-guide-page .how-block-header h2 {
  letter-spacing: -0.02em;
}

body.community-guide-page .how-block-header h2 em {
  font-style: normal;
  color: var(--verde, #2a5c47);
}

body.community-guide-page .how-block--alt.cg-section {
  background: linear-gradient(180deg, rgba(248, 250, 249, 0.85) 0%, rgba(255, 255, 255, 0) 100%);
}

body.community-guide-page .how-page-anchors a {
  transition:
    background 0.2s var(--cg-ease),
    border-color 0.2s var(--cg-ease),
    color 0.2s var(--cg-ease),
    transform 0.2s var(--cg-ease);
}

body.community-guide-page .how-page-anchors a:hover {
  transform: translateY(-1px);
}

body.community-guide-page .how-flow-step .how-flow-body h3 {
  transition: color 0.2s var(--cg-ease);
}

body.community-guide-page .how-flow-step:hover .how-flow-body h3 {
  color: var(--verde, #2a5c47);
}

body.community-guide-page .how-faq-item[open] summary {
  color: var(--verde, #2a5c47);
}

/* ——— Media e layout visivo ——— */
body.community-guide-page .cg-banner {
  margin: 0 0 2rem;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(42, 92, 71, 0.12);
  box-shadow:
    0 1px 2px rgba(42, 92, 71, 0.05),
    0 16px 40px rgba(42, 92, 71, 0.1);
}

body.community-guide-page .cg-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 35%;
  background: linear-gradient(135deg, rgba(106, 171, 138, 0.12), rgba(42, 92, 71, 0.06));
}

body.community-guide-page .cg-banner-caption {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-soft, #64748b);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(42, 92, 71, 0.08);
}

body.community-guide-page .cg-media {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(42, 92, 71, 0.12);
  box-shadow:
    0 1px 2px rgba(42, 92, 71, 0.05),
    0 16px 40px rgba(42, 92, 71, 0.1);
}

body.community-guide-page .cg-media img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 220px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(106, 171, 138, 0.12), rgba(42, 92, 71, 0.06));
}

body.community-guide-page .cg-media--tall img {
  min-height: 280px;
  object-position: center 30%;
}

body.community-guide-page .cg-flow-wrap {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 900px) {
  body.community-guide-page .cg-flow-wrap {
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 2.5rem;
  }

  body.community-guide-page .cg-media--tall {
    position: sticky;
    top: calc(var(--home-nav-height, 4.35rem) + 1.5rem);
  }
}

body.community-guide-page .cg-split--connect {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
}

@media (min-width: 860px) {
  body.community-guide-page .cg-split--connect {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 2rem;
  }
}

body.community-guide-page .cg-split--connect .how-matching-grid {
  margin: 0;
}

body.community-guide-page .cg-card-icon,
body.community-guide-page .cg-value-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  margin-bottom: 0.65rem;
  border-radius: 12px;
  color: var(--verde, #2a5c47);
  background: rgba(106, 171, 138, 0.12);
  border: 1px solid rgba(42, 92, 71, 0.1);
}

body.community-guide-page .cg-card-icon svg,
body.community-guide-page .cg-value-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

body.community-guide-page .cg-feature-cards .how-card,
body.community-guide-page .how-value-card {
  transition:
    transform 0.25s var(--cg-ease),
    box-shadow 0.25s var(--cg-ease),
    border-color 0.25s var(--cg-ease);
}

body.community-guide-page .cg-feature-cards .how-card:hover,
body.community-guide-page .how-value-card:hover {
  transform: translateY(-3px);
  border-color: rgba(42, 92, 71, 0.2);
  box-shadow:
    0 2px 4px rgba(42, 92, 71, 0.06),
    0 20px 44px rgba(42, 92, 71, 0.12);
}

body.community-guide-page .cg-feature-cards .how-card {
  position: relative;
}

body.community-guide-page .cg-feature-cards .how-card-num {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

body.community-guide-page .cg-cta {
  overflow: hidden;
}

body.community-guide-page .cg-cta-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 900px) {
  body.community-guide-page .cg-cta-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.5rem;
  }
}

body.community-guide-page .cg-cta-visual {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(42, 92, 71, 0.06),
    0 20px 44px rgba(42, 92, 71, 0.12);
}

body.community-guide-page .cg-cta-visual img {
  display: block;
  width: 100%;
  height: auto;
}

body.community-guide-page .cg-cta-copy {
  text-align: center;
}

@media (min-width: 900px) {
  body.community-guide-page .cg-cta-copy {
    text-align: left;
  }
}

body.community-guide-page .cg-cta-copy h2 {
  margin-top: 0;
}

body.community-guide-page.candidate-tools-page .bw-community-guide {
  max-width: none;
  padding: 0;
}

body.community-guide-page.candidate-tools-page .how-page-hero {
  padding: 2rem 0 2.5rem;
  background: transparent;
}

body.community-guide-page.candidate-tools-page .how-page-hero.bw-hero--with-photo {
  padding: 2.5rem 0 3rem;
  border-radius: 18px;
  margin-bottom: 0.5rem;
}

body.community-guide-page.candidate-tools-page .how-block {
  padding: 3rem 0;
}

body.community-guide-page.candidate-tools-page .how-block .container,
body.community-guide-page.candidate-tools-page .how-page-hero .container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0;
}

body.community-guide-page .how-values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

body.community-guide-page .how-value-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 8px 24px rgba(26, 26, 24, 0.05);
}

body.community-guide-page .how-value-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--ink);
}

body.home-landing:not(.candidate-area).community-guide-page .how-value-card {
  display: flex;
  flex-direction: column;
}

body.home-landing:not(.candidate-area).community-guide-page .cg-banner,
body.home-landing:not(.candidate-area).community-guide-page .cg-media {
  border-radius: var(--jr-radius-sm, 18px);
}

body.home-landing:not(.candidate-area).community-guide-page .cg-cta-visual {
  border-radius: var(--jr-radius-sm, 18px);
}

body.community-guide-page .how-value-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

body.community-guide-page .how-community-cta {
  text-align: inherit;
  margin-top: 1.5rem;
}

body.community-guide-page.candidate-tools-page .cg-cta {
  padding: 2rem 0 0.5rem;
  background: linear-gradient(180deg, rgba(106, 171, 138, 0.1) 0%, transparent 100%);
  border-radius: 18px;
}

body.community-guide-page.candidate-tools-page .cg-cta-copy h2 {
  font-family: var(--bw-font-display, inherit);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--ink);
}

body.community-guide-page.candidate-tools-page .cg-cta-copy p {
  color: var(--ink-soft);
  max-width: none;
  margin-bottom: 0;
}

@media (max-width: 640px) {
  body.community-guide-page.candidate-tools-page .how-page-anchors {
    justify-content: flex-start;
  }
}
