/* ============================================================
   ENDEAVOR INTELLIGENCE — Main Stylesheet
   Built from: Rebecca's Brand Guidelines + Design Architecture v2
   ============================================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors */
  --moss: #008471;
  --moss-hover: #006B5A;
  --moss-active: #005A4D;
  --midnight: #150E44;
  --midnight-hover: #1E1460;
  --charcoal: #363C40;
  --mint: #4CC9A2;
  --indigo: #2D33AA;
  --black10: #E6E7E8;
  --white: #FFFFFF;

  /* Typography */
  --font: 'Montserrat', sans-serif;
  --weight-light: 300;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* Spacing (8px base) */
  --xs: 8px;
  --sm: 16px;
  --md: 24px;
  --lg: 32px;
  --xl: 48px;
  --2xl: 64px;
  --3xl: 80px;
  --4xl: 96px;
  --5xl: 128px;

  /* Layout */
  --container: 1200px;
  --content-width: 760px;
  --wide-content: 1000px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-weight: var(--weight-medium);
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* --- Typography --- */
h1, h2, h3, h4 {
  line-height: 1.4;
  color: var(--charcoal);
}

h1 {
  font-weight: var(--weight-extrabold);
  font-size: 42px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: var(--sm);
}

h2 {
  font-weight: var(--weight-bold);
  font-size: 30px;
  line-height: 1.3;
  margin-top: var(--xl);
  margin-bottom: var(--sm);
}

h3 {
  font-weight: var(--weight-semibold);
  font-size: 24px;
  margin-top: var(--lg);
  margin-bottom: var(--xs);
}

/* Reset heading top margin when first child in a container */
h1:first-child, h2:first-child, h3:first-child,
.topic__name, .tier__name, .framework-entry__name {
  margin-top: 0;
}

p { margin-bottom: var(--md); }

.lead {
  font-size: 19px;
  font-weight: var(--weight-medium);
  line-height: 1.5;
}

/* Body links */
.content a {
  color: var(--charcoal);
  text-decoration: underline;
  text-decoration-color: var(--moss);
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}
.content a:hover { color: var(--moss); }

/* --- Layout --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--md);
}

.content-width {
  max-width: var(--content-width);
  margin: 0 auto;
}

.wide-content {
  max-width: var(--wide-content);
  margin: 0 auto;
}

.section {
  padding: var(--4xl) 0;
}

.section--sm {
  padding: var(--2xl) 0;
}

/* --- Header --- */
.header {
  padding: var(--md) 0;
  background: var(--white);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--md);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--sm);
  text-decoration: none;
}

.header__logo svg,
.header__logo img {
  height: 52px;
  width: auto;
  flex-shrink: 0;
}

.header__logo-text {
  font-size: 32px;
  font-weight: var(--weight-bold);
  color: var(--charcoal);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Desktop nav */
.nav { display: flex; align-items: center; gap: var(--md); }

.nav__link {
  font-size: 15px;
  font-weight: var(--weight-medium);
  color: var(--charcoal);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav__link:hover,
.nav__link--active {
  color: var(--moss);
  border-bottom-color: var(--moss);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--xs);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  margin: 6px 0;
  transition: transform var(--transition-medium), opacity var(--transition-medium);
}

/* Mobile overlay nav */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--midnight);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--xl);
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.mobile-nav.is-open {
  display: flex;
  opacity: 1;
}

.mobile-nav__close {
  position: absolute;
  top: var(--md);
  right: var(--md);
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
}

.mobile-nav__link {
  font-size: 22px;
  font-weight: var(--weight-medium);
  color: var(--white);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.mobile-nav__link:hover { color: var(--mint); }

.mobile-nav__logo {
  position: absolute;
  bottom: var(--xl);
}

.mobile-nav__logo img {
  height: 36px;
  opacity: 0.7;
}

/* --- Footer --- */
.footer {
  background: var(--midnight);
  padding: var(--3xl) 0;
  color: var(--white);
}

.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--md);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: var(--xl);
  align-items: start;
}

.footer__heading {
  font-size: 14px;
  font-weight: var(--weight-semibold);
  color: var(--mint);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--sm);
}

.footer__link {
  display: block;
  font-size: 15px;
  font-weight: var(--weight-medium);
  color: var(--white);
  text-decoration: none;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.footer__link:hover { color: var(--mint); }

.footer__bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--xl) var(--md) 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: var(--xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__bottom p {
  font-size: 14px;
  font-weight: var(--weight-medium);
  color: var(--mint);
  margin: 0;
}

.footer__bottom-logo {
  flex-shrink: 0;
}

.footer__bottom-logo img {
  height: 44px;
  width: auto;
  max-width: 240px;
  opacity: 0.75;
  transition: opacity var(--transition-fast);
}

.footer__bottom-logo img:hover {
  opacity: 1;
}

/* --- Midnight Blocks --- */
.midnight-block {
  background: var(--midnight);
  color: var(--white);
  padding: var(--2xl) 0;
  width: 100%;
  margin-top: var(--lg);
  margin-bottom: var(--2xl);
}

.midnight-block:last-child {
  margin-bottom: 0;
}

.midnight-block h1,
.midnight-block h2,
.midnight-block h3 {
  color: var(--white);
  margin-top: 0;
}

.midnight-block h2 + p,
.midnight-block h3 + p {
  margin-top: 0;
}

.midnight-block p {
  color: var(--white);
}

.midnight-block a {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--mint);
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.midnight-block a:hover { color: var(--mint); }

.midnight-block .btn--primary {
  background: var(--moss);
  color: var(--white);
}

/* Midnight block with X framing (background element) */
.midnight-block--framed {
  position: relative;
  overflow: hidden;
}

.midnight-block--framed::before {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 400px;
  height: 400px;
  background: url('/images/favicon/favicon.svg') no-repeat center;
  background-size: contain;
  opacity: 0.06;
  pointer-events: none;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-weight: var(--weight-semibold);
  font-size: 16px;
  padding: 16px 32px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  text-align: center;
}

.btn--primary {
  background: var(--moss);
  color: var(--white);
}
.btn--primary:hover { background: var(--moss-hover); }
.btn--primary:active { background: var(--moss-active); }

.btn--secondary {
  background: var(--midnight);
  color: var(--white);
}
.btn--secondary:hover { background: var(--midnight-hover); }

.btn--ghost {
  background: var(--charcoal);
  border: 2px solid var(--charcoal);
  color: var(--white);
  padding: 14px 30px;
}
.btn--ghost:hover {
  background: #4A5054;
  border-color: #4A5054;
  color: var(--white);
}

/* Large routing buttons (homepage) */
.btn--large {
  padding: 20px 40px;
  font-size: 18px;
}

.routing-buttons {
  display: flex;
  gap: var(--md);
  margin: var(--xl) 0 var(--lg);
}

.routing-btn {
  text-align: center;
}

.routing-btn__desc {
  display: block;
  margin-top: var(--xs);
  font-size: 14px;
  font-weight: var(--weight-medium);
  color: var(--charcoal);
  opacity: 0.7;
}

.routing-buttons--tertiary {
  justify-content: center;
  margin-top: 0;
}

/* --- Testimonials --- */
.testimonials {
  display: flex;
  flex-direction: column;
  gap: var(--xl);
}

.testimonial {
  max-width: var(--content-width);
  margin: 0 auto;
}

.testimonial__quote {
  font-size: 18px;
  font-weight: var(--weight-light);
  font-style: italic;
  line-height: 1.5;
  color: var(--white);
  margin-bottom: var(--sm);
}

.testimonial__quote::before { content: '\201C'; }
.testimonial__quote::after { content: '\201D'; }

.testimonial__attribution {
  font-size: 15px;
  font-weight: var(--weight-medium);
  color: var(--mint);
}

/* --- Content Cards --- */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: var(--xs);
}

.card {
  padding: var(--lg);
  background: var(--black10);
  border-radius: 6px;
}

.card__title {
  font-size: 19px;
  font-weight: var(--weight-bold);
  color: var(--charcoal);
  margin-bottom: var(--xs);
}

.card__title a {
  color: var(--charcoal);
  text-decoration: underline;
  text-decoration-color: var(--moss);
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.card__title a:hover { color: var(--moss); }

.card__meta {
  font-size: 14px;
  font-weight: var(--weight-medium);
  color: var(--moss);
  margin-bottom: var(--xs);
}

.card__desc {
  font-size: 16px;
  color: var(--charcoal);
  margin: 0;
}

/* --- Homepage Hero Image --- */
.homepage-hero-img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: var(--lg);
}

/* --- Homepage Testimonials --- */
.homepage-testimonials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--xl);
  max-width: var(--wide-content);
  margin: 0 auto;
}

@media (max-width: 768px) {
  .homepage-testimonials {
    grid-template-columns: 1fr;
    gap: var(--lg);
  }
}

.homepage-testimonial {
  text-align: center;
  padding: var(--xl) 0;
}

.homepage-testimonial__quote {
  font-size: 18px;
  font-weight: var(--weight-light);
  font-style: italic;
  line-height: 1.5;
  color: var(--charcoal);
  margin-bottom: var(--sm);
}

.homepage-testimonial__quote::before { content: '\201C'; }
.homepage-testimonial__quote::after { content: '\201D'; }

.homepage-testimonial__attribution {
  font-size: 15px;
  font-weight: var(--weight-medium);
  color: var(--charcoal);
  opacity: 0.6;
  margin: 0;
}

/* --- Forms --- */
.form-wrapper {
  max-width: 600px;
}

/* HubSpot form overrides */
.hs-form input[type="text"],
.hs-form input[type="email"],
.hs-form textarea,
.hs-form select {
  font-family: var(--font) !important;
  font-weight: var(--weight-medium) !important;
  font-size: 16px !important;
  color: var(--charcoal) !important;
  border: 1px solid var(--black10) !important;
  border-radius: 4px !important;
  padding: 12px 16px !important;
  transition: border-color var(--transition-fast) !important;
}

.hs-form input:focus,
.hs-form textarea:focus,
.hs-form select:focus {
  border-color: var(--moss) !important;
  outline: none !important;
}

.hs-form .hs-button {
  font-family: var(--font) !important;
  font-weight: var(--weight-semibold) !important;
  font-size: 16px !important;
  background: var(--moss) !important;
  color: var(--white) !important;
  padding: 16px 32px !important;
  border-radius: 6px !important;
  border: none !important;
  cursor: pointer !important;
  transition: background-color var(--transition-fast) !important;
}

.hs-form .hs-button:hover {
  background: var(--moss-hover) !important;
}

.form-success {
  padding: var(--lg);
  background: var(--black10);
  border-radius: 6px;
}

.form-success p {
  font-size: 17px;
  margin: 0;
}

/* --- Post-Event Hero --- */
.event-hero {
  background: var(--midnight);
  color: var(--white);
  padding: var(--5xl) 0 var(--2xl);
  text-align: center;
}

.event-hero h1 {
  color: var(--white);
  margin-bottom: var(--sm);
}

.event-hero__meta {
  font-size: 18px;
  font-weight: var(--weight-medium);
  color: var(--mint);
}

/* --- 404 --- */
.page-404 {
  text-align: center;
  padding: var(--5xl) 0;
}

.page-404__x {
  width: 80px;
  margin: 0 auto var(--lg);
}

.page-404 h1 {
  font-size: 28px;
  margin-bottom: var(--sm);
}

.page-404__links {
  display: flex;
  gap: var(--md);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--lg);
}

/* --- Section Divider (X mark) --- */
.x-divider {
  text-align: center;
  padding: var(--lg) 0;
}

.x-divider img {
  width: 32px;
  height: 32px;
  opacity: 0.15;
  margin: 0 auto;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-mint { color: var(--mint); }
.text-moss { color: var(--moss); }
.mt-sm { margin-top: var(--sm); }
.mt-md { margin-top: var(--md); }
.mt-lg { margin-top: var(--lg); }
.mt-xl { margin-top: var(--xl); }
.mb-md { margin-bottom: var(--md); }
.mb-lg { margin-bottom: var(--lg); }
.mb-xl { margin-bottom: var(--xl); }

/* --- Homepage specific --- */
.hero {
  padding: var(--5xl) 0 var(--2xl);
  text-align: center;
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto var(--md);
}

.hero__secondary {
  font-size: 15px;
  color: var(--charcoal);
  opacity: 0.6;
  margin-top: var(--lg);
}

.hero__secondary a {
  color: var(--charcoal);
  text-decoration: underline;
  text-decoration-color: var(--moss);
  text-underline-offset: 3px;
}

.hero__secondary a:hover { color: var(--moss); }

.teasers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--lg);
  max-width: var(--wide-content);
  margin: 0 auto;
  padding: var(--xl) var(--md);
}

.teaser {
  padding: var(--lg);
  background: var(--black10);
  border-radius: 6px;
}

.teaser__label {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--moss);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--xs);
}

.teaser__title {
  font-size: 18px;
  font-weight: var(--weight-bold);
  margin-bottom: var(--xs);
}

.teaser__link {
  font-size: 15px;
  color: var(--charcoal);
  text-decoration: underline;
  text-decoration-color: var(--moss);
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.teaser__link:hover { color: var(--moss); }

/* --- Engagement Tiers --- */
.tiers {
  display: flex;
  flex-direction: column;
  gap: var(--md);
}

.tier {
  padding: var(--lg);
  background: var(--black10);
  border-radius: 6px;
}

.tier__name {
  font-size: 20px;
  font-weight: var(--weight-bold);
  margin-bottom: var(--xs);
}

.tier__desc {
  font-size: 16px;
  margin: 0;
}

.tiers + h2,
.tiers + p + h2,
.card-grid + h2 {
  margin-top: 56px;
}

/* --- Speaking Topics --- */
.topics {
  display: grid;
  gap: var(--md);
}

.topic {
  padding: var(--sm) var(--lg);
  background: var(--white);
  border-left: 4px solid var(--moss);
}

.topic__name {
  font-size: 19px;
  font-weight: var(--weight-bold);
  margin-bottom: var(--xs);
}

/* --- Event History --- */
.event-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--xs);
}

.event-list li {
  padding: var(--sm) var(--md);
  font-size: 16px;
  border-radius: 6px;
  background: var(--black10);
}

.event-list__name {
  font-weight: var(--weight-bold);
  display: block;
  font-size: 17px;
  margin-bottom: 4px;
}

.event-list__detail {
  color: var(--moss);
  font-size: 14px;
  font-weight: var(--weight-medium);
  display: block;
}

@media (max-width: 768px) {
  .event-list {
    grid-template-columns: 1fr;
  }
}

/* --- Framework Entry --- */
.framework-entry {
  display: flex;
  gap: var(--lg);
  padding: var(--lg);
  align-items: flex-start;
  background: var(--black10);
  border-radius: 6px;
}

.framework-entry__icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  margin-top: 2px;
  background: rgba(0, 132, 113, 0.06);
  border-radius: 8px;
  border: 1.5px dashed rgba(0, 132, 113, 0.25);
}

.framework-entry__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.framework-entry__content {
  flex: 1;
}

.framework-entry__name {
  font-size: 20px;
  font-weight: var(--weight-bold);
  margin-bottom: var(--xs);
}

/* --- Speaking Feature Images (inline section breakers) --- */
.speaking-feature-img {
  width: 100%;
  border-radius: 6px;
  margin: var(--lg) 0;
}

/* --- About Hero Image --- */
.about-hero {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 6px;
  margin-bottom: var(--lg);
}

/* --- Page Headshot --- */
.page-headshot {
  float: right;
  width: 200px;
  margin: 0 0 var(--md) var(--lg);
  border-radius: 6px;
}

/* --- Report Hero (Research page) --- */
.report-hero {
  display: flex;
  align-items: center;
  gap: var(--xl);
  text-align: left;
}

.report-hero__cover {
  flex: 0 0 320px;
}

.report-cover {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.report-hero__text {
  flex: 1;
}

/* --- Previous Edition (Research page) --- */
.previous-edition {
  display: flex;
  align-items: center;
  gap: var(--xl);
}

.edition-cover {
  flex: 0 0 280px;
  width: 280px;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.edition-text {
  flex: 1;
}

.edition-date {
  color: var(--charcoal);
  opacity: 0.6;
  font-size: 14px;
  margin-bottom: var(--sm);
}

/* --- Responsive --- */
@media (max-width: 1024px) and (min-width: 769px) {
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--lg);
  }
}

@media (max-width: 768px) {
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }
  .lead { font-size: 17px; }

  .nav { display: none; }
  .nav-toggle { display: block; }

  .header__inner { padding: 0 var(--sm); }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--lg);
  }

  .routing-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .routing-buttons .btn--large {
    width: 100%;
  }

  .teasers {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: var(--3xl) 0 var(--xl);
  }

  .section {
    padding: var(--2xl) 0;
  }

  .framework-entry {
    flex-direction: column;
  }

  .framework-entry__icon {
    width: 48px;
    height: 48px;
  }

  .container { padding: 0 var(--sm); }
  .content-width { padding: 0 var(--sm); }

  .about-hero {
    max-height: 280px;
  }

  .page-headshot {
    float: none;
    width: 100%;
    max-width: 300px;
    margin: 0 0 var(--md) 0;
  }

  .report-hero {
    flex-direction: column;
    text-align: center;
  }

  .report-hero__cover {
    flex: none;
    width: 100%;
    max-width: 300px;
  }

  .previous-edition {
    flex-direction: column;
  }

  .edition-cover {
    flex: none;
    width: 100%;
    max-width: 280px;
  }
}

/* --- Print --- */
@media print {
  .header, .footer, .mobile-nav, .nav-toggle, .btn, form { display: none !important; }
  body { color: #000; background: #fff; font-size: 12pt; }
  .midnight-block { background: none !important; color: #000 !important; display: block !important; padding: 20px 0; border-top: 1px solid #ccc; }
  .midnight-block h2, .midnight-block h3, .midnight-block p { color: #000 !important; }
  a::after { content: " (" attr(href) ")"; font-size: 10pt; color: #666; }
  .testimonial__quote { color: #000 !important; font-style: italic; }
  .testimonial__attribution { color: #333 !important; }
}
