/* Tax Learning Library page. Scoped so it does not restyle the site menu or footer. */
.tax-library {
  margin-top: var(--navbar-height, 140px);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
}

.tax-library h1,
.tax-library h2,
.tax-library h3,
.tax-library h4 {
  margin-bottom: 0;
  line-height: 1.2;
}

.tax-library h2 {
  font-size: 1.45rem;
}

.tax-library p {
  margin: 0;
}

.tax-library a {
  color: var(--primary-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tax-library a:hover {
  text-decoration-thickness: 2px;
}

.tax-library ul {
  list-style: disc;
}

.tax-library .wrap {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.tax-library .library-menu {
  position: sticky;
  top: var(--navbar-height, 140px);
  z-index: 20;
  background: white;
  border-bottom: 1px solid var(--border-color);
}

.tax-library .library-menu-label {
  margin: 0;
  padding: 0.55rem 0 0.1rem;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-color);
}

.tax-library a.library-menu-label {
  display: block;
  text-decoration: none;
}

.tax-library a.library-menu-label:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

.tax-library .library-menu ul {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  margin: 0;
  padding: 0.35rem 0 0.15rem;
}

.tax-library .library-menu ul a {
  display: inline-block;
  padding: 0.55rem 0.1rem 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  text-decoration: none;
}

.tax-library .library-menu ul a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.tax-library .library-menu ul a[aria-current="page"] {
  color: var(--primary-color);
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--secondary-ink);
}

.tax-library .library-menu ul a[aria-current="page"]:hover {
  color: var(--primary-color);
}

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

.tax-library a.topic-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 180px;
  padding: 22px;
  background: white;
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--secondary-color);
  border-radius: 16px;
  box-shadow: 0 14px 35px rgba(31, 41, 55, 0.08);
  color: var(--text-primary);
  text-decoration: none;
}

.tax-library a.topic-card:hover {
  border-color: var(--primary-color);
  text-decoration: none;
}

.tax-library a.topic-card h2,
.tax-library a.topic-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.35rem;
  line-height: 1.25;
}

.tax-library a.topic-card p {
  margin: 0;
  color: var(--text-secondary);
}

@media (min-width: 1100px) {
  .tax-library .topic-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .tax-library .topic-grid {
    grid-template-columns: 1fr;
  }
}

.tax-library .hero {
  margin-top: 0;
  padding: 4rem 0 2rem;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: #fff;
  text-align: center;
}

.tax-library .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.77rem;
  font-weight: 750;
  color: var(--gold-on-dark);
}

.tax-library .hero h1 {
  margin: 0.75rem auto 1rem;
  color: #fff;
}

.tax-library .hero p {
  font-size: 1.25rem;
  max-width: 700px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 auto;
}

.tax-library .note {
  display: inline-block;
  max-width: 100%;
  margin-top: 22px;
  padding: 9px 13px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tax-library .main {
  padding: 36px 0 58px;
}

.tax-library .intro {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  margin-bottom: 28px;
}

.tax-library .panel,
.tax-library .article {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 14px 35px rgba(31, 41, 55, 0.08);
}

.tax-library .panel {
  padding: 23px;
  overflow-x: auto;
}

.tax-library .panel h2,
.tax-library .section-title {
  color: var(--text-primary);
  margin: 0 0 8px;
  line-height: 1.2;
}

.tax-library .panel p {
  margin: 8px 0;
  color: var(--text-secondary);
}

.tax-library .small {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.tax-library .toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 18px;
  flex-wrap: wrap;
}

.tax-library .search {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.tax-library .search input {
  width: 100%;
  border: 1px solid #7f949a;
  border-radius: 12px;
  padding: 14px 15px 14px 43px;
  font: inherit;
  background: white;
  color: var(--text-primary);
}

.tax-library .search:before {
  content: "⌕" / "";
  position: absolute;
  left: 15px;
  top: 6px;
  font-size: 1.6rem;
  color: var(--text-secondary);
}

.tax-library .section-title {
  font-size: 1.55rem;
  margin: 32px 0 14px;
}

.tax-library .grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tax-library .article {
  padding: 19px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 220px;
}

.tax-library .tag {
  color: var(--primary-color);
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 800;
}

.tax-library .article h3 {
  font-size: 1.12rem;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 8px 0;
}

.tax-library .article p {
  color: var(--text-secondary);
  margin: 0 0 14px;
  font-size: 0.94rem;
}

.tax-library .article details {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.tax-library .article summary {
  color: var(--primary-color);
  font-weight: 700;
  cursor: pointer;
}

.tax-library .article details p {
  margin: 10px 0 0;
  color: var(--text-primary);
  font-size: 0.91rem;
}

.tax-library .article ul {
  padding-left: 18px;
  margin: 8px 0;
  color: var(--text-primary);
  font-size: 0.91rem;
}

.tax-library .callout {
  background: var(--bg-accent);
  border-left: 4px solid var(--secondary-mark);
  padding: 12px 14px;
  border-radius: 0 9px 9px 0;
  margin-top: 12px;
  font-size: 0.9rem;
}

.tax-library .form-table {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 14px 35px rgba(31, 41, 55, 0.08);
  scroll-margin-top: calc(var(--navbar-height, 140px) + 4.5rem);
}

.tax-library table {
  width: 100%;
  border-collapse: collapse;
}

.tax-library th,
.tax-library td {
  text-align: left;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  overflow-wrap: break-word;
}

.tax-library th {
  color: var(--text-primary);
  background: var(--bg-accent);
  font-size: 0.9rem;
}

.tax-library td:first-child,
.tax-library th[scope="row"] {
  font-weight: 700;
  color: var(--primary-color);
}

.tax-library .form-table td:first-child {
  width: 1%;
  white-space: nowrap;
}

.tax-library .form-table td:first-child a {
  font-weight: 700;
  white-space: nowrap;
}

.tax-library .step-cell {
  white-space: normal;
}

.tax-library .step-label {
  display: block;
  color: var(--primary-color);
  font-weight: 700;
  white-space: nowrap;
}

.tax-library .step-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
}

.tax-library table.label-table th[scope="row"] {
  white-space: nowrap;
}

.tax-library .library-note {
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--secondary-color);
  border-radius: 0 0.65rem 0.65rem 0;
  background: white;
  color: var(--text-primary);
  line-height: 1.55;
}

@media (max-width: 560px) {
  .tax-library table.steps-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .tax-library table.steps-table,
  .tax-library table.steps-table tbody,
  .tax-library table.steps-table tr,
  .tax-library table.steps-table td {
    display: block;
    width: auto;
  }

  .tax-library table.steps-table tr {
    border-bottom: 1px solid var(--border-color);
  }

  .tax-library table.steps-table td {
    border-bottom: 0;
  }

  .tax-library table.steps-table td.step-cell {
    padding-bottom: 0.15rem;
  }
}

.tax-library .empty {
  display: none;
  padding: 20px;
  color: var(--text-secondary);
  background: white;
  border: 1px dashed #7f949a;
  border-radius: 12px;
}

.tax-library .contact-cta {
  margin: 24px auto 12px;
  padding: 26px;
  border-radius: 16px;
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 14px 35px rgba(31, 41, 55, 0.08);
}

.tax-library .contact-cta h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.45rem;
}

.tax-library .contact-cta p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 18px;
}

.tax-library a.cta-button {
  display: inline-block;
  max-width: 100%;
  padding: 11px 17px;
  border-radius: 8px;
  background: var(--secondary-color);
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.tax-library a.cta-button:hover {
  background: var(--accent-color);
  text-decoration: none;
}

.tax-library .disclaimer {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 19px;
}

.tax-library .no-results-dialog {
  width: min(460px, calc(100% - 32px));
  border: 0;
  border-radius: 16px;
  padding: 27px;
  background: white;
  color: var(--text-primary);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.tax-library .no-results-dialog::backdrop {
  background: rgba(31, 41, 55, 0.55);
}

.tax-library .no-results-dialog h2 {
  margin: 0 0 9px;
  color: var(--primary-color);
  font-size: 1.45rem;
  line-height: 1.2;
}

.tax-library .no-results-dialog p {
  margin: 0 0 18px;
  color: var(--text-secondary);
}

.tax-library .dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tax-library .dialog-close {
  font: inherit;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 15px;
  cursor: pointer;
}

.tax-library .hide {
  display: none !important;
}

@media (max-width: 850px) {
  .tax-library .intro {
    grid-template-columns: 1fr;
  }

  .tax-library .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tax-library a:focus-visible,
.tax-library button:focus-visible,
.tax-library summary:focus-visible,
.tax-library input:focus-visible,
.tax-library .form-table:focus-visible,
.tax-library [role="region"]:focus-visible {
  outline: 3px solid var(--secondary-ink);
  outline-offset: 3px;
}

.tax-library .contact-cta a:focus-visible {
  outline-color: #fff;
}

.tax-library .form-table,
.tax-library .panel,
.tax-library [role="region"] {
  max-width: 100%;
}

@media (max-width: 560px) {
  .tax-library .hero {
    padding: 2rem 0 1.5rem;
  }

  .tax-library .hero p {
    font-size: 1.05rem;
  }

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