/* ==========================================================
   BHD — Association of Independent Canadian Accounting Firms
   Stylesheet
   ========================================================== */

/* ===== DESIGN TOKENS ===== */
:root {
  --blue:         #3D52A0;   /* Primary BHD blue */
  --blue-dark:    #2D3F7A;   /* Darker shade for gradients / hover */
  --blue-light:   #5B78C2;   /* Lighter accent */
  --blue-pale:    #EEF2FF;   /* Very light blue for backgrounds */
  --blue-border:  #B8C8E8;   /* Border colour in light sections */
  --gold:         #F0C040;   /* Map marker accent */
  --text:         #1A1A2E;   /* Main body text */
  --text-mid:     #4A5568;   /* Secondary text */
  --text-light:   #64748B;   /* Muted text */
  --white:        #FFFFFF;
  --gray-bg:      #F7F9FC;   /* Alternate section background */
  --border:       #E2E8F0;
  --radius:       8px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 4px rgba(61, 82, 160, 0.07);
  --shadow:       0 4px 16px rgba(61, 82, 160, 0.10);
  --shadow-lg:    0 10px 32px rgba(61, 82, 160, 0.16);
  --ease:         0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
}
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
a { color: var(--blue); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--blue-dark); }

/* ===== LAYOUT ===== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
  text-align: center;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn--primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: var(--white);
}

.btn--white {
  background: var(--white);
  color: var(--blue);
  border-color: var(--white);
}
.btn--white:hover {
  background: transparent;
  color: var(--white);
}

.btn--outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.55);
}
.btn--outline:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
}
.header__logo { height: 64px; width: auto; }
.header__nav {
  display: flex;
  gap: 36px;
}
.header__nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  letter-spacing: 0.01em;
}
.header__nav a:hover { color: var(--blue); }

/* Mobile hamburger */
.header__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.header__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: background var(--ease);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(140deg, var(--blue-dark) 0%, var(--blue) 55%, var(--blue-light) 100%);
  color: var(--white);
  padding: 100px 0 96px;
  text-align: center;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 22px;
}
.hero__text {
  font-size: clamp(1rem, 2vw, 1.18rem);
  opacity: 0.88;
  max-width: 600px;
  margin: 0 auto 40px;
}
.hero__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== SECTIONS ===== */
.section { padding: 88px 0; }
.section--alt { background: var(--gray-bg); }
.section--blue {
  background: linear-gradient(150deg, var(--blue-dark) 0%, var(--blue) 100%);
}
.section__header {
  text-align: center;
  margin-bottom: 60px;
}
.section__title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 12px;
}
.section__title--white { color: var(--white); }
.section__subtitle {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 540px;
  margin: 0 auto;
}
.section__subtitle--white { color: rgba(255, 255, 255, 0.80); }

/* ===== FIRM CARDS ===== */
.firms-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.firm-card {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-lg);
  padding: 28px 16px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--ease), transform var(--ease);
}
.firm-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* Logo placeholder — remove this block once real logos are added */
.firm-card__logo-area {
  width: 100px;
  height: 100px;
  background: var(--blue-pale);
  border: 2px dashed var(--blue-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}
.firm-card__initials {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.5px;
}
.firm-card__logo-note {
  font-size: 9px;
  color: var(--blue-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/*
  TO ADD REAL LOGOS:
  1. Remove .firm-card__logo-area, .firm-card__initials, and .firm-card__logo-note elements from each card in the HTML.
  2. In their place add: <img src="logos/firm-name.png" alt="Firm Name" class="firm-card__logo-img">
  3. The CSS below handles the real logo display:
*/
.firm-card__logo-img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
}

.firm-card__logo-img--padded {
  padding: 0 20px;
}

.firm-card__logo-img--tj {
  padding: 0 6px;
}

.firm-card__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.firm-card__location {
  font-size: 12px;
  font-weight: 500;
  color: var(--blue-light);
  margin-top: auto;
}

/* ===== MAP ===== */
.map-wrapper {
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

#canada-map {
  width: 100%;
  line-height: 0;
}

/* ===== JOIN / RECRUITMENT ===== */
.join-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 52px;
  align-items: start;
}

.join-intro {
  font-size: 1.05rem;
  color: var(--text-mid);
  margin-bottom: 36px;
  font-style: italic;
  line-height: 1.7;
}

.join-benefits-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 24px;
}

.benefits-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.benefit {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.benefit__icon {
  width: 26px;
  height: 26px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.benefit__body h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.benefit__body p {
  font-size: 13.5px;
  color: var(--text-light);
  font-style: italic;
}

/* Join card (sidebar) */
.join-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.join-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 14px;
}
.join-card > p {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 24px;
  line-height: 1.6;
}
.join-card .btn {
  width: 100%;
  margin-bottom: 0;
}

.join-card__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0 20px;
}
.join-card__criteria-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-light);
  margin-bottom: 12px;
}
.join-card__criteria {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.join-card__criteria li {
  font-size: 13.5px;
  color: var(--text-mid);
  padding-left: 16px;
  position: relative;
  font-style: italic;
}
.join-card__criteria li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--blue-light);
}
.join-card__note {
  font-size: 12.5px;
  color: var(--text-light);
  line-height: 1.5;
}

/* ===== FOOTER ===== */
.footer { background: #111827; }

.footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-top: 56px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 26px 0;
}
.footer__logo {
  height: 72px;
  width: auto;
  /* Inverts the colour logo to white for the dark footer */
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.footer__brand p {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
  max-width: 240px;
}

.footer__col h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 18px;
}
.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer__col a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  transition: color var(--ease);
}
.footer__col a:hover { color: var(--white); }
.footer__col p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
}

.footer__logo-wrap p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1060px) {
  .firms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .join-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .join-sidebar {
    max-width: 480px;
    width: 100%;
  }
}

/* Mobile */
@media (max-width: 720px) {
  .container { padding: 0 18px; }

  /* Header */
  .header__inner { justify-content: center; }
  .header__nav { display: none; }
  .header__toggle { display: none; }

  /* Hero */
  .hero { padding: 64px 0 56px; }
  .hero__actions { flex-direction: column; align-items: center; }
  .hero__actions .btn { width: 220px; }

  /* Sections */
  .section { padding: 60px 0; }
  .section__header { margin-bottom: 40px; }

  /* Map */
  .map-wrapper { border-radius: 8px; }

  /* Join card */
  .join-sidebar { max-width: none; width: 100%; }

  /* Firm cards */
  .firm-card { padding: 18px 12px 14px; gap: 8px; }
  .firm-card__logo-img { height: 34px; }
  .firm-card__logo-img--padded { padding: 0 10px; }
  .firm-card__logo-img--tj { padding: 0 3px; }
  .firm-card__name { font-size: 12.5px; }
  .firm-card__location { font-size: 11px; }

}

@media (max-width: 440px) {
  .firms-grid {
    grid-template-columns: 1fr;
    max-width: 300px;
    margin: 0 auto;
  }
}
