/* ==========================================================================
   Michigan Towing Association -- Site Design System
   ========================================================================== */

:root {
  --navy-950: #0a1f3d;
  --navy-900: #0d2a52;
  --navy-800: #123765;
  --navy-700: #1a4a86;
  --navy-100: #e7edf6;
  --red-700: #b3122a;
  --red-600: #c8102e;
  --red-500: #dc2a44;
  --gray-900: #1b2430;
  --gray-700: #4a5568;
  --gray-500: #7a8699;
  --gray-200: #e3e7ee;
  --gray-100: #f4f6fa;
  --white: #ffffff;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;

  --container-w: 1180px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(10, 31, 61, 0.08), 0 1px 2px rgba(10, 31, 61, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 31, 61, 0.12);
  --shadow-lg: 0 20px 48px rgba(10, 31, 61, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--red-600); }

h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 800; line-height: 1.15; color: var(--navy-950); margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.85rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--red-600); }

p { margin: 0 0 1.1em; color: var(--gray-700); }

.container { max-width: var(--container-w); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-600);
  margin-bottom: 0.6em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--red-600); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--red-700); color: var(--white); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,0.6); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,0.12); color: var(--white); border-color: var(--white); }
.btn-navy { background: var(--navy-900); color: var(--white); }
.btn-navy:hover { background: var(--navy-950); color: var(--white); }
.btn-sm { padding: 0.6em 1.2em; font-size: 0.85rem; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy-950); color: var(--white); padding: 12px 20px; z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Utility bar ---------- */
.utility-bar {
  background: var(--navy-950);
  color: rgba(255,255,255,0.85);
  font-size: 0.83rem;
}
.utility-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}
.utility-links { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.utility-links a { color: rgba(255,255,255,0.85); display: inline-flex; align-items: center; gap: 6px; }
.utility-links a:hover { color: var(--white); }
.utility-social { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; }
.utility-social a {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.utility-social a:hover { background: var(--red-600); }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 500;
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 24px;
}
.site-header .nav-row { padding-left: 32px; padding-right: 32px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; padding-left: 4px; margin-right: 12px; }
.brand img { height: 50px; width: auto; }
.brand-text { line-height: 1.2; white-space: nowrap; }
.brand-text strong { display: block; font-size: 0.98rem; color: var(--navy-950); font-weight: 800; }
.brand-text span { display: none; }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}
.main-nav a {
  display: inline-block;
  padding: 10px 11px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--navy-900);
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { background: var(--navy-100); color: var(--navy-950); }
.main-nav .nav-cta { background: var(--red-600); color: var(--white); margin-left: 6px; }
.main-nav .nav-cta:hover { background: var(--red-700); color: var(--white); }

/* Dropdown */
.main-nav .has-dropdown { position: relative; }
.main-nav .has-dropdown > a::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
  margin-bottom: 1px;
}
.main-nav .dropdown {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 170px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 50;
}
.main-nav .has-dropdown:hover .dropdown,
.main-nav .has-dropdown:focus-within .dropdown {
  display: block;
}
.main-nav .dropdown a {
  display: block;
  padding: 9px 12px;
  font-size: 0.88rem;
  border-radius: 6px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy-950);
  position: relative;
  transition: 0.2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--white);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(10,31,61,0.94) 0%, rgba(10,31,61,0.82) 42%, rgba(10,31,61,0.55) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  padding-top: 96px;
  padding-bottom: 84px;
  max-width: 640px;
}
.hero h1 { color: var(--white); margin-bottom: 0.4em; }
.hero .lede { color: rgba(255,255,255,0.88); font-size: 1.1rem; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.hero-stats {
  position: relative; z-index: 2;
  display: flex; gap: 40px; flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.hero-stats .stat strong { display: block; font-size: 1.8rem; font-weight: 800; color: var(--white); }
.hero-stats .stat span { font-size: 0.82rem; color: rgba(255,255,255,0.75); text-transform: uppercase; letter-spacing: 0.05em; }

/* small page hero (interior pages) */
.page-hero {
  position: relative;
  color: var(--white);
  background: linear-gradient(120deg, var(--navy-950), var(--navy-800));
  background-size: cover;
  background-position: center;
}
.page-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(10,31,61,0.92), rgba(10,31,61,0.72));
}
.page-hero-inner { position: relative; z-index: 2; padding-top: 56px; padding-bottom: 56px; }
.page-hero h1 { color: var(--white); margin: 0; }
.breadcrumb { font-size: 0.82rem; color: rgba(255,255,255,0.7); margin-bottom: 10px; }
.breadcrumb a { color: rgba(255,255,255,0.7); }
.breadcrumb a:hover { color: var(--white); }

/* ---------- Brand strip (large logo) ---------- */
.brand-strip {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  text-align: center;
  padding: 48px 32px;
}
.brand-strip img { height: 140px; width: auto; margin: 0 auto 18px; }
.brand-strip h2 { margin-bottom: 0.2em; }
.brand-strip p { color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; margin-bottom: 0; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-navy { background: var(--navy-950); color: var(--white); }
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy p { color: rgba(255,255,255,0.8); }
.section-gray { background: var(--gray-100); }

.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Layout helpers ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: start;
}
.layout .main-col { min-width: 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.benefit-card { padding: 26px 24px; }
.benefit-card .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--navy-100);
  color: var(--navy-800);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 16px;
}
.benefit-card h3 { font-size: 1.05rem; margin-bottom: 0.4em; }
.benefit-card p { font-size: 0.92rem; margin-bottom: 0; }

/* ---------- Join page intro (text + image) ---------- */
.join-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 40px;
  align-items: start;
}
.join-intro-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  justify-self: end;
}
@media (max-width: 900px) {
  .join-intro { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 640px) {
  .join-intro { grid-template-columns: 1fr; }
  .join-intro-img { max-width: 300px; margin: 0 auto; justify-self: center; }
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar .widget {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
}
.sidebar .widget h4 { margin-bottom: 0.8em; }
.sidebar .widget-navy {
  background: var(--navy-950);
  border-color: var(--navy-950);
  color: var(--white);
}
.sidebar .widget-navy h4 { color: var(--white); }
.sidebar .widget-navy p { color: rgba(255,255,255,0.75); }
.sidebar .widget img { border-radius: 6px; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.link-list a { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.92rem; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--red-700), var(--red-600));
  color: var(--white);
  text-align: center;
  padding: 64px 0;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: rgba(255,255,255,0.9); max-width: 560px; margin-left: auto; margin-right: auto; }

/* ---------- Resource lists (member resources / links pages) ----------
   Deliberately NOT <table> markup: the MembershipWorks mfl.js widget
   embedded on these pages scans the whole document and force-hides any
   <table> element it finds, not just its own. Divs sidestep that. */
.resource-list { margin: 0 0 8px; border-top: 1px solid var(--gray-200); }
.resource-list .resource-row { padding: 12px 14px; border-bottom: 1px solid var(--gray-200); font-size: 0.95rem; }
.resource-list .resource-row:hover { background: var(--gray-100); }
.resource-list .resource-row a { font-weight: 600; display: block; }

/* ---------- Board member grid ---------- */
.board-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--white);
}
.board-card .role {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red-600);
  background: rgba(200,16,46,0.08);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.board-card h3 { margin-bottom: 2px; font-size: 1.08rem; }
.board-card .company { font-weight: 600; color: var(--gray-900); font-size: 0.92rem; margin-bottom: 6px; }
.board-card address { font-style: normal; font-size: 0.88rem; color: var(--gray-500); line-height: 1.5; }
.board-card .phone { display: inline-block; margin-top: 8px; font-weight: 700; color: var(--navy-800); font-size: 0.9rem; }

/* ---------- Member-gated notice ---------- */
.gated-notice {
  border: 1px dashed var(--navy-700);
  background: var(--navy-100);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.gated-notice .icon { font-size: 1.3rem; color: var(--navy-800); }
.gated-notice strong { display: block; color: var(--navy-950); margin-bottom: 2px; }
.gated-notice p { margin: 0; font-size: 0.92rem; color: var(--navy-800); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: rgba(255,255,255,0.75); }
.footer-top { padding: 56px 32px 36px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-col h4 { color: var(--white); font-size: 0.85rem; margin-bottom: 1em; }
.footer-col p { color: rgba(255,255,255,0.6); font-size: 0.9rem; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-left: 2px; }
.footer-brand img { height: 44px; }
.footer-brand strong { color: var(--white); font-size: 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col ul a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-col ul a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 32px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: rgba(255,255,255,0.75); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--navy-950);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.2s;
  z-index: 400;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--red-600); color: var(--white); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1150px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 12px; gap: 2px; }
  .main-nav a { white-space: normal; font-size: 0.95rem; padding: 12px 14px; }
  .main-nav .nav-cta { margin-left: 0; text-align: center; }
  .main-nav .dropdown {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--gray-200);
    margin: 2px 0 6px 14px;
    padding: 0;
  }
  .main-nav .dropdown a { padding: 10px 14px; font-size: 0.9rem; }
}

@media (max-width: 760px) {
  .utility-bar .utility-links { display: none; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 64px; padding-bottom: 56px; }
  .hero-stats { gap: 28px; }
  .section { padding: 52px 0; }
}
