/**
 * PressConf design system - typography, spacing rhythm, and component defaults.
 * Override per block with editor styles or utility classes when needed.
 */

html:root {
  /* Spacing rhythm — equal top/bottom air on every page section band */
  --pc-space-section-y: clamp(3.75rem, 7vw, 5.5rem);
  --pc-space-section-x: var(--pc-site-gutter, clamp(1rem, 1.15rem + 0.8vw, 2rem));
  --pc-space-stack: var(--wp--preset--spacing--50);
  --pc-space-cta-before: var(--wp--preset--spacing--50);
  --pc-space-cta-after: var(--wp--preset--spacing--70);
  --pc-space-inline: var(--pc-space-section-x);

  /* One button size sitewide (fill + outline share padding) */
  --pc-btn-pad-y: 0.875rem;
  --pc-btn-pad-x: 1.5rem;
  --pc-btn-font-size: 1rem;
  --pc-btn-font-weight: 500;
  --pc-btn-line-height: 1.25;
  --pc-btn-min-height: 2.75rem;
  --pc-btn-radius: 4px;

  /* Typography - single brand font (Def Sans VF) */
  --pc-font-body: var(--pc-brand-font-body);
  --pc-font-display: var(--pc-brand-font-body);
}

/* Body / controls stay sentence case; headings are uppercase (brand rule). */
body.pressconf-brand-fonts :where(
  h1, h2, h3, h4, h5, h6,
  .wp-block-heading
) {
  font-family: var(--pc-font-body) !important;
}

body.pressconf-brand-fonts :where(
  p,
  .wp-block-paragraph,
  input,
  textarea,
  select
) {
  font-family: var(--pc-font-body) !important;
  letter-spacing: normal;
  text-transform: none !important;
}

/* Headlines: uppercase Def Sans, weight 400 - sitewide */
body.pressconf-brand-fonts :is(h1, h2, h3, .wp-block-heading):not(.is-testimonial-name) {
  font-weight: 400 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

body.pressconf-brand-fonts :is(h1, h2, h3, .wp-block-heading) :is(code, .wp-block-code) {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* Header menu keeps uppercase + pixel first letter (styled in brand-tokens + header block) */
body.pressconf-brand-fonts .pc-header-nav :where(.wp-block-navigation, .wp-block-navigation *) {
  text-transform: uppercase;
}

/* Optional uppercase utility when a block needs it */
.pc-text-upper {
  text-transform: uppercase !important;
}

/*
 * Section title / subtitle pairs — uppercase labels (Who, Goals, similar blocks).
 * Apply in the editor via block styles or utility classes.
 * Specificity must beat body.pressconf-brand-fonts :where(...) text-transform reset.
 */
body.pressconf-brand-fonts :is(h1, h2, h3, h4, h5, h6, .wp-block-heading).pc-section-title,
body.pressconf-brand-fonts .pc-section-title {
  font-weight: 400 !important;
  letter-spacing: 0.04em !important;
  line-height: 1.1 !important;
  text-transform: uppercase !important;
}

body.pressconf-brand-fonts :is(h1, h2, h3, h4, h5, h6, .wp-block-heading).pc-section-title:not([class*='font-size']):not([style*='font-size']),
body.pressconf-brand-fonts .pc-section-title:not([class*='font-size']):not([style*='font-size']) {
  font-size: clamp(1.58rem, 1.58rem + ((1vw - 0.2rem) * 1.168), 2.66rem) !important;
}

body.pressconf-brand-fonts :is(p, .wp-block-paragraph).pc-section-subtitle,
body.pressconf-brand-fonts .pc-section-subtitle {
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.25rem) !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em !important;
  line-height: 1.35 !important;
  text-transform: uppercase !important;
}

body.pressconf-brand-fonts .pc-section-subtitle :where(strong, mark, em) {
  font-weight: inherit !important;
  text-transform: inherit !important;
}

body.pressconf-brand-fonts :is(p, .wp-block-paragraph).pc-listing-title,
body.pressconf-brand-fonts .pc-listing-title {
  font-size: var(--wp--preset--font-size--normal, 1rem) !important;
  font-weight: 400 !important;
  letter-spacing: 0.03em !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  text-transform: uppercase !important;
}

/* Feature / expect cards — title + tagline uppercase pair */
body.pressconf-brand-fonts :is(h3, h4, .wp-block-heading).pc-card-title,
body.pressconf-brand-fonts .pc-card-title {
  font-size: var(--wp--preset--font-size--medium, 1.125rem) !important;
  font-weight: 500 !important;
  letter-spacing: 0.03em !important;
  line-height: 1.3 !important;
  text-transform: uppercase !important;
}

body.pressconf-brand-fonts :is(h3, h4, .wp-block-heading).pc-card-title :where(em, strong) {
  font-style: normal !important;
  font-weight: inherit !important;
  text-transform: inherit !important;
}

body.pressconf-brand-fonts :is(p, .wp-block-paragraph).pc-card-tagline,
body.pressconf-brand-fonts .pc-card-tagline {
  font-size: var(--wp--preset--font-size--normal, 1rem) !important;
  font-weight: 400 !important;
  letter-spacing: 0.03em !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  text-transform: uppercase !important;
}

/* Listing card row (icon badge + label) */
.pc-listing.pc-shadow-xs.pc-rounded {
  align-items: center;
}

.pc-listings {
  width: 100%;
}

/* Body copy - legacy font mode */
body:not(.pressconf-brand-fonts) {
  font-family: var(--pc-font-body);
}

body:not(.pressconf-brand-fonts) :where(h1, h2, h3, h4, h5, h6, .wp-block-heading) {
  font-family: var(--pc-font-display);
}

/* Buttons — one shared size/padding sitewide (beats pc-btn-sm/lg/xl utilities). */
body.pressconf-brand-fonts .wp-block-button > :is(.wp-block-button__link, .wp-element-button),
body.pressconf-brand-fonts .wp-block-button[class*="pc-btn"] > :is(.wp-block-button__link, .wp-element-button),
body.pressconf-brand-fonts .wp-block-button.pc-btn-sm > :is(.wp-block-button__link, .wp-element-button),
body.pressconf-brand-fonts .wp-block-button.pc-btn-lg > :is(.wp-block-button__link, .wp-element-button),
body.pressconf-brand-fonts .wp-block-button.pc-btn-xl > :is(.wp-block-button__link, .wp-element-button),
body.pressconf-brand-fonts .wp-block-button.pc-btn-wide > :is(.wp-block-button__link, .wp-element-button),
body.pressconf-brand-fonts .pc-header-tickets .wp-block-button__link {
  box-sizing: border-box;
  border-radius: var(--pc-btn-radius) !important;
  font-family: var(--pc-font-body) !important;
  font-size: var(--pc-btn-font-size) !important;
  font-weight: var(--pc-btn-font-weight) !important;
  letter-spacing: 0.04em !important;
  line-height: var(--pc-btn-line-height) !important;
  min-height: var(--pc-btn-min-height) !important;
  padding: var(--pc-btn-pad-y) var(--pc-btn-pad-x) !important;
  text-transform: uppercase !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.wp-block-button__link,
.wp-element-button {
  font-family: var(--pc-font-body);
  font-weight: var(--pc-btn-font-weight, 500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Default fill buttons - brand lavender */
.wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-background),
.wp-block-button:not(.is-style-outline) > .wp-element-button:not(.has-background),
.is-style-fill.wp-block-button > .wp-block-button__link:not(.has-background) {
  background-color: var(--pc-btn-bg);
  border-color: var(--pc-btn-bg);
  color: var(--pc-btn-text-on-fill);
}

.wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-background):hover,
.wp-block-button:not(.is-style-outline) > .wp-element-button:not(.has-background):hover,
.is-style-fill.wp-block-button > .wp-block-button__link:not(.has-background):hover {
  background-color: var(--pc-btn-bg-hover);
  border-color: var(--pc-btn-bg-hover);
  color: var(--pc-btn-text-on-fill);
}

.wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-background):active,
.wp-block-button:not(.is-style-outline) > .wp-element-button:not(.has-background):active,
.is-style-fill.wp-block-button > .wp-block-button__link:not(.has-background):active {
  background-color: var(--pc-btn-bg-active);
  border-color: var(--pc-btn-bg-active);
  color: var(--pc-btn-text-on-fill);
}

.wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-background):focus-visible,
.wp-block-button:not(.is-style-outline) > .wp-element-button:not(.has-background):focus-visible,
.is-style-fill.wp-block-button > .wp-block-button__link:not(.has-background):focus-visible {
  outline: 2px solid var(--pc-btn-bg-hover);
  outline-offset: 2px;
}

/* Outline buttons */
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
  background-color: transparent;
  border-color: var(--pc-btn-border);
  color: var(--pc-btn-border);
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):focus-visible {
  background-color: transparent;
  border-color: var(--pc-btn-border);
  color: var(--pc-btn-border);
  opacity: 0.82;
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):active {
  background-color: transparent;
  border-color: var(--pc-btn-border);
  color: var(--pc-btn-border);
  opacity: 0.7;
}

/* Section vertical rhythm */
.pc-section > :where(.wp-block-heading, h1, h2, h3, h4, h5, h6) + :where(.wp-block-paragraph, p) {
  margin-top: var(--pc-space-stack);
}

.pc-section > :where(.wp-block-paragraph, p) + :where(.wp-block-columns, .wp-block-group, .wp-block-gallery) {
  margin-top: var(--pc-space-stack);
}

/* Section footer CTAs - consistent gap above + centered in the shell */
.pc-section :is(> .wp-block-buttons, .wp-block-group > .wp-block-buttons).pc-section-cta,
.pc-section > .wp-block-buttons:last-child:not(:first-child),
.pc-feature-cards .wp-block-buttons.pc-section-cta,
.pc-site-shell > .wp-block-buttons.pc-section-cta,
.pc-site-shell .wp-block-buttons.pc-section-cta {
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  margin-top: var(--pc-space-cta-before) !important;
  margin-bottom: 0 !important;
  width: 100%;
}

/* Keep equal --pc-space-section-y; CTA air comes from margin-top above. */

/* Drop redundant fixed spacers immediately before a section CTA */
.pc-section > .wp-block-spacer:has(+ .wp-block-buttons.pc-section-cta),
.pc-section > .wp-block-spacer:has(+ .wp-block-buttons:last-child:not(:first-child)),
.pc-section .wp-block-group > .wp-block-spacer:has(+ .wp-block-buttons.pc-section-cta) {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
}

/* Section CTAs use the same shared button tokens */
.pc-section-cta .wp-block-button__link,
.pc-section-cta.pc-btn-xl .wp-block-button__link,
.pc-section-cta .pc-btn-xl .wp-block-button__link {
  font-size: var(--pc-btn-font-size) !important;
  font-weight: var(--pc-btn-font-weight) !important;
  min-height: var(--pc-btn-min-height) !important;
  padding: var(--pc-btn-pad-y) var(--pc-btn-pad-x) !important;
}

/* Form fields */
.pc-section :where(input, textarea, select):not([type='checkbox']):not([type='radio']) {
  font-family: var(--pc-font-body);
}

/* Explicit word-per-line headings (FAQ title, etc.) */
.pc-heading-stacked {
  text-wrap: wrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

.pc-heading-stacked br {
  display: block;
  content: '';
}

/* Keep intentional phrases intact (e.g. "is Different", "PressConf"). */
.pc-heading-stacked .pc-nowrap {
  white-space: nowrap;
}

/* Don't let flex shrink crush this title into mid-word wraps. */
.wp-block-column:has(> .pc-heading-stacked) {
  flex-shrink: 0;
  min-width: min(100%, 14.5rem);
}
