/* ==========================================================
   Web Group shared stylesheet - mobile first.
   Tool sites: 70/30 two columns on desktop, tool first on mobile.
   Essay sites: single centred column, 720px measure.
   ========================================================== */

:root {
    --brand: #1d4ed8;
    --brand-dark: #1e40af;
    --accent: #059669;
    --ink: #111827;
    --ink-soft: #4b5563;
    --line: #e5e7eb;
    --bg: #ffffff;
    --bg-soft: #f7f8fa;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
    --measure: 760px;
    --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 .6rem; }
h2 { font-size: 1.4rem; line-height: 1.3; margin: 2rem 0 .7rem; }
h3 { font-size: 1.12rem; margin: 1.4rem 0 .5rem; }
p { margin: 0 0 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-soft); }
.hint { font-size: .85rem; color: var(--ink-soft); margin: .4rem 0 0; }
.lede { font-size: 1.05rem; color: var(--ink-soft); }
.section { margin: 2.5rem auto; }

/* ---------- header ---------- */
.topbar { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 40; }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.nav { display: none; gap: 14px; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); font-size: .93rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: inline-block; background: none; border: 0; font-size: 1.3rem; cursor: pointer; }
.account { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.avatar { border-radius: 50%; }
.credits { background: var(--bg-soft); border-radius: 999px; padding: 3px 10px; }

@media (min-width: 900px) {
    .nav { display: flex; }
    .nav-toggle { display: none; }
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none;
    transition: background .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink-soft); border-color: var(--line); }
.btn-offer { background: var(--accent); color: #fff; }
.btn-offer:hover { background: #047857; color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- cards ---------- */
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.tool-card { padding: 22px; }
.sticky { position: static; }
.pill { display: inline-block; font-size: .78rem; background: var(--bg-soft); border-radius: 999px; padding: 3px 10px; color: var(--ink-soft); }

/* ---------- layouts ---------- */
.layout-tool { display: grid; grid-template-columns: 1fr; gap: 28px; padding-top: 28px; padding-bottom: 48px; }
.layout-essay { max-width: var(--measure); padding-top: 28px; padding-bottom: 48px; }

@media (min-width: 992px) {
    .layout-tool { grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr); gap: 36px; }
    .sticky { position: sticky; top: 84px; }
    h1 { font-size: 2.25rem; }
}

.hero { background: var(--bg-soft); padding: 56px 0; text-align: center; border-bottom: 1px solid var(--line); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tool-tile { display: block; color: inherit; margin: 0; }
.tool-tile:hover { text-decoration: none; border-color: var(--brand); }

.post-list, .link-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.post-list a { font-weight: 600; }
.link-list li { padding: 6px 0; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field input, .field textarea, .field select {
    width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
    font: inherit; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
.tool-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.cost-note { font-size: .85rem; color: var(--ink-soft); }

.tool-status { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--bg-soft); font-size: .92rem; }
.tool-status.error { background: #fef2f2; color: #b91c1c; }
.tool-result { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.result-actions { display: flex; gap: 8px; }
.result-body { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--bg-soft); }

/* ---------- prose (SEO essay) ---------- */
.prose { font-size: 15.5px; line-height: 1.68; }
.prose h2 { font-size: 1.32rem; }
.prose h3 { font-size: 1.08rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }

.essay-head { margin-bottom: 18px; }
.essay-meta { font-size: .86rem; color: var(--ink-soft); }
.breadcrumb { font-size: .85rem; color: var(--ink-soft); display: flex; gap: 6px; margin-bottom: 10px; }

.toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 22px; }
.toc-title { font-weight: 700; font-size: .9rem; margin: 0 0 6px; }
.toc ol { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
.toc li { margin-bottom: .25rem; }
.toc .toc-l3 { margin-left: .8rem; list-style: circle; }

.data-anchor { margin: 28px 0; }
.table-wrap { overflow-x: auto; }
.data-anchor table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-anchor th, .data-anchor td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }

.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq-answer { margin-top: 8px; color: var(--ink-soft); }

/* ---------- offers ---------- */
.offer {
    border: 1px solid var(--line); border-left: 3px solid var(--accent);
    border-radius: var(--radius); padding: 16px 18px; margin: 22px 0; background: #f6fdf9;
}
.offer-label { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.offer-headline { font-weight: 700; margin: 6px 0 4px; }
.offer-body { font-size: .9rem; color: var(--ink-soft); }
.offer-side { margin-top: 0; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .55); }
.modal-card { position: relative; background: #fff; border-radius: 16px; padding: 28px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink-soft); }
.modal-note { font-size: .8rem; color: var(--ink-soft); text-align: center; margin: 12px 0 0; }
.plans { display: grid; gap: 12px; margin: 18px 0; }
.plan { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; position: relative; }
.plan:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }
.plan input { margin-right: 8px; }
.plan-name { font-weight: 600; }
.plan-price { display: block; font-size: 1.3rem; font-weight: 700; margin-top: 4px; }
.plan-price small { font-size: .8rem; font-weight: 500; color: var(--ink-soft); }
.plan-badge { position: absolute; top: -10px; right: 12px; background: var(--accent); color: #fff; font-size: .7rem; padding: 3px 8px; border-radius: 999px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 40px 0 24px; margin-top: 40px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 26px; }
.footer h3 { font-size: .92rem; margin: 0 0 8px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 6px; }
.footer a { color: var(--ink-soft); }
.footer-brand { font-weight: 700; margin-bottom: 4px; }
.related-sites { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 14px; flex-wrap: wrap; font-size: .86rem; }
.copyright { margin-top: 18px; font-size: .82rem; color: var(--ink-soft); }

.pagination { display: flex; gap: 16px; align-items: center; margin-top: 28px; font-size: .92rem; }

@media (max-width: 899px) {
    .nav.open { display: flex; flex-direction: column; width: 100%; padding: 10px 0; }
}
