/* FINAL 1.0.0. Shared control language and component rhythm.
 * This layer loads after the legacy TEC adaptation; no external assets/fonts.
 */
body.egov-calendar-negz-styling {
  --egov-control-radius: 999px;
  --egov-control-height: 2.75rem;
  --egov-control-px: 1.15rem;
  --egov-section-gap: clamp(1.25rem, 2.8vw, 2rem);
  --egov-card-radius: var(--egov-radius, 14px);
  --egov-focus: #123651;
  --egov-soft-border: #dce5df;
}

/* A true off state removes decorative movement, without touching transforms
 * used by the theme/TEC for menu positioning or functional interactions. */
body.egov-calendar-motion-off {
  --egov-motion-duration: 0ms;
  --egov-hover-lift-small: 0px;
  --egov-hover-lift: 0px;
  --egov-hover-scale: 1;
}

/* Every owned button shares the subscription control's pill shape. Secondary
 * actions retain their quiet surface; icon buttons remain compact. */
body.egov-calendar-negz-styling :where(.tribe-events, .tribe-events-single, #tribe-community-events, .egov-directory-shell, .egov-submitter-card)
  :is(button, .button, input[type="button"], input[type="submit"], .tribe-common-c-btn),
body.egov-calendar-negz-styling :is(.egov-button, .egov-subscribe-direct),
body.home.egov-calendar-negz-styling .wp-block-button__link,
body.egov-calendar-negz-styling :is(.egov-subscribe-top, .egov-subscribe-shortcode) summary {
  min-height: var(--egov-control-height);
  border-radius: var(--egov-control-radius) !important;
  font-family: var(--egov-sans);
  font-weight: 650;
  line-height: 1.25;
  touch-action: manipulation;
}
body.egov-calendar-negz-styling :is(.egov-button, .egov-subscribe-direct),
body.egov-calendar-negz-styling :is(.egov-subscribe-top, .egov-subscribe-shortcode) summary,
body.egov-calendar-negz-styling .tribe-events .tribe-events-c-search__button,
body.egov-calendar-negz-styling #tribe-community-events :is(input[type="submit"], button[type="submit"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem var(--egov-control-px);
  border: 2px solid var(--egov-action-bg) !important;
  background: var(--egov-action-bg) !important;
  color: var(--egov-action-text) !important;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 2px 3px rgb(18 54 81 / 7%);
}
body.egov-calendar-negz-styling :is(.egov-button, .egov-subscribe-direct):hover,
body.home.egov-calendar-negz-styling .wp-block-button__link:hover,
body.egov-calendar-negz-styling :is(.egov-subscribe-top, .egov-subscribe-shortcode) summary:hover,
body.egov-calendar-negz-styling .tribe-events .tribe-events-c-search__button:hover,
body.egov-calendar-negz-styling #tribe-community-events :is(input[type="submit"], button[type="submit"]):hover {
  border-color: var(--egov-action-hover) !important;
  background: var(--egov-action-hover) !important;
  color: var(--egov-action-text) !important;
}
body.egov-calendar-negz-styling .egov-button--secondary,
body.egov-calendar-negz-styling #tribe-community-events button.egov-community-disclosure {
  padding: .6rem var(--egov-control-px);
  border-radius: var(--egov-control-radius) !important;
  border: 1px solid var(--egov-soft-border) !important;
  background: #fff !important;
  color: var(--egov-ink) !important;
  box-shadow: none;
}
body.egov-calendar-negz-styling .egov-button--secondary:hover,
body.egov-calendar-negz-styling #tribe-community-events button.egov-community-disclosure:hover {
  border-color: var(--egov-ink) !important;
  background: var(--egov-surface-green) !important;
  color: var(--egov-ink) !important;
}
body.egov-calendar-negz-styling :where(.tribe-events, .tribe-events-single, #tribe-community-events, .egov-directory-shell, .egov-sponsors)
  :is(a, button, input, select, textarea, summary):focus-visible,
body.egov-calendar-negz-styling :is(.egov-button, .egov-subscribe-direct):focus-visible,
body.egov-calendar-negz-styling :is(.egov-subscribe-top, .egov-subscribe-shortcode) summary:focus-visible {
  outline: 3px solid var(--egov-focus) !important;
  outline-offset: 3px;
}
body.egov-calendar-negz-styling :where(.tribe-events, #tribe-community-events) :is(button, input[type="submit"]):disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* Calendar hierarchy: one calm partner surface, compact subscription action,
 * then the search/filter task. Results retain the strongest content contrast. */
body.egov-calendar-negz-styling .egov-sponsors {
  margin-bottom: 1rem;
  padding: .85rem 1.15rem;
  box-shadow: none;
}
body.egov-calendar-negz-styling .egov-sponsors .egov-sponsors__header h2 {
  font-size: .72rem;
  color: #52645b;
}
body.egov-calendar-negz-styling .egov-subscribe-top {
  margin-block: .5rem 1.15rem;
}
body.egov-calendar-negz-styling .tribe-events .tribe-events-c-events-bar {
  margin-bottom: var(--egov-section-gap);
  border: 1px solid var(--egov-soft-border);
  border-radius: var(--egov-card-radius);
  box-shadow: 0 4px 18px rgb(18 54 81 / 4%);
}
body.egov-calendar-negz-styling .tribe-filter-bar {
  padding: 1.1rem;
  border-color: var(--egov-soft-border);
}
body.egov-calendar-negz-styling .tribe-events .egov-card-formats {
  margin-block: .65rem .8rem;
  gap: .4rem;
}
body.egov-calendar-negz-styling .egov-ai-disclosure {
  align-items: flex-start;
  gap: .5rem;
  margin-block: .75rem 1.2rem;
  max-width: 70ch;
  color: #4e5f6b;
  font-size: .8rem;
  font-style: normal;
  line-height: 1.55;
}
body.egov-calendar-negz-styling .egov-ai-disclosure__icon {
  flex: 0 0 auto;
  margin-top: .05em;
  color: #2f6b50;
}
body.egov-calendar-negz-styling .egov-event-details {
  margin-block: var(--egov-section-gap);
  padding: clamp(1.15rem, 3vw, 1.8rem);
  border-color: var(--egov-soft-border);
  border-radius: var(--egov-card-radius);
  background: #f8faf8;
}
body.egov-calendar-negz-styling .egov-event-details > h2 {
  margin-bottom: 1.15rem;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}
body.egov-calendar-negz-styling .egov-event-taxonomies { gap: .85rem 1.5rem; }
body.egov-calendar-negz-styling .egov-badge { padding: .3rem .7rem; }
body.egov-calendar-negz-styling .egov-event-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .8rem;
  border: 1px solid #e7cdbb;
  border-radius: 999px;
  background: #fff1e8;
  color: #773c1c;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.4;
}
body.egov-calendar-negz-styling .egov-empty-guidance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-block: 1rem var(--egov-section-gap);
  padding: 1.1rem 1.25rem;
  border: 1px solid #cbdde5;
  border-radius: var(--egov-card-radius);
  background: #f2f7fa;
  color: var(--egov-ink);
  font-size: .95rem;
  line-height: 1.6;
}
body.egov-calendar-negz-styling .egov-empty-guidance a {
  display: inline-flex;
  align-items: center;
  min-height: var(--egov-control-height);
  padding: .55rem 1rem;
  border: 1px solid #b5cbd6;
  border-radius: 999px;
  background: #fff;
  color: var(--egov-ink);
  font-weight: 650;
}

/* Form: consistent spacing makes the required path readable without hiding
 * native fields when Core has failed to provide its replacement. */
body.egov-calendar-negz-styling #tribe-community-events .tribe-section {
  margin-bottom: var(--egov-section-gap);
  border-color: var(--egov-soft-border);
  border-radius: var(--egov-card-radius);
}
body.egov-calendar-negz-styling #tribe-community-events .tribe-section-header {
  padding: 1rem clamp(1.1rem, 3vw, 1.75rem);
  background: #f6f9f6;
  border-bottom: 1px solid var(--egov-soft-border);
}
body.egov-calendar-negz-styling #tribe-community-events .tribe-section-header h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}
body.egov-calendar-negz-styling #tribe-community-events .tribe-section-content {
  padding: clamp(1.1rem, 3vw, 1.75rem);
}
body.egov-calendar-negz-styling #tribe-community-events .egov-submitter-prefill {
  margin-block: .5rem 1.3rem;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid #cbdde5;
  background: #f2f7fa;
}
body.egov-calendar-negz-styling #tribe-community-events .egov-community-progress a {
  border-radius: 999px;
}
/* A hidden native checkbox needs its visible label's own strong focus ring. */
body.egov-calendar-negz-styling .tribe-filter-bar
  :is(.tribe-filter-bar-c-checkbox, .tribe-common-form-control-checkbox):has(input:focus-visible)
  .tribe-common-form-control-checkbox__label {
  outline: 3px solid var(--egov-focus);
  outline-offset: 3px;
}

@media (max-width: 767px) {
  body.egov-calendar-negz-styling { --egov-card-radius: min(var(--egov-radius, 14px), 12px); }
  body.egov-calendar-negz-styling .egov-sponsors { padding: .75rem; }
  body.egov-calendar-negz-styling .egov-subscribe-top { justify-content: flex-start; }
  body.egov-calendar-negz-styling .egov-subscribe-top__panel { left: 0; right: auto; }
  body.egov-calendar-negz-styling #tribe-community-events .egov-community-progress ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.egov-calendar-negz-styling #tribe-community-events .egov-community-progress { overflow: visible; }
  body.egov-calendar-negz-styling #tribe-community-events .egov-community-progress a { font-size: .82rem; }
}
@media (max-width: 380px) {
  body.egov-calendar-negz-styling #tribe-community-events .egov-community-progress ol { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  body.egov-calendar-negz-styling {
    --egov-motion-duration: 0ms;
    --egov-hover-lift-small: 0px;
    --egov-hover-lift: 0px;
    --egov-hover-scale: 1;
  }
}
