/* ==========================================================================
   Coffee Home Brewing — base layer
   Global element styling. The Arq Live Edit shims from the stock child theme
   are preserved verbatim at the bottom; removing them breaks the editor.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--ch-header-h) + 24px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--ch-paper);
  color: var(--ch-ink);
  font-family: var(--ch-body);
  font-size: var(--ch-fs-body);
  font-synthesis-weight: none;
  line-height: var(--ch-lh-body);
  min-height: 100vh;
  text-rendering: optimizelegibility;
  -webkit-font-smoothing: antialiased;
}

.wp-site-blocks {
  min-height: 100vh;
}

img,
svg,
video {
  display: block;
  height: auto;
  max-width: 100%;
}

img {
  background: var(--ch-paper-2);
}

a {
  color: var(--ch-ink);
  text-decoration-color: var(--ch-rule-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--ch-cherry);
}

:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--ch-cherry);
  outline-offset: 3px;
}

/* --- Headings: grotesque display against a serif body -------------------- */
h1,
h2,
h3,
h4,
h5,
h6,
.wp-block-post-title,
.wp-block-query-title,
.wp-block-heading {
  color: var(--ch-ink);
  font-family: var(--ch-display);
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.08;
  text-wrap: balance;
}

h1,
.wp-block-post-title,
.wp-block-query-title {
  font-size: clamp(2.35rem, 1.5rem + 3.4vw, 4rem);
  margin: 0 0 var(--ch-s4);
}

h2 {
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem);
}

h3 {
  font-size: clamp(1.28rem, 1.1rem + 0.6vw, 1.55rem);
  letter-spacing: -0.014em;
}

h4 {
  font-size: 1.08rem;
  letter-spacing: -0.008em;
}

p {
  margin: 0 0 var(--ch-s5);
}

p:last-child {
  margin-bottom: 0;
}

/* --- Numbers, specs and labels all live in the mono register ------------- */
.ch-data,
.wp-block-post-date,
time {
  font-family: var(--ch-mono);
  font-variant-numeric: tabular-nums;
}

/* --- Forms --------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="number"],
select,
textarea,
.wp-block-search__input {
  background: var(--ch-surface);
  border: 1px solid var(--ch-rule);
  border-radius: var(--ch-r-sm);
  color: var(--ch-ink);
  font-family: var(--ch-mono);
  font-size: 0.9rem;
  padding: 0.78rem 0.85rem;
  width: 100%;
}

textarea {
  font-family: var(--ch-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 9rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ch-ink);
}

/* --- Buttons: cherry fill is reserved for outbound / affiliate actions ---- */
.wp-block-button__link,
.wp-element-button,
button.wp-block-search__button,
input[type="submit"] {
  background: var(--ch-ink);
  border: 1px solid transparent;
  border-radius: var(--ch-r-sm);
  color: #fff;
  cursor: pointer;
  font-family: var(--ch-display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.008em;
  line-height: 1;
  padding: 0.9rem 1.4rem;
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.wp-block-button__link:hover,
.wp-element-button:hover,
input[type="submit"]:hover {
  background: #000;
  color: #fff;
}

.wp-block-button__link:active,
.wp-element-button:active {
  transform: translateY(1px);
}

.wp-block-button.is-style-outline .wp-block-button__link,
.ch-btn-ghost .wp-block-button__link {
  background: transparent;
  border-color: var(--ch-rule-2);
  color: var(--ch-ink);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.ch-btn-ghost .wp-block-button__link:hover {
  background: var(--ch-surface);
  border-color: var(--ch-ink);
  color: var(--ch-ink);
}

/* The one place cherry is allowed to fill. */
.ch-btn-buy .wp-block-button__link {
  background: var(--ch-cherry);
  box-shadow: 0 1px 0 var(--ch-cherry-dk);
  color: #fff;
}

.ch-btn-buy .wp-block-button__link:hover {
  background: var(--ch-cherry-dk);
}

/* --- Accessibility helpers ---------------------------------------------- */
.skip-link {
  background: var(--ch-ink);
  color: #fff;
  font-family: var(--ch-mono);
  font-size: 0.8rem;
  left: -9999px;
  padding: 0.75rem 1.25rem;
  position: absolute;
  top: 0;
  z-index: 999;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

.ch-sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.arq-shell {
  padding-left: var(--ch-s5);
  padding-right: var(--ch-s5);
}

.arq-muted {
  color: var(--ch-muted);
}

/* --- Print --------------------------------------------------------------- */
@media print {
  .ch-topbar,
  .arq-site-header,
  .arq-site-footer,
  .ch-sidebar,
  .ch-progress,
  .ch-toc {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .ch-post-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Arq Live Edit compatibility — preserved from the stock child theme.
   ========================================================================== */
:root {
  --arq-admin-bar-height: 0px;
  --arq-live-edit-focus-ring: var(--ch-verde);
  --arq-live-edit-toolbar-space: 0px;
}

body.arq-live-edit-compatible {
  --arq-live-edit-toolbar-space: 0px;
}

body.admin-bar {
  --arq-admin-bar-height: var(--wp-admin--admin-bar--height, 32px);
}

@media screen and (max-width: 782px) {
  body.admin-bar {
    --arq-admin-bar-height: var(--wp-admin--admin-bar--height, 46px);
  }
}

body.arq-le-active {
  --arq-live-edit-toolbar-space: 5.5rem;

  overflow-x: clip;
}

body.arq-le-active .wp-site-blocks {
  isolation: isolate;
}

body.arq-le-active [data-arq-edit] {
  scroll-margin-top: calc(var(--arq-admin-bar-height, 0px) + 2rem);
}
