﻿/**
 * Page layouts library (category cards) + 2/3-col demos + landing shell.
 */

.kc-categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.kc-categories-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.kc-categories-grid > .kc-category-panel {
  grid-column: 1 / -1;
  width: 100%;
}

/*
 * Layout cards are groups, not anchors: a core/group saves only its own tag, so
 * an <a> wrapping the card's children makes the block invalid in the editor.
 * The card is the positioned container and the anchor — which lives in the
 * title paragraph so its label and URL stay editable — is stretched back over
 * it with `::after { inset: 0 }`. Hit area, hover region and pointer cursor are
 * the ones the full-card anchor had.
 */
.kc-category-link {
  position: relative;
}

.kc-category-link__anchor,
.kc-category-link__anchor:link,
.kc-category-link__anchor:visited,
.kc-category-link__anchor:hover,
.kc-category-link__anchor:focus,
.kc-category-link__anchor:active {
  color: inherit;
  text-decoration: none;
}

.kc-category-link__anchor::after {
  content: '';
  position: absolute;
  inset: 0;
}

.kc-category-link,
.kc-category-link:visited {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16.667px;
  border: 0.667px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s, border-color 0.2s, background-color 0.2s;
}

.kc-category-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--fusion-blue-deep) 10%, transparent);
  border-color: color-mix(in srgb, var(--fusion-blue-deep) 25%, transparent);
  background-color: #f8fafd;
  text-decoration: none;
}

.kc-category-link svg {
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.kc-category-link:hover svg {
  transform: translateX(3px);
  stroke: var(--fusion-blue-deep);
}

.kc-category-link__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.kc-category-link__text {
  margin: 0;
  font-family: var(--global__font-family, 'Open Sans', 'Inter', system-ui, sans-serif);
  font-size: 16px;
  font-weight: 400;
  color: #101828;
  min-width: 0;
}

.kc-category-link__count {
  margin: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 4px 8px;
  border-radius: 8px;
  font-family: var(--global__font-family, 'Open Sans', 'Inter', system-ui, sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.kc-category-link:hover .kc-category-link__count {
  background: #eceff3;
  border-color: #d1d5db;
}

.kc-section--categories .kc-categories-grid {
  margin-top: 0;
}

/* Categories row + inline expanding panel (one stacked block; panel sits directly under cards) */
.kc-category-inline-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

/* Category card as button (inline-expand categories) */
button.kc-category-link {
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.kc-category-link--active,
button.kc-category-link.kc-category-link--active {
  border-color: color-mix(in srgb, var(--fusion-blue-deep) 55%, #93b4e8);
  background-color: #f8fafd;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--fusion-blue-deep) 14%, transparent);
}

.kc-category-link--active .kc-category-link__text,
button.kc-category-link.kc-category-link--active .kc-category-link__text {
  color: var(--fusion-blue-deep);
  font-weight: 500;
}

.kc-category-link--active .kc-category-link__count,
button.kc-category-link.kc-category-link--active .kc-category-link__count {
  border-color: #d1d5db;
  background: #eef2f7;
  color: #374151;
}

/* Inline documentation category panel (full-width under card row; pushes page content down) */
.kc-category-panel {
  margin-top: 0;
  padding: clamp(1.25rem, 2.2vw, 1.625rem) clamp(1.25rem, 2vw, 1.75rem);
  border: 1px solid color-mix(in srgb, var(--fusion-blue-deep) 45%, #b8cce8);
  border-radius: 12px;
  background: #ffffff;
  scroll-margin-top: 5.5rem;
  box-shadow: 0 2px 14px color-mix(in srgb, var(--fusion-blue-deep) 8%, transparent);
}

.kc-category-panel__heading {
  margin: 0;
  font-family: var(--global__font-family, 'Open Sans', 'Inter', system-ui, sans-serif);
  font-size: clamp(1.125rem, 0.45vw + 0.95rem, 1.375rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--fusion-blue-deep);
}

.kc-category-panel__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(1rem, 2.5vw, 1.75rem);
  row-gap: 4px;
  margin: clamp(0.875rem, 1.8vw, 1.125rem) 0 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 1023px) {
  .kc-category-panel__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kc-category-panel__grid {
    grid-template-columns: 1fr;
  }
}

.kc-category-panel__grid > li {
  margin: 0;
  padding: 0;
}

.kc-category-panel__topic,
.kc-category-panel__topic:visited {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  padding: 10px 6px 10px 2px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  color: var(--fusion-blue-deep);
  background: transparent;
  font-family: var(--global__font-family, 'Open Sans', 'Inter', system-ui, sans-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.kc-category-panel__topic:hover {
  background: color-mix(in srgb, var(--fusion-blue-deep) 5%, #ffffff);
  text-decoration: none;
  color: var(--fusion-blue);
}

.kc-category-panel__topic-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.kc-category-panel__topic-label::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.45em;
  border-radius: 50%;
  background: var(--fusion-blue);
}

.kc-category-panel__placeholder {
  margin: clamp(0.75rem, 1.5vw, 1rem) 0 0;
  font-family: var(--global__font-family, 'Open Sans', 'Inter', system-ui, sans-serif);
  font-size: 16px;
  line-height: 1.5;
  color: #4b5563;
}

/* Page layouts library + simple 2/3-col demos */
.ccg-page-layouts-page.ccg-main,
.ccg-page-layouts-page {
  max-width: none;
  padding: 0;
  overflow-x: clip;
}

.ccg-page-layouts-page .wp-block-post-title {
  display: none;
}

.ccg-layout-demo__grid {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0 2.5rem;
}

.ccg-layout-demo__grid--2 {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.ccg-layout-demo__grid--3 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
}

@media (max-width: 900px) {
  .ccg-layout-demo__grid--2,
  .ccg-layout-demo__grid--3 {
    grid-template-columns: 1fr;
  }
}

.ccg-layout-demo__main,
.ccg-layout-demo__side {
  padding: 1.25rem 1.5rem;
  border: 1px solid color-mix(in srgb, var(--color-gray-lighter) 85%, var(--color-primary-lightest));
  border-radius: 0.75rem;
  background: var(--color-white);
}

.ccg-layout-demo__main h2,
.ccg-layout-demo__side h2 {
  margin-top: 0;
  font-size: 1.125rem;
  color: var(--color-primary-darkest);
}

/* ── Landing template shell (mirror Fusion Toolkit full-bleed) ── */
body:has(.ccg-landing-page),
body:has(.lpl-page),
.wp-site-blocks:has(.ccg-landing-page),
.wp-site-blocks:has(.lpl-page) {
  overflow-x: clip;
}

#main-content.ccg-landing-page,
#main-content.lpl-page,
.ccg-landing-page.ccg-main,
.ccg-main.ccg-landing-page,
.ccg-landing-page,
.lpl-page,
.ccg-main:has(.lpl-page),
.ccg-main:has(.ccg-landing-sections) {
  max-width: none !important;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding: 0 !important;
  overflow-x: clip;
}

.ccg-landing-page .wp-block-post-title,
.ccg-main:has(.lpl-page) > .wp-block-post-title {
  display: none;
}

.ccg-landing-page .wp-block-post-content,
.ccg-landing-page .wp-block-post-content.is-layout-constrained,
.ccg-landing-page .wp-block-post-content.is-layout-flow,
.ccg-main:has(.lpl-page) .wp-block-post-content,
.ccg-main:has(.lpl-page) .wp-block-post-content.is-layout-constrained,
.lpl-page .wp-block-post-content {
  max-width: none !important;
  width: 100%;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0;
}

.ccg-landing-page .wp-block-html,
.lpl-page .wp-block-html {
  margin-block: 0;
  max-width: none;
  width: 100%;
}

/* Full-width hero + CTA band (site standard — edge-to-edge backgrounds) */
.ccg-landing-page .ft-breadcrumb-bar,
.lpl-page .ft-breadcrumb-bar,
.ccg-landing-page .ft-hero,
.lpl-page .ft-hero,
.ccg-landing-sections.ft-hero,
.ccg-landing-page .lpl-section,
.lpl-page .lpl-section,
.ccg-landing-page .lpl-section--cta-band,
.lpl-page .lpl-section--cta-band {
  position: relative;
  width: 100%;
  max-width: none !important;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

.ccg-landing-page .ft-hero.alignfull,
.lpl-page .ft-hero.alignfull,
.ccg-landing-page .wp-block-group.ft-hero,
.ccg-landing-page .wp-block-group.alignfull {
  max-width: none !important;
  width: 100%;
}

/* Landing breadcrumb full-bleed sizing — the light surface + text colors are the
   `fusion-breadcrumb-light` block style (block-styles.css). */
.ccg-landing-page .ft-breadcrumb-bar,
.lpl-page .ft-breadcrumb-bar {
  width: 100%;
  max-width: none;
  margin: 0;
}

.ccg-landing-page .ft-breadcrumb-bar .kc-breadcrumb-inner,
.lpl-page .ft-breadcrumb-bar .kc-breadcrumb-inner {
  max-width: var(--fusion-site-max-width, 100rem);
  margin: 0 auto;
  padding: 0.75rem var(--fusion-site-padding-x) 0.875rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .ccg-landing-page .ft-breadcrumb-bar .kc-breadcrumb-inner,
  .lpl-page .ft-breadcrumb-bar .kc-breadcrumb-inner {
    padding-left: var(--fusion-site-padding-x-md);
    padding-right: var(--fusion-site-padding-x-md);
  }
}

.ccg-landing-page .wp-block-html:has(.ft-breadcrumb-bar),
.lpl-page .wp-block-html:has(.ft-breadcrumb-bar) {
  margin-block: 0 !important;
}

.ccg-landing-page .wp-block-html:has(.ft-breadcrumb-bar) + .wp-block-group.ft-hero,
.lpl-page .wp-block-html:has(.ft-breadcrumb-bar) + .wp-block-group.ft-hero {
  margin-block-start: 0 !important;
}

.ccg-landing-page .ft-hero,
.lpl-page .ft-hero {
  margin-top: 0;
}

.ccg-landing-page .ft-hero--with-section-nav + .wp-block-html:has(.interior-section-nav-root),
.lpl-page .ft-hero--with-section-nav + .wp-block-html:has(.interior-section-nav-root) {
  margin-block-start: calc(var(--interior-section-nav-block-height, 3.75rem) * -0.55) !important;
}

/* CTA band: full-bleed blue, content centered in container */
.ccg-landing-page .lpl-section--cta-band,
.lpl-page .lpl-section--cta-band {
  padding-left: 0;
  padding-right: 0;
}

.ccg-landing-page .lpl-section--cta-band .lpl-cta-band,
.lpl-page .lpl-section--cta-band .lpl-cta-band {
  max-width: var(--fusion-site-max-width);
  margin-inline: auto;
  padding-inline: var(--fusion-site-padding-x);
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .ccg-landing-page .lpl-section--cta-band .lpl-cta-band,
  .lpl-page .lpl-section--cta-band .lpl-cta-band {
    padding-inline: var(--fusion-site-padding-x-md);
  }
}
