/* ══════════════════════════════════════════════════════════════
   HEA SITE-WIDE BRAND LAYER
   Applies to every page and post that is not one of the four
   custom templates. Colours mirror the HEA palette block in the
   page templates. Change a value there, change it here.
   ══════════════════════════════════════════════════════════════ */

body.hea-on {
  --primary:        #1E4976;
  --primary-light:  #2E6BA8;
  --primary-dark:   #122d49;
  --hero-dark:      #091e35;
  --secondary:      #C9A061;
  --secondary-dark: #a07d42;
  --text-dark:      #1a1a1a;
  --text-medium:    #4a4a4a;
  --text-light:     #6b6b6b;
  --bg-cream:       #FAF8F5;
  --bg-white:       #ffffff;
  --border-subtle:  #e8e5e0;
  --grad-dark:      linear-gradient(140deg, var(--hero-dark) 0%, var(--primary) 100%);
  --hea-sans:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --hea-serif:      'Playfair Display', Georgia, serif;
}

/* ── 1. Retire the old Divi header and footer ─────────────────── */
body.hea-on #main-header,
body.hea-on #top-header,
body.hea-on .et-l--header,
body.hea-on #main-footer,
body.hea-on .et-l--footer,
body.hea-on #et-footer-nav,
body.hea-on #footer-bottom {
  display: none !important;
}

/* Divi adds top padding to make room for its fixed header. */
body.hea-on #page-container {
  padding-top: 0 !important;
  margin-top: 0 !important;
  box-shadow: none !important;
}
body.hea-on,
body.hea-on #page-container,
body.hea-on #et-main-area,
body.hea-on #main-content {
  background-color: var(--bg-cream) !important;
}
body.hea-on #main-content .container::before { display: none !important; } /* Divi sidebar divider */

/* ── 2. Typography on old content ─────────────────────────────── */
body.hea-on #et-main-area,
body.hea-on #et-main-area p,
body.hea-on #et-main-area li,
body.hea-on #et-main-area td,
body.hea-on #et-main-area blockquote {
  font-family: var(--hea-sans) !important;
  -webkit-font-smoothing: antialiased;
}
body.hea-on #et-main-area p,
body.hea-on #et-main-area li {
  line-height: 1.75;
}
body.hea-on #et-main-area h1,
body.hea-on #et-main-area h2,
body.hea-on #et-main-area h3,
body.hea-on #et-main-area h4,
body.hea-on #et-main-area h5,
body.hea-on #et-main-area .entry-title,
body.hea-on #et-main-area .et_pb_module_header {
  font-family: var(--hea-serif) !important;
  letter-spacing: -0.005em;
  line-height: 1.22;
}

/* Divi buttons become the brand gold button. */
html body.hea-on #page-container .et_pb_button.et_pb_button,
html body.hea-on #page-container a.more-link,
html body.hea-on #page-container .et_pb_more_button.et_pb_button {
  background: var(--secondary) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 8px !important;
  font-family: var(--hea-sans) !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.2px !important;
  text-transform: none !important;
  text-decoration: none !important;
  padding: 0.95rem 2.25rem !important;
  box-shadow: 0 4px 16px rgba(201, 160, 97, 0.35) !important;
  transition: background 0.3s, transform 0.3s !important;
}
html body.hea-on #page-container .et_pb_button.et_pb_button:hover {
  background: var(--secondary-dark) !important;
  transform: translateY(-2px);
}
html body.hea-on #page-container .et_pb_button.et_pb_button::after,
html body.hea-on #page-container .et_pb_button.et_pb_button::before {
  display: none !important;
}

/* ── 3. Header ─────────────────────────────────────────────────── */
.hea-chrome, .hea-chrome * { box-sizing: border-box; }

#hea-header {
  position: sticky;
  top: 0;
  z-index: 99990;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--hea-sans);
}
body.admin-bar #hea-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar #hea-header { top: 0; } }

.hea-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.1rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.hea-logo {
  font-family: var(--hea-serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  color: var(--primary) !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.hea-logo em, .hea-footer-logo em { color: var(--secondary); font-style: italic; }

.hea-nav { display: flex; align-items: center; gap: 2.2rem; }
.hea-nav a {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-medium) !important;
  text-decoration: none !important;
  transition: color 0.3s;
}
.hea-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--secondary);
  transition: width 0.3s;
}
.hea-nav a:hover, .hea-nav a.is-current { color: var(--primary) !important; }
.hea-nav a:hover::after, .hea-nav a.is-current::after { width: 100%; }
.hea-nav a.hea-nav-cta {
  background: var(--secondary);
  color: #fff !important;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.88rem;
}
.hea-nav a.hea-nav-cta::after { display: none; }
.hea-nav a.hea-nav-cta:hover { background: var(--secondary-dark); color: #fff !important; }

.hea-burger {
  display: none;
  background: none;
  border: 0;
  padding: 8px 0 8px 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}
.hea-burger span { display: block; width: 28px; height: 2px; background: var(--primary); border-radius: 2px; }

#hea-menu {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--hero-dark);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 24px;
}
#hea-menu.open { display: flex; }
#hea-menu a {
  color: #fff !important;
  text-decoration: none !important;
  font-family: var(--hea-serif);
  font-size: 26px;
}
#hea-menu a.hea-menu-cta {
  font-family: var(--hea-sans);
  font-size: 16px;
  font-weight: 600;
  background: var(--secondary);
  padding: 14px 28px;
  border-radius: 6px;
  margin-top: 8px;
}
.hea-close {
  position: absolute;
  top: 18px; right: 20px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 980px) {
  .hea-bar { padding: 14px 16px; }
  .hea-nav { display: none; }
  .hea-burger { display: flex; }
}

/* ── 4. Footer ─────────────────────────────────────────────────── */
#hea-footer {
  background: var(--hero-dark);
  padding: 2.75rem 0;
  font-family: var(--hea-sans);
}
.hea-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.hea-footer-logo { font-family: var(--hea-serif); font-size: 1.2rem; font-weight: 600; color: #fff; }
.hea-footer-links { display: flex; flex-wrap: wrap; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.hea-footer-links a { font-size: 0.82rem; color: rgba(255, 255, 255, 0.55) !important; text-decoration: none !important; transition: color 0.3s; }
.hea-footer-links a:hover { color: var(--secondary) !important; }
.hea-footer-copy { margin: 0; padding: 0; color: rgba(255, 255, 255, 0.35); font-size: 0.77rem; }

@media (max-width: 768px) {
  .hea-footer-inner { flex-direction: column; text-align: center; padding: 0 1.25rem; gap: 1rem; }
  .hea-footer-links { justify-content: center; gap: 1rem 1.25rem; }
}

/* ── 5. In-article assessment block and author box ─────────────── */
.hea-label {
  display: block;
  font-family: var(--hea-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0 0 0.6rem;
}

.hea-cta {
  margin: 2.5rem 0 !important;
  padding: 2.25rem 2.25rem 2.4rem !important;
  border-radius: 16px;
  background: var(--grad-dark);
  color: #fff;
  text-align: left;
}
body.hea-on #et-main-area .hea-cta .hea-cta-title {
  font-family: var(--hea-serif) !important;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff !important;
  margin: 0 0 0.6rem;
  padding: 0;
}
body.hea-on #et-main-area .hea-cta .hea-cta-text {
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 1rem;
  margin: 0 0 1.4rem;
  padding: 0;
}
.hea-btn {
  display: inline-block;
  background: var(--secondary);
  color: #fff !important;
  text-decoration: none !important;
  font-family: var(--hea-sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.9rem 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(201, 160, 97, 0.35);
  transition: background 0.3s, transform 0.3s;
}
.hea-btn:hover { background: var(--secondary-dark); transform: translateY(-2px); }

.hea-author {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin: 3rem 0 1rem !important;
  padding: 2rem !important;
  border-radius: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}
.hea-author img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
body.hea-on #et-main-area .hea-author p { margin: 0; padding: 0; }
body.hea-on #et-main-area .hea-author .hea-author-name {
  font-family: var(--hea-serif) !important;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary) !important;
}
body.hea-on #et-main-area .hea-author .hea-author-role {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--secondary-dark) !important;
  margin-bottom: 0.7rem;
}
body.hea-on #et-main-area .hea-author .hea-author-bio {
  font-size: 0.95rem;
  color: var(--text-medium) !important;
  margin-bottom: 0.8rem;
}
.hea-author a { color: var(--primary) !important; }
.hea-author-links a {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none !important;
  margin-right: 1.25rem;
  white-space: nowrap;
}

/* Sidebar assessment card (replaces the old Love Match quiz) */
.hea-side {
  margin: 0 0 2rem;
  padding: 1.75rem 1.5rem 1.9rem;
  border-radius: 14px;
  background: var(--grad-dark);
  text-align: center;
}
body.hea-on #et-main-area .hea-side .hea-side-title {
  font-family: var(--hea-serif) !important;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff !important;
  margin: 0 0 0.5rem;
  padding: 0;
}
body.hea-on #et-main-area .hea-side .hea-side-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75) !important;
  margin: 0 0 1.2rem;
  padding: 0;
}
.hea-side .hea-btn { padding: 0.75rem 1.6rem; font-size: 0.9rem; }

/* Divi divider lines (drawn as a pseudo-element) */
body.hea-on #et-main-area .et_pb_divider::before {
  border-top-color: rgba(201, 160, 97, 0.45) !important;
}

@media (max-width: 600px) {
  .hea-cta { padding: 1.75rem 1.4rem !important; }
  .hea-author { flex-direction: column; padding: 1.5rem !important; }
}
