/*
Theme Name: InchCalculators
Theme URI: https://inchcalculators.org/
Author: InchCalculators.org
Description: Fast, SEO-friendly calculator theme. Includes 300+ calculators and 1,500+ unit converters as WordPress pages. After activating, open Appearance > Calculator Setup and click "Create pages".
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: Proprietary
Text Domain: inchcalculators
*/
/* InchCalculators.org – main stylesheet */
:root {
  --brand: #1849a9; --brand-d: #12357d; --brand-l: #e8effc; --accent: #f08c00;
  --ink: #18212f; --ink-2: #475467; --ink-3: #667085; --line: #e3e8ef; --bg: #f5f7fb; --card: #fff;
  --ok: #067647; --err: #b42318; --err-bg: #fef3f2;
  --r: 12px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin: 0 0 .4rem; letter-spacing: -.01em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 99; }

/* header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.hdr { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; color: var(--ink); font-weight: 600; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--brand); font-weight: 800; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.hdr-search { flex: 1; max-width: 520px; margin-left: auto; }
.cat-nav { border-top: 1px solid var(--line); background: var(--card); }
.cat-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.cat-nav ul::-webkit-scrollbar { display: none; }
.cat-nav a { display: block; padding: 10px 12px; font-size: .9rem; color: var(--ink-2); white-space: nowrap; font-weight: 500; border-bottom: 2px solid transparent; }
.cat-nav a:hover { color: var(--brand); border-bottom-color: var(--brand); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* search */
.search-box { position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search-box input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px 0 38px; font: inherit; font-size: .95rem; background: var(--bg); color: var(--ink); }
.search-box input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-l); }
.search-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(16,24,40,.14); overflow: hidden; z-index: 40; max-height: 420px; overflow-y: auto; }
.search-suggest a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; color: var(--ink); border-bottom: 1px solid var(--line); }
.search-suggest a:last-child { border-bottom: 0; }
.search-suggest a:hover, .search-suggest a.active { background: var(--brand-l); text-decoration: none; }
.search-suggest small { color: var(--ink-3); white-space: nowrap; }
.sg-empty { padding: 12px 14px; color: var(--ink-3); }

/* hero */
.hero { background: linear-gradient(135deg, #12357d 0%, #1849a9 55%, #2563eb 100%); color: #fff; padding: 56px 0 64px; text-align: center; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.hero p { max-width: 680px; margin: 0 auto 24px; color: #dbe6ff; font-size: 1.08rem; }
.hero-search { max-width: 640px; margin: 0 auto; text-align: left; }
.hero-search input { height: 54px; font-size: 1.05rem; background: #fff; border: 0; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.hero-tags a { color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 4px 12px; border-radius: 999px; font-size: .88rem; }
.hero-tags a:hover { background: rgba(255,255,255,.25); text-decoration: none; }

.sec-title { font-size: 1.35rem; margin: 40px 0 16px; display: flex; align-items: center; gap: 8px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cat-tile { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.cat-tile:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-2px); }
.cat-tile .ico { width: 30px; height: 30px; color: var(--brand); background: var(--brand-l); padding: 5px; border-radius: 8px; box-sizing: content-box; margin-bottom: 6px; }
.ct-name { font-weight: 600; }
.ct-count { font-size: .85rem; color: var(--ink-3); }
.ico { width: 20px; height: 20px; vertical-align: -4px; flex: none; }
.ico.big { width: 44px; height: 44px; color: var(--brand); background: var(--brand-l); padding: 10px; border-radius: 12px; box-sizing: content-box; }

.pop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pop-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); }
.pop-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.pop-card h3 a { color: var(--ink); display: flex; gap: 8px; align-items: center; }
.pop-card h3 .ico { color: var(--brand); }
.pop-card ul { list-style: none; margin: 0 0 8px; padding: 0; }
.pop-card li a { display: block; padding: 5px 0; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.pop-card li a:hover { color: var(--brand); }
.more { font-size: .9rem; font-weight: 600; }
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 48px 0; }
.why div { background: var(--card); border-radius: var(--r); padding: 20px; border: 1px solid var(--line); }
.why h3 { margin: 0 0 6px; font-size: 1.05rem; }
.why p { margin: 0; color: var(--ink-2); }

/* breadcrumbs */
.crumbs ol { list-style: none; margin: 0; padding: 14px 16px 0; display: flex; flex-wrap: wrap; font-size: .88rem; color: var(--ink-3); }
.crumbs .wrap ol, .crumbs ol { padding-left: 0; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: #98a2b3; }
.crumbs a { color: var(--ink-2); }

/* page layout */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; padding-bottom: 48px; }
.page-head { padding: 16px 0 8px; }
.cat-head { display: flex; gap: 18px; align-items: center; }
.lead { color: var(--ink-2); font-size: 1.05rem; margin: 0 0 12px; max-width: 760px; }
.count { color: var(--ink-3); font-size: .92rem; }

/* calculator card */
.calc-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 16px rgba(16,24,40,.06); padding: 24px; margin: 8px 0 24px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--ink); }
.field label em { font-weight: 400; color: var(--ink-3); font-style: normal; }
.field small { display: block; color: var(--ink-3); font-size: .82rem; margin-top: 4px; }
.field[hidden] { display: none; }
.ig { display: flex; border: 1px solid #cfd6e0; border-radius: 10px; background: #fff; overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.ig:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.ig input { flex: 1; min-width: 0; border: 0; height: 44px; padding: 0 12px; font: inherit; font-size: 1rem; background: transparent; color: var(--ink); }
.ig input:focus, .ig select:focus { outline: none; }
.ig select { border: 0; border-left: 1px solid var(--line); background: #f8fafc; padding: 0 8px; font: inherit; font-size: .92rem; color: var(--ink-2); max-width: 46%; cursor: pointer; }
.affix { display: flex; align-items: center; padding: 0 12px; background: #f8fafc; color: var(--ink-3); border-left: 1px solid var(--line); }
.ig .affix:first-child { border-left: 0; border-right: 1px solid var(--line); }
.field > select, .field > input[type=date], .field > input[type=time], .field > input[type=text], .field > textarea {
  width: 100%; height: 44px; border: 1px solid #cfd6e0; border-radius: 10px; padding: 0 12px; font: inherit; background: #fff; color: var(--ink); }
.field > textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field > select:focus, .field > input:focus, .field > textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.fcheck label { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-top: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.btn { appearance: none; border: 0; background: var(--brand); color: #fff; font: inherit; font-weight: 600; height: 44px; padding: 0 22px; border-radius: 10px; cursor: pointer; }
.btn:hover { background: var(--brand-d); }
.btn.ghost { background: #fff; color: var(--ink-2); border: 1px solid #cfd6e0; }
.btn.ghost:hover { background: var(--bg); }
.btn.link { background: none; color: var(--brand); padding: 0 8px; margin-left: auto; }
.calc-error { margin-top: 16px; background: var(--err-bg); color: var(--err); padding: 10px 14px; border-radius: 10px; font-size: .95rem; }
.calc-result { margin-top: 20px; border-radius: 12px; background: linear-gradient(180deg, #f2f7ff, #fff); border: 1px solid #cddcf7; padding: 18px 20px; }
.r-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.r-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-top: 1px solid #e3ebf8; flex-wrap: wrap; }
.r-row:first-of-type { border-top: 0; }
.rl { color: var(--ink-2); }
.rvw { text-align: right; font-weight: 600; }
.rv { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.r-primary { flex-direction: column; align-items: flex-start; gap: 2px; }
.r-primary .rvw { text-align: left; }
.r-primary .rv { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; color: var(--brand-d); letter-spacing: -.01em; }
.out-unit { font: inherit; font-size: .9rem; border: 1px solid #cfd6e0; border-radius: 8px; padding: 3px 6px; background: #fff; color: var(--ink-2); vertical-align: middle; }
.r-html { margin-top: 12px; font-size: .95rem; }
.r-html h3 { font-size: 1rem; margin: 0 0 6px; }
.r-note { font-size: .88rem; color: var(--ink-3); margin: 10px 0 0; }
.swap-link { margin: -8px 0 16px; font-weight: 600; }

/* prose */
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 28px 20px; }
.wrap.prose { margin-top: 16px; margin-bottom: 48px; }
.prose h2 { font-size: 1.3rem; margin: 28px 0 10px; }
.prose h3 { font-size: 1.08rem; margin: 20px 0 8px; }
.prose p, .prose li { color: #344054; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
.formula { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--bg); border-left: 4px solid var(--brand); padding: 12px 16px; border-radius: 6px; overflow-x: auto; color: var(--ink) !important; }
.updated { font-size: .88rem; color: var(--ink-3) !important; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 28px; }
.tbl-wrap { overflow-x: auto; margin: 12px 0; }
.tbl { border-collapse: collapse; width: 100%; font-size: .94rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.tbl th { background: var(--bg); font-weight: 600; }
.tbl tbody tr:nth-child(even) td { background: #fafbfd; }
.faq details { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: #fff; }
.faq summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; position: relative; padding-right: 40px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 10px; font-size: 1.3rem; color: var(--brand); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 16px 8px; }

/* related & lists */
.related { margin-top: 28px; }
.related h2 { font-size: 1.2rem; }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.link-list li a { display: block; background: var(--card); border: 1px solid var(--line); padding: 10px 14px; border-radius: 10px; color: var(--ink); font-size: .95rem; }
.link-list li a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.link-list.cols { margin-bottom: 8px; }
.calc-tiles { list-style: none; padding: 0; margin: 0 0 48px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.calc-tiles a { display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; color: var(--ink); box-shadow: var(--shadow); }
.calc-tiles a:hover { border-color: var(--brand); text-decoration: none; }
.calc-tiles strong { display: block; color: var(--brand-d); margin-bottom: 4px; }
.calc-tiles span { font-size: .9rem; color: var(--ink-3); }
.conv-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.conv-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.conv-group h3 { margin: 0 0 6px; font-size: 1rem; }
.conv-group ul { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.conv-group li { padding: 2px 0; }

/* sidebar */
.side-col { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.side-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.side-box h2 { font-size: 1rem; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.side-box h2 .ico { color: var(--brand); }
.side-box ul { list-style: none; margin: 0 0 8px; padding: 0; max-height: 560px; overflow-y: auto; }
.side-box li a { display: flex; gap: 8px; align-items: center; padding: 5px 0; color: var(--ink-2); font-size: .92rem; }
.side-box li a .ico { width: 16px; height: 16px; color: var(--ink-3); }
.side-box li.cur a { color: var(--brand); font-weight: 600; }

/* search page */
.search-page-form { display: flex; gap: 8px; margin: 16px 0; }
.search-page-form input { flex: 1; height: 44px; border: 1px solid #cfd6e0; border-radius: 10px; padding: 0 12px; font: inherit; }
.search-results { list-style: none; padding: 0; margin: 0 0 48px; }
.search-results li { display: flex; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.search-results small { color: var(--ink-3); }

/* footer */
.site-footer { background: #0f1b33; color: #b9c4d8; margin-top: 32px; }
.ftr { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 40px 16px 24px; }
.site-footer .logo { color: #fff; }
.site-footer .logo b { color: #8fb3ff; }
.ftr p { font-size: .92rem; }
.ftr h2 { color: #fff; font-size: .95rem; margin: 6px 0 10px; }
.ftr ul { list-style: none; padding: 0; margin: 0; }
.ftr li a { color: #b9c4d8; font-size: .92rem; display: block; padding: 3px 0; }
.ftr li a:hover { color: #fff; }
.ftr-bottom { border-top: 1px solid #22324f; padding: 16px; font-size: .85rem; color: #8392ad; }

/* responsive */
@media (max-width: 960px) {
  .page-grid { grid-template-columns: 1fr; }
  .side-col { position: static; }
  .ftr { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .hdr { height: 58px; gap: 10px; }
  .hdr-search { display: none; }
  .nav-toggle { display: block; margin-left: auto; }
  .cat-nav { display: none; }
  .nav-open .cat-nav { display: block; }
  .nav-open .hdr-search { display: flex; position: absolute; top: 58px; left: 0; right: 0; max-width: none; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
  .nav-open .cat-nav { margin-top: 62px; }
  .cat-nav ul { flex-direction: column; }
  .cat-nav a { border-bottom: 1px solid var(--line); padding: 12px 4px; }
  .calc-card { padding: 18px 16px; border-radius: 14px; }
  .prose { padding: 4px 16px 16px; }
  .fields { grid-template-columns: 1fr; }
  .btn.link { margin-left: 0; }
  .hero { padding: 36px 0 44px; }
  .ftr { grid-template-columns: 1fr; gap: 16px; }
  .cat-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media print {
  .site-header, .site-footer, .side-col, .related, .actions { display: none !important; }
  body { background: #fff; }
}
.narrow > h1:first-child { margin-top: 24px; }
@media (min-width: 721px) {
  .cat-nav ul { flex-wrap: wrap; overflow: visible; }
  .cat-nav a { padding: 9px 10px; font-size: .88rem; }
}

/* WordPress-specific additions */
.wp-page { padding-top: 16px; padding-bottom: 48px; }
.wp-page .prose img { max-width: 100%; height: auto; }
.wp-page .entry-title { margin-top: 8px; }
.post-list { list-style: none; padding: 0; }
.post-list li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; }
.post-list h2 { margin: 0 0 6px; font-size: 1.2rem; }
.pagination { display: flex; gap: 8px; margin: 24px 0; }
.alignwide, .alignfull { max-width: 100%; }
.screen-reader-text { position: absolute; left: -9999px; }
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
.ic-content-after { margin-top: 24px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.pc-img img { display: block; width: 100%; height: 170px; object-fit: cover; }
.pc-body { padding: 16px 18px; }
.pc-body h2 { font-size: 1.15rem; margin: 0 0 4px; }
.pc-body h2 a { color: var(--ink); }
.pc-meta { color: var(--ink-3) !important; font-size: .88rem; margin: 0 0 8px; }
.single-post .entry-title { margin-top: 20px; }
.post-thumb img { border-radius: 10px; margin: 8px 0 16px; }
.pagination .page-numbers { padding: 6px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.pagination .current { background: var(--brand); color: #fff; }
.wp-page.page-grid { padding-top: 0; }
