/*
Theme Name: West by Midwest
Theme URI: https://westbymidwest.com
Author: West by Midwest Business Services
Author URI: https://westbymidwest.com
Description: A plain, fast, dark theme for West by Midwest Business Services. Operations consulting for small businesses. Page copy is baked into templates; colors, contact details, and CTA links are editable in Appearance > Customize > West by Midwest.
Version: 1.2.2
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: westbymidwest
Tags: business, consulting, one-column, dark-mode-support, custom-colors, custom-logo, custom-menu, translation-ready, accessibility-ready
*/

/* ==========================================================================
   1. Tokens — dark
   Brand: ink #1c1b1a · cranberry #9b1b30 · warm gray #6b665e

   TWO CRANBERRIES, ON PURPOSE.
   --accent        #9b1b30  true brand cranberry. Button FILLS only, white text
                            on top. Do not use it for text on the dark ground:
                            it measures about 1.5:1 against ink and is unreadable.
   --accent-bright #d95a72  lightened cranberry for links, rules, and small
                            marks on dark. Measures about 4.7:1 against ink,
                            which clears WCAG AA for normal text.
   ========================================================================== */

:root {
  --ink: #1c1b1a;           /* page ground */
  --surface: #262422;       /* cards, tinted bands */
  --surface-2: #2f2c2a;     /* inputs, hovers */
  --rule: #3a3734;

  --text: #f2efeb;          /* warm off-white, not pure white */
  --text-muted: #a9a39a;

  --accent: #9b1b30;        /* fills only */
  --accent-bright: #d95a72; /* text, links, marks */
  --accent-hover: #e8798d;

  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --narrow: 760px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section-y: clamp(3.5rem, 8vw, 6.5rem);
  --radius: 3px;
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--ink);
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.1875rem;
  line-height: 1.68;          /* slightly looser than the light build; light text on dark needs the air */
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-bright); }

:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 5.6vw, 3.65rem); }
h2 { font-size: clamp(1.7rem, 3.7vw, 2.55rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.45rem); letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; letter-spacing: 0; }

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

strong { font-weight: 600; color: var(--text); }

hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

::selection { background: var(--accent); color: #fff; }

/* ==========================================================================
   3. Layout
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: var(--narrow); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

/* Tinted band: one step up from the page ground */
.section--tint { background: var(--surface); }

/* Emphasis band: inverted to paper, used sparingly for CTAs */
.section--band { background: var(--text); color: var(--ink); }
.section--band h1, .section--band h2, .section--band h3 { color: var(--ink); }
.section--band p { color: rgba(28, 27, 26, 0.78); }
.section--band a { color: var(--ink); }
.section--band .lede { color: rgba(28, 27, 26, 0.8); }

.center { text-align: center; }
.center .hero__actions, .center .actions { justify-content: center; }

.lede {
  font-size: clamp(1.2rem, 2.1vw, 1.4rem);
  line-height: 1.5;
  color: var(--text-muted);
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-bright);
  margin-bottom: 1rem;
}
.section--band .eyebrow { color: var(--accent); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--text); color: var(--ink);
  padding: 0.75rem 1.25rem; z-index: 999;
}
.skip-link:focus { left: 0; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ==========================================================================
   4. Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* True brand cranberry, white text: about 6:1. Safe. */
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: #b3213a; border-color: #b3213a; color: #fff; }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--rule); }
.btn--ghost:hover { background: var(--text); color: var(--ink); border-color: var(--text); }

/* For use inside .section--band, which is light */
.btn--light { background: var(--ink); color: var(--text); border-color: var(--ink); }
.btn--light:hover { background: transparent; color: var(--ink); border-color: var(--ink); }

.btn--sm { padding: 0.55rem 1.05rem; font-size: 0.92rem; }

.actions, .hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }

.arrow-link {
  display: inline-block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent-bright);
  text-decoration: none;
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 1px;
}
.arrow-link:hover { color: var(--accent-hover); }
.section--band .arrow-link { color: var(--accent); }

/* ==========================================================================
   5. Header & navigation
   ========================================================================== */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: rgba(28, 27, 26, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 84px;
  padding-block: 0.9rem;
}

/*
 * LOGO SIZING — the one place !important earns its keep.
 *
 * Two things can blow the header lockup up to its natural size:
 *
 * 1. WordPress prints an uploaded custom logo inside its own
 *    <a class="custom-logo-link">, which is a sibling of .site-logo rather
 *    than a child, so a rule scoped under .site-logo never matches it.
 *    Hence .custom-logo is targeted directly.
 *
 * 2. Image optimization, lazy-load, and page-builder plugins routinely
 *    inject `img { height: auto !important }` sitewide. Without !important
 *    here, that wins and the logo renders at full size.
 *
 * .site-header__inner img is the catch-all: any image in the header bar,
 * whatever markup wraps it, gets pinned.
 */
.site-logo,
.custom-logo-link { display: flex; align-items: center; text-decoration: none; }

.site-header__inner img,
.site-logo img,
.custom-logo {
  height: 42px !important;
  width: auto !important;
  max-width: none;
}

@media (max-width: 480px) {
  .site-header__inner img,
  .site-logo img,
  .custom-logo { height: 34px !important; }
}

.nav { display: flex; align-items: center; gap: 1.75rem; }

.nav__list {
  display: flex; align-items: center; gap: 1.6rem;
  list-style: none; margin: 0; padding: 0;
}

.nav__list a {
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-muted);
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
}
.nav__list a:hover,
.nav__list .current-menu-item > a,
.nav__list .current_page_item > a {
  color: var(--text);
  border-bottom-color: var(--accent-bright);
}

.nav__toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; color: var(--text);
}

@media (max-width: 900px) {
  .nav__toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.5rem;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
  .nav .btn { margin-top: 1.1rem; text-align: center; }
}

/* ==========================================================================
   6. Hero
   ========================================================================== */

.hero {
  padding-block: clamp(3.5rem, 9vw, 7rem);
  border-bottom: 1px solid var(--rule);
}

.hero__inner { max-width: 900px; }
.hero__title { margin-bottom: 1.1rem; }

.hero__sub {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.5;
  font-weight: 500;
  color: var(--text-muted);
  max-width: 48ch;
  margin: 0;
}

.page-hero { padding-block: clamp(3rem, 6vw, 4.75rem); border-bottom: 1px solid var(--rule); }
.page-hero .lede { max-width: 60ch; margin-top: 1rem; }

/* ==========================================================================
   7. Content blocks
   ========================================================================== */

.prose { max-width: 68ch; }
.prose h2 { margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2rem; }
.prose ul { padding-left: 1.15rem; margin: 0 0 1.15em; }
.prose li { margin-bottom: 0.5rem; }

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split__media { order: -1; }
}

.split__media img { width: 100%; border-radius: var(--radius); }

.split__media--placeholder {
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  display: grid; place-items: center;
  padding: 2rem; text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem; line-height: 1.5;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  margin-top: 2.75rem;
}
@media (max-width: 800px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent-bright);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.25rem);
  display: flex; flex-direction: column;
}
.section--tint .card { background: var(--ink); }

.card h3 { margin-bottom: 0.9rem; }
.card p { font-size: 1.02rem; color: var(--text-muted); }

.card__note {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: auto;
  padding-top: 1.1rem;
}

.card .btn { align-self: flex-start; margin-top: 1.4rem; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
  margin-top: 2.75rem;
}
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

.mini h3 { font-size: 1.08rem; margin-bottom: 0.45rem; }
.mini p { font-size: 0.98rem; line-height: 1.55; color: var(--text-muted); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.75rem, 4vw, 3.25rem);
  margin-top: 2.75rem;
}
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

.step { border-top: 2px solid var(--rule); padding-top: 1.25rem; }
.section--band .step { border-top-color: rgba(28, 27, 26, 0.35); }

.step__num {
  display: block;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 0.6rem;
}
.section--band .step__num { color: var(--accent); }

.step h3 { font-size: 1.15rem; }
.step p { font-size: 0.99rem; color: var(--text-muted); }

.svc {
  padding-block: clamp(2.5rem, 5vw, 3.75rem);
  border-top: 1px solid var(--rule);
  scroll-margin-top: 110px;
}
.svc:first-of-type { border-top: 0; padding-top: 0; }
.svc__body { max-width: 68ch; }

.svc__meta {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin: 0 0 1.5rem; padding: 0;
  list-style: none; font-size: 0.95rem;
}
.svc__meta li { color: var(--text-muted); }
.svc__meta strong { color: var(--text); font-weight: 600; }

.subnav {
  position: sticky; top: 84px; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding-block: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.subnav ul {
  display: flex; gap: 1.5rem;
  list-style: none; margin: 0; padding: 0;
  white-space: nowrap;
}
.subnav a { font-size: 0.92rem; font-weight: 500; text-decoration: none; color: var(--text-muted); }
.subnav a:hover { color: var(--accent-bright); }
@media (max-width: 900px) { .subnav { top: 0; } }

.callout {
  border-left: 3px solid var(--accent-bright);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 2rem 0;
  color: var(--text-muted);
}

/* ==========================================================================
   8. Contact form
   ========================================================================== */

.form-slot { margin-top: 2.5rem; max-width: 640px; }

.form-slot input[type="text"],
.form-slot input[type="email"],
.form-slot input[type="tel"],
.form-slot textarea,
.form-slot select {
  width: 100%;
  font: inherit; font-size: 1rem;
  padding: 0.8rem 0.95rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  margin-bottom: 1rem;
}
.form-slot input::placeholder, .form-slot textarea::placeholder { color: var(--text-muted); opacity: 0.75; }
.form-slot input:focus, .form-slot textarea:focus { border-color: var(--accent-bright); outline: none; }
.form-slot label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; color: var(--text); }
.form-slot textarea { min-height: 160px; resize: vertical; }
.form-slot input[type="submit"], .form-slot button[type="submit"] {
  background: var(--accent); color: #fff; border: 0;
  font: inherit; font-weight: 600;
  padding: 0.85rem 1.75rem; border-radius: var(--radius); cursor: pointer;
}

.contact-fallback {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-bright);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
}
.contact-fallback .email-link {
  display: inline-block;
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--accent-bright);
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  margin-bottom: 0.75rem;
}
.contact-fallback .email-link:hover { color: var(--accent-hover); }

.contact-meta { margin-top: 2rem; font-size: 0.98rem; color: var(--text-muted); }
.contact-meta a { color: var(--text-muted); }
.contact-meta a:hover { color: var(--accent-bright); }

/* ==========================================================================
   9. Footer
   ========================================================================== */

.site-footer {
  background: #141312;
  border-top: 1px solid var(--rule);
  color: var(--text-muted);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  font-size: 0.97rem;
}

.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
@media (max-width: 800px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* Same defence as the header lockup. See the LOGO SIZING note above. */
.site-footer__brand img {
  height: 40px !important;
  width: auto !important;
  max-width: none;
  margin-bottom: 1.25rem;
}

.site-footer h4 {
  color: var(--text);
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 1rem;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.55rem; }

.site-footer__bottom {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  font-size: 0.88rem;
  color: #7d7770;
}

/* ==========================================================================
   10. Fallback / 404
   ========================================================================== */

.entry-content { max-width: 68ch; }
.entry-content img { margin-block: 1.5rem; }

/* ==========================================================================
   11. Print — always ink on paper, regardless of the screen theme
   ========================================================================== */

@media print {
  html, body { background: #fff !important; color: #000 !important; }
  h1, h2, h3, h4, p, li, strong { color: #000 !important; }
  .site-header, .site-footer, .subnav, .btn, .hero__actions, .actions { display: none !important; }
  .section, .section--tint, .section--band { background: #fff !important; color: #000 !important; padding-block: 1rem; }
  body { font-size: 11pt; }
}
