/* ==========================================================================
   Australiawide Mercantile Agency - modern stylesheet (2026 rebuild)
   Mobile-first, responsive, WCAG 2.1 AA. No framework, no jQuery.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */
:root {
  /* Brand palette. Navy pulled from the existing logo/header treatment.
     All text/background pairings below meet WCAG AA (>=4.5:1). */
  --c-navy-900: #0a2540;
  --c-navy-800: #103254;
  --c-navy-700: #17456f;
  --c-accent:   #006f82;   /* 5.8:1 on white -- brand teal (from logo.png) */
  --c-accent-d: #004754;   /* hover -- 10.4:1 on white */
  --c-ink:      #1f2933;   /* 14.8:1 on white */
  --c-ink-soft: #52606d;   /*  7.0:1 on white */
  --c-line:     #d9e0e6;
  --c-bg:       #ffffff;
  --c-bg-alt:   #f4f7f9;
  --c-bg-dark:  #004754;   /* teal (was navy #0a2540) */
  --c-ok:       #1a6b2a;
  --c-err:      #a3241c;
  --c-focus:    #b45309;

  --f-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Fluid type scale */
  --t-xs:   0.8125rem;
  --t-sm:   0.9375rem;
  --t-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --t-lg:   clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --t-xl:   clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --t-2xl:  clamp(1.75rem, 1.45rem + 1.4vw, 2.5rem);
  --t-3xl:  clamp(2rem, 1.55rem + 2.2vw, 3.25rem);

  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 3rem;     --sp-8: 4rem;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-1: 0 1px 2px rgba(10,37,64,.06), 0 2px 8px rgba(10,37,64,.06);
  --shadow-2: 0 4px 12px rgba(10,37,64,.10), 0 12px 28px rgba(10,37,64,.08);
  --wrap: 1180px;
  --transition: 160ms ease;
}

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--sp-4); color: var(--c-navy-900); font-weight: 700; }
h1 { font-size: var(--t-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--t-2xl); letter-spacing: -0.01em; }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }
p  { margin: 0 0 var(--sp-4); }
a  { color: var(--c-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--c-accent-d); }
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Utilities ---------------------------------------------------------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: 0;
  background: var(--c-navy-900); color: #fff; padding: var(--sp-3) var(--sp-5);
  border-radius: 0 0 var(--radius) var(--radius); z-index: 200;
  transform: translateY(-100%);
  transition: transform var(--transition);
}
.skip-link:focus { transform: translateY(0); color: #fff; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--alt { background: var(--c-bg-alt); }
.lede { font-size: var(--t-lg); color: var(--c-ink-soft); max-width: 60ch; }

/* --- Header / nav ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c-line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); padding-block: var(--sp-3); flex-wrap: nowrap;
}
.brand { display: flex; align-items: center; text-decoration: none; flex: 1 1 auto; min-width: 0; }
.brand img { width: auto; max-width: 320px; height: auto; flex-shrink: 1; min-width: 0; }
@media (max-width: 30em) { .brand img { max-width: 220px; } }
@media (max-width: 23em) { .brand img { max-width: 180px; } }

.nav-toggle {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: none; border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3); font: inherit; font-size: var(--t-sm);
  color: var(--c-navy-900); cursor: pointer; min-height: 44px; flex-shrink: 0;
  white-space: nowrap;
}
.nav-toggle:hover { background: var(--c-bg-alt); }
.nav-toggle svg { width: 22px; height: 22px; fill: currentColor; }

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--sp-1);
}
.site-nav a {
  display: block; padding: var(--sp-3) var(--sp-3);
  color: var(--c-navy-900); text-decoration: none; font-weight: 600;
  font-size: var(--t-sm); border-radius: var(--radius); min-height: 44px;
}
.site-nav a:hover { background: var(--c-bg-alt); color: var(--c-accent-d); }
.site-nav a[aria-current="page"] {
  color: #fff; background: var(--c-accent); font-weight: 700;
}
.site-nav a[aria-current="page"]:hover { background: var(--c-accent-d); color: #fff; }

/* Mobile drawer */
@media (max-width: 61.99em) {
  .site-nav {
    display: none;
    position: absolute; inset-inline: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--c-line);
    box-shadow: var(--shadow-2); padding: var(--sp-3) 1.25rem var(--sp-5);
  }
  .site-nav.is-open { display: block; }
}
@media (min-width: 62em) {
  .nav-toggle { display: none; }
  .site-nav ul { flex-direction: row; align-items: center; gap: 0; flex-wrap: wrap; justify-content: flex-end; }
  .site-nav a { padding: var(--sp-2) var(--sp-3); }
}
@media (min-width: 62em) and (max-width: 74.9em) {
  .header-inner { gap: var(--sp-3); }
  .site-nav a { padding: var(--sp-2) 0.6rem; font-size: var(--t-xs); }
}

/* --- Hero --------------------------------------------------------------- */
.hero {
  --hero-img: url('../images/main.jpg');
  position: relative; color: #fff;
  background: linear-gradient(180deg, rgba(10,37,64,.86), rgba(10,37,64,.78)), var(--hero-img, var(--c-navy-900));
  background-size: cover; background-position: center;
}
.hero-inner { padding-block: clamp(3rem, 9vw, 6.5rem); max-width: 46rem; }
.hero h1 { color: #fff; margin-bottom: var(--sp-4); }
.hero p  { font-size: var(--t-lg); color: #e6eef5; margin-bottom: var(--sp-5); }
.hero--sub .hero-inner { padding-block: clamp(2.25rem, 6vw, 3.75rem); }
.hero--sub h1 { font-size: var(--t-2xl); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  background: var(--c-accent); color: #fff; text-decoration: none;
  font-weight: 600; font-size: var(--t-sm);
  padding: var(--sp-3) var(--sp-5); border: 0; border-radius: var(--radius);
  min-height: 46px; cursor: pointer; transition: background var(--transition);
}
.btn:hover { background: var(--c-accent-d); color: #fff; }
.btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.65); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* --- Cards / grid ------------------------------------------------------- */
.grid { display: grid; gap: var(--sp-5); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 62em) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 40em) { .grid--3 { grid-template-columns: 1fr; } }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }

.card {
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  padding: var(--sp-5); box-shadow: var(--shadow-1);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card h3 { font-size: var(--t-lg); margin-bottom: var(--sp-3); }
.card p:last-child { margin-bottom: 0; }
.card-icon {
  width: 44px; height: 44px; margin-bottom: var(--sp-4);
  color: var(--c-accent); background: #e8f1f9;
  border-radius: var(--radius); padding: 9px;
}
.card-icon svg { width: 100%; height: 100%; fill: currentColor; display: block; }

/* Stats */
.stats { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.stat { text-align: center; padding: var(--sp-4); }
.stat dt { font-size: var(--t-sm); color: var(--c-ink-soft); order: 2; }
.stat dd {
  margin: 0; order: 1; font-size: var(--t-2xl); font-weight: 700;
  color: var(--c-accent); line-height: 1.1;
}
.stat { display: flex; flex-direction: column; }

/* Person */
.person { border-left: 3px solid var(--c-accent); padding-left: var(--sp-5); }
.person h3 { margin-bottom: var(--sp-1); }
.person .role { color: var(--c-accent-d); font-weight: 600; font-size: var(--t-sm); margin-bottom: var(--sp-3); }

/* Lists */
.list-check { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; gap: var(--sp-3); }
.list-check li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.list-check svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: .25rem; fill: var(--c-accent); }

/* Doc links */
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.doc-list a {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5); background: #fff;
  border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  text-decoration: none; color: var(--c-navy-900); font-weight: 600;
  box-shadow: var(--shadow-1); transition: border-color var(--transition), box-shadow var(--transition);
}
.doc-list a:hover { border-color: var(--c-accent); box-shadow: var(--shadow-2); }
.doc-list svg { flex: 0 0 auto; width: 26px; height: 26px; fill: var(--c-accent); }
.doc-list .meta { display: block; font-weight: 400; font-size: var(--t-xs); color: var(--c-ink-soft); }

/* --- Forms -------------------------------------------------------------- */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-weight: 600; font-size: var(--t-sm); margin-bottom: var(--sp-2); }
.field .req { color: var(--c-err); }
.field input, .field textarea {
  width: 100%; padding: var(--sp-3); font: inherit; font-size: var(--t-base);
  color: var(--c-ink); background: #fff;
  border: 1px solid #9aa5b1; border-radius: var(--radius);
  min-height: 46px;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--c-accent); }
.form-status { min-height: 1.5em; font-weight: 600; margin-top: var(--sp-3); }
.form-status.is-ok  { color: var(--c-ok); }
.form-status.is-err { color: var(--c-err); }
.cf-turnstile { margin-block: var(--sp-4); max-width: 100%; overflow: hidden; }

/* Contact details */
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); }
.contact-list li { display: flex; gap: var(--sp-4); align-items: flex-start; min-width: 0; }
.contact-list li > span { min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.contact-list svg { flex: 0 0 auto; width: 22px; height: 22px; fill: var(--c-accent); margin-top: .2rem; }
.contact-list .label { display: block; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--c-ink-soft); }

.map-embed { border: 1px solid var(--c-line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.map-embed iframe { display: block; width: 100%; height: 320px; border: 0; }

/* --- Footer ------------------------------------------------------------- */
.site-footer { background: var(--c-bg-dark); color: #c8d6e2; padding-block: var(--sp-7) var(--sp-5); margin-top: var(--sp-7); }
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.footer-grid > div { min-width: 0; }
.site-footer h2 { color: #fff; font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--sp-4); }
.site-footer a { color: #c8d6e2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); min-width: 0; }
.site-footer li { overflow-wrap: break-word; word-break: break-word; min-width: 0; }
.site-footer a { overflow-wrap: break-word; word-break: break-word; }
.footer-bottom {
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,.14);
  display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between;
  font-size: var(--t-xs); color: #9fb3c8;
}
.badges { display: flex; gap: var(--sp-4); align-items: center; flex-wrap: wrap; }
.badges img { height: 46px; width: auto; background: #fff; padding: 4px; border-radius: var(--radius); }

/* --- Print -------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .hero, .nav-toggle { display: none !important; }
  body { color: #000; }
}
