/* calcdeck.net — Global Styles */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --blue:        #2563EB;
  --blue-dark:   #1D4ED8;
  --blue-light:  #EFF6FF;
  --green:       #059669;
  --green-light: #ECFDF5;
  --text:        #0F172A;
  --text-body:   #1E293B;
  --text-muted:  #64748B;
  --border:      #E2E8F0;
  --surface:     #FFFFFF;
  --bg:          #F8FAFC;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --max-width:   1100px;
  --content-width: 720px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.content-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
}
.page-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
@media (max-width: 900px) {
  .page-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--blue); }
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.nav-links a:hover { color: var(--blue); text-decoration: none; }
@media (max-width: 600px) {
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.8rem; }
}

/* ============================================================
   HERO / PAGE HEADER
   ============================================================ */
.page-hero {
  background: var(--blue-light);
  border-bottom: 1px solid #DBEAFE;
  padding: 36px 20px 32px;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.page-hero p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }

/* ============================================================
   CALCULATOR
   ============================================================ */
.calc-wrap { margin: 28px auto; max-width: 580px; }

.calc-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 16px;
  align-items: end;
}
.input-row.single { grid-template-columns: 1fr; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.input-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: border-color .15s;
}
.input-group:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.input-group input {
  flex: 1;
  border: none;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  outline: none;
  min-width: 0;
}
.input-group input::placeholder { color: #CBD5E1; }

.input-prefix, .input-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}
.input-prefix { border-left: none; border-right: 1px solid var(--border); }

select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.btn-calc {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 20px;
  transition: background .15s, transform .1s;
}
.btn-calc:hover { background: var(--blue-dark); }
.btn-calc:active { transform: scale(.99); }

/* ============================================================
   RESULT CARD
   ============================================================ */
.result-card {
  display: none;
  background: var(--green-light);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
  animation: fadeIn .25s ease;
}
.result-card.visible { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.result-main {
  text-align: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #6EE7B7;
}
.result-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
}
.result-number {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-top: 4px;
}
.result-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.result-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.result-table tr { border-bottom: 1px solid #A7F3D0; }
.result-table tr:last-child { border-bottom: none; }
.result-table td { padding: 8px 4px; }
.result-table td:first-child { color: var(--text-muted); }
.result-table td:last-child { text-align: right; font-weight: 600; color: var(--text); }
.result-table .highlight td { font-weight: 700; }
.result-table .highlight td:last-child { color: var(--green); }

/* ============================================================
   CONTENT AREA
   ============================================================ */
.tool-content { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--border); }
.tool-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  margin-top: 32px;
}
.tool-content h2:first-child { margin-top: 0; }
.tool-content p { color: var(--text-body); margin-bottom: 16px; line-height: 1.7; }
.tool-content ol, .tool-content ul { padding-left: 20px; margin-bottom: 16px; }
.tool-content li { margin-bottom: 6px; color: var(--text-body); line-height: 1.6; }
.tool-content strong { color: var(--text); font-weight: 600; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; color: var(--text); margin-bottom: 8px; }
.faq-a { color: var(--text-body); font-size: 0.95rem; line-height: 1.6; }

/* ============================================================
   RELATED TOOLS
   ============================================================ */
.related-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.related-tool-link {
  display: block;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue);
  transition: border-color .15s, box-shadow .15s;
}
.related-tool-link:hover { border-color: var(--blue); box-shadow: var(--shadow); text-decoration: none; }

/* ============================================================
   AFFILIATE SIDEBAR
   ============================================================ */
.affiliate-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
}
.affiliate-block h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.affiliate-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.affiliate-item:last-child { border-bottom: none; padding-bottom: 0; }
.affiliate-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--blue);
  text-align: center;
  flex-shrink: 0;
  line-height: 1.2;
}
.affiliate-info { flex: 1; min-width: 0; }
.affiliate-name { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.affiliate-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.affiliate-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 12px;
  background: var(--blue);
  color: white;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background .15s;
}
.affiliate-cta:hover { background: var(--blue-dark); text-decoration: none; }

/* ============================================================
   HOMEPAGE
   ============================================================ */
.home-hero {
  background: linear-gradient(135deg, var(--blue-light) 0%, #E0EAFF 100%);
  padding: 60px 20px;
  text-align: center;
  border-bottom: 1px solid #DBEAFE;
}
.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.home-hero p {
  margin-top: 12px;
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.tools-section { padding: 48px 0; }
.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: block;
  transition: box-shadow .15s, border-color .15s, transform .15s;
  box-shadow: var(--shadow);
}
.tool-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
  transform: translateY(-1px);
  text-decoration: none;
}
.tool-card-icon {
  width: 40px;
  height: 40px;
  background: var(--blue-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}
.tool-card-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.tool-card-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.tool-card-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--green-light);
  color: var(--green);
}

/* ============================================================
   BLOG
   ============================================================ */
.blog-grid { display: grid; gap: 16px; }
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: block;
  transition: box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow);
}
.blog-card:hover { box-shadow: var(--shadow-md); border-color: var(--blue); text-decoration: none; }
.blog-card-tag { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); margin-bottom: 6px; }
.blog-card-title { font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.35; }
.blog-card-desc { font-size: 0.875rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.blog-card-arrow { font-size: 0.8rem; color: var(--blue); margin-top: 10px; display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--text);
  color: #94A3B8;
  padding: 40px 20px;
  margin-top: 60px;
  font-size: 0.875rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.footer-logo { font-size: 1.1rem; font-weight: 700; color: white; }
.footer-logo span { color: #60A5FA; }
.footer-tagline { color: #64748B; font-size: 0.8rem; margin-top: 4px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: #94A3B8; font-size: 0.8rem; }
.footer-links a:hover { color: white; text-decoration: none; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 20px auto 0;
  padding-top: 20px;
  border-top: 1px solid #1E293B;
  color: #475569;
  font-size: 0.75rem;
}
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; gap: 12px; }
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 12px 0;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb span { margin: 0 6px; }

/* ============================================================
   UTILITY
   ============================================================ */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.875rem; }
.text-center { text-align: center; }
.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
