/* =============================================
   THE SIGNING DESK — Main Stylesheet
   Stack: Plain CSS, no frameworks
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* === CSS VARIABLES === */
:root {
  --ink:        #1a1a2e;
  --ink-light:  #3d3d5c;
  --paper:      #faf9f6;
  --paper-warm: #f2efe8;
  --accent:     #b5451b;
  --accent-light: #e8603a;
  --accent-pale: #fdf0ec;
  --border:     #ddd8cc;
  --mid:        #8a8070;
  --success:    #2d6a4f;
  --warning:    #8b6914;
  --serif:      'Libre Baskerville', Georgia, serif;
  --sans:       'DM Sans', system-ui, sans-serif;
  --max-w:      1100px;
  --col-w:      680px;
  --radius:     4px;
  --shadow:     0 2px 12px rgba(26,26,46,0.08);
  --shadow-lg:  0 8px 32px rgba(26,26,46,0.14);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 17px; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent-light); }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); margin: 2rem 0 0.75rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.3rem); margin: 1.5rem 0 0.5rem; }
h4 { font-size: 1rem; font-family: var(--sans); font-weight: 600; margin: 1rem 0 0.4rem; }

p { margin-bottom: 1rem; }
ul, ol { margin: 0 0 1rem 1.5rem; }
li { margin-bottom: 0.4rem; }

strong { font-weight: 600; }
em { font-style: italic; }

.lead {
  font-size: 1.1rem;
  color: var(--ink-light);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* === LAYOUT === */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.article-body {
  max-width: var(--col-w);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* === HEADER & NAV === */
.site-header {
  background: var(--ink);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.site-logo {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-logo span {
  color: var(--accent-light);
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.main-nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255,255,255,0.1);
  color: var(--paper);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--paper);
  font-size: 1.4rem;
}

/* === HERO === */
.hero {
  background: var(--ink);
  background-image: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #1a2744 100%);
  color: var(--paper);
  padding: 4rem 1.25rem 3.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-light);
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero h1 {
  color: var(--paper);
  font-size: clamp(2rem, 5vw, 3rem);
  max-width: 700px;
  margin-bottom: 1.25rem;
}

.hero .lead {
  color: rgba(250,249,246,0.75);
  max-width: 580px;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* === BUTTONS === */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-light); color: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--paper);
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.6); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

/* === PAGE HEADER (non-hero pages) === */
.page-header {
  background: var(--ink);
  color: var(--paper);
  padding: 2.5rem 1.25rem;
  border-bottom: 3px solid var(--accent);
}

.page-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.page-header .breadcrumb {
  font-size: 0.78rem;
  color: rgba(250,249,246,0.5);
  margin-bottom: 0.75rem;
}

.page-header .breadcrumb a {
  color: rgba(250,249,246,0.6);
  text-decoration: none;
}

.page-header .breadcrumb a:hover { color: var(--paper); }

.page-header h1 {
  color: var(--paper);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 0.75rem;
}

.page-header .lead {
  color: rgba(250,249,246,0.7);
  max-width: 600px;
  font-size: 1rem;
  margin: 0;
}

/* === MAIN CONTENT LAYOUT === */
.main-content {
  padding: 3rem 1.25rem;
}

.content-with-sidebar {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.content-full {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* === SIDEBAR === */
.sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-card {
  background: var(--paper-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.sidebar-card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mid);
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-weight: 600;
}

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

.sidebar-card ul li {
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.sidebar-card ul li:last-child { border-bottom: none; }

.sidebar-card ul li a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--ink-light);
  text-decoration: none;
}

.sidebar-card ul li a:hover { color: var(--accent); }

.sidebar-tool-cta {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.sidebar-tool-cta h3 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 0.5rem;
  font-family: var(--sans);
}

.sidebar-tool-cta p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 1rem;
}

.sidebar-tool-cta .btn {
  background: #fff;
  color: var(--accent);
  width: 100%;
  text-align: center;
}

/* === CARDS === */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--ink-light);
  margin: 0;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* === CALLOUT BOXES === */
.callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-pale);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}

.callout-info {
  border-color: #2563eb;
  background: #eff6ff;
}

.callout-warning {
  border-color: var(--warning);
  background: #fefce8;
}

.callout-success {
  border-color: var(--success);
  background: #f0fdf4;
}

.callout p { margin: 0; font-size: 0.93rem; }
.callout strong { display: block; margin-bottom: 0.3rem; }

/* === TABLES === */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead { background: var(--ink); color: var(--paper); }
thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--paper-warm); }
tbody td { padding: 0.7rem 1rem; vertical-align: top; }

/* === FAQ SECTION === */
.faq-section {
  margin: 3rem 0;
  border-top: 2px solid var(--border);
  padding-top: 2rem;
}

.faq-section h2 {
  margin-bottom: 1.5rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: var(--paper-warm);
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background 0.15s;
}

.faq-question:hover { background: #e8e4da; }

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 1rem 1.25rem;
  font-size: 0.93rem;
  border-top: 1px solid var(--border);
  background: #fff;
}

.faq-item.open .faq-answer { display: block; }
.faq-answer p:last-child { margin-bottom: 0; }

/* === DISCLAIMER === */
.disclaimer {
  background: var(--paper-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  font-size: 0.82rem;
  color: var(--mid);
}

.disclaimer strong { color: var(--ink-light); }

/* === SECTION DIVIDERS === */
.section {
  padding: 3rem 1.25rem;
}

.section-alt {
  background: var(--paper-warm);
}

.section-dark {
  background: var(--ink);
  color: var(--paper);
}

.section-dark h2,
.section-dark h3 { color: var(--paper); }

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--mid);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.section-dark .section-subtitle { color: rgba(250,249,246,0.6); }

/* === TAG / BADGE === */
.tag {
  display: inline-block;
  background: var(--accent-pale);
  color: var(--accent);
  border: 1px solid rgba(181,69,27,0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tag-state {
  background: #e8f4fd;
  color: #1a6ea8;
  border-color: rgba(26,110,168,0.2);
}

.tag-new {
  background: #f0fdf4;
  color: var(--success);
  border-color: rgba(45,106,79,0.2);
}

/* === STATE GRID === */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.state-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.88rem;
  transition: all 0.15s;
}

.state-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-pale);
}

/* === STEP LIST === */
.step-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  counter-reset: steps;
}

.step-list li {
  counter-increment: steps;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.step-list li::before {
  content: counter(steps);
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--sans);
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

/* === CHECKLIST === */
.checklist {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.checklist li {
  padding: 0.5rem 0 0.5rem 2rem;
  position: relative;
  border-bottom: 1px solid var(--border);
  margin: 0;
  font-size: 0.93rem;
}

.checklist li:last-child { border-bottom: none; }

.checklist li::before {
  content: '☐';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1.1rem;
}

/* === TOOL CONTAINER === */
.tool-container {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.tool-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.tool-description {
  color: var(--mid);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ink-light);
}

.form-group select,
.form-group input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.93rem;
  background: var(--paper);
  color: var(--ink);
  appearance: none;
  transition: border-color 0.15s;
}

.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.tool-result {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: none;
}

.tool-result.visible { display: block; }

.result-number {
  font-family: var(--serif);
  font-size: 2.5rem;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.result-label {
  font-size: 0.85rem;
  color: rgba(250,249,246,0.6);
  margin-bottom: 1rem;
}

.result-breakdown {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1rem;
  font-size: 0.88rem;
}

.result-breakdown table {
  color: var(--paper);
}

.result-breakdown thead { background: rgba(255,255,255,0.08); }
.result-breakdown tbody tr { border-color: rgba(255,255,255,0.08); }
.result-breakdown tbody tr:nth-child(even) { background: rgba(255,255,255,0.04); }

/* === FOOTER === */
.site-footer {
  background: var(--ink);
  color: rgba(250,249,246,0.65);
  padding: 3rem 1.25rem 2rem;
  margin-top: 4rem;
  border-top: 3px solid var(--accent);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.footer-brand .site-logo {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.83rem;
  line-height: 1.6;
  margin: 0;
}

.footer-col h4 {
  color: var(--paper);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  font-family: var(--sans);
  font-weight: 600;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li { margin-bottom: 0.35rem; }

.footer-col ul li a {
  color: rgba(250,249,246,0.6);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.footer-col ul li a:hover { color: var(--paper); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-bottom a {
  color: rgba(250,249,246,0.5);
  text-decoration: none;
}

.footer-bottom a:hover { color: var(--paper); }

/* === PDF DOWNLOAD BLOCK === */
.pdf-download {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--paper-warm);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}

.pdf-download:hover {
  box-shadow: var(--shadow);
  color: inherit;
}

.pdf-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.pdf-download-info strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.pdf-download-info span {
  font-size: 0.83rem;
  color: var(--mid);
}

/* === ANALYTICS PLACEHOLDER === */
/* GA4 placeholder — uncomment and replace G-XXXXXXXXXX */
/*
  <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'G-XXXXXXXXXX');
  </script>
*/

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .content-with-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .main-nav { display: none; }
  .main-nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--ink); padding: 1rem; gap: 0.5rem; border-top: 1px solid rgba(255,255,255,0.1); }
  .nav-toggle { display: block; }
  .site-header { position: relative; }
  .two-col { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 1.25rem 2rem; }
  .hero-cta-group { flex-direction: column; }
  .pdf-download { flex-direction: column; text-align: center; }
}

/* === PRINT === */
@media print {
  .site-header, .site-footer, .sidebar { display: none; }
  .content-with-sidebar { grid-template-columns: 1fr; }
  body { font-size: 12pt; }
  a { color: inherit; text-decoration: none; }
  .callout, .disclaimer { border: 1px solid #ccc; }
}
