/*
Theme Name: RMH
Theme URI: https://remodelmyhome.ai/
Author: Remodel My Home
Author URI: https://remodelmyhome.ai/
Description: Custom block theme for the Remodel My Home marketing website.
Version: 0.2.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: rmh
*/

:root {
  --rmh-navy: #163a5f;
  --rmh-navy-deep: #0f2944;
  --rmh-red: #b72d34;
  --rmh-green: #164636;
  --rmh-gold: #c4a46a;
  --rmh-ink: #1c2733;
  --rmh-muted: #5d6875;
  --rmh-line: #dce2e8;
  --rmh-soft: #f5f7fa;
  --rmh-cream: #f7f3ea;
  --rmh-shadow: 0 22px 60px rgba(20, 43, 66, 0.12);
  --rmh-radius-lg: 28px;
  --rmh-radius-md: 18px;
  --rmh-header-height: 78px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: linear-gradient(180deg, #fbfcfd 0%, #f6f8fb 34%, #ffffff 100%);
  color: var(--rmh-ink);
  margin: 0;
}
a { transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease; }
a:hover { color: var(--rmh-red); }
:where(.wp-site-blocks) { padding: 0; }
.wp-site-blocks > * { margin-block-start: 0; }

.rmh-site-main { min-height: 45vh; }
.rmh-section { padding-block: clamp(4.5rem, 8vw, 6rem); scroll-margin-top: calc(var(--rmh-header-height) + 1rem); }
.rmh-section-tight { padding-block: clamp(3rem, 6vw, 4.5rem); }
.rmh-eyebrow {
  align-items: center;
  color: var(--rmh-red) !important;
  display: inline-flex;
  font-size: 0.78rem !important;
  font-weight: 800;
  gap: 0.65rem;
  letter-spacing: 0.12em;
  margin: 0;
  text-transform: uppercase;
}
.rmh-eyebrow::before {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 4px;
  width: 34px;
}
.rmh-lead { color: #40505f !important; font-size: var(--wp--preset--font-size--lead) !important; }

/* Header */
.rmh-site-header {
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(220, 226, 232, 0.9);
  padding-inline: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.admin-bar .rmh-site-header { top: 32px; }
.rmh-header-inner {
  min-height: var(--rmh-header-height);
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
.rmh-brand-link { flex: 0 0 220px; }
.rmh-brand-link a {
  background: url("assets/images/rmh-logo.webp") left center / contain no-repeat;
  display: block;
  height: 54px;
  overflow: hidden;
  text-indent: -9999px;
  width: 205px;
}
.rmh-primary-nav { margin-left: auto; }
.rmh-primary-nav .wp-block-navigation-item__content {
  border-radius: 999px;
  color: #314252;
  padding: 0.75rem 0.9rem;
}
.rmh-primary-nav .wp-block-navigation-item__content:hover,
.rmh-primary-nav .current-menu-item > .wp-block-navigation-item__content {
  background: #eef3f8;
  color: var(--rmh-navy);
}
.rmh-primary-nav .wp-block-navigation__submenu-container {
  border: 1px solid var(--rmh-line) !important;
  border-radius: var(--rmh-radius-md);
  box-shadow: var(--rmh-shadow);
  min-width: 270px !important;
  overflow: visible;
  padding: 10px !important;
}
.rmh-primary-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  border-radius: 12px;
  color: #344654;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
  padding: 12px 13px;
}

.rmh-global-video-overlay {
  backdrop-filter: blur(12px);
  background: rgba(7, 18, 29, 0.82);
  display: grid;
  inset: 0;
  padding: 28px;
  place-items: center;
  position: fixed;
  z-index: 2147483500;
}
.rmh-global-video-overlay[hidden] { display: none; }
.rmh-global-video-backdrop {
  background: transparent;
  border: 0;
  inset: 0;
  position: absolute;
}
.rmh-global-video-dialog {
  background: #07121d;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.46);
  overflow: hidden;
  position: relative;
  width: min(1120px, 100%);
  z-index: 1;
}
.rmh-global-video-header {
  align-items: center;
  background: var(--rmh-navy-deep);
  color: #fff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 16px 18px;
}
.rmh-global-video-header strong { font-size: 1.05rem; }
.rmh-global-video-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: grid;
  flex: 0 0 auto;
  font-size: 1.35rem;
  height: 40px;
  place-items: center;
  width: 40px;
}
.rmh-global-video-close:hover,
.rmh-global-video-close:focus-visible { background: var(--rmh-red); outline: none; }
.rmh-global-video-dialog video {
  background: #000;
  display: block;
  max-height: calc(100vh - 150px);
  width: 100%;
}
body.rmh-video-open { overflow: hidden; }
.rmh-header-demo .wp-block-button__link,
.is-style-rmh-primary .wp-block-button__link {
  background: var(--rmh-red);
  box-shadow: 0 14px 30px rgba(183, 45, 52, 0.23);
  color: #fff;
}
.rmh-header-demo .wp-block-button__link:hover,
.is-style-rmh-primary .wp-block-button__link:hover {
  box-shadow: 0 18px 36px rgba(183, 45, 52, 0.32);
  color: #fff;
  transform: translateY(-1px);
}
.is-style-rmh-secondary .wp-block-button__link { background: var(--rmh-navy); color: #fff; }
.wp-block-button__link { white-space: nowrap; }

/* Reusable presentation styles */
.is-style-rmh-card,
.rmh-card {
  background: #fff;
  border: 1px solid var(--rmh-line);
  border-radius: var(--rmh-radius-md);
  box-shadow: 0 12px 30px rgba(20, 43, 66, 0.06);
  padding: clamp(1.35rem, 3vw, 2rem);
}
.rmh-hero {
  background:
    radial-gradient(circle at 72% 20%, rgba(196, 164, 106, 0.16) 0%, rgba(196, 164, 106, 0) 30%),
    radial-gradient(circle at 18% 10%, rgba(183, 45, 52, 0.1) 0%, rgba(183, 45, 52, 0) 28%);
  min-height: min(760px, calc(100vh - var(--rmh-header-height)));
  padding-block: clamp(5rem, 10vw, 8rem);
}
.rmh-feature-grid { align-items: stretch; }
.rmh-feature-grid > .wp-block-column { display: flex; }
.rmh-feature-grid > .wp-block-column > .wp-block-group { width: 100%; }

/* Default editorial templates */
.rmh-page-header,
.rmh-archive-header { padding-block: clamp(4rem, 8vw, 6.5rem) clamp(2rem, 4vw, 3rem); }
.rmh-page-content { padding-bottom: clamp(4rem, 8vw, 6rem); }
.rmh-post-meta { color: var(--rmh-muted); font-size: 0.88rem; }
.rmh-query-card { border-bottom: 1px solid var(--rmh-line); padding-block: 2rem; }

/* Shared retailer partnership section */
.rmh-demo-section {
  background: linear-gradient(135deg, var(--rmh-navy-deep), #214f79);
  color: #fff;
  margin-block-end: 0;
  padding-block: clamp(4.5rem, 8vw, 6rem);
}
.rmh-demo-section h2,
.rmh-demo-section h3 { color: #fff; }
.rmh-demo-section p { color: rgba(255, 255, 255, 0.76); }
.rmh-demo-wrap {
  align-items: start;
  display: grid;
  gap: 30px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  margin-inline: auto;
  max-width: var(--wp--style--global--wide-size);
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
.rmh-demo-copy h2 { margin-block: 0; }
.rmh-demo-lead {
  font-size: clamp(1.05rem, 1.35vw, 1.32rem);
  margin-block: 1rem 0;
  max-width: 820px;
}
.rmh-proof-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.rmh-proof-chip {
  align-items: center;
  background: #fff;
  border: 1px solid var(--rmh-line);
  border-radius: 999px;
  box-shadow: 0 7px 18px rgba(20, 43, 66, 0.05);
  color: #33485a;
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 750;
  gap: 8px;
  padding: 9px 12px;
}
.rmh-proof-chip > span {
  background: var(--rmh-red);
  border-radius: 999px;
  height: 8px;
  width: 8px;
}
.rmh-outcome-panel { display: grid; gap: 16px; margin-top: 26px; }
.rmh-outcome-intro {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  padding: 20px;
}
.rmh-outcome-intro h3 { margin: 0 0 8px; }
.rmh-outcome-intro p,
.rmh-outcome-card p { margin: 0; }
.rmh-outcome-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rmh-outcome-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 18px;
  padding: 16px;
}
.rmh-outcome-card strong { color: #fff; display: block; margin-bottom: 7px; }
.rmh-outcome-card p { font-size: 0.9rem; }
.rmh-onboarding-note {
  background: rgba(196, 164, 106, 0.16);
  border: 1px solid rgba(196, 164, 106, 0.35);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.94rem;
  padding: 16px 18px;
}
.rmh-onboarding-note strong { color: #fff; }
.rmh-demo-form {
  background: #fff;
  border: 1px solid var(--rmh-line);
  border-radius: 26px;
  box-shadow: var(--rmh-shadow);
  color: var(--rmh-ink);
  padding: 26px;
}
.rmh-form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rmh-demo-form label { color: #324353; display: grid; font-size: 0.82rem; font-weight: 850; gap: 6px; }
.rmh-demo-form input,
.rmh-demo-form select,
.rmh-demo-form textarea {
  background: #fbfcfd;
  border: 1px solid var(--rmh-line);
  border-radius: 13px;
  color: #344654;
  font: inherit;
  padding: 12px 13px;
  width: 100%;
}
.rmh-demo-form textarea { min-height: 110px; resize: vertical; }
.rmh-demo-form input:invalid,
.rmh-demo-form select:invalid,
.rmh-demo-form textarea:invalid { border-color: rgba(183, 45, 52, 0.55); }
.rmh-form-span-2 { grid-column: span 2; }
.rmh-form-submit {
  background: var(--rmh-red);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(183, 45, 52, 0.23);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0.9rem 1.35rem;
}
.rmh-form-submit:hover { box-shadow: 0 18px 36px rgba(183, 45, 52, 0.32); transform: translateY(-1px); }
.rmh-form-status { font-size: 0.9rem; font-weight: 750; margin: 12px 0 0; min-height: 1.3em; }
.rmh-form-status.error { color: var(--rmh-red); }
.rmh-form-status.success { color: var(--rmh-navy); }

/* Footer */
.rmh-site-footer { background: var(--rmh-navy-deep); color: #fff; margin-block-start: 0 !important; padding-block: 2.875rem; }
.rmh-footer-inner { padding-inline: clamp(1.25rem, 4vw, 3rem); }
.rmh-footer-brand {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--rmh-radius-md);
  display: block;
  padding: 0.6rem 0.75rem;
}
.rmh-footer-brand a {
  background: url("assets/images/rmh-logo.webp") center / contain no-repeat;
  display: block;
  height: 42px;
  overflow: hidden;
  text-indent: -9999px;
  width: 180px;
}
.rmh-site-footer .wp-block-social-links { gap: 12px; }
.rmh-site-footer .wp-social-link {
  align-items: center;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}
.rmh-site-footer .wp-social-link a { align-items: center; display: flex; height: 100%; justify-content: center; padding: 0; width: 100%; }
.rmh-site-footer .wp-social-link svg { height: 21px; width: 21px; }
.rmh-site-footer .wp-social-link:hover { background: rgba(255, 255, 255, 0.12) !important; transform: translateY(-2px); }
.rmh-footer-note { color: rgba(255, 255, 255, 0.65) !important; font-size: 0.82rem !important; }

/* Accessibility and responsive behavior */
:focus-visible { outline: 3px solid rgba(22, 58, 95, 0.55); outline-offset: 3px; }
.rmh-site-footer :focus-visible,
.rmh-demo-section :focus-visible { outline-color: rgba(255, 255, 255, 0.8); }

@media (max-width: 1020px) {
  /* A backdrop-filter ancestor constrains fixed descendants in mobile Safari. */
  .rmh-site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #fff;
  }
  /* Keep the open mobile navigation above every page-specific stacking context. */
  .rmh-site-header:has(.wp-block-navigation__responsive-container.is-menu-open) {
    z-index: 2147483000;
  }
  .rmh-header-inner { min-height: 72px; }
  .rmh-brand-link { flex-basis: 150px; }
  .rmh-brand-link a { height: 46px; width: 150px; }
  .rmh-header-demo { display: none; }
  .rmh-primary-nav { order: 3; }
  .rmh-demo-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 782px) {
  .admin-bar .rmh-site-header { top: 46px; }
  .rmh-header-inner { padding-inline: 1rem; }
  .rmh-brand-link { flex-basis: 138px; }
  .rmh-brand-link a { height: 42px; width: 138px; }
  .rmh-primary-nav .wp-block-navigation__responsive-container.is-menu-open {
    background: #fff;
    height: 100vh;
    height: 100dvh;
    inset: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--rmh-ink);
    padding: 1.5rem;
    position: fixed;
    width: 100vw;
    z-index: 2147483001;
  }
  .rmh-primary-nav .wp-block-navigation__responsive-container-content { align-items: stretch; }
  .rmh-primary-nav .wp-block-navigation__container { align-items: stretch; width: 100%; }
  .rmh-primary-nav .wp-block-navigation-item { align-items: stretch; width: 100%; }
  .rmh-primary-nav .wp-block-navigation-item__content { width: 100%; }
  .rmh-outcome-grid { grid-template-columns: 1fr; }
  .rmh-form-grid { grid-template-columns: 1fr; }
  .rmh-form-span-2 { grid-column: auto; }
  .rmh-footer-inner { align-items: flex-start !important; flex-direction: column; }
  .rmh-global-video-overlay { padding: 12px; }
  .rmh-global-video-dialog { border-radius: 18px; }
  .rmh-global-video-header { padding: 12px 14px; }
}

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