/* ===============================
   CORE LAYOUT / GLOBAL
   Trade Near Me — layout.css
================================ */

:root { --container: 1100px; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--tnm-font);
  background: var(--tnm-bg);
  color: var(--tnm-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sticky footer for every page: short pages keep the footer at the bottom of the screen.
   Put page content in <main> as a direct child of <body>, with the footer after it. */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > * { flex-shrink: 0; min-width: 0; }
/* Flex stops margin:auto children filling the width, so give them it back (max-width still applies). */
body > main, body > .blog-body {
  flex: 1 0 auto;
  width: -webkit-fill-available;
  width: -moz-available;
  width: stretch;
}
/* Flex also stops this margin merging with the footer's own, which would double the gap. */
body > main > :last-child, body > .blog-body > :last-child { margin-bottom: 0; }

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

.small-muted {
  color: var(--tnm-muted);
  margin-top: 8px;
}

/* ===============================
   HEADER / NAV
================================ */
header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--tnm-card);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 56px;
  display: block;
}

.brand-text strong {
  font-size: 1rem;
  color: var(--tnm-primary);
}

nav.site-nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

nav.site-nav a {
  text-decoration: none;
  color: var(--tnm-text);
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
}

nav.site-nav a:hover {
  background: rgba(3,102,214,0.06);
  color: var(--tnm-primary);
}

.right-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-signin {
  background: transparent;
  border: 1px solid var(--tnm-primary);
  color: var(--tnm-primary);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.btn-signin:hover {
  background: var(--tnm-primary);
  color: #fff;
}

@media (max-width: 820px) {
  nav.site-nav { display: none; }
}

/* ===============================
   MAIN
================================ */
main {
  background: var(--tnm-bg);
  padding: 24px 0;
}

.page-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--tnm-primary);
  margin: 24px 0 16px;
}

/* ===============================
   FOOTER
================================ */
footer.site-footer {
  background: #f3f4f6;
  border-top: 1px solid #e5e7eb;
  margin-top: 40px;
  padding: 20px 18px;
  font-size: 0.85rem;
  color: var(--tnm-muted);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.footer-links a {
  text-decoration: none;
  font-weight: 600;
  color: var(--tnm-primary);
}

.footer-links a:hover { text-decoration: underline; }

.footer-legal { opacity: 0.8; }

/* ===============================
   GLOBAL MODAL
================================ */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  padding: 16px;
}

.modal[aria-hidden="false"] { display: flex; }

.modal .modal-content {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  position: relative;
}

.modal .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: #f1f5f9;
  color: var(--tnm-text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#leadForm {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

#leadForm input,
#leadForm textarea {
  width: 100%;
  box-sizing: border-box;
}

#leadForm button[type="submit"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 0;
  font-weight: 800;
  background: var(--tnm-primary);
  color: #fff;
  cursor: pointer;
}

body.modal-open { overflow: hidden; }

/* ===============================
   GLOBAL BUTTONS
================================ */
.btn-call {
  background: var(--tnm-primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-call:hover { filter: brightness(0.95); }

.btn-enquire {
  background: var(--tnm-accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-enquire:hover { filter: brightness(0.95); }

/* ===============================
   OLD CARD STYLE (SEO pages)
================================ */
.card {
  background: var(--tnm-card);
  border-radius: var(--tnm-radius);
  padding: 18px;
  box-shadow: 0 6px 20px rgba(2,6,23,0.06);
}

.card h3 {
  margin: 0 0 6px 0;
  color: var(--tnm-primary);
  font-size: 1.1rem;
}

.card p { margin: 8px 0 0 0; line-height: 1.5; }

.card .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ===============================
   ACCESSIBILITY
================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.results-section-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-muted);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #e2e8f0;
}
.results-section-heading--secondary {
  margin-top: 2rem;
}

.abn-verified-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #0366d6;
  background: rgba(3,102,214,0.08);
  border: 1px solid rgba(3,102,214,0.2);
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.emergency-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #cc0000;
  background: rgba(204,0,0,0.07);
  border: 1px solid rgba(204,0,0,0.2);
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

#listingsContainer { display: flex; flex-direction: column; gap: 10px; }
.listing-card { background: #fff; border-radius: 12px; border: 1px solid #e8edf2; box-shadow: 0 1px 6px rgba(2,6,23,0.05); overflow: hidden; cursor: pointer; transition: box-shadow 0.15s; position: relative; }
.listing-card:hover { box-shadow: 0 4px 16px rgba(2,6,23,0.1); }
.listing-card-accent { height: 3px; width: 100%; }
.listing-card-main { display: flex; align-items: flex-start; padding: 12px 12px 8px 12px; gap: 10px; }
.listing-icon-badge { width: 36px; height: 36px; min-width: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.listing-body { flex: 1; min-width: 0; }
.listing-title-row { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; flex-wrap: wrap; }
.listing-title { font-size: 0.95rem; font-weight: 800; color: var(--tnm-text); margin: 0; line-height: 1.2; }
.verified-tick { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; background: #10b981; border-radius: 50%; flex-shrink: 0; }
.verified-tick svg { width: 10px; height: 10px; }
.listing-cat-pill { display: inline-block; background: rgba(3,102,214,0.08); color: var(--tnm-primary); font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-bottom: 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background 0.15s; }
.listing-cat-pill.expanded { background: rgba(3,102,214,0.14); white-space: normal; overflow: visible; text-overflow: unset; max-width: 100%; }
.listing-location { display: block; font-size: 0.72rem; color: var(--tnm-muted); font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-expand-hint { display: block; font-size: 0.7rem; color: var(--tnm-primary); font-weight: 700; margin-top: 5px; }
.listing-actions-row { display: flex; gap: 8px; padding: 0 12px 12px 12px; }
.listing-drawer { display: none; border-top: 1px solid #f0f4f8; }
.listing-drawer.open { display: block; }
.drawer-inner { padding: 10px 12px 12px 58px; }
.drawer-location { font-size: 0.78rem; color: var(--tnm-muted); font-weight: 600; margin: 0 0 6px 0; }
.drawer-desc { font-size: 0.83rem; color: #374151; line-height: 1.6; margin: 0; }
@media (min-width: 600px) {
  .listing-card { display: flex; flex-direction: row; align-items: center; }
  .listing-card-accent { position: absolute; width: 3px; height: 100%; top: 0; left: 0; }
  .listing-card-inner { flex: 1; display: flex; flex-direction: column; padding-left: 3px; }
  .listing-card-main { padding-bottom: 12px; }
  .listing-actions-row { flex-direction: column; width: 120px; min-width: 120px; padding: 14px 12px; gap: 8px; border-left: 1px solid #f0f4f8; flex-shrink: 0; align-self: center; }
}
@media (max-width: 400px) {
  .listing-card-main { padding: 10px 10px 6px 10px; gap: 8px; }
  .listing-icon-badge { width: 32px; height: 32px; min-width: 32px; font-size: 1rem; }
  .listing-title { font-size: 0.88rem; }
  .listing-actions-row { padding: 0 10px 10px 10px; gap: 6px; }
  .drawer-inner { padding: 10px 10px 12px 50px; }
}
/* Tradie of the Day */
#tradieOfDay:empty { display: none; }
.tod-band {
  margin-bottom: 16px;
  border-radius: 14px;
  padding: 3px;
  background: linear-gradient(120deg, var(--tnm-accent), #ff8a3e);
  box-shadow: 0 6px 22px rgba(255,77,62,0.22);
}
.tod-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 10px 14px;
  color: #fff;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.tod-label .tod-star { font-size: 1.05rem; line-height: 1; }
.tod-band .listing-card {
  border-radius: 11px;
  border: none;
  box-shadow: 0 2px 10px rgba(2,6,23,0.06);
}

/* Listing card badges (2026-11-09). Hub pages had no badge styles, so ABN / licence / emergency badges showed as
   plain text and could be cut off. On phones the name and tick keep the first line and the badges wrap underneath. */
.seo-listing-card .card-title-row { flex-wrap: wrap; }
.seo-listing-card .card-title { min-width: 0; overflow-wrap: anywhere; }
.seo-listing-card .card-abn,
.seo-listing-card .card-emerg { display: inline-flex; align-items: center; font-size: 0.62rem; font-weight: 700; border-radius: 999px; padding: 2px 7px; white-space: nowrap; flex-shrink: 0; }
.seo-listing-card .card-abn { color: #0366d6; background: rgba(3,102,214,0.08); border: 1px solid rgba(3,102,214,0.2); }
.seo-listing-card .card-emerg { color: #cc0000; background: rgba(204,0,0,0.07); border: 1px solid rgba(204,0,0,0.2); }
@media (max-width: 640px) {
  .seo-listing-card .card-title-row::after,
  .listing-card .listing-title-row::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
  .seo-listing-card .card-title-row .card-abn,
  .seo-listing-card .card-title-row .card-emerg,
  .listing-card .listing-title-row .abn-verified-badge,
  .listing-card .listing-title-row .emergency-badge { order: 2; }
  .listing-card .listing-title { min-width: 0; overflow-wrap: anywhere; }
}

/* Paid plans (2026-11-24): pricing.html and the "Your plan" card on account.html. Monthly is the default;
   [data-plans][data-interval="year"] switches every price to yearly. Pill buttons, brand colours only. */
.plans-wrap { max-width: 1040px; margin: 0 auto; }
.plans-free { text-align: center; font-size: clamp(1.3rem, 3.4vw, 1.9rem); font-weight: 900; color: #0a1628; margin: 4px 0 6px; }
.plans-sub { text-align: center; color: var(--tnm-muted); max-width: 560px; margin: 0 auto 18px; line-height: 1.55; }
.plans-toggle { display: flex; justify-content: center; gap: 4px; background: #eef2f7; border-radius: 999px; padding: 4px; width: max-content; max-width: 100%; margin: 0 auto 18px; }
.plans-toggle button { border: none; background: transparent; border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 0.88rem; color: var(--tnm-muted); cursor: pointer; font-family: inherit; }
.plans-toggle button[aria-pressed="true"] { background: #fff; color: #0a1628; box-shadow: 0 1px 4px rgba(2,6,23,0.12); }
.plans-toggle .plans-save { color: #10b981; font-weight: 800; }
.plans-founding { background: #0a1628; color: #fff; border-radius: 14px; padding: 16px 18px; margin: 0 0 18px; line-height: 1.55; }
.plans-founding strong { color: #ff6b57; }
.plans-founding .plans-count { display: block; margin-top: 6px; font-weight: 800; color: #10b981; }
.plans-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 860px) { .plans-grid { grid-template-columns: repeat(3, 1fr); } }
.plan-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; box-shadow: 0 2px 10px rgba(2,6,23,0.05); }
.plan-card h2, .plan-card h3 { margin: 0 0 4px; font-size: 1.15rem; font-weight: 900; color: #0a1628; }
.plan-card.is-current { border: 2px solid #0366d6; }
.plan-price { font-size: 1.7rem; font-weight: 900; color: #0366d6; margin: 6px 0 2px; }
.plan-price small { font-size: 0.85rem; font-weight: 700; color: var(--tnm-muted); }
.plan-note { font-size: 0.8rem; color: var(--tnm-muted); margin: 0 0 10px; }
.plan-includes { font-size: 0.85rem; font-weight: 800; color: #0a1628; margin: 6px 0 4px; }
.plan-list { margin: 0 0 14px; padding-left: 20px; font-size: 0.9rem; line-height: 1.55; color: #374151; flex: 1; }
.plan-list li { margin: 3px 0; }
.price-year { display: none; }
[data-plans][data-interval="year"] .price-month { display: none; }
[data-plans][data-interval="year"] .price-year { display: inline; }
.plan-cta { display: inline-flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; border: none; border-radius: 999px; padding: 12px 18px; font-weight: 800; font-size: 0.92rem; text-decoration: none; background: #ff4d3e; color: #fff; cursor: pointer; font-family: inherit; text-align: center; }
.plan-cta:hover { filter: brightness(0.95); }
.plan-cta.is-disabled, .plan-cta[disabled], .plan-cta[aria-disabled="true"] { background: #e5e7eb; color: #64748b; cursor: not-allowed; filter: none; }
.plan-cta--quiet { background: #fff; color: #0366d6; border: 2px solid #0366d6; }
.plan-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: 0.75rem; font-weight: 800; background: rgba(3,102,214,0.1); color: #0366d6; }
.plan-badge--paid { background: rgba(16,185,129,0.12); color: #047857; }
.plans-faq { max-width: 720px; margin: 28px auto 0; }
.plans-faq h2 { font-size: 1.2rem; font-weight: 900; color: #0a1628; margin: 0 0 10px; }
.plans-faq details { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 14px; margin: 0 0 8px; }
.plans-faq summary { font-weight: 800; color: #0a1628; cursor: pointer; }
.plans-faq details p { margin: 8px 0 0; color: #374151; line-height: 1.55; }
.policy-body { max-width: 720px; }
.policy-body h2 { font-size: 1.1rem; font-weight: 900; color: #0a1628; margin: 22px 0 6px; }
.policy-body p { line-height: 1.65; color: #374151; }
