/* Smith for Castle Rock — /taxes */

.taxes-page {
  background: var(--white);
}

.taxes-hero {
  padding: 84px 0 72px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.taxes-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.72fr);
  gap: clamp(48px, 7vw, 100px);
  align-items: center;
}

.taxes-hero-copy h1 {
  max-width: 800px;
  margin: 14px 0 24px;
  color: var(--navy);
  font-size: clamp(3.4rem, 6.5vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.taxes-hero-copy p {
  max-width: 760px;
  margin: 0;
  color: #4a555f;
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  line-height: 1.65;
}

.tax-search-card {
  padding: 34px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 5px solid var(--rust);
  box-shadow: var(--shadow);
}

.tax-search-kicker {
  margin-bottom: 8px;
  color: var(--rust);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tax-search-card h2 {
  margin: 0 0 22px;
  color: var(--navy);
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.tax-search-card label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 0.92rem;
}

.tax-search-control {
  position: relative;
}

.tax-search-control input {
  min-height: 58px;
  padding: 15px 48px 15px 16px;
  border: 1px solid #aeb5ba;
  border-radius: 6px;
  font-size: 1.06rem;
}

.tax-search-spinner {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid rgba(12, 27, 43, 0.15);
  border-top-color: var(--rust);
  border-radius: 50%;
  opacity: 0;
}

.tax-search-spinner.is-active {
  opacity: 1;
  animation: tax-spin 0.7s linear infinite;
}

@keyframes tax-spin {
  to { transform: rotate(360deg); }
}

.tax-search-results {
  display: none;
  margin-top: 8px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(12, 27, 43, 0.12);
}

.tax-search-results.is-open {
  display: block;
}

.tax-search-option {
  width: 100%;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tax-search-option:last-child {
  border-bottom: 0;
}

.tax-search-option:hover,
.tax-search-option.is-active {
  background: var(--paper);
}

.tax-search-option strong {
  color: var(--navy);
  font-size: 1rem;
}

.tax-search-option span {
  color: var(--slate);
  font-size: 0.85rem;
}

.tax-search-empty {
  padding: 16px;
  color: var(--slate);
  font-size: 0.92rem;
}

.tax-search-note {
  margin: 14px 0 0;
  color: #6b747c;
  font-size: 0.78rem;
  line-height: 1.5;
}

.tax-result-section {
  padding: 76px 0 90px;
  scroll-margin-top: 110px;
}

.tax-loading {
  background: var(--white);
}

.tax-loading-card,
.tax-error-card {
  padding: 26px 28px;
  background: var(--paper);
  border-left: 5px solid var(--rust);
  font-weight: 700;
}

.tax-error-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #7c291d;
  background: #fff1ed;
}

.tax-result-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 30px;
}

.tax-result-header h2 {
  margin: 8px 0 6px;
  color: var(--navy);
  font-size: clamp(2.4rem, 4vw, 4.1rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.tax-result-header p {
  margin: 0;
  color: var(--slate);
}

.tax-text-button {
  padding: 0 0 3px;
  color: var(--rust);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tax-outside-town {
  margin-bottom: 22px;
  padding: 18px 20px;
  color: #6f3c16;
  background: #fff7e8;
  border: 1px solid #e9d1a2;
}

.tax-total-row {
  margin-bottom: 18px;
  padding: 26px 30px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  color: var(--white);
  background: var(--navy);
}

.tax-total-copy span,
.tax-total-meta {
  color: #b8c3cd;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tax-total-copy strong {
  display: block;
  margin-top: 4px;
  color: var(--white);
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.tax-total-meta strong {
  display: block;
  margin-top: 6px;
  color: var(--white);
  font-size: 1.25rem;
}

.tax-headline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tax-headline-card {
  min-height: 210px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--line);
}

.tax-town-card {
  border-top: 5px solid var(--navy);
}

.tax-metro-card {
  border-top: 5px solid var(--rust);
}

.tax-card-label {
  color: var(--slate);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tax-card-value {
  color: var(--navy);
  font-size: clamp(3.2rem, 6vw, 5.8rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.tax-metro-card .tax-card-value {
  color: var(--rust);
}

.tax-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--slate);
  font-size: 0.88rem;
  font-weight: 700;
}

.tax-ratio-panel {
  margin-top: 18px;
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 36px;
  color: var(--white);
  background: var(--navy);
}

.tax-ratio-number {
  color: #f0e8df;
  font-size: clamp(3.7rem, 7vw, 7rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.06em;
}

.tax-ratio-copy {
  max-width: 760px;
  color: #c6d0d8;
  font-size: 1.08rem;
  line-height: 1.6;
}

.tax-ratio-copy strong {
  color: var(--white);
}

.tax-metro-names {
  margin-top: 18px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.tax-metro-names span {
  color: var(--rust);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tax-metro-names strong {
  color: var(--navy);
}

.tax-breakdown-layout {
  margin-top: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: 34px;
  align-items: start;
}

.tax-breakdown-card,
.tax-context-card {
  background: var(--white);
  border: 1px solid var(--line);
}

.tax-breakdown-card {
  padding: 30px;
}

.tax-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.tax-section-heading h3,
.tax-context-card h3 {
  margin: 7px 0 0;
  color: var(--navy);
  font-size: 1.9rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.tax-section-heading > span {
  color: var(--slate);
  font-size: 0.8rem;
}

.tax-authority-row {
  padding: 22px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.tax-authority-row:last-child {
  border-bottom: 0;
}

.tax-authority-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.tax-authority-title-row > strong {
  color: var(--navy);
  font-size: 1.02rem;
}

.tax-authority-badges {
  display: inline-flex;
  gap: 6px;
}

.tax-badge {
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tax-badge-town {
  color: var(--navy);
}

.tax-badge-metro {
  color: var(--rust);
}

.tax-authority-detail {
  margin-top: 5px;
  color: var(--slate);
  font-size: 0.83rem;
}

.tax-authority-bar {
  height: 4px;
  margin-top: 12px;
  overflow: hidden;
  background: #ece9e3;
}

.tax-authority-bar span {
  display: block;
  height: 100%;
  background: var(--navy);
}

.tax-authority-amount {
  text-align: right;
}

.tax-authority-amount strong {
  display: block;
  color: var(--navy);
  font-size: 1.1rem;
}

.tax-authority-amount span {
  color: var(--slate);
  font-size: 0.8rem;
}

.tax-context-card {
  position: sticky;
  top: 150px;
  padding: 30px;
  border-top: 5px solid var(--rust);
}

.tax-context-card p {
  color: #4e5963;
  line-height: 1.65;
}

.tax-context-card .button {
  width: 100%;
  margin-top: 12px;
}

.tax-source-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--rust);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.taxes-explainer {
  padding: 90px 0;
  color: var(--white);
  background: var(--navy);
}

.taxes-explainer-heading {
  max-width: 800px;
  margin-bottom: 46px;
}

.taxes-explainer .eyebrow {
  color: #d76145;
}

.taxes-explainer-heading h2 {
  margin: 14px 0 0;
  font-size: clamp(2.7rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.taxes-explainer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px;
}

.taxes-explainer-grid > div {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.taxes-explainer-grid span {
  color: #d76145;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.taxes-explainer-grid h3 {
  margin: 16px 0 9px;
  font-size: 1.4rem;
}

.taxes-explainer-grid p {
  margin: 0;
  color: #b8c3cd;
  line-height: 1.65;
}

@media (max-width: 980px) {
  .taxes-hero-grid,
  .tax-breakdown-layout {
    grid-template-columns: 1fr;
  }

  .taxes-hero-copy {
    max-width: 820px;
  }

  .tax-context-card {
    position: static;
  }
}

@media (max-width: 720px) {
  .taxes-hero {
    padding: 56px 0 48px;
  }

  .taxes-hero-copy h1 {
    font-size: clamp(3.1rem, 14vw, 4.7rem);
  }

  .tax-search-card {
    padding: 24px 20px;
  }

  .tax-result-section {
    padding: 54px 0 68px;
  }

  .tax-result-header,
  .tax-total-row,
  .tax-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .tax-total-row {
    display: flex;
  }

  .tax-headline-grid,
  .taxes-explainer-grid {
    grid-template-columns: 1fr;
  }

  .tax-headline-card {
    min-height: 180px;
    padding: 24px;
  }

  .tax-ratio-panel {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 26px 24px;
  }

  .tax-metro-names {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .tax-breakdown-card,
  .tax-context-card {
    padding: 24px 20px;
  }

  .tax-authority-row {
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 14px;
  }

  .tax-authority-title-row {
    display: block;
  }

  .tax-authority-badges {
    display: flex;
    margin-top: 7px;
  }

  .taxes-explainer {
    padding: 68px 0;
  }

  .taxes-explainer-grid {
    gap: 18px;
  }

  .taxes-explainer-grid > div {
    padding: 24px 0 0;
  }
}

@media (max-width: 430px) {
  .tax-card-meta {
    flex-direction: column;
    gap: 4px;
  }

  .tax-authority-row {
    grid-template-columns: 1fr;
  }

  .tax-authority-amount {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    text-align: left;
  }
}
