/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
  background: #f8fafc;
  line-height: 1.6;
}
a { color: #0369a1; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */
nav {
  background: #0369a1;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-logo {
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.3px;
}
.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a { color: rgba(255,255,255,0.88); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: #fff; text-decoration: none; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 60%, #38bdf8 100%);
  color: #fff;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: 0.75rem; }
.hero p { font-size: 1.05rem; opacity: 0.9; max-width: 560px; margin: 0 auto; }

/* ── Calculator Card ── */
.calc-wrap {
  max-width: 680px;
  margin: -1.5rem auto 2.5rem;
  padding: 0 1rem;
}
.calc-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  padding: 2rem;
}
.calc-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Form ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.input-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-weight: 600;
  font-size: 1rem;
  pointer-events: none;
}
.input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.85rem;
  pointer-events: none;
}
input[type="number"], select {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]:focus, select:focus {
  outline: none;
  border-color: #0369a1;
  background: #fff;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
select { padding-left: 1rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.calc-btn {
  width: 100%;
  padding: 1rem;
  background: #0369a1;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.15s, transform 0.1s;
}
.calc-btn:hover { background: #0284c7; transform: translateY(-1px); }
.calc-btn:active { transform: translateY(0); }

/* ── Results ── */
.result-box {
  display: none;
  margin-top: 1.5rem;
  border-top: 2px solid #e2e8f0;
  padding-top: 1.5rem;
}
.result-verdict {
  text-align: center;
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
}
.verdict-safe { background: #dcfce7; color: #15803d; }
.verdict-tight { background: #fef9c3; color: #854d0e; }
.verdict-over { background: #fee2e2; color: #b91c1c; }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.result-item {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.result-item .label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.result-item .value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0369a1;
}
.result-item .value.danger { color: #dc2626; }
.result-item .value.warn { color: #d97706; }

.result-bar-wrap { margin-bottom: 1rem; }
.result-bar-wrap .bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.4rem;
}
.bar-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}
.bar-safe { background: #22c55e; }
.bar-tight { background: #eab308; }
.bar-over { background: #ef4444; }

.result-tip {
  background: #f0f9ff;
  border-left: 4px solid #0369a1;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: #0c4a6e;
  line-height: 1.6;
}

/* ── Tabs (calculator modes) ── */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
}
.tab-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn.active {
  background: #fff;
  color: #0369a1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Content Area ── */
.content-wrap { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 3rem; }

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #0369a1;
}

/* ── Info Cards ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.info-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border-top: 4px solid #0369a1;
}
.info-card .icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.info-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.info-card p { font-size: 0.9rem; color: #475569; line-height: 1.6; }

/* ── Blog Post List ── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.post-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 4px solid #0369a1;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.post-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.post-card p { font-size: 0.85rem; color: #64748b; line-height: 1.5; }
.post-card .read-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0369a1;
}

/* ── Disclaimer ── */
.disclaimer {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.6;
  margin-top: 2rem;
}
.disclaimer strong { color: #475569; }

/* ── Footer ── */
footer {
  background: #1e293b;
  color: rgba(255,255,255,0.7);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}
footer a { color: rgba(255,255,255,0.7); }
footer a:hover { color: #fff; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }

/* ── Blog Post Page ── */
.post-header {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  color: #fff;
  padding: 3rem 1.5rem 2.5rem;
}
.post-header h1 { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 800; max-width: 760px; }
.post-meta { font-size: 0.85rem; opacity: 0.8; margin-top: 0.5rem; }
.post-body { max-width: 760px; margin: 2.5rem auto; padding: 0 1.5rem 3rem; }
.post-body h2 { font-size: 1.3rem; font-weight: 700; color: #0369a1; margin: 2rem 0 0.75rem; }
.post-body h3 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.post-body p { margin-bottom: 1rem; color: #374151; line-height: 1.75; }
.post-body ul, .post-body ol { margin: 0.75rem 0 1rem 1.5rem; }
.post-body li { margin-bottom: 0.4rem; color: #374151; line-height: 1.65; }
.post-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; }
.post-body th { background: #0369a1; color: #fff; padding: 0.6rem 1rem; text-align: left; }
.post-body td { padding: 0.6rem 1rem; border-bottom: 1px solid #e2e8f0; }
.post-body tr:nth-child(even) td { background: #f8fafc; }
.highlight-box {
  background: #f0f9ff;
  border-left: 4px solid #0369a1;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.92rem;
  color: #0c4a6e;
}
.source-note {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.related-posts { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid #e2e8f0; }
.related-posts h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .calc-card { padding: 1.25rem; }
  .tabs { flex-direction: column; }
  .tab-btn { text-align: center; }
}
@media (max-width: 400px) {
  .result-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.4rem; }
}
