/* ============================================
   The Leadership Survey — Shared Stylesheet
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy:        #00297A;
  --navy-hover:  #002068;
  --white:       #ffffff;
  --bg:          #f8f8f8;
  --body-text:   #1a1a1a;
  --grey:        #666666;
  --rule:        #e0e0e0;
  --dark-bg:     #0D1117;
  --max-content: 920px;
  --sans-title:  'Source Sans 3', 'Source Sans Pro', 'Segoe UI', Arial, sans-serif;
  --sans-body:   -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--sans-body);
  color: var(--body-text);
  background: var(--bg);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Flat header (about / privacy / index / share) ───── */

.flat-header {
  padding: 1.25rem 2.5rem 0.5rem;
  background: var(--bg);
}

.flat-nav {
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title-flat {
  font-family: var(--sans-title);
  font-size: clamp(1.55rem, 5.2vw, 2.5rem);
  font-weight: 400;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: 0.12em;
  line-height: 1;
  white-space: nowrap;
}

.flat-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.flat-nav-links {
  font-size: 0.92rem;
  color: var(--body-text);
  display: flex;
  align-items: center;
}

.flat-nav-link {
  color: var(--body-text);
  text-decoration: none;
  font-weight: 400;
}

.flat-nav-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.flat-nav-link.active-page {
  font-weight: 700;
}

.flat-nav-sep {
  color: var(--body-text);
  padding: 0 0.35rem;
}

/* ── Hamburger button (mobile only) ──────────── */

.hamburger {
  display: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 18px;
  height: 18px;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--navy);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

body.dark-page .hamburger span,
body.index-page .hamburger span {
  background: #ffffff;
}

.lang-flat {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans-title);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.05em;
  padding: 0;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  position: relative;
  top: 1px;
}

.flat-lang {
  position: relative;
}

.flat-lang .lang-dropdown {
  background: var(--bg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border: 1px solid var(--rule);
}

.flat-lang .lang-dropdown a {
  color: var(--body-text);
  font-size: 0.82rem;
}

.flat-lang .lang-dropdown a:hover {
  background: var(--rule);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 7rem;
  z-index: 100;
  padding: 0.25rem 0;
}

.lang-dropdown.open {
  display: block;
}

.lang-dropdown a {
  display: block;
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-family: var(--sans-title);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  transition: background 0.15s;
}

.flat-lang .lang-dropdown a.active {
  font-weight: 700;
  pointer-events: none;
}

@media (max-width: 600px) {
  .flat-header { padding: 1rem 1.25rem 0.5rem; }
}

/* ── Mobile/tablet header: full-width slide-down menus (below 800px) ── */

@media (max-width: 800px) {
  /* Show the hamburger */
  .hamburger { display: flex; }

  /* Nav links become a full-width panel sliding down below the header */
  .flat-nav-links {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--menu-top, 4rem);
    width: 100vw;
    max-width: none;
    min-width: 0;
    background: #EEEEEE;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0;
    z-index: 90;
  }
  .flat-nav-links.open {
    display: flex;
  }
  .flat-nav-links .flat-nav-link {
    display: block;
    padding: 0.7rem 1.5rem;
    width: 100%;
    font-size: 1.1rem;
    text-align: left;
  }
  .flat-nav-links .flat-nav-sep {
    display: none;
  }

  /* Language dropdown gets the same full-width slide-down treatment */
  .flat-lang .lang-dropdown {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--menu-top, 4rem);
    width: 100vw;
    max-width: none;
    min-width: 0;
    background: #EEEEEE;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 0.5rem 0;
    z-index: 90;
  }
  .flat-lang .lang-dropdown a {
    display: block;
    padding: 0.7rem 1.5rem;
    width: 100%;
    font-family: var(--sans-body);
    font-size: 1.1rem;
    text-align: left;
    font-weight: 400;
    letter-spacing: 0;
  }

  /* Dark page variants (index, privacy) */
  body.dark-page .flat-nav-links,
  body.dark-page .flat-lang .lang-dropdown,
  body.index-page .flat-nav-links,
  body.index-page .flat-lang .lang-dropdown {
    background: #1A1F27;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  body.dark-page .flat-nav-links .flat-nav-link,
  body.index-page .flat-nav-links .flat-nav-link {
    color: #ffffff;
  }
  body.dark-page .flat-lang .lang-dropdown a,
  body.index-page .flat-lang .lang-dropdown a {
    color: #ffffff;
  }

  /* Hover/tap states */
  .flat-nav-links .flat-nav-link:hover,
  .flat-lang .lang-dropdown a:hover {
    background: rgba(0,0,0,0.04);
    text-decoration: none;
  }
  body.dark-page .flat-nav-links .flat-nav-link:hover,
  body.dark-page .flat-lang .lang-dropdown a:hover,
  body.index-page .flat-nav-links .flat-nav-link:hover,
  body.index-page .flat-lang .lang-dropdown a:hover {
    background: rgba(255,255,255,0.06);
  }
}

/* ── Main content ────────────────────────────── */

main {
  flex: 1;
  padding: 1.5rem 2.5rem 3rem;
}

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

/* Indented content (about, privacy) — gives body content a symmetric inset
   from the header's edges, establishing visual hierarchy and a composed,
   framed feel. The header itself stays at full width; only the content
   shifts in. Removed at narrow widths via the mobile media query below. */
main.indented-content .container {
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

p {
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--body-text);
  margin-bottom: 1.1rem;
}

p.callout {
  font-weight: 700;
  letter-spacing: -0.02em;
}

a.inline-link {
  color: var(--body-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── CTA button ──────────────────────────────── */

.cta {
  margin-top: 2.25rem;
  text-align: center;
}

.btn {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  font-family: var(--sans-body);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 6px;
  transition: background 0.2s;
  border: 1.5px solid transparent;
}

.btn:hover {
  background: var(--navy-hover);
}

/* ── Footer ──────────────────────────────────── */

footer {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 2.5rem;
}

footer .inner {
  max-width: var(--max-content);
  margin: 0 auto;
  text-align: center;
  font-size: 0.78rem;
  color: var(--grey);
}

footer a {
  color: var(--grey);
  text-decoration: none;
}

footer a:hover {
  color: var(--body-text);
}

/* ── Privacy page (dark) ─────────────────────── */

body.dark-page {
  background: var(--dark-bg);
}

body.dark-page .flat-header {
  background: var(--dark-bg);
}

body.dark-page .site-title-flat,
body.dark-page .flat-nav-link,
body.dark-page .flat-nav-sep,
body.dark-page .flat-nav-links,
body.dark-page .lang-flat {
  color: #ffffff;
}

body.dark-page .flat-lang .lang-dropdown {
  background: var(--dark-bg);
  border-color: #333;
}

body.dark-page .flat-lang .lang-dropdown a {
  color: #ffffff;
}

body.dark-page .flat-lang .lang-dropdown a:hover {
  background: #1a1f27;
}

body.dark-page p,
body.dark-page p.callout {
  color: #ffffff;
}

body.dark-page a.inline-link {
  color: #ffffff;
}

body.dark-page .btn {
  background: #ffffff;
  color: var(--dark-bg);
  border-color: #ffffff;
}

body.dark-page .btn:hover {
  background: #e8e8e8;
  color: var(--dark-bg);
}

body.dark-page footer {
  border-top-color: #333;
}

body.dark-page footer .inner span,
body.dark-page footer .inner {
  color: #888;
}

/* ── Index page ──────────────────────────────── */

body.index-page {
  background: var(--dark-bg);
}

body.index-page .flat-header {
  background: transparent;
}

body.index-page .site-title-flat,
body.index-page .flat-nav-link,
body.index-page .flat-nav-sep,
body.index-page .flat-nav-links,
body.index-page .lang-flat {
  color: #ffffff;
}

body.index-page .flat-lang .lang-dropdown {
  background: var(--dark-bg);
  border-color: #333;
}

body.index-page .flat-lang .lang-dropdown a {
  color: #ffffff;
}

body.index-page .flat-lang .lang-dropdown a:hover {
  background: #1a1f27;
}

.index-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding: 14vh 2.5rem 0;
}

.index-container {
  max-width: var(--max-content);
  margin: 0 auto;
  width: 100%;
}

.index-tagline {
  font-family: var(--sans-title);
  font-size: clamp(2rem, 7.2vw, 3.8rem);
  font-weight: 400;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 0;
  letter-spacing: 0.01em;
}

.index-cta {
  margin-top: 5rem;
  text-align: center;
  max-width: var(--max-content);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

body.index-page .btn {
  background: transparent;
  color: #ffffff;
  border: 1.5px solid #ffffff;
}

body.index-page .btn:hover {
  background: rgba(255,255,255,0.1);
}

/* ── Share page ──────────────────────────────── */

.share-message {
  text-align: center;
  font-size: 1.1rem;
  margin-top: 2rem;
  margin-bottom: 2.5rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.share-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.share-buttons .btn {
  min-width: 14rem;
  text-align: center;
  padding: 0.5rem 1.25rem;
  /* Normalise button vs anchor rendering so all three buttons match */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  line-height: 1;
  box-sizing: border-box;
  font-family: var(--sans-body);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
}

/* Hide the "Pass it on" (native share) button on desktop. The Web Share API
   exists on some desktop browsers (Mac Safari, Chrome) but the button is
   primarily a mobile/tablet pattern. On desktop, users have Copy link, Email,
   and QR — all reliable. The button is revealed at narrower widths via the
   media query at the bottom of this file. */
.share-buttons #shareBtn {
  display: none;
}

.share-qr {
  text-align: center;
  margin-top: 0;
}

.share-qr img {
  width: 180px;
  height: 180px;
  display: block;
  margin: 0.5rem auto 0;
}

.share-qr-label {
  font-size: 0.85rem;
  color: var(--grey);
  margin-bottom: 0;
}

.copied-msg {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--grey);
  min-height: 1.2rem;
}

@media (max-width: 800px) {
  /* Below 800px we treat the visitor as on phone/narrow tablet:
     show the Pass it on button (relies on Web Share API)
     hide the QR code (you can't scan your own screen) */
  .share-buttons #shareBtn { display: inline-flex; }
  .share-qr { display: none; }
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  main { padding: 1.25rem 1.25rem 3rem; }
  .container > p:first-child { margin-top: 0.75rem; }
  footer { padding: 1.25rem; }
  .index-main { padding: 8vh 1.25rem 0; }
  /* Drop the content indent on mobile — every horizontal pixel matters here */
  main.indented-content .container { padding-left: 0; padding-right: 0; }
}
