/* =====================================================================
   1099TaxHelper.com — Mobile-First Responsive Stylesheet
   ---------------------------------------------------------------------
   Loads AFTER each page's inline <style> block, so these rules win the
   cascade for equal/greater specificity. Mobile is the default; layout
   expands at 481px and 768px.
   ===================================================================== */

/* ---------- 1. Global resets ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
  line-height: 1.6;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;          /* kill horizontal scroll on every device */
  max-width: 100%;
}

img, svg, video, iframe, picture {
  max-width: 100%;
  height: auto;
}

/* Long URLs in source lists / footnotes never break the layout */
a, p, li, td, summary, .lead, .source-list a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Tap-friendly link targets everywhere */
a {
  text-underline-offset: 2px;
}

/* ---------- 2. MOBILE FIRST (≤ 480px) — base styles ---------- */

/* --- Top nav: stack on tiny screens, big tap targets --- */
nav.top {
  padding: 10px 14px !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 8px !important;
}
nav.top a.brand {
  font-size: 16px !important;
  min-height: 44px;
  display: flex;
  align-items: center;
}
nav.top .links {
  display: flex !important;
  flex-wrap: wrap !important;
  width: 100%;
  gap: 4px 14px !important;
  font-size: 15px !important;
}
nav.top .links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 2px;
}

/* --- Main column --- */
main {
  max-width: 100% !important;
  padding: 20px 16px 48px !important;
}

/* --- Hero --- */
.hero {
  margin: 0 -16px !important;
  padding: 28px 16px 24px !important;
}
.badge {
  font-size: 11px !important;
  padding: 4px 10px !important;
}

/* --- Typography --- */
h1 {
  font-size: clamp(1.5rem, 7vw, 2rem) !important;
  line-height: 1.2 !important;
  margin: 0 0 14px !important;
}
h2 {
  font-size: 1.25rem !important;
  line-height: 1.25 !important;
  margin: 28px 0 10px !important;
}
h3 {
  font-size: 1.05rem !important;
  margin: 20px 0 8px !important;
}
p, li {
  font-size: 16px;
  line-height: 1.6;
}
.lead {
  font-size: 1rem !important;
  line-height: 1.55 !important;
}

/* --- Calculator card: stack everything, big touch inputs --- */
.calc {
  padding: 18px !important;
  margin: 18px 0 !important;
  border-radius: 14px;
}
.calc h2 { margin-top: 0 !important; }
.calc .row {
  display: block !important;          /* override 2-col grid on mobile */
  grid-template-columns: 1fr !important;
  gap: 0 !important;
}
.calc .row > div + div { margin-top: 12px; }

.calc label {
  display: block;
  font-size: 14px !important;
  font-weight: 600;
  margin: 14px 0 6px !important;
  color: #334155;
}

.calc input,
.calc select,
.calc textarea,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100% !important;
  min-height: 48px;                   /* ≥44px tap target */
  padding: 12px 14px !important;
  font-size: 16px !important;        /* prevents iOS zoom on focus */
  line-height: 1.4;
  border: 1px solid #cbd5e1;
  border-radius: 10px !important;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}
.calc input:focus,
.calc select:focus,
.calc textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5,150,105,.25);
}

/* --- Result + breakdown --- */
.result {
  padding: 16px !important;
  margin-top: 16px !important;
  border-radius: 12px;
}
.result .label { font-size: 11px !important; }
.result .value {
  font-size: 1.75rem !important;
  line-height: 1.15;
  margin: 4px 0 !important;
  word-break: break-word;
}
.result .sub { font-size: 13px !important; line-height: 1.45; }

.breakdown { font-size: 14px !important; }
.breakdown div {
  display: flex !important;
  justify-content: space-between !important;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 8px 0 !important;
}

/* --- Buttons / CTAs: easy-to-press --- */
.cta-box,
.callout {
  padding: 18px !important;
  margin: 22px 0 !important;
  border-radius: 12px;
}
.cta-box .btn,
a.btn,
button,
input[type="submit"],
input[type="button"] {
  display: inline-block;
  min-height: 48px;
  line-height: 1.2;
  padding: 14px 22px !important;
  font-size: 16px !important;
  font-weight: 600;
  border-radius: 10px !important;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
@media (max-width: 480px) {
  .cta-box .btn,
  a.btn {
    display: block;
    width: 100%;
  }
}

/* --- FAQ accordions --- */
details {
  border-radius: 10px;
}
details summary {
  padding: 14px 16px !important;
  min-height: 48px;
  font-size: 15px !important;
  line-height: 1.4;
}
details > p {
  padding: 0 16px 16px !important;
  font-size: 15px;
  line-height: 1.55;
}

/* --- Alerts --- */
.alert {
  padding: 14px 16px !important;
  margin: 16px 0 !important;
  font-size: 14px !important;
  line-height: 1.5;
  border-radius: 8px;
}

/* --- Tables: scroll horizontally on small screens --- */
table {
  width: 100% !important;
  font-size: 13px !important;
}
th, td {
  padding: 8px 10px !important;
  line-height: 1.4;
}
@media (max-width: 600px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: normal;
  }
  table tbody, table thead { width: 100%; }
}

/* --- Grids: state list, guide list, tip grid, related pills --- */
.state-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  gap: 8px !important;
  margin: 16px 0 !important;
}
.state-grid a {
  min-height: 56px;
  padding: 10px 12px !important;
  font-size: 13px !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
}

.guide-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  margin: 16px 0 !important;
}
.guide-grid a {
  padding: 14px 16px !important;
  min-height: 64px;
}
.guide-grid a strong { font-size: 15px !important; }
.guide-grid a .desc { font-size: 13.5px !important; }

.tip-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}
.tip-grid .tip { padding: 16px !important; }

.related {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}
.related a {
  min-height: 40px;
  padding: 8px 14px !important;
  display: inline-flex;
  align-items: center;
}

/* --- Checklists --- */
.checklist li {
  padding: 14px 16px !important;
  font-size: 15px;
  line-height: 1.5;
}

/* --- Source list --- */
.source-list li {
  font-size: 14.5px !important;
  line-height: 1.55;
  margin: 10px 0 !important;
}
.source-list .pub { display: inline-block; margin-left: 4px; }

/* --- Footer --- */
footer {
  padding: 24px 16px !important;
  font-size: 13px !important;
  line-height: 1.6;
}
footer a {
  display: inline-block;
  padding: 8px 6px;
  min-height: 36px;
}

/* Avoid global !important poisoning of inline 'style="margin:0 ..."' on
   <p> tags inside footer/callout/cta-box; preserve their inline override. */


/* =====================================================================
   3. BREAKPOINT — 481px and up (large phones / small tablets)
   ===================================================================== */
@media (min-width: 481px) {
  main {
    padding: 26px 20px 56px !important;
  }
  .hero {
    margin: 0 -20px !important;
    padding: 36px 20px 28px !important;
  }
  h1 { font-size: clamp(1.7rem, 5.5vw, 2.25rem) !important; }
  h2 { font-size: 1.4rem !important; }

  .state-grid {
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
  }
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
  .tip-grid {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }

  .cta-box .btn,
  a.btn { width: auto; display: inline-block; }
}


/* =====================================================================
   4. BREAKPOINT — 768px and up (tablets / desktop)
   Restore desktop layout.
   ===================================================================== */
@media (min-width: 768px) {
  nav.top {
    padding: 14px 24px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }
  nav.top .links {
    width: auto;
    font-size: 13px !important;
    gap: 18px !important;
  }
  nav.top .links a { min-height: 0; padding: 0; }

  main {
    max-width: 880px !important;
    padding: 32px 24px 64px !important;
  }
  .hero {
    margin: 0 -24px !important;
    padding: 48px 24px 32px !important;
  }

  h1 { font-size: clamp(1.75rem, 4vw, 2.75rem) !important; }
  h2 { font-size: 1.5rem !important; margin: 40px 0 12px !important; }

  /* Calculator returns to 2-col on desktop */
  .calc .row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
  }
  .calc .row > div + div { margin-top: 0; }

  .calc input,
  .calc select,
  .calc textarea {
    min-height: 44px;
    padding: 11px 14px !important;
  }

  /* Tables back to normal */
  table {
    display: table !important;
    overflow: visible !important;
  }

  /* Grids back to auto-fill */
  .state-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px,1fr)) !important;
  }
  .guide-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px,1fr)) !important;
  }
  .tip-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px,1fr)) !important;
  }
}


/* =====================================================================
   5. Accessibility — respect reduced-motion users
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* =====================================================================
   6. Print — keep the basics readable
   ===================================================================== */
@media print {
  nav.top, footer, .cta-box { display: none !important; }
  main { max-width: 100% !important; padding: 0 !important; }
  .hero { background: none !important; }
}
