/* =========================================================
   Quick Tiny Tools — Global Stylesheet
   Reusable, mobile-first, lightweight CSS.
   Add new tool-specific styles at the bottom or in a
   dedicated section. Keep utility classes generic.
   ========================================================= */

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1f2937;
  background: #f9fafb;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  color: #111827;
  margin: 0 0 0.5em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; margin-top: 1.5em; }
h3 { font-size: 1.1rem; margin-top: 1.25em; }

p { margin: 0 0 1em; }

ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.35em; }

/* ---------- Layout containers ---------- */
.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container--wide {
  max-width: 1040px;
}

main {
  padding: 1.25rem 0 2.5rem;
}

/* ---------- Header / Nav ---------- */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  max-width: 1040px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #111827;
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav a {
  color: #374151;
  font-size: 0.95rem;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.hero h1 {
  font-size: 1.9rem;
  margin-bottom: 0.25em;
}

.hero .tagline {
  color: #4b5563;
  font-size: 1.05rem;
  margin-bottom: 0.5em;
}

.hero .intro {
  color: #4b5563;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Card grid (for tools / categories) ---------- */
.section {
  margin-top: 2rem;
}

.section__title {
  margin-bottom: 0.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  display: block;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover,
.card:focus {
  border-color: #2563eb;
  text-decoration: none;
}

.card__title {
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.25em;
  font-size: 1.05rem;
}

.card__desc {
  color: #4b5563;
  font-size: 0.95rem;
  margin: 0;
}

.card--featured {
  border-color: #2563eb;
  background: #eff6ff;
}

.card--coming-soon {
  opacity: 0.7;
  cursor: default;
  pointer-events: none;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  margin-left: 0.5em;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--muted {
  background: #9ca3af;
}

/* ---------- Calculator / Tool box ---------- */
.tool-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.1rem;
  margin: 1rem 0 1.5rem;
}

.tool-box h2 {
  margin-top: 0;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.form-row label {
  font-weight: 600;
  color: #111827;
  font-size: 0.95rem;
}

.form-row input,
.form-row select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  appearance: none;
}

.form-row input:focus,
.form-row select:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.unit-toggle {
  display: inline-flex;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.unit-toggle button {
  background: transparent;
  border: 0;
  padding: 0.55rem 0.95rem;
  font-size: 0.95rem;
  cursor: pointer;
  color: #374151;
  font-weight: 600;
}

.unit-toggle button.is-active {
  background: #2563eb;
  color: #fff;
}

.btn {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  border: 0;
  padding: 0.75rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}

.btn:hover,
.btn:focus {
  background: #1d4ed8;
}

.btn--secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn--secondary:hover,
.btn--secondary:focus {
  background: #d1d5db;
}

/* ---------- Result box ---------- */
.result {
  margin-top: 1rem;
  background: #ecfdf5;
  border: 1px solid #34d399;
  border-radius: 10px;
  padding: 1rem;
}

.result[hidden] {
  display: none;
}

.result__title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #047857;
  font-weight: 700;
  margin: 0 0 0.25em;
}

.result__value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #064e3b;
  margin: 0 0 0.25em;
  line-height: 1.2;
}

.result__sub {
  font-size: 1rem;
  color: #065f46;
  margin: 0 0 0.5em;
}

.result__instruction {
  color: #064e3b;
  font-size: 0.95rem;
  margin: 0.4em 0 0;
}

/* ---------- Tip / safety box ---------- */
.tip-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
}

.tip-box h3 {
  margin: 0 0 0.4em;
  color: #92400e;
  font-size: 1rem;
}

.tip-box ul {
  margin: 0;
  padding-left: 1.2rem;
}

.tip-box li {
  color: #78350f;
}

/* ---------- FAQ ---------- */
.faq details {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: #111827;
}

.faq details[open] summary {
  margin-bottom: 0.5em;
}

/* ---------- Disclaimer ---------- */
.disclaimer {
  font-size: 0.85rem;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
  margin-top: 2rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 1.25rem 1rem;
  margin-top: 2rem;
}

.site-footer__inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer a {
  color: #374151;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: #6b7280; }

/* =========================================================
   FUTURE TOOL STYLES
   Add tool-specific overrides below this line, ideally
   scoped under a wrapper class (e.g. .tool-pizza, .tool-loan)
   so the global styles stay clean.
   ========================================================= */
