/* MeasureMate — site styles
 * Soft neutral palette (warm stone) with a single teal accent.
 * Mobile-first, no frameworks, no webfonts — fast by default.
 */
:root {
  --bg: #faf8f5;
  --card: #ffffff;
  --ink: #28241f;
  --muted: #6f675d;
  --line: #e8e2d8;
  --accent: #0f766e;
  --accent-ink: #0b5d57;
  --accent-soft: #e7f4f2;
  --soft: #f4f0e9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 36, 31, 0.05), 0 8px 24px rgba(40, 36, 31, 0.07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1rem;
}
a { color: var(--accent-ink); }
a:hover { color: var(--accent); }
img { max-width: 100%; }

.container { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px 16px; padding-top: 10px; padding-bottom: 10px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.12rem; color: var(--ink); text-decoration: none;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 700;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.92rem; }
.site-nav a {
  text-decoration: none; color: var(--muted); font-weight: 600;
  padding: 4px 2px; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent-ink); }
.site-nav a[aria-current="page"] { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 30px 0 4px; }
.page-hero { padding-top: 26px; }
h1 { font-size: clamp(1.65rem, 5vw, 2.45rem); line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.02em; }
.tagline { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 1.02rem; }

/* ---------- Cards / converter ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.converter { max-width: 720px; margin: 22px auto 8px; padding: 18px; }

.tabs {
  display: flex; gap: 6px; padding: 5px;
  background: var(--soft); border-radius: 999px; margin-bottom: 18px;
}
.tab {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  padding: 10px 12px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 700; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--accent); color: #fff; }

.field { margin-bottom: 12px; min-width: 0; }
.field label {
  display: block; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 5px;
}
input[type="number"], select {
  width: 100%;
  font: inherit; font-size: 1.05rem;
  color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px 12px; outline: none;
}
input[type="number"]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select { appearance: auto; }
option:disabled, option.incompatible { color: #c2bab0; }

.convert-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px; align-items: end;
}
.swap {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid var(--accent); cursor: pointer;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 20px; line-height: 1;
  justify-self: center; margin-bottom: 6px;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.swap:hover { background: var(--accent); color: #fff; transform: rotate(180deg); }

.result {
  margin-top: 14px;
  background: var(--accent-soft);
  border: 1px solid #cde8e4;
  border-radius: 12px;
  padding: 14px 16px;
}
.result-main {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: clamp(1.35rem, 4.5vw, 1.85rem); font-weight: 800;
  color: var(--accent-ink); word-break: break-word;
}
.copy {
  flex-shrink: 0; border: 1px solid var(--accent); border-radius: 999px;
  background: #fff; color: var(--accent-ink); cursor: pointer;
  font-size: 0.78rem; font-weight: 700; padding: 6px 12px;
}
.copy:hover { background: var(--accent); color: #fff; }
.result-sub { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.tool-note { font-size: 0.85rem; color: var(--muted); margin: 14px 0 0; }

/* ---------- Ad slots (paste AdSense code inside) ---------- */
.ad-slot {
  position: relative;
  max-width: 720px; min-height: 110px;
  margin: 24px auto;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--line); border-radius: 12px;
  background: #fcfaf7; color: #c9c1b5;
  font-size: 0.85rem;
}
.ad-label {
  position: absolute; top: 6px; left: 12px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #b3aa9c;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; background: #fff; }
caption { text-align: left; font-weight: 700; padding: 0 0 8px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
thead th {
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em;
}
tbody tr:nth-child(even) { background: #faf8f4; }

.quick-ref { max-width: 880px; margin: 8px auto 0; }
.quick-ref h2 { text-align: center; }
.quick-tables {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.quick-tables .card { padding: 14px 16px; }
.quick-tables h3 { margin: 2px 0 8px; font-size: 1rem; color: var(--accent-ink); }
.quick-tables table { font-size: 0.88rem; }
.quick-tables td { padding: 6px 8px; }

/* ---------- Article / content pages ---------- */
.article, .page-content { max-width: 720px; margin: 8px auto 0; }
.article h2, .page-content h2 { font-size: 1.4rem; margin: 34px 0 10px; letter-spacing: -0.01em; }
.article h3, .page-content h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.article p, .page-content p { margin: 0 0 14px; }
.article ul, .article ol, .page-content ul, .page-content ol { padding-left: 22px; margin: 0 0 14px; }
.article li, .page-content li { margin-bottom: 8px; }
.lead { font-size: 1.05rem; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px 18px; margin-bottom: 10px;
}
.faq-item summary {
  cursor: pointer; font-weight: 700; padding: 12px 0;
  list-style-position: inside;
}
.faq-item summary:hover { color: var(--accent-ink); }
.faq-item[open] { border-color: var(--accent); }
.faq-item p { margin-top: 0; }

.center-note { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  font-weight: 700; text-decoration: none;
  padding: 12px 22px; border-radius: 10px;
}
.btn:hover { background: var(--accent-ink); color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 48px;
  background: var(--soft);
  border-top: 1px solid var(--line);
  padding: 26px 0 30px;
  font-size: 0.92rem;
}
.footer-cols {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 18px;
}
.footer-brand { font-weight: 800; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.footer-blurb { color: var(--muted); margin: 0; font-size: 0.88rem; }
.site-footer h3 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0 0 8px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-fine { color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); padding-top: 14px; margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .convert-row { grid-template-columns: 1fr; }
  .swap { transform: rotate(90deg); margin: 0 auto; }
  .swap:hover { transform: rotate(270deg); }
  .converter { padding: 14px; }
  .header-inner { justify-content: center; text-align: center; }
}
