/* InvoiceHub Ghost theme. Tokens and public-page components mirror api/web/static/app.css. */
:root {
    --primary: #0E8388;
    --primary-dark: #0b6d71;
    --ink: #183638;
    --ink-strong: #103f42;
    --ink-muted: #52686a;
    --line: #e0e9e9;
    --line-strong: #dce6e6;
    --tint: #e7f2f1;
    --surface: #fff;
    --page: #f6f8f8;
    --gutter: clamp(1rem, 5vw, 4rem);
    --measure: 46rem;
    --wide: 62rem;
    font-family: var(--gh-font-body, Inter, system-ui, sans-serif);
    color: var(--ink);
    background: var(--page);
}
h1, h2, h3, h4 { font-family: var(--gh-font-heading, inherit); }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; }
a { color: var(--primary); }
img { max-width: 100%; height: auto; }
button, .button { border: 0; border-radius: .45rem; padding: .65rem 1rem; background: var(--primary); color: #fff; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
.button:hover, button:hover { background: #12a3a8; }
.button.secondary { background: #e7eeee; color: #173839; }
.button.secondary:hover { background: #dfeaea; }
:is(a, button, input, select, textarea):focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.skip-link { position: absolute; left: -999rem; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 20; padding: .5rem 1rem; background: var(--surface); }
.eyebrow { margin: 0 0 .35rem; color: var(--primary-dark); font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--ink-muted); font-size: .9rem; line-height: 1.6; }

/* Header */
.public-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; padding: .9rem var(--gutter); background: #fffffff2; border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.public-brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; color: var(--ink-strong); font-size: 1.05rem; font-weight: 750; letter-spacing: -.02em; text-decoration: none; }
.public-brand svg, .menu-toggle svg, .search-button svg { width: 2.2rem; height: 2.2rem; padding: .4rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.public-brand svg { color: var(--primary-dark); background: var(--tint); border: 1px solid #cfe5e3; border-radius: .65rem; }
.public-nav { display: flex; align-items: center; gap: 1.25rem; }
.public-nav .nav { display: flex; align-items: center; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.public-nav .nav a { color: #3a5254; font-size: .9rem; font-weight: 650; text-decoration: none; }
.public-nav .nav a:hover, .public-nav .nav-current a { color: var(--primary); }
.public-nav > .button { padding: .6rem 1.25rem; font-weight: 650; }
.search-button, .menu-toggle { padding: 0; color: #3a5254; background: none; border-radius: .65rem; }
.search-button:hover, .menu-toggle:hover { color: var(--primary); background: var(--tint); }
.menu-toggle { display: none; }

/* Hero bands */
.landing-hero, .article-hero { padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) clamp(3.5rem, 8vw, 6rem); text-align: center; color: #cfe6e3; background: radial-gradient(circle at 15% 0, #1b6263 0, #103f42 42%, #0a3033 100%); }
.landing-hero > div, .article-hero-inner { max-width: var(--measure); margin-inline: auto; }
.landing-eyebrow { margin: 0 0 .75rem; color: #8fd8cc; font-size: .75rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.landing-eyebrow a { color: inherit; text-decoration: none; }
.landing-hero h1, .article-hero h1 { margin: 0 0 1rem; color: #fff; font-size: clamp(1.9rem, 5vw, 3.1rem); line-height: 1.12; letter-spacing: -.02em; overflow-wrap: anywhere; }
.article-hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; }
.landing-lead { margin: 0 0 2rem; font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.65; }
.article-hero .landing-lead:last-child { margin-bottom: 0; }
.article-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; margin: 0; color: #9fbdbb; font-size: .85rem; }
.landing-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1.25rem; margin: 0; }
.landing-cta { padding: .85rem 1.75rem; font-size: 1rem; font-weight: 700; box-shadow: 0 10px 24px #00000029; transition: background .15s; }
.landing-ghost { padding-bottom: .15rem; color: #9ee1d7; font-weight: 650; text-decoration: none; border-bottom: 1px solid #9ee1d766; }
.landing-ghost:hover { color: #fff; border-color: #fff; }
.landing-icon { display: inline-flex; padding: .55rem; color: var(--primary-dark); background: var(--tint); border: 1px solid #cfe5e3; border-radius: .7rem; }
.landing-icon svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Home sections */
.home-section { padding: clamp(2.5rem, 6vw, 4rem) var(--gutter); scroll-margin-top: 4.5rem; }
.home-section > * { max-width: 72rem; margin-inline: auto; }
.home-band { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 1.75rem; text-align: center; }
.section-head h2 { margin: 0; font-size: clamp(1.3rem, 2.6vw, 1.8rem); }
.tool-grid, .post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1.25rem; }
.tool-card, .post-card { min-width: 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: .9rem; box-shadow: 0 2px 6px #163d3f0a; transition: transform .15s, box-shadow .15s; }
.tool-card:hover, .post-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px #163d3f14; }
.tool-card { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; padding: 1.5rem; color: var(--ink); text-decoration: none; }
.tool-card strong { font-size: 1rem; line-height: 1.4; }
.tool-card .muted { margin-top: auto; }
.post-card { overflow: hidden; }
.post-card-link { display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none; }
.post-card-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card-body { display: flex; flex-direction: column; gap: .5rem; flex: 1; padding: 1.25rem 1.5rem 1.5rem; }
.post-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.post-card .muted { margin: 0; }
.post-card time { margin-top: auto; color: #708688; font-size: .8rem; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; color: var(--ink-muted); font-size: .9rem; }

/* Closing call to action */
.landing-close { padding: clamp(2.5rem, 6vw, 4rem) var(--gutter); text-align: center; background: var(--surface); border-top: 1px solid var(--line); }
.landing-close h2 { margin: 0 0 .6rem; font-size: clamp(1.3rem, 2.6vw, 1.8rem); }
.landing-close p { max-width: var(--measure); margin: 0 auto 1.5rem; color: var(--ink-muted); line-height: 1.65; }

/* Articles and pages */
.article-image { max-width: var(--wide); margin: clamp(-3rem, -5vw, -2rem) auto 0; padding: 0 var(--gutter); }
.article-image img { display: block; width: 100%; max-height: 32rem; object-fit: cover; border-radius: .9rem; box-shadow: 0 16px 40px #00000029; }
.article-image figcaption, .gh-content figcaption { margin-top: .6rem; color: var(--ink-muted); font-size: .85rem; text-align: center; }
.article-body { padding: clamp(2rem, 5vw, 3.5rem) var(--gutter); }
.article-comments, .article-next { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter) clamp(2rem, 5vw, 3rem); }
.article-next a { font-weight: 650; text-decoration: none; }

/* Editor content: text runs at a readable measure; wide and full cards break out of it. */
.gh-content { display: grid; grid-template-columns: [full-start] minmax(0, 1fr) [wide-start] minmax(0, calc((var(--wide) - var(--measure)) / 2)) [main-start] min(var(--measure), 100%) [main-end] minmax(0, calc((var(--wide) - var(--measure)) / 2)) [wide-end] minmax(0, 1fr) [full-end]; font-size: 1.05rem; line-height: 1.75; color: #24403f; }
.gh-content > * { grid-column: main; margin-block: 0 1.25rem; min-width: 0; }
.gh-content > .kg-width-wide { grid-column: wide; }
.gh-content > .kg-width-full { grid-column: full; }
.gh-content > .kg-width-full img { width: 100%; }
.gh-content :is(h2, h3, h4) { margin-top: 2.25rem; margin-bottom: .75rem; color: var(--ink-strong); line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.gh-content > :first-child { margin-top: 0; }
.gh-content h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); }
.gh-content h3 { font-size: 1.2rem; }
.gh-content h4 { font-size: 1.05rem; }
.gh-content :is(h2, h3, h4) a { text-decoration: none; }
.gh-content :is(h2, h3, h4) a:hover { text-decoration: underline; }
.gh-content a { text-underline-offset: .15em; }
.gh-content :is(ul, ol) { padding-left: 1.4rem; }
.gh-content li + li { margin-top: .35rem; }
.gh-content blockquote:not([class]) { padding: .25rem 0 .25rem 1.25rem; border-left: 4px solid var(--primary); color: #36585a; font-style: italic; }
.gh-content hr { width: 100%; height: 1px; border: 0; background: var(--line-strong); margin-block: 2.5rem; }
.gh-content code { padding: .1rem .35rem; background: #eef4f4; border-radius: .3rem; font-size: .9em; }
.gh-content pre { overflow-x: auto; padding: 1.1rem 1.25rem; color: #e3f1ef; background: #0f2f31; border-radius: .7rem; font-size: .9rem; line-height: 1.6; }
.gh-content pre code { padding: 0; background: none; color: inherit; }
.gh-content table:not([class]) { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; font-size: .95rem; }
.gh-content table:not([class]) :is(th, td) { padding: .6rem .8rem; border: 1px solid var(--line-strong); text-align: left; }
.gh-content table:not([class]) th { background: #f0f6f6; }
.gh-content figure { margin-inline: 0; }
.gh-content .kg-image { border-radius: .7rem; }
.gh-content .kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.kg-width-wide, .kg-width-full { position: relative; }

/* Calculators: HTML cards carry inline styles from the editor; restyle them to the app's form controls. */
.gh-content .kg-html-card > div[id]:has(form) { max-width: 30rem !important; padding: 1.5rem !important; color: var(--ink) !important; font-family: inherit !important; background: var(--surface) !important; border: 1px solid var(--line-strong); border-radius: .9rem !important; box-shadow: 0 10px 30px #163d3f14 !important; }
.gh-content .kg-html-card > div[id]:has(form) h2 { margin-top: 0; color: var(--ink-strong) !important; font-size: 1.25rem; }
.gh-content .kg-html-card form label { color: #2c4a4c; font-size: .875rem; font-weight: 650; }
.gh-content .kg-html-card form :is(input, select) { min-height: 2.75rem; padding: .55rem .75rem !important; color: var(--ink); font: inherit; background: #fff; border: 1px solid #b5c6c7 !important; border-radius: .45rem !important; }
.gh-content .kg-html-card form :is(input, select):focus { border-color: var(--primary) !important; outline: 3px solid #0e838833; }
.gh-content .kg-html-card button { min-height: 2.75rem; background: var(--primary) !important; font-family: inherit; font-size: .95rem !important; font-weight: 650; border-radius: .45rem !important; }
.gh-content .kg-html-card button:hover { background: #096e73 !important; }
.gh-content .kg-html-card [id$="result"], .gh-content .kg-html-card [id$="Result"] { background: #effaf6 !important; border: 1px solid #c6e4d5; border-radius: .6rem !important; }
.gh-content .kg-html-card table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.gh-content .kg-html-card :is(th, td) { padding: .45rem .6rem; border-bottom: 1px solid var(--line); text-align: left; }

/* Footer */
.site-foot { flex-shrink: 0; background: var(--surface); border-top: 1px solid var(--line); }
.site-foot-inner { display: grid; grid-template-columns: minmax(14rem, 20rem) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); max-width: 72rem; margin-inline: auto; padding: clamp(2rem, 5vw, 3rem) var(--gutter); }
.site-foot-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.site-foot-brand p { margin: 0; color: var(--ink-muted); font-size: .9rem; line-height: 1.6; }
.site-foot-nav .nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .6rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.site-foot-nav a { color: #3a5254; font-size: .875rem; text-decoration: none; }
.site-foot-nav a:hover { color: var(--primary); }
.public-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 1.25rem; padding: 1.25rem var(--gutter); border-top: 1px solid var(--line); color: var(--ink-muted); font-size: .85rem; }
.public-foot > span { margin-right: auto; font-weight: 650; }
.public-foot a { font-weight: 650; text-decoration: none; }

@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; }
    .public-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: .75rem; padding-top: .5rem; }
    .public-bar.is-open .public-nav { display: flex; }
    .public-nav .nav { flex-direction: column; align-items: stretch; gap: 0; }
    .public-nav .nav a { display: block; padding: .6rem 0; font-size: 1rem; border-bottom: 1px solid var(--line); }
    .public-nav > .button { text-align: center; }
    .search-button { align-self: flex-start; }
    .site-foot-inner { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .tool-card, .post-card { transition: none; }
    .tool-card:hover, .post-card:hover { transform: none; }
}
