/* CCS_SHARED_MARKER
   Chamathka Cab Service — shared primitives.
   Snippet: "CCS Shared Styles" | group: Shared Styles | type: css | run_at: wp_head
   Ported from the design's base.css + components.css. Every value is a theme token. */

/* --- 1. Box-sizing reset, scoped to the ccs- prefix --------------------- */
[class*="ccs-"],
[class*="ccs-"]::before,
[class*="ccs-"]::after,
[class*="ccs-"] * {
  box-sizing: border-box;
}

/* --- 2. Focus rings ----------------------------------------------------- */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
  border-radius: var(--wp--custom--radius-xs);
}

/* --- 3. Document-level behaviour the design assumes --------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--wp--custom--header-height) + var(--wp--preset--spacing--50));
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  :root {
    --wp--custom--duration-fast: 1ms;
    --wp--custom--duration-base: 1ms;
    --wp--custom--duration-slow: 1ms;
    --wp--custom--duration-reveal: 1ms;
  }
}

/* --- 4. blockGap stripes between top-level frame blocks ------------------
   Core's blockGap margins use :where() (zero specificity), so a plain class
   wins without a prefix war. The design stacks header/main/footer flush. */
.wp-site-blocks > * {
  margin-block-start: 0;
}

.entry-content > [class*="ccs-"],
.wp-block-post-content > [class*="ccs-"] {
  margin-block-start: 0;
}

/* --- 5. Icons ----------------------------------------------------------- */
.ccs-icon {
  display: block;
  width: var(--wp--custom--icon-size-md);
  height: var(--wp--custom--icon-size-md);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--wp--custom--icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ccs-icon.ccs-icon--sm {
  width: var(--wp--custom--icon-size-sm);
  height: var(--wp--custom--icon-size-sm);
}

.ccs-icon.ccs-icon--lg {
  width: var(--wp--custom--icon-size-lg);
  height: var(--wp--custom--icon-size-lg);
}

.ccs-icon.ccs-icon--solid {
  fill: currentColor;
  stroke: none;
}

/* Square plate behind an icon, used by the reason, step and job cards. */
.ccs-icon-plate {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: var(--wp--custom--radius-md);
  background-color: var(--wp--preset--color--accent-soft);
  color: var(--wp--preset--color--accent);
}

.ccs-icon-plate.ccs-icon-plate--dark {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--wp--preset--color--accent-ink-inverse);
  border: var(--wp--custom--border-hairline) solid var(--wp--custom--border-inverse);
}

/* --- 6. Buttons ---------------------------------------------------------
   Doubled class on colour rules so they beat theme.json's
   `:root :where(a:not(.wp-element-button))` link colour (equal specificity,
   prints later). */
.ccs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wp--preset--spacing--20);
  min-height: var(--wp--custom--button-height);
  padding-inline: var(--wp--preset--spacing--50);
  border: 1px solid transparent;
  border-radius: var(--wp--custom--radius-md);
  font-size: var(--wp--preset--font-size--base);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--wp--custom--duration-fast) var(--wp--custom--ease-out),
    border-color var(--wp--custom--duration-fast) var(--wp--custom--ease-out),
    color var(--wp--custom--duration-fast) var(--wp--custom--ease-out),
    transform var(--wp--custom--duration-fast) var(--wp--custom--ease-out);
}

.ccs-button:hover,
.ccs-button:focus-visible {
  text-decoration: none;
}

.ccs-button:active {
  transform: translateY(1px);
}

.ccs-button.ccs-button--primary {
  background-color: var(--wp--preset--color--accent-fill);
  border-color: var(--wp--preset--color--accent-fill);
  color: var(--wp--preset--color--base);
  box-shadow: var(--wp--custom--shadow-accent);
}

.ccs-button.ccs-button--primary:hover,
.ccs-button.ccs-button--primary:focus-visible {
  background-color: var(--wp--preset--color--accent-ink);
  border-color: var(--wp--preset--color--accent-ink);
  color: var(--wp--preset--color--base);
}

.ccs-button.ccs-button--ghost {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.34);
  color: var(--wp--preset--color--base);
}

.ccs-button.ccs-button--ghost:hover,
.ccs-button.ccs-button--ghost:focus-visible {
  background-color: var(--wp--preset--color--base);
  border-color: var(--wp--preset--color--base);
  color: var(--wp--preset--color--black);
}

.ccs-button.ccs-button--dark {
  background-color: var(--wp--preset--color--black);
  border-color: var(--wp--preset--color--black);
  color: var(--wp--preset--color--base);
}

.ccs-button.ccs-button--dark:hover,
.ccs-button.ccs-button--dark:focus-visible {
  background-color: var(--wp--preset--color--ink-soft);
  border-color: var(--wp--preset--color--ink-soft);
  color: var(--wp--preset--color--base);
}

.ccs-button.ccs-button--outline {
  background-color: transparent;
  border-color: var(--wp--preset--color--line-strong);
  color: var(--wp--preset--color--contrast);
}

.ccs-button.ccs-button--outline:hover,
.ccs-button.ccs-button--outline:focus-visible {
  border-color: var(--wp--preset--color--accent-fill);
  color: var(--wp--preset--color--accent-ink);
}

.ccs-button.ccs-button--sm {
  min-height: var(--wp--custom--button-height-sm);
  padding-inline: var(--wp--preset--spacing--40);
  font-size: var(--wp--preset--font-size--sm);
}

.ccs-button.ccs-button--block {
  width: 100%;
}

/* --- 7. Shared section primitives --------------------------------------- */
.ccs-container {
  width: 100%;
  max-width: calc(var(--wp--custom--container-max) + var(--wp--custom--container-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--wp--custom--container-gutter);
}

.ccs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--wp--preset--spacing--20);
  margin: 0 0 var(--wp--preset--spacing--40);
  color: var(--wp--preset--color--accent-ink);
  font-size: var(--wp--preset--font-size--xs);
  font-weight: 700;
  letter-spacing: var(--wp--custom--tracking-wider);
  line-height: 1;
  text-transform: uppercase;
}

.ccs-eyebrow::before {
  content: "";
  flex: none;
  width: var(--wp--custom--rule-accent-width);
  height: var(--wp--custom--border-thick);
  background-color: currentColor;
}

.ccs-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
