/* =============================================
   Calculatr.in — Global Stylesheet
   assets/style.css
   ============================================= */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand:    #1a56db;
  --brand-dk: #1340a8;
  --brand-lt: #e8eeff;
  --accent:   #0ea5e9;
  --bg:       #f5f7ff;
  --surface:  #ffffff;
  --border:   #dde3f0;
  --text:     #1e2740;
  --muted:    #64748b;
  --green:    #16a34a;
  --red:      #dc2626;
  --radius:   10px;
  --shadow:   0 2px 10px rgba(26,86,219,.10);
  --font:     'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:     'DM Mono', 'Fira Code', 'Consolas', monospace;
}
html  { scroll-behavior: smooth; }
body  {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--brand-dk); }

/* ── HEADER ── */
header {
  background: var(--brand);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(26,86,219,.4);
}
.logo { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -.5px; }
.logo a { color: #fff; text-decoration: none; }
.logo span { color: #93c5fd; }
.header-tagline { font-size: 11px; color: #bfdbfe; display: none; }
@media(min-width:480px){ .header-tagline { display: block; } }

#menu-btn {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px; padding: 4px;
}
#menu-btn span {
  display: block; width: 24px; height: 2px;
  background: #fff; border-radius: 2px; transition: .25s;
}

/* ── NAV OVERLAY (dim background behind sidebar) ── */
#nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 998;
  cursor: pointer;
}
#nav-overlay.active { display: block; }

/* ── MOBILE NAV — fixed right-side drawer ── */
#mobile-nav {
  display: block;
  position: fixed;
  top: 0;
  right: -290px;
  left: auto;
  width: 270px;
  height: 100vh;
  background: var(--brand-dk, #1340a8);
  z-index: 999;
  transition: right .3s ease;
  padding: 66px 0 24px;
  box-shadow: -4px 0 24px rgba(0,0,0,.3);
  overflow-y: auto;
}
#mobile-nav.open { right: 0; }
#mobile-nav a {
  display: block;
  color: #bfdbfe;
  padding: 13px 22px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
#mobile-nav a:last-child { border-bottom: none; }
#mobile-nav a:hover { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }

/* ── NAV CLOSE BUTTON ── */
#nav-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
#nav-close-btn:hover { background: rgba(255,255,255,.28); }

/* ── LAYOUT ── */
.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 14px;
}

/* ── BREADCRUMBS ── */
#breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  padding: 10px 0 4px;
}
#breadcrumbs a { color: var(--muted); }
#breadcrumbs a:hover { color: var(--brand); }

/* ── PAGE TITLE ── */
h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 8px 0 10px;
  letter-spacing: -.3px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 8px;
}
p { margin-bottom: 12px; }

/* ── CALCULATOR PANEL ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel-title {
  background: var(--brand-lt);
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-dk);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title::before { content: '▼'; font-size: 11px; }

/* ── FORM ELEMENTS ── */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-end;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 140px;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.form-group input,
.form-group select {
  padding: 9px 11px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  transition: border-color .2s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 28px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-secondary { background: var(--bg); color: var(--brand); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--brand-lt); }

/* ── RESULT BOX ── */
.result-box {
  display: none;
  background: #f0fff4;
  border: 1.5px solid #86efac;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-top: 16px;
}
.result-box.show { display: block; }
.result-label {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 4px;
}
.result-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}
.result-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.result-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.result-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.result-table td:first-child { color: var(--muted); }
.result-table td:last-child { font-weight: 600; font-family: var(--mono); }

/* ── RELATED BOX ── */
.related-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  margin: 0 0 24px;
}
.related-box strong { color: var(--muted); font-size: 12px; display: block; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.related-box a {
  display: inline-block;
  background: var(--brand-lt);
  color: var(--brand-dk);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  margin: 3px 4px 3px 0;
  font-weight: 600;
}
.related-box a:hover { background: var(--brand); color: #fff; text-decoration: none; }

/* ── CATEGORY CARDS (used on index + category pages) ── */
.cat-section { margin-bottom: 28px; }
.cat-head {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  letter-spacing: .3px;
}
.cat-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 8px 0;
  columns: 2;
  column-gap: 0;
}
@media(min-width:600px){ .cat-list { columns: 3; } }
.cat-list a {
  display: block;
  padding: 5px 14px;
  font-size: 14px;
  color: var(--brand);
  break-inside: avoid;
  transition: background .15s;
}
.cat-list a:hover {
  background: var(--brand-lt);
  text-decoration: none;
  border-radius: 4px;
}

/* ── INFO TEXT ── */
.info-section {
  font-size: 14.5px;
  color: #374151;
  line-height: 1.75;
}
.info-section h2 { font-size: 17px; }

/* ── FOOTER ── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 24px;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--brand); }

/* ── OVERRIDES & ADDITIONS ── */
:root{--brand:#1a56db;--brand-dk:#1244b8;--brand-lt:#dbeafe;--bg:#f0f6ff}
header{height:56px}
.logo{display:flex;align-items:center;flex-shrink:0;height:100%}
.logo a{display:flex;align-items:center;gap:8px;color:#fff;text-decoration:none;font-size:22px;font-weight:700;letter-spacing:-.5px;white-space:nowrap;line-height:1;height:100%}
.logo a img{width:28px;height:28px;display:block;object-fit:contain;flex-shrink:0}
