/*
Theme Name: BenchCost
Theme URI: https://benchcost.com/
Author: BenchCost
Description: A fast, quiet theme built for cost-calculator and reference sites. No page builder, no jQuery, no external requests. Sticky header, optional sidebar with an ad slot, and a calculator-index page template that lists your tools automatically.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: benchcost
Tags: blog, one-column, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, accessibility-ready
*/

:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --bg-sunk: #eef0f3;
  --ink: #16191d;
  --ink-soft: #4a5158;
  --ink-faint: #767d85;
  --line: #dfe3e8;
  --line-soft: #ebeef1;
  --brand: #1f5f4b;
  --brand-ink: #14493a;
  --brand-wash: #e8f2ee;
  --accent: #b3541e;
  --warn-wash: #fff8e6;
  --warn-line: #e8d49a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: break-word;
}

/* ---------- accessibility ---------- */

.screen-reader-text {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  background: var(--brand);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus { left: 0; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- layout ---------- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
  padding: 32px 0 56px;
}

.layout.full { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .rail { order: 2; }
}

/* ---------- header ---------- */

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 40;
}

.admin-bar .masthead { top: 32px; }

@media screen and (max-width: 782px) {
  .admin-bar .masthead { top: 46px; }
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover { color: var(--brand); }

.logo-mark {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.logo img { max-height: 34px; width: auto; }

.nav ul {
  display: flex;
  gap: 22px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav li { margin: 0; }

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.nav a:hover { color: var(--brand); }

.nav .current-menu-item > a,
.nav .current_page_item > a { color: var(--brand); font-weight: 600; }

@media (max-width: 760px) {
  .masthead-inner { min-height: 0; padding: 12px 0; flex-direction: column; align-items: flex-start; }
  .nav ul { gap: 14px; }
}

/* ---------- typography ---------- */

h1, h2, h3, h4 { text-wrap: balance; }

h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -.025em;
  margin: 0 0 12px;
  font-weight: 750;
}

h2 {
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -.018em;
  margin: 40px 0 12px;
  font-weight: 700;
}

h3 {
  font-size: 19px;
  line-height: 1.35;
  margin: 28px 0 8px;
  font-weight: 650;
}

h4 { font-size: 17px; margin: 24px 0 6px; font-weight: 650; }

p { margin: 0 0 16px; }

a { color: var(--brand); text-underline-offset: 2px; }

.entry-content { max-width: 72ch; }
.entry-content > .bc,
.entry-content > .bc-table-scroll,
.entry-content > .bc-sources { max-width: none; }

.lede {
  font-size: 19px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 24px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--ink-faint);
  margin: 0 0 14px;
}

.breadcrumb a { color: var(--ink-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); text-decoration: underline; }

.entry-meta {
  font-size: 14px;
  color: var(--ink-faint);
  margin: 0 0 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

ul, ol { margin: 0 0 18px; padding-left: 22px; }
li { margin-bottom: 7px; }

blockquote {
  margin: 0 0 20px;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--brand);
  color: var(--ink-soft);
  font-style: italic;
}

code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--bg-sunk);
  padding: 1px 5px;
  border-radius: 4px;
}

pre {
  background: var(--bg-sunk);
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

pre code { background: none; padding: 0; }

hr { border: none; border-top: 1px solid var(--line); margin: 34px 0; }

/* ---------- WordPress core classes ---------- */

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

.alignleft { float: left; margin: 6px 24px 18px 0; }
.alignright { float: right; margin: 6px 0 18px 24px; }
.aligncenter { display: block; margin: 0 auto 20px; }
.alignwide { max-width: none; }
.alignfull { max-width: none; }

.wp-caption { max-width: 100%; margin-bottom: 20px; }

.wp-caption-text,
.wp-element-caption,
figcaption {
  font-size: 14px;
  color: var(--ink-faint);
  margin-top: 7px;
}

figure { margin: 0 0 22px; }

.sticky .entry-title::after { content: " \2605"; color: var(--accent); }

/* ---------- generic tables in content ---------- */

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 0 0 22px;
}

.entry-content th,
.entry-content td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.entry-content th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-faint);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

/* ---------- cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
  margin: 0 0 34px;
  padding: 0;
  list-style: none;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  background: var(--bg);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}

.card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.card-title {
  display: block;
  font-weight: 680;
  font-size: 17px;
  margin-bottom: 6px;
  letter-spacing: -.012em;
  line-height: 1.3;
}

.card-desc {
  display: block;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---------- hero ---------- */

.hero {
  padding: 46px 0 30px;
  border-bottom: 1px solid var(--line-soft);
}

.hero h1 { font-size: 40px; max-width: 20ch; }
.hero .lede { max-width: 62ch; margin-bottom: 0; }

@media (max-width: 600px) {
  h1 { font-size: 27px; }
  .hero h1 { font-size: 30px; }
  body { font-size: 16px; }
}

/* ---------- sidebar ---------- */

.rail { position: sticky; top: 86px; }
.admin-bar .rail { top: 118px; }

@media (max-width: 900px) {
  .rail { position: static; }
}

.rail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
  background: var(--bg);
}

.rail-card h3,
.rail-card .widget-title {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-faint);
  font-weight: 700;
}

.rail-list,
.rail-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-list li,
.rail-card li { margin-bottom: 9px; }

.rail-list a,
.rail-card a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.rail-list a:hover,
.rail-card a:hover { color: var(--brand); text-decoration: underline; }

/* ---------- ad slots ---------- */

.ad-slot {
  margin: 30px 0;
  min-height: 90px;
  display: grid;
  place-items: center;
  background: var(--bg-sunk);
  border: 1px dashed #c8ced6;
  border-radius: var(--radius-sm);
  color: #9aa2ab;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  overflow: hidden;
}

.ad-slot.tall { min-height: 600px; align-items: start; }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 34px 0 40px;
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-top: 20px;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 26px;
  margin-bottom: 26px;
}

.foot h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-faint);
  margin: 0 0 10px;
  font-weight: 700;
}

.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 7px; }
.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover { color: var(--brand); text-decoration: underline; }

.foot-legal {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 13.5px;
  color: var(--ink-faint);
}

.foot-legal p { margin: 0 0 10px; }
.foot-legal p:last-child { margin-bottom: 0; }

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 30px 0;
}

.pagination .page-numbers {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 15px;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- search ---------- */

.search-form { display: flex; gap: 8px; }

.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
}

.search-form button {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

.search-form button:hover { background: var(--brand-ink); }

/* ---------- post list ---------- */

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

.post-list > li {
  padding: 22px 0;
  border-bottom: 1px solid var(--line-soft);
  margin: 0;
}

.post-list h2 { margin: 0 0 6px; font-size: 21px; }
.post-list h2 a { text-decoration: none; color: var(--ink); }
.post-list h2 a:hover { color: var(--brand); }
.post-list p { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* ---------- notices ---------- */

.notice-box {
  border-left: 3px solid var(--brand);
  background: var(--bg-alt);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0 0 22px;
  font-size: 15.5px;
}

.notice-box.caution {
  border-left-color: var(--accent);
  background: var(--warn-wash);
  border-top: 1px solid var(--warn-line);
  border-right: 1px solid var(--warn-line);
  border-bottom: 1px solid var(--warn-line);
}

.notice-box p:last-child { margin-bottom: 0; }

/* ---------- print ---------- */

@media print {
  .masthead, .rail, .foot, .ad-slot, .skip-link { display: none !important; }
  .layout { grid-template-columns: 1fr; padding: 0; }
  body { font-size: 12pt; }
  a { text-decoration: underline; }
}

/* First heading in a section should not carry the full h2 top margin. */
.section-lead { margin-top: 14px; }
