/*
Theme Name: ToolReview SAMGov Ops
Theme URI: https://samgovanalyticsreview.com
Author: ToolReview Ops
Description: Operations-brief visual language for SAM.gov Analytics Review.
Version: 1.0.0
License: GPL-2.0-or-later
Text Domain: toolreview-samgov-ops
*/

:root {
  --sg-bg: #eef6fb;
  --sg-bg-2: #dcecf8;
  --sg-panel: #ffffff;
  --sg-panel-soft: #f4fbff;
  --sg-text: #153247;
  --sg-muted: #4f6a7b;
  --sg-border: rgba(34, 84, 114, 0.2);
  --sg-accent: #1a8cc9;
  --sg-accent-2: #1c9d6a;
  --sg-head: #0b2536;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.sg-theme {
  font-family: "Public Sans", "Segoe UI", sans-serif;
  color: var(--sg-text);
  line-height: 1.66;
  background:
    radial-gradient(1000px 500px at 0% 0%, rgba(26, 140, 201, 0.18), transparent 68%),
    radial-gradient(800px 400px at 100% 0%, rgba(28, 157, 106, 0.14), transparent 68%),
    linear-gradient(180deg, var(--sg-bg), #f8fcff 62%);
}

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

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

.sg-header {
  border-bottom: 1px solid var(--sg-border);
  background: rgba(245, 251, 255, 0.94);
  backdrop-filter: blur(6px);
}
.sg-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
}
.sg-brand { text-decoration: none; color: var(--sg-head); display: inline-flex; flex-direction: column; }
.sg-brand-name {
  font-family: "DM Serif Display", "Georgia", serif;
  font-size: clamp(1.25rem, 2.1vw, 1.95rem);
}
.sg-brand-tag {
  color: var(--sg-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sg-menu,
.sg-menu-fallback {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sg-menu a,
.sg-menu-fallback a {
  display: inline-block;
  text-decoration: none;
  color: var(--sg-head);
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  padding: 0.42rem 0.76rem;
  font-weight: 700;
  font-size: 0.9rem;
  background: #fff;
}
.sg-menu a:hover,
.sg-menu-fallback a:hover,
.sg-menu .current-menu-item > a,
.sg-menu .current_page_item > a {
  border-color: rgba(26, 140, 201, 0.5);
  color: var(--sg-accent);
}

.sg-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}
.sg-hero-main {
  border: 1px solid var(--sg-border);
  border-radius: 14px;
  padding: clamp(1.2rem, 3vw, 2.2rem);
  background: linear-gradient(180deg, #ffffff, #eef8ff);
}
.sg-kicker {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--sg-muted);
}
.sg-hero h1 {
  margin: 0.3rem 0 0;
  font-family: "DM Serif Display", serif;
  color: var(--sg-head);
  font-size: clamp(1.8rem, 3.9vw, 2.95rem);
  line-height: 1.1;
}
.sg-hero p { margin: 0.75rem 0 0; }
.sg-actions {
  margin-top: 0.95rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.sg-chip {
  text-decoration: none;
  border-radius: 999px;
  padding: 0.5rem 0.86rem;
  font-weight: 700;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
}
.sg-chip-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--sg-accent), #57b7e6);
}
.sg-chip-secondary {
  color: var(--sg-head);
  border-color: var(--sg-border);
  background: #fff;
}

.sg-hero-aside {
  border: 1px solid var(--sg-border);
  border-radius: 14px;
  padding: 1rem;
  background: linear-gradient(180deg, #f6fbff, #e9f6ff);
}
.sg-hero-aside h2 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  color: var(--sg-head);
  font-size: 1.35rem;
}
.sg-hero-aside ul {
  margin: 0.7rem 0 0;
  padding-left: 1.1rem;
}
.sg-hero-aside li + li { margin-top: 0.38rem; }

.sg-section { margin-top: 2rem; }
.sg-section-head h1,
.sg-section-head h2,
.sg-article h1 {
  margin: 0;
  color: var(--sg-head);
  font-family: "DM Serif Display", serif;
}
.sg-section-head p { margin: 0.36rem 0 0; color: var(--sg-muted); }
.sg-eyebrow {
  margin: 0;
  color: var(--sg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.73rem;
}

.sg-stream {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.75rem;
}
.sg-stream-item {
  border: 1px solid var(--sg-border);
  border-radius: 12px;
  padding: 0.86rem 0.9rem;
  background: var(--sg-panel);
}
.sg-stream-item h3 {
  margin: 0.38rem 0 0.43rem;
  font-family: "DM Serif Display", serif;
  font-size: 1.15rem;
}
.sg-meta {
  margin: 0;
  font-size: 0.74rem;
  color: var(--sg-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.sg-stream-item p { margin: 0; }

.sg-criteria-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.sg-criteria-item {
  border: 1px solid var(--sg-border);
  border-radius: 12px;
  padding: 0.8rem;
  background: var(--sg-panel-soft);
}
.sg-criteria-item h3 {
  margin: 0.34rem 0 0;
  font-family: "DM Serif Display", serif;
  font-size: 1.03rem;
}

.sg-post-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.sg-card {
  border: 1px solid var(--sg-border);
  border-radius: 12px;
  padding: 0.82rem;
  background: var(--sg-panel);
}
.sg-card h2,
.sg-card h3 {
  margin: 0.35rem 0 0.45rem;
  font-family: "DM Serif Display", serif;
  font-size: 1.03rem;
}
.sg-card p { margin: 0; }

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

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

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

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

@media (max-width: 980px) {
  .sg-hero,
  .sg-criteria-grid,
  .sg-post-grid {
    grid-template-columns: 1fr;
  }
  .sg-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

/* Newsletter UX Refresh */
.sg-newsletter,
.sg-popup-signup {
  border: 1px solid color-mix(in srgb, var(--sg-border) 72%, #ffffff 28%);
  border-radius: 14px;
  background: linear-gradient(180deg, #f7fcff, #eaf6ff);
  box-shadow: 0 16px 34px rgba(17, 90, 146, 0.12);
}
.sg-popup-signup { padding: 0.3rem 0.15rem 0.1rem; }
.sg-popup-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: #1d79b8;
}
.sg-popup-signup h3,
.sg-newsletter .mailgun-list-title .widget-title {
  margin: 0 0 0.4rem;
  color: var(--sg-head);
  font-size: clamp(1.1rem, 2.1vw, 1.44rem);
}
.sg-popup-signup > p {
  margin: 0 0 0.82rem;
  color: #2d5f82;
}
.sg-newsletter .mailgun-list-widget-inputs,
.sg-popup-signup .mailgun-list-widget-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
}
.sg-newsletter .mailgun-list-widget-name,
.sg-popup-signup .mailgun-list-widget-name,
.sg-newsletter .mailgun-list-widget-email,
.sg-popup-signup .mailgun-list-widget-email {
  margin: 0;
  display: grid;
  gap: 0.28rem;
}
.sg-newsletter label,
.sg-popup-signup label {
  color: #3f6f90;
  font-size: 0.78rem;
  font-weight: 600;
}
.sg-newsletter input[type="text"],
.sg-popup-signup input[type="text"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #a8c6dd;
  border-radius: 9px;
  padding: 0.61rem 0.7rem;
  background: #fff;
  color: var(--sg-head);
}
.sg-newsletter .mailgun-list-submit-button,
.sg-popup-signup .mailgun-list-submit-button {
  margin-top: 0.8rem;
  width: 100%;
  min-height: 45px;
  border: 1px solid #2f87c5;
  border-radius: 999px;
  padding: 0.6rem 0.92rem;
  background: linear-gradient(135deg, #2d9be0, #2378b5);
  color: #fff;
  font-weight: 700;
}
.sg-newsletter .result-panel,
.sg-popup-signup .result-panel {
  margin-top: 0.74rem;
  border-radius: 8px;
  border: 1px solid #a8c6dd;
  background: #f4fbff;
  color: #2e6486;
}
@media (max-width: 760px) {
  .sg-newsletter .mailgun-list-widget-inputs,
  .sg-popup-signup .mailgun-list-widget-inputs { grid-template-columns: 1fr; }
}

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

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

/* Newsletter readability fix */
.sg-news-field input::placeholder {
  color: #68849a;
  opacity: 1;
}
.sg-news-field input:focus {
  border-color: #2d9be0 !important;
  box-shadow: 0 0 0 3px rgba(45, 155, 224, 0.2);
  outline: none;
}
