/*
Theme Name: Homebuyer Rewards
Author: Homebuyer Rewards Program
Description: A fast, accessible, conversion-focused companion theme for the Homebuyer Rewards Tools plugin. Includes editable starter pages, buyer guides, agent applications, contact management, flexible branding, and SEO foundations.
Version: 1.0.2
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: homebuyer-rewards-theme
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: custom-logo, custom-menu, featured-images, block-styles, wide-blocks, accessibility-ready, blog, education
*/

:root {
  --hbr-primary: #123b5d;
  --hbr-primary-dark: #0b2b45;
  --hbr-accent: #c69a4b;
  --hbr-accent-soft: #f7edd9;
  --hbr-bg: #f5f7fa;
  --hbr-surface: #ffffff;
  --hbr-text: #17212b;
  --hbr-muted: #5d6b78;
  --hbr-border: #d9e1e8;
  --hbr-success: #18764b;
  --hbr-danger: #a01919;
  --hbr-radius: 16px;
  --hbr-shadow: 0 16px 42px rgba(18, 59, 93, .10);
  --hbr-content: 780px;
  --hbr-wide: 1180px;
  --hbr-body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hbr-heading-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--hbr-bg);
  color: var(--hbr-text);
  font-family: var(--hbr-body-font);
  font-size: 17px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.hbr-sticky-header { scroll-padding-top: 96px; }
a { color: var(--hbr-primary); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--hbr-primary-dark); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--hbr-accent); outline-offset: 3px; }

h1, h2, h3, h4, h5, h6 {
  color: var(--hbr-primary-dark);
  font-family: var(--hbr-heading-font);
  line-height: 1.16;
  letter-spacing: -.025em;
}
h1 { font-size: clamp(2.35rem, 6vw, 4.8rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
p { margin: 0 0 1.25rem; }
ul, ol { padding-left: 1.35rem; }
hr { border: 0; border-top: 1px solid var(--hbr-border); margin: 2.5rem 0; }

.hbr-container { width: min(calc(100% - 2rem), var(--hbr-wide)); margin-inline: auto; }
.hbr-content-width { width: min(100%, var(--hbr-content)); margin-inline: auto; }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px;
  margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: #fff; clip: auto !important; clip-path: none; color: var(--hbr-primary); display: block;
  font-size: .9rem; font-weight: 800; height: auto; left: 1rem; padding: .8rem 1rem; top: 1rem;
  width: auto; z-index: 100000;
}

.hbr-announcement { background: var(--hbr-primary-dark); color: #fff; font-size: .9rem; }
.hbr-announcement .hbr-container { display: flex; justify-content: center; gap: .6rem; padding: .55rem 1rem; text-align: center; }
.hbr-announcement a { color: #fff; font-weight: 800; }
.site-header { background: rgba(255,255,255,.98); border-bottom: 1px solid var(--hbr-border); z-index: 999; }
.hbr-sticky-header .site-header { position: sticky; top: 0; backdrop-filter: blur(12px); }
.admin-bar.hbr-sticky-header .site-header { top: 32px; }
.hbr-header-inner { width: min(calc(100% - 2rem), 1380px); min-height: 82px; display: flex; align-items: center; gap: 1rem; }
.site-branding { display: flex; align-items: center; flex: 0 0 auto; min-width: 190px; }
.custom-logo-link { display: inline-flex; align-items: center; flex: 0 0 auto; }
.custom-logo { display: block; max-height: 48px; width: auto; }
.hbr-built-in-brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--hbr-primary-dark); text-decoration: none; white-space: nowrap; }
.hbr-built-in-brand:hover { color: var(--hbr-primary); }
.hbr-brand-mark { display: inline-grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border: 2px solid var(--hbr-primary); border-radius: 11px; background: linear-gradient(145deg, #fff, var(--hbr-accent-soft)); color: var(--hbr-primary); box-shadow: 0 7px 18px rgba(18,59,93,.11); }
.hbr-brand-mark svg { width: 25px; height: 25px; }
.hbr-brand-name { color: inherit; font-size: 1rem; font-weight: 900; line-height: 1.05; letter-spacing: -.02em; }
.site-description { display: none; }
.main-navigation { flex: 1 1 auto; min-width: 0; margin-left: auto; }
.main-navigation ul { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: .42rem; margin: 0; padding: 0; list-style: none; }
.main-navigation li { position: relative; flex: 0 0 auto; }
.main-navigation a { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: .58rem .7rem; border: 1px solid var(--hbr-border); border-radius: 8px; background: #fff; color: var(--hbr-text); font-size: .86rem; font-weight: 800; line-height: 1; text-align: center; text-decoration: none; white-space: nowrap; }
.main-navigation a:hover, .main-navigation .current-menu-item > a, .main-navigation .current-menu-ancestor > a { border-color: var(--hbr-primary); background: var(--hbr-bg); color: var(--hbr-primary); }
.main-navigation .sub-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 260px; padding: .5rem; background: #fff;
  border: 1px solid var(--hbr-border); border-radius: 12px; box-shadow: var(--hbr-shadow);
}
.main-navigation li:hover > .sub-menu, .main-navigation li:focus-within > .sub-menu { display: block; }
.main-navigation .sub-menu a { padding: .65rem .75rem; }
.hbr-header-cta, .hbr-button, .wp-block-button__link, input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .76rem 1.15rem;
  border: 2px solid var(--hbr-primary); border-radius: 9px; background: var(--hbr-primary); color: #fff !important; font-weight: 850;
  line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; box-shadow: 0 8px 20px rgba(18,59,93,.16);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.hbr-header-cta:hover, .hbr-button:hover, .wp-block-button__link:hover, input[type="submit"]:hover { transform: translateY(-1px); opacity: .95; box-shadow: 0 12px 25px rgba(18,59,93,.20); }
.hbr-button--accent, .is-style-hbr-accent .wp-block-button__link { background: var(--hbr-accent); color: #15202a !important; }
.hbr-button--light, .is-style-outline .wp-block-button__link { background: #fff; border: 2px solid var(--hbr-primary); color: var(--hbr-primary) !important; box-shadow: none; }
.menu-toggle { display: none; margin-left: auto; width: 46px; height: 42px; border: 1px solid var(--hbr-border); border-radius: 9px; background: #fff; color: var(--hbr-primary); font-size: 1.35rem; cursor: pointer; }

.site-main { min-height: 55vh; }
.hbr-page-header { padding: clamp(2.5rem, 7vw, 5rem) 0 2rem; background: linear-gradient(180deg, #eef4f8 0%, var(--hbr-bg) 100%); }
.hbr-page-header h1 { max-width: 900px; margin: .4rem 0 .8rem; font-size: clamp(2.2rem, 5vw, 4rem); }
.hbr-page-header p { max-width: 760px; margin: 0; color: var(--hbr-muted); font-size: 1.12rem; }
.hbr-breadcrumbs { padding-top: 1.1rem; color: var(--hbr-muted); font-size: .86rem; }
.hbr-breadcrumbs a { color: var(--hbr-muted); }
.hbr-breadcrumbs span { margin: 0 .4rem; }
.entry-content { padding: clamp(2rem, 5vw, 4.5rem) 0; }
.hbr-standard-page .entry-content > *:not(.alignwide):not(.alignfull), .single-post .entry-content > *:not(.alignwide):not(.alignfull) { max-width: var(--hbr-content); margin-left: auto; margin-right: auto; }
.hbr-wide-page .entry-content > *:not(.alignfull) { max-width: var(--hbr-wide); margin-left: auto; margin-right: auto; }
.alignwide { width: min(100%, var(--hbr-wide)); margin-inline: auto; }
.alignfull { width: 100%; max-width: none !important; }

.hbr-home-content { padding: 0; }
.hbr-hero-section { position: relative; overflow: hidden; padding: clamp(4rem, 10vw, 8rem) 0; background: linear-gradient(135deg, var(--hbr-primary-dark), var(--hbr-primary)); color: #fff; }
.hbr-hero-section::after { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -220px; border: 90px solid rgba(255,255,255,.06); border-radius: 50%; }
.hbr-hero-section > .wp-block-group__inner-container { position: relative; z-index: 1; }
.hbr-hero-section h1 { max-width: 900px; margin: .35rem 0 1rem; color: #fff; }
.hbr-hero-section p { max-width: 760px; color: rgba(255,255,255,.9); font-size: clamp(1.05rem, 2vw, 1.28rem); }
.hbr-eyebrow { margin: 0 0 .4rem !important; color: var(--hbr-accent) !important; font-size: .78rem !important; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.hbr-hero-section .wp-block-button.is-style-outline .wp-block-button__link { border-color: #fff; color: #fff !important; background: transparent; }
.hbr-trust-strip { margin-top: -36px; position: relative; z-index: 5; }
.hbr-trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 1px solid var(--hbr-border); border-radius: var(--hbr-radius); box-shadow: var(--hbr-shadow); overflow: hidden; }
.hbr-trust-grid > div { padding: 1.35rem 1.5rem; text-align: center; }
.hbr-trust-grid > div + div { border-left: 1px solid var(--hbr-border); }
.hbr-trust-grid strong { display: block; color: var(--hbr-primary); font-size: 1.55rem; }
.hbr-trust-grid span { color: var(--hbr-muted); font-size: .88rem; }
.hbr-section { padding: clamp(3.5rem, 8vw, 7rem) 0; }
.hbr-section--white { background: #fff; }
.hbr-section--soft { background: #edf3f7; }
.hbr-section--dark { background: var(--hbr-primary-dark); color: #fff; }
.hbr-section--dark h2, .hbr-section--dark h3 { color: #fff; }
.hbr-section-title { max-width: 780px; margin: 0 auto 2.5rem; text-align: center; }
.hbr-section-title p { color: var(--hbr-muted); font-size: 1.08rem; }
.hbr-section--dark .hbr-section-title p { color: rgba(255,255,255,.78); }
.hbr-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.25rem; }
.hbr-card { height: 100%; padding: 1.6rem; background: #fff; border: 1px solid var(--hbr-border); border-radius: var(--hbr-radius); box-shadow: 0 10px 30px rgba(18,59,93,.06); }
.hbr-card h3 { margin-top: .25rem; }
.hbr-card p:last-child { margin-bottom: 0; }
.hbr-card-number { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--hbr-accent-soft); color: var(--hbr-primary); font-weight: 900; }
.hbr-card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.hbr-card-link:hover .hbr-card { transform: translateY(-3px); border-color: var(--hbr-accent); }
.hbr-card { transition: transform .16s ease, border-color .16s ease; }
.hbr-two-column { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.hbr-highlight-box { padding: clamp(1.5rem, 4vw, 2.5rem); background: var(--hbr-accent-soft); border: 1px solid #ead5ad; border-radius: var(--hbr-radius); }
.hbr-check-list { list-style: none; padding: 0; }
.hbr-check-list li { position: relative; padding-left: 1.9rem; margin: .7rem 0; }
.hbr-check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--hbr-success); font-weight: 900; }
.hbr-cta-panel { padding: clamp(2rem, 5vw, 4rem); border-radius: 22px; background: linear-gradient(135deg, var(--hbr-primary), var(--hbr-primary-dark)); color: #fff; text-align: center; box-shadow: var(--hbr-shadow); }
.hbr-cta-panel h2 { color: #fff; margin-top: 0; }
.hbr-cta-panel p { max-width: 760px; margin-inline: auto; color: rgba(255,255,255,.86); }
.hbr-cta-panel .wp-block-buttons { justify-content: center; }
.hbr-faq-list details { margin: .75rem 0; background: #fff; border: 1px solid var(--hbr-border); border-radius: 11px; }
.hbr-faq-list summary { padding: 1rem 1.1rem; color: var(--hbr-primary-dark); font-weight: 850; cursor: pointer; }
.hbr-faq-list details > *:not(summary) { padding: 0 1.1rem 1rem; margin: 0; }

.hbr-form-wrap { padding: clamp(1.25rem, 4vw, 2rem); background: #fff; border: 1px solid var(--hbr-border); border-radius: var(--hbr-radius); box-shadow: var(--hbr-shadow); }
.hbr-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.hbr-field { display: flex; flex-direction: column; gap: .35rem; }
.hbr-field--full { grid-column: 1 / -1; }
.hbr-field label { font-size: .92rem; font-weight: 800; }
.hbr-field input, .hbr-field select, .hbr-field textarea {
  width: 100%; min-height: 48px; padding: .72rem .82rem; border: 1px solid #aebbc6; border-radius: 8px; background: #fff; color: var(--hbr-text);
}
.hbr-field textarea { min-height: 145px; resize: vertical; }
.hbr-field small { color: var(--hbr-muted); }
.hbr-consent { display: flex; gap: .65rem; align-items: flex-start; margin: 1rem 0; font-size: .88rem; }
.hbr-consent input { margin-top: .3rem; }
.hbr-form-message { margin-bottom: 1rem; padding: .9rem 1rem; border-left: 4px solid var(--hbr-success); background: #edf8f2; color: #125c3a; }
.hbr-form-message--error { border-color: var(--hbr-danger); background: #fff0f0; color: #7c1515; }
.hbr-honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.hbr-post-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.25rem; padding-bottom: 4rem; }
.hbr-post-card { display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--hbr-border); border-radius: var(--hbr-radius); box-shadow: 0 9px 28px rgba(18,59,93,.06); }
.hbr-post-card img { aspect-ratio: 16/9; object-fit: cover; }
.hbr-post-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.35rem; }
.hbr-post-card h2 { margin: .3rem 0 .7rem; font-size: 1.35rem; }
.hbr-post-card h2 a { text-decoration: none; }
.hbr-post-meta { color: var(--hbr-muted); font-size: .83rem; }
.hbr-post-card__body > a:last-child { margin-top: auto; font-weight: 800; }
.navigation.pagination { padding: 0 0 4rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.page-numbers { padding: .5rem .75rem; background: #fff; border: 1px solid var(--hbr-border); border-radius: 7px; text-decoration: none; }
.page-numbers.current { background: var(--hbr-primary); color: #fff; }

.site-footer { margin-top: 0; background: #091f31; color: rgba(255,255,255,.76); }
.hbr-footer-main { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 2.2rem; padding: 4rem 0 3rem; }
.site-footer h2, .site-footer h3 { color: #fff; font-size: 1rem; }
.hbr-footer-brand h2 { font-size: 1.25rem; }
.site-footer a { color: rgba(255,255,255,.86); }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: .45rem 0; }
.hbr-footer-contact { font-size: .92rem; }
.hbr-footer-contact p { margin: .35rem 0; }
.hbr-social-links { display: flex; gap: .65rem; margin-top: 1rem; }
.hbr-social-links a { display: inline-grid; place-items: center; min-width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; text-decoration: none; }
.hbr-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 1.25rem 0 1.5rem; font-size: .78rem; }
.hbr-footer-bottom .hbr-container { display: flex; justify-content: space-between; gap: 1rem; }
.hbr-footer-disclaimer { max-width: 850px; }

.hbr-empty-state, .hbr-404 { padding: clamp(3rem, 8vw, 7rem) 0; text-align: center; }
.hbr-404 h1 { margin-bottom: .5rem; }

@media (max-width: 1160px) {
  .menu-toggle { display: inline-grid; place-items: center; }
  .hbr-header-cta { display: none; }
  .main-navigation { display: none; position: absolute; left: 1rem; right: 1rem; top: calc(100% + .4rem); padding: .7rem; background: #fff; border: 1px solid var(--hbr-border); border-radius: 12px; box-shadow: var(--hbr-shadow); }
  .site-header { position: relative; }
  .hbr-sticky-header .site-header { position: sticky; }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { display: block; }
  .main-navigation .sub-menu { display: block; position: static; min-width: 0; padding: 0 0 0 .8rem; border: 0; box-shadow: none; }
  .hbr-card-grid, .hbr-post-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hbr-footer-main { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 782px) { .admin-bar.hbr-sticky-header .site-header { top: 46px; } }
@media (max-width: 700px) {
  body { font-size: 16px; }
  .hbr-header-inner { min-height: 68px; }
  .hbr-brand-name { font-size: .95rem; }
  .hbr-brand-mark { flex-basis: 38px; width: 38px; height: 38px; }
  .hbr-brand-mark svg { width: 23px; height: 23px; }
  .hbr-trust-grid, .hbr-card-grid, .hbr-post-grid, .hbr-two-column, .hbr-form-grid, .hbr-footer-main { grid-template-columns: 1fr; }
  .hbr-trust-grid > div + div { border-left: 0; border-top: 1px solid var(--hbr-border); }
  .hbr-footer-bottom .hbr-container { display: block; }
  .hbr-footer-main { gap: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
