/* ==========================================================================
   Efficiency HQ — WordPress-only additions.

   styles.css is kept byte-identical to the static prototype so it can be
   re-synced from the design source at any time. Anything WordPress needs that
   the static site never had lives here, loaded after it.
   ========================================================================== */

/* Playbook gotcha: a component rule with equal specificity that loads later
   will beat [hidden]{display:none}. Force it. */
[hidden] { display: none !important; }

/* ---- Skip link / screen-reader text ---- */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 999;
  width: auto; height: auto;
  margin: 0; padding: 12px 18px;
  clip-path: none;
  background: var(--navy-900);
  color: #fff;
  border-radius: var(--r-pill);
  font-family: var(--body);
  font-weight: 600;
  text-decoration: none;
}

/* ---- Admin bar: the header is sticky, so nudge it down ---- */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

/* ---- Contact Form 7 ---- */
/* CF7 wraps every field in a <span class="wpcf7-form-control-wrap">; make it
   transparent to the layout so .field styling behaves exactly as the static. */
.wpcf7-form-control-wrap { display: block; }
.wpcf7 form .wpcf7-response-output {
  margin: 14px 0 0;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  font-family: var(--body);
  font-size: .92rem;
  line-height: 1.5;
}
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output { border-color: #E0B341; background: #FCF6E6; color: #6A4E08; }
.wpcf7 form.sent .wpcf7-response-output { border-color: var(--lime); background: var(--lime-tint); color: var(--navy-900); }
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output { border-color: #D96A6A; background: #FBEDED; color: #7A2020; }
.wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-size: .82rem;
  color: #C0392B;
}
.sidecard--form .wpcf7-not-valid-tip { color: #FFC9C2; }
.wpcf7-spinner { margin: 10px auto 0; display: block; }
/* One compact form serves both the home hero (paired fields) and the service
   sidebar (stacked, as the prototype had it) — same form, same inbox. */
.sidecard--form .field--row { grid-template-columns: 1fr; gap: 0; }
/* The submit button keeps the site's .btn styling; CF7 adds its own class. */
.wpcf7 .btn.wpcf7-submit { cursor: pointer; }
.wpcf7 form .wpcf7-list-item { margin: 0; }

/* ---- Blog ---- */
.entry-media { margin-bottom: 26px; }
.entry-media img { width: 100%; height: auto; border-radius: var(--r-lg); display: block; }
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  font-family: var(--body);
  font-size: .88rem;
  color: var(--muted);
  margin-top: 14px;
}
.entry-meta a { color: var(--slate); text-decoration: none; }
.entry-meta a:hover { color: var(--lime-deep); }

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.post-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--cloud); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card__body h3 { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.post-card__body h3 a { color: var(--navy-900); text-decoration: none; }
.post-card__body h3 a:hover { color: var(--lime-deep); }
.post-card__body p { margin: 0; color: var(--slate); font-size: .95rem; }
.post-card__meta { margin-top: auto; font-size: .82rem; color: var(--muted); }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(20px, 3vw, 30px);
}

/* Long-form post body inherits .prose from the design system; these are the
   elements the static site never had an example of. */
.prose img, .prose iframe, .prose video { max-width: 100%; height: auto; border-radius: var(--r-lg); }
.prose figure { margin: 26px 0; }
.prose figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; text-align: center; }
.prose blockquote {
  margin: 26px 0;
  padding: 18px 24px;
  border-left: 3px solid var(--lime);
  background: var(--mist);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  font-size: 1.05rem;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; color: var(--slate); }
.prose li { margin-bottom: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.prose th { background: var(--mist); font-family: var(--display); }
.prose code {
  background: var(--cloud);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .9em;
}
.prose pre { background: var(--navy-900); color: #E8EEF6; padding: 18px 20px; border-radius: var(--r-lg); overflow-x: auto; }
.prose pre code { background: none; border: 0; color: inherit; padding: 0; }

/* WP core content classes */
.alignleft { float: left; margin: 6px 24px 18px 0; }
.alignright { float: right; margin: 6px 0 18px 24px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide, .alignfull { max-width: none; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; }
.sticky .post-card { border-color: var(--lime); }

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: clamp(34px, 5vw, 54px);
}
.pagination .page-numbers {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--slate);
  font-family: var(--body);
  font-weight: 600;
  text-decoration: none;
}
.pagination .page-numbers:hover { border-color: var(--lime); color: var(--navy-900); }
.pagination .page-numbers.current { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }

/* 404 / search */
.page-stub { text-align: center; max-width: 640px; margin: 0 auto; }
.page-stub .h2 { margin-bottom: 14px; }
.page-stub p { color: var(--slate); margin-bottom: 24px; }
.search-form-inline { display: flex; gap: 10px; max-width: 460px; margin: 0 auto 10px; }
.search-form-inline input[type="search"] {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  font-family: var(--body);
  font-size: .95rem;
}
.search-form-inline input[type="search"]:focus { outline: none; border-color: var(--lime); }

/* Editor-facing safety: an unfilled section should never collapse the layout */
.section:empty { display: none; }
