/* Shared layout utilities. Each site sets brand colors in site.css. */
*,
*::before,
*::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.2;
  font-weight: 650;
  margin: 0 0 0.6em;
  overflow-wrap: anywhere;
}
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3.5vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p, li { overflow-wrap: anywhere; }
a { color: var(--accent-ink); }
a:hover { text-decoration-thickness: 2px; }
.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.8rem;
  z-index: 100;
}
.skip:focus { top: 0.5rem; }
.wrap {
  width: min(70rem, calc(100% - 1.5rem));
  margin-inline: auto;
}
header.site {
  border-bottom: 3px solid var(--ink);
  background: var(--header-bg, var(--paper));
  padding: 0.7rem 0;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.brand {
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-tag {
  font-size: 0.78rem;
  color: var(--muted);
}
#menu-btn {
  font: inherit;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  min-height: 44px;
}
#site-nav {
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0 0;
}
#site-nav.open { display: flex; }
#site-nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.55rem 0.2rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}
#site-nav a[aria-current="page"] { font-weight: 700; }
@media (min-width: 900px) {
  #menu-btn { display: none; }
  .header-row { flex-wrap: wrap; }
  #site-nav, #site-nav.open {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.15rem 1rem;
    padding: 0;
    width: 100%;
    justify-content: flex-start;
  }
  #site-nav a {
    border: 0;
    min-height: 0;
    padding: 0.2rem 0;
  }
}
main { padding: 1.4rem 0 3rem; }
.lede { font-size: 1.12rem; max-width: 44rem; }
.tool {
  background: var(--card, #fff);
  border: 2px solid var(--ink);
  padding: 1rem 1rem 1.2rem;
  margin: 1.2rem 0;
}
.tool h2 { margin-top: 0; }
.grid-form {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .grid-form.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid-form.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}
label, fieldset { font-weight: 600; font-size: 0.95rem; }
fieldset {
  border: 1px solid var(--rule);
  padding: 0.6rem 0.8rem;
  margin: 0;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; }
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
  font: inherit;
  padding: 0.55rem 0.6rem;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  width: 100%;
  max-width: 100%;
  min-height: 44px;
}
textarea { min-height: 8rem; }
button.calc,
button.primary {
  font: inherit;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--ink);
  padding: 0.7rem 1rem;
  cursor: pointer;
  min-height: 44px;
}
button.calc:focus,
button.primary:focus,
#menu-btn:focus,
a:focus {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.result {
  margin-top: 1rem;
  padding: 0.9rem;
  background: var(--result-bg, #f3efe4);
  border-left: 5px solid var(--accent);
}
.result[hidden] { display: none !important; }
.note, .source, .muted { color: var(--muted); font-size: 0.92rem; }
.cards {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
  margin: 1.2rem 0;
}
@media (min-width: 700px) {
  .cards.three { grid-template-columns: 1fr 1fr 1fr; }
  .cards.two { grid-template-columns: 1fr 1fr; }
}
.card {
  border: 2px solid var(--ink);
  padding: 0.9rem 1rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: block;
  min-width: 0;
}
.card h2, .card h3 { margin-bottom: 0.35em; }
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--rule);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 20rem;
}
th, td {
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
th { background: var(--header-bg, #efe7d8); }
.ad,
.ad-slot {
  border: 1px solid var(--rule);
  margin: 2.5rem 0;
  padding: 0.55rem 0.6rem 0.75rem;
  background: rgba(0,0,0,0.02);
  box-sizing: border-box;
  max-width: 100%;
}
.ad-label {
  margin: 0 0 0.4rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ad-frame {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  background: transparent;
}
/* Reserved heights so empty slots do not collapse and shift the page (CLS). */
.ad-slot-incontent .ad-frame { min-height: 280px; }
.ad-slot-rail .ad-frame { min-height: 600px; width: 300px; max-width: 100%; }
.ad-slot-footer .ad-frame { min-height: 100px; }
.ad-slot + form,
form + .ad-slot,
.tool + .ad-slot,
.ad-slot + .tool {
  margin-top: 3rem;
}
.tool .ad-slot { display: none; }
.wrap.page-with-rail {
  width: min(86rem, calc(100% - 1.5rem));
}
.page-main { min-width: 0; }
.ad-rail { display: none; }
@media (min-width: 1100px) {
  .wrap.page-with-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2.25rem;
    align-items: start;
  }
  .ad-rail { display: block; }
}
.ad-anchor-region {
  padding: 2.5rem 0 0.4rem;
  background: transparent;
}
.ad-anchor-region .wrap { width: min(70rem, calc(100% - 1.5rem)); }
.ad-slot-footer { margin: 0; }

.sources { margin-top: 2rem; }
.sources ul { padding-left: 1.2rem; }
.callout {
  border: 2px solid var(--ink);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  background: #fff;
}
footer.site {
  border-top: 3px solid var(--ink);
  padding: 1.4rem 0 2rem;
  font-size: 0.92rem;
  background: var(--header-bg, #efe7d8);
}
footer.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.6rem 0 1rem;
}
footer.site a { color: var(--ink); }
.sister { margin-top: 0.8rem; color: var(--muted); }
noscript p {
  border: 2px solid var(--accent);
  padding: 0.7rem 0.9rem;
}

/* SEO and answer-engine layout */
.breadcrumbs {
  font-size: 0.9rem;
  margin: 0 0 1rem;
  color: var(--muted);
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumbs li { display: inline; }
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--muted);
}
.breadcrumbs a { color: var(--accent-ink); }
.direct-answer {
  max-width: 44rem;
  margin: 0 0 0.8rem;
  padding: 0.85rem 1rem;
  border-left: 5px solid var(--accent);
  background: var(--result-bg, #f3efe4);
}
.last-updated {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 1rem;
}
.see-also { margin: 0 0 1.2rem; max-width: 44rem; }
#key-facts { margin: 1.2rem 0 1.4rem; }
#key-facts h2 { margin-top: 0; }
.faq { margin: 2rem 0 1.5rem; }
.faq .faq-item { margin: 0 0 1.1rem; max-width: 44rem; }
.faq .faq-item h3 { font-size: 1.05rem; margin-bottom: 0.35em; }
.related-tools { margin: 1.8rem 0 0.4rem; }
.related-tools ul { padding-left: 1.2rem; }
#editorial-standards { margin-top: 1.6rem; max-width: 44rem; }
