/*
Theme Name: ToolReview ContractData Ledger
Theme URI: https://contractdatatoolreview.com
Author: ToolReview Ops
Description: Ledger-style visual language for Contract Data Tool Review.
Version: 1.0.0
License: GPL-2.0-or-later
Text Domain: toolreview-contractdata-ledger
*/

:root {
  --cd-bg: #f7faf7;
  --cd-bg-2: #edf3ed;
  --cd-panel: #ffffff;
  --cd-panel-soft: #f3f8f3;
  --cd-text: #17241b;
  --cd-muted: #4d6354;
  --cd-border: rgba(30, 67, 46, 0.22);
  --cd-accent: #1c8b54;
  --cd-accent-2: #1f5d91;
  --cd-head: #102015;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.cd-theme {
  font-family: "Work Sans", "Segoe UI", sans-serif;
  color: var(--cd-text);
  line-height: 1.66;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.025) 0 1px, transparent 1px 28px),
    linear-gradient(180deg, rgba(0,0,0,0.02) 0 1px, transparent 1px 28px),
    linear-gradient(180deg, var(--cd-bg), #fdfefd 60%);
}

a { color: var(--cd-accent-2); text-underline-offset: 2px; }
a:hover { color: var(--cd-accent); }

.cd-wrap { width: min(1140px, calc(100% - 2.2rem)); margin: 0 auto; }
.cd-site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.cd-main { flex: 1; padding: 1.25rem 0 3rem; }

.cd-header {
  border-bottom: 1px solid var(--cd-border);
  background: rgba(248, 252, 248, 0.95);
}
.cd-header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.82rem 0;
}
.cd-brand { text-decoration: none; color: var(--cd-head); display: inline-flex; flex-direction: column; }
.cd-brand-name {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: clamp(1.08rem, 1.8vw, 1.42rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cd-brand-tag {
  color: var(--cd-muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cd-menu,
.cd-menu-fallback {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.cd-menu a,
.cd-menu-fallback a {
  text-decoration: none;
  color: var(--cd-head);
  font-weight: 700;
  border: 1px solid var(--cd-border);
  border-radius: 6px;
  padding: 0.4rem 0.72rem;
  font-size: 0.88rem;
  background: #fff;
}
.cd-menu a:hover,
.cd-menu-fallback a:hover,
.cd-menu .current-menu-item > a,
.cd-menu .current_page_item > a {
  border-color: rgba(28, 139, 84, 0.5);
  color: var(--cd-accent);
}

.cd-hero {
  border: 1px solid var(--cd-border);
  border-radius: 10px;
  padding: clamp(1.15rem, 3vw, 2.2rem);
  background:
    linear-gradient(180deg, #ffffff, #f2f8f2),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.03) 0 1px, transparent 1px 24px);
}
.cd-kicker {
  margin: 0 0 0.3rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--cd-muted);
}
.cd-hero h1 {
  margin: 0;
  color: var(--cd-head);
  font-size: clamp(1.8rem, 3.7vw, 2.9rem);
  line-height: 1.1;
}
.cd-hero > p { margin: 0.75rem 0 0; max-width: 66ch; }
.cd-actions {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.cd-link-button {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.52rem 0.88rem;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}
.cd-link-button-main {
  color: #fff;
  background: linear-gradient(135deg, var(--cd-accent), #4ac487);
}
.cd-link-button-alt {
  color: var(--cd-head);
  background: #fff;
  border-color: var(--cd-border);
}

.cd-ledger-panel {
  margin-top: 1rem;
  border: 1px solid var(--cd-border);
  border-radius: 10px;
  padding: 0.9rem;
  background: var(--cd-panel-soft);
}
.cd-ledger-panel h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--cd-head);
}
.cd-ledger-table { margin-top: 0.7rem; }
.cd-ledger-table [role="row"] {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px dashed var(--cd-border);
}
.cd-ledger-table [role="row"]:last-child { border-bottom: 0; }
.cd-ledger-table span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
}
.cd-ledger-table strong {
  font-size: 0.87rem;
  color: var(--cd-accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.cd-section { margin-top: 2rem; }
.cd-section-head h1,
.cd-section-head h2,
.cd-article h1 {
  margin: 0;
  color: var(--cd-head);
}
.cd-section-head p { margin: 0.35rem 0 0; color: var(--cd-muted); }
.cd-eyebrow {
  margin: 0;
  color: var(--cd-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.73rem;
}

.cd-post-grid {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.cd-post-grid-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cd-card {
  border: 1px solid var(--cd-border);
  border-radius: 10px;
  padding: 0.8rem;
  background: var(--cd-panel);
}
.cd-card-compact { background: var(--cd-panel-soft); }
.cd-card h2,
.cd-card h3 {
  margin: 0.36rem 0 0.44rem;
  font-size: 1.02rem;
  line-height: 1.34;
}
.cd-meta {
  margin: 0;
  color: var(--cd-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cd-card p { margin: 0; }

.cd-article,
.cd-not-found,
.cd-archive-desc {
  border: 1px solid var(--cd-border);
  border-radius: 10px;
  padding: 1rem;
  background: var(--cd-panel);
}
.cd-content > *:first-child { margin-top: 0; }
.cd-content > *:last-child { margin-bottom: 0; }
.cd-content h2,
.cd-content h3,
.cd-content h4 { color: var(--cd-head); }
.cd-content ul,
.cd-content ol { padding-left: 1.2rem; }
.cd-content li + li { margin-top: 0.35rem; }
.cd-content blockquote {
  margin: 1rem 0;
  padding: 0.72rem 0.94rem;
  border-left: 3px solid var(--cd-accent);
  background: #eff6ef;
}

.cd-search-form {
  margin-top: 0.86rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cd-search-input {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--cd-border);
  border-radius: 8px;
  padding: 0.54rem 0.7rem;
  background: #fff;
  color: var(--cd-head);
}
.cd-search-button,
.cd-button {
  cursor: pointer;
}
.cd-search-button {
  border: 1px solid var(--cd-border);
  border-radius: 8px;
  padding: 0.54rem 0.8rem;
  color: #fff;
  background: var(--cd-accent);
  font-weight: 700;
}
.cd-button {
  border: 1px solid var(--cd-border);
  border-radius: 999px;
  padding: 0.54rem 0.82rem;
  text-decoration: none;
  color: var(--cd-head);
  background: #fff;
}

.cd-pagination { margin-top: 1rem; }
.cd-pagination .page-numbers {
  display: inline-block;
  margin-right: 0.35rem;
  border: 1px solid var(--cd-border);
  border-radius: 7px;
  padding: 0.34rem 0.56rem;
  text-decoration: none;
  background: #fff;
}

.cd-footer {
  border-top: 1px solid var(--cd-border);
  background: rgba(243, 249, 243, 0.95);
}
.cd-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.95rem 0;
  color: var(--cd-muted);
  font-size: 0.86rem;
}
.cd-footer-inner p { margin: 0; }

@media (max-width: 980px) {
  .cd-post-grid,
  .cd-post-grid-compact {
    grid-template-columns: 1fr;
  }
  .cd-header-inner {
    grid-template-columns: 1fr;
  }
}

/* Mailgun Newsletter Styles */
.cd-newsletter {
  border: 1px solid var(--cd-border);
  border-radius: 12px;
  background: #f0f8f1;
}
.cd-newsletter .mailgun-list-widget-front {
  margin-top: 0.74rem;
}
.cd-newsletter .mailgun-list-widget-inputs {
  display: grid;
  gap: 0.72rem;
}
.cd-newsletter .mailgun-list-widget-name,
.cd-newsletter .mailgun-list-widget-email {
  margin: 0;
  display: grid;
  gap: 0.32rem;
}
.cd-newsletter input[type="text"] {
  width: 100%;
  border: 1px solid var(--cd-border);
  border-radius: 8px;
  padding: 0.56rem 0.68rem;
  background: #fff;
  color: var(--cd-head);
}
.cd-newsletter .mailgun-list-submit-button {
  margin-top: 0.68rem;
  border: 1px solid var(--cd-border);
  border-radius: 999px;
  padding: 0.58rem 0.92rem;
  background: var(--cd-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.cd-newsletter .result-panel {
  margin-top: 0.76rem;
  padding: 0.68rem 0.88rem;
  border: 1px solid var(--cd-border);
  border-radius: 8px;
  font-weight: 600;
  background: #fff;
}

/* Newsletter UX Refresh */
.cd-newsletter,
.cd-popup-signup {
  border: 1px solid color-mix(in srgb, var(--cd-border) 72%, #ffffff 28%);
  border-radius: 14px;
  background: linear-gradient(180deg, #f6fbf6, #ebf5eb);
  box-shadow: 0 16px 34px rgba(42, 89, 51, 0.13);
}
.cd-popup-signup { padding: 0.3rem 0.15rem 0.1rem; }
.cd-popup-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: #397a4a;
}
.cd-popup-signup h3,
.cd-newsletter .mailgun-list-title .widget-title {
  margin: 0 0 0.4rem;
  color: var(--cd-head);
  font-size: clamp(1.1rem, 2.1vw, 1.44rem);
}
.cd-popup-signup > p {
  margin: 0 0 0.82rem;
  color: #355f3f;
}
.cd-newsletter .mailgun-list-widget-inputs,
.cd-popup-signup .mailgun-list-widget-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
}
.cd-newsletter .mailgun-list-widget-name,
.cd-popup-signup .mailgun-list-widget-name,
.cd-newsletter .mailgun-list-widget-email,
.cd-popup-signup .mailgun-list-widget-email {
  margin: 0;
  display: grid;
  gap: 0.28rem;
}
.cd-newsletter label,
.cd-popup-signup label {
  color: #4a7152;
  font-size: 0.78rem;
  font-weight: 600;
}
.cd-newsletter input[type="text"],
.cd-popup-signup input[type="text"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #a8c7ad;
  border-radius: 9px;
  padding: 0.61rem 0.7rem;
  background: #fff;
  color: var(--cd-head);
}
.cd-newsletter .mailgun-list-submit-button,
.cd-popup-signup .mailgun-list-submit-button {
  margin-top: 0.8rem;
  width: 100%;
  min-height: 45px;
  border: 1px solid #4f8b5b;
  border-radius: 999px;
  padding: 0.6rem 0.92rem;
  background: linear-gradient(135deg, #5ca16b, #417a4d);
  color: #fff;
  font-weight: 700;
}
.cd-newsletter .result-panel,
.cd-popup-signup .result-panel {
  margin-top: 0.74rem;
  border-radius: 8px;
  border: 1px solid #a8c7ad;
  background: #f5fcf5;
  color: #356441;
}
@media (max-width: 760px) {
  .cd-newsletter .mailgun-list-widget-inputs,
  .cd-popup-signup .mailgun-list-widget-inputs { grid-template-columns: 1fr; }
}

.cd-article-newsletter {
  margin-top: 1.2rem;
  padding: 0.95rem;
}
.cd-article-newsletter > h3 {
  margin-top: 0;
}
.cd-article-newsletter > p {
  margin-bottom: 0.75rem;
}

/* Theme-native newsletter form */
.cd-news-form {
  margin-top: 0.7rem;
}
.cd-news-form-inner {
  display: block;
}
.cd-news-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}
.cd-news-field {
  margin: 0;
  display: grid;
  gap: 0.28rem;
}
.cd-news-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cd-head);
  opacity: 0.85;
}
.cd-news-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--cd-border);
  border-radius: 10px;
  padding: 0.62rem 0.74rem;
  background: rgba(255,255,255,0.97);
  color: var(--cd-head);
}
.cd-news-field input:focus {
  outline: 2px solid color-mix(in srgb, linear-gradient(135deg, #5ca16b, #417a4d) 40%, #ffffff 60%);
  outline-offset: 1px;
}
.cd-news-submit {
  margin-top: 0.8rem;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--cd-border);
  border-radius: 999px;
  padding: 0.62rem 0.92rem;
  background: linear-gradient(135deg, #5ca16b, #417a4d);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.cd-news-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}
.cd-news-feedback {
  min-height: 1.2em;
  margin: 0.6rem 0 0;
  font-size: 0.86rem;
}
.cd-news-form-inner.is-success .cd-news-feedback {
  color: #2d7342;
}
.cd-news-form-inner.is-error .cd-news-feedback {
  color: #9a2a2a;
}
.cd-popup-signup .cd-news-form {
  margin-top: 0.85rem;
}
@media (max-width: 760px) {
  .cd-news-fields {
    grid-template-columns: 1fr;
  }
}

/* Newsletter readability fix */
.cd-news-field input::placeholder {
  color: #6e8473;
  opacity: 1;
}
.cd-news-field input:focus {
  border-color: #5ca16b !important;
  box-shadow: 0 0 0 3px rgba(92, 161, 107, 0.2);
  outline: none;
}
