/* ===============================
   Base & Reset
================================ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f9f9f9;
  color: #333;
}

/* ===============================
   Layout
================================ */

.container {
  max-width: 520px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Reduce space between header and main content */
main.container {
  margin-top: 20px;
}

/* ===============================
   Header (Ad-safe)
================================ */

.site-header {
  background: transparent;
  border-bottom: none;
  margin: 0;
  padding: 8px 0;
}

/* Reserved space for future ads */
.header-ad-slot {
  min-height: 0;         /* No ad yet */
  width: 100%;
}

/* Header inner */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-nav a {
  font-weight: 500;
  text-decoration: none;
}

/* Logo */
.site-header img {
  height: 38px;
  width: auto;
}

.site-nav a {
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* ===============================
   Header spacing fix
================================ */

.site-header .container {
  margin: 0 auto;
  padding: 0;
}

/* ===============================
   Typography
================================ */

h1 {
  text-align: center;
  font-size: 2rem;
  color: #1a73e8;
  margin-bottom: 10px;
}

h2 {
  color: #1a73e8;
  margin-top: 40px;
  margin-bottom: 15px;
}

h3 {
  color: #1a73e8;
  margin-top: 30px;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 10px 0;
}

.hint {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #777;
  text-align: center;
  font-style: italic;
}

.intro {
  text-align: center;
  margin-bottom: 30px;
  color: #555;
}

/* ===============================
   Forms & Inputs
================================ */

label {
  display: block;
  margin-bottom: 20px;
  font-weight: 600;
}

input[type="number"],
input[type="date"] {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: #1a73e8;
}

/* ===============================
   Select (Dropdowns)
================================ */

select {
  width: 100%;
  margin-top: 6px;
  padding: 12px 40px 12px 12px;
  font-size: 1rem;
  font-family: inherit;
  color: #333;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;

  /* Remove default OS styling */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Custom dropdown arrow */
  background-image:
    linear-gradient(45deg, transparent 50%, #555 50%),
    linear-gradient(135deg, #555 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

select:focus {
  outline: none;
  border-color: #1a73e8;
}

/* Disabled state */
select:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Ensure label spacing consistency */
label select {
  margin-top: 6px;
}

/* ===============================
   Hub & Cross-Navigation Links
================================ */

.hub-link {
  margin: 18px 0 28px;
  font-size: 0.95rem;
  color: #555;
  text-align: center;
}

.hub-link a {
  font-weight: 600;
  color: #1a73e8;
  text-decoration: none;
}

.hub-link a:hover {
  text-decoration: underline;
}

/* ===============================
   Results Box
================================ */

.result {
  margin-top: 25px;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  font-size: 1.05rem;
}

.result p {
  margin: 8px 0;
}

/* ===============================
   Tool List (Homepage)
================================ */

.tools {
  margin-top: 40px;
}

.tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tool-list li {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.tool-list a {
  display: block;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

.tool-list a:hover {
  background: #f1f5ff;
}

/* ===============================
   Tool list item descriptor
   (subordinate label below link text)
================================ */

.tool-list__desc {
  display: block;
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  line-height: 1.4;
  margin-top: 3px;
  font-weight: 400;
}

/* ===============================
   Footer
================================ */

.site-footer {
  background: transparent;
  border-top: none;
  margin-top: 40px;
}

.site-footer .container {
  text-align: center;
  padding: 10px 0;
}

.footer-links {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 6px;
  line-height: 1.5;
}

.footer-links a {
  color: #777;
  text-decoration: none;
}

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

.footer-copy {
  font-size: 0.75rem;
  color: #999;
  margin: 0;
}

/* ===============================
   Mobile
================================ */

@media (max-width: 400px) {
  .container {
    margin: 25px auto;
    padding: 0 15px;
  }

  h1 {
    font-size: 1.6rem;
  }
}

/* ===============================
   Mobile Header
================================ */

@media (max-width: 480px) {

  .header-inner {
    padding: 6px 0;
  }

  .site-header img {
    height: 32px;
  }
}

/* =========================
   Tool list grouping labels
   ========================= */

.tool-group {
  list-style: none;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
}

.tool-group + li {
  margin-top: 0.25rem;
}

.related-calculators {
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: #666;
}

.related-calculators a {
  font-weight: 500;
}

/* ===============================
   Homepage Enhancements
   =============================== */

/* Hero section */
.hero {
  margin-bottom: 35px;
}

.hero h1 {
  margin-bottom: 12px;
}

.hero .intro {
  font-size: 1.05rem;
}

/* ===============================
   Category Hub
   =============================== */

.categories {
  margin-top: 40px;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.category-card {
  display: block;
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.category-card:hover {
  background: #f1f5ff;
}

.category-card h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.category-card p {
  margin: 0;
  font-size: 0.95rem;
  color: #666;
}

/* ===============================
   Popular Tools
   =============================== */

.popular-tools {
  margin-top: 45px;
}

/* Reuse existing tool-list styles */
.popular-tools .tool-list li {
  margin-bottom: 10px;
}

/* ===============================
   Authority Content
   =============================== */

.authority {
  margin-top: 45px;
  font-size: 0.95rem;
  color: #555;
}

.authority p {
  margin-bottom: 12px;
}

.authority a {
  font-weight: 500;
}

/* ===============================
   FAQ Section
   =============================== */

.faq {
  margin-top: 45px;
}

.faq h3 {
  margin-top: 22px;
  margin-bottom: 6px;
  font-size: 1rem;
}

.faq p {
  margin-top: 0;
  font-size: 0.95rem;
  color: #555;
}

/* ===============================
   Comparison Tables (SEO)
================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  font-size: 0.95rem;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

thead {
  background: #f1f5ff;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
}

th {
  font-weight: 600;
  color: #1a73e8;
}

tbody tr:not(:last-child) {
  border-bottom: 1px solid #eee;
}

tbody tr strong {
  color: #111;
}

@media (max-width: 480px) {
  table {
    font-size: 0.9rem;
  }
}

/* ===============================
   Tooltip (calculator hints)
================================ */

.tooltip {
  position: relative;
  display: inline-block;
  margin-left: 4px;
  cursor: help;
  font-size: 0.9em;
  opacity: 0.7;
}

.tooltip:hover {
  opacity: 1;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 125%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 280px;
  padding: 8px 10px;
  background: #111;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.4;
  border-radius: 6px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 115%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #111 transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
  opacity: 1;
}

/* ===============================
   Primary Tool Highlight Box
   =============================== */

.primary-tool {
  margin: 1.75rem 0 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #2563eb; /* subtle authority cue */
  background-color: #f9fafb;
  border-radius: 6px;
}

.primary-tool__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.primary-tool__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  line-height: 1.35;
}

.primary-tool__title a {
  color: #111827;
  text-decoration: none;
}

.primary-tool__title a:hover {
  text-decoration: underline;
}

.primary-tool__description {
  font-size: 0.9rem;
  color: #374151;
  margin: 0;
}

.primary-tool + section {
  margin-top: 2.5rem;
}

/* ===============================
   State compare tool
================================ */

.compare-tool {
  margin-top: 14px;
}

.compare-tool label {
  margin-bottom: 14px;
}

/* Compare page enhancements (safe, scoped) */
.badge{
  display:inline-block;
  padding:2px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:.85em;
  margin-left:6px;
}

.row-best td{
  font-weight:600;
}

/* ===============================
   Compare results table UX fix
   (scoped; won't affect other calculators)
================================ */

#compareResults .results-breakdown{
  overflow-x: auto;              /* allow horizontal scroll on narrow screens */
  -webkit-overflow-scrolling: touch;
}

#compareResults table{
  width: 100%;
  min-width: 720px;              /* prevents awkward wrapping */
  table-layout: auto;
}

#compareResults th,
#compareResults td{
  white-space: nowrap;           /* prevents "-" on one line and "$11,212" on next */
  font-variant-numeric: tabular-nums;
}

#compareResults th:first-child,
#compareResults td:first-child{
  white-space: normal;           /* allow state name/badge to wrap if needed */
}

#compareResults th:not(:first-child),
#compareResults td:not(:first-child){
  text-align: right;             /* numbers align cleanly */
}

.badge-best{
  display:inline-block;
  padding:2px 8px;
  margin-left:8px;
  border-radius:999px;
  background:#e6f4ea;
  color:#137333;
  font-size:.75rem;
  font-weight:600;
}

/* ===============================
   State Hub Calculator
   (/us/states/index.html)
   
   Paste this block at the end of main.css.
   All classes are scoped with the shc- prefix
   to avoid conflicts with existing styles.
================================ */

/* ── Outer wrapper ── */
.shc-wrap {
  margin-top: 1rem;
}

/* ── Mode toggle (Annual Salary / Hourly Wage) ── */
.shc-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
}

.shc-toggle__btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  color: #555;
  background: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.3;
}

.shc-toggle__btn:first-child {
  border-right: 1px solid #ccc;
}

.shc-toggle__btn--active {
  background: #1a73e8;
  color: #fff;
}

.shc-toggle__btn:not(.shc-toggle__btn--active):hover {
  background: #f1f5ff;
  color: #1a73e8;
}

/* ── Results panel ── */
.shc-results {
  margin-top: 20px;
}

/* State name headline inside results */
.shc-results__state-line {
  font-size: 0.85rem;
  color: #777;
  font-style: italic;
  text-align: center;
  margin: 0 0 16px;
}

/* 2×2 grid for the four key figures */
.shc-results__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.shc-results__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8faff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
}

.shc-results__label {
  font-size: 0.78rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  line-height: 1.2;
}

.shc-results__value {
  font-size: 1.25rem;
  color: #111;
  font-weight: 700;
  line-height: 1.2;
}

/* Tax breakdown one-liner below the grid */
.shc-results__breakdown {
  font-size: 0.82rem;
  color: #666;
  text-align: center;
  line-height: 1.5;
  padding: 0 4px;
  margin-bottom: 2px;
}

/* Deep link hint is already styled by existing .hint class */

/* ── Mobile adjustments ── */
@media (max-width: 400px) {
  .shc-results__grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .shc-results__value {
    font-size: 1.1rem;
  }

  .shc-toggle__btn {
    font-size: 0.85rem;
    padding: 9px 8px;
  }
}

/* ===============================
   Advanced Take-Home Pay Calculator
   (/income-and-pay/take-home-pay)

   Paste this block at the end of main.css.
   
   DEPENDENCIES: This snippet also uses the
   .shc-toggle, .shc-toggle__btn, .shc-toggle__btn--active,
   .shc-results__grid, .shc-results__cell, .shc-results__label,
   .shc-results__value classes from the state-hub CSS snippet.
   Paste the state-hub CSS snippet first if not already in main.css.
================================ */

/* ── Outer wrapper ── */
.thp-wrap {
  margin-top: 1rem;
}

/* ── State selector label "optional" qualifier ── */
.thp-optional {
  font-weight: 400;
  font-size: 0.82rem;
  color: #888;
  font-style: italic;
  margin-left: 4px;
}

/* ── FICA checkbox row ── */
.thp-fica-row {
  margin: -8px 0 20px;
}

.thp-fica-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: #555;
  cursor: pointer;
  margin-bottom: 0;
}

.thp-fica-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: #1a73e8;
  cursor: pointer;
}

/* ── Results panel ── */
.thp-results {
  margin-top: 20px;
}

/* Primary cell highlight (annual take-home) */
.thp-cell--primary {
  border-color: #1a73e8 !important;
  background: #f0f6ff !important;
}

.thp-cell--primary .shc-results__value {
  color: #1a73e8;
  font-size: 1.4rem;
}

/* ── Tax breakdown panel ── */
.thp-breakdown {
  margin-top: 16px;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.thp-breakdown__title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin: 0 0 10px;
}

/* Individual breakdown row */
.thp-breakdown__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #f3f4f6;
  gap: 8px;
}

.thp-breakdown__row:last-child {
  border-bottom: none;
}

.thp-breakdown__label {
  font-size: 0.9rem;
  color: #444;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.thp-breakdown__note {
  font-size: 0.75rem;
  color: #999;
  font-style: italic;
  font-weight: 400;
}

.thp-breakdown__value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  text-align: right;
}

.thp-breakdown__value--deduction {
  color: #c0392b;
}

/* Total row at the bottom of breakdown */
.thp-breakdown__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid #e5e7eb;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.thp-breakdown__total strong {
  color: #1a73e8;
  font-size: 1rem;
}

/* ── Mobile ── */
@media (max-width: 400px) {
  .thp-fica-label {
    font-size: 0.82rem;
  }

  .thp-cell--primary .shc-results__value {
    font-size: 1.2rem;
  }

  .thp-breakdown__label,
  .thp-breakdown__value {
    font-size: 0.82rem;
  }
}

/* ===============================
   Salary Calculator
   (/income-and-pay/salary-calculator.html)

   Paste this block at the end of main.css.

   DEPENDENCIES:
   The .shc-toggle, .shc-toggle__btn, .shc-toggle__btn--active
   classes come from the state-hub CSS snippet.
   Paste that snippet first if not already in main.css.

   The .thp-optional class comes from the thp- CSS snippet.
   Paste that snippet first if not already in main.css.

   All new classes here are prefixed sc- to avoid conflicts.
================================ */

/* ── Outer wrapper ── */
.sc-wrap {
  margin-top: 1rem;
}

/* ── Section divider labels (Gross pay / After-tax) ── */
.sc-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin: 20px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eee;
}

.sc-section-label--tax {
  color: #1a73e8;
  border-color: #c7d9f8;
  margin-top: 24px;
}

/* ── 3×2 pay period grid ── */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

/* ── Individual cell ── */
.sc-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8faff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  min-width: 0;       /* prevent overflow on narrow screens */
}

/* Highlight variant for after-tax annual cell */
.sc-cell--primary {
  background: #edf3ff;
  border-color: #1a73e8;
}

.sc-cell--primary .sc-cell__value {
  color: #1a73e8;
}

.sc-cell__label {
  font-size: 0.72rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  line-height: 1.2;
  white-space: nowrap;
}

.sc-cell__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
  line-height: 1.2;
  word-break: break-all;  /* prevent very large numbers overflowing */
}

/* ── Tax summary one-liner ── */
.sc-tax-summary {
  font-size: 0.78rem;
  color: #666;
  text-align: center;
  line-height: 1.6;
  margin-top: 10px;
  padding: 8px 4px 0;
  border-top: 1px solid #f0f0f0;
}

.sc-tax-summary span {
  display: inline-block;
  margin: 0 2px;
}

.sc-rate {
  font-weight: 600;
  color: #444;
}

/* ── Results box override — ensure enough padding ── */
.sc-results {
  margin-top: 20px;
  padding: 16px;
}

/* ── Mobile: narrow to 2 columns ── */
@media (max-width: 400px) {
  .sc-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .sc-cell__value {
    font-size: 0.95rem;
  }

  .sc-cell__label {
    font-size: 0.68rem;
  }

  .sc-tax-summary {
    font-size: 0.73rem;
  }
}

/* ===============================
   Homepage Quick Reference Block
   (homepage index.html only)
   
   Paste at the end of main.css.
   All classes prefixed hp- to avoid conflicts.
================================ */

/* ── Outer wrapper ── */
.hp-quickref {
  margin: 0 0 10px;
  padding: 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  border-left: 4px solid #1a73e8;
}

/* Small label above the grid */
.hp-quickref__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  margin: 0 0 12px;
  text-align: center;
}

/* 2×2 grid on mobile, 4-col on wider screens */
.hp-quickref__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

/* Individual cell */
.hp-quickref__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 6px;
  background: #f8faff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

/* Salary label (e.g. "$75k salary") */
.hp-quickref__salary {
  font-size: 0.78rem;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

/* Primary value (no-tax state) */
.hp-quickref__value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #137333;    /* green — positive/best-case */
  line-height: 1.3;
}

/* Secondary value (high-tax state for contrast) */
.hp-quickref__alt {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
  line-height: 1.3;
}

/* Mobile: stays 2-col, just tighter */
@media (max-width: 400px) {
  .hp-quickref__grid {
    gap: 8px;
  }

  .hp-quickref__value {
    font-size: 0.88rem;
  }

  .hp-quickref__alt {
    font-size: 0.75rem;
  }
}

