/* ===========================================================================
   Aniline Applications — Ghost blog theme
   Tokens, palettes, header, hero, bands, signup and footer are taken from
   anilineapps.com/css/styles.css so the blog matches the product pages.
   Blog-specific sections (post feed, article, Ghost cards) are at the end.
=========================================================================== */

/* ----- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ----- Type tokens ------------------------------------------------------- */
:root {
  --font-display: var(--gh-font-heading, "Citywide", "Arial Narrow", sans-serif);
  --font-display-wide: "Citywide Semiwide", "Citywide", sans-serif;
  --font-body: var(--gh-font-body, ff-meta-serif-web-pro, Georgia, "Times New Roman", serif);
  --font-ui: ff-meta-web-pro, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --container: 1060px;
  --narrow: 720px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --rule-w: 1px;
  --t: 220ms ease;
}

/* ===========================================================================
   PALETTES
   Site-wide palette comes from the theme setting (body.t-indigo etc).
   Posts tagged "indigo" / "croissant" override it via Ghost's body_class.
=========================================================================== */

/* ---- Neutral (home) ----------------------------------------------------- */
[data-theme="light"] .t-home, .t-home {
  --bg: #fcfcfc;  --text: #1a1a1a;  --muted: #8c8c8c;  --nav: #9a9a9a;
  --rule: #c2c2c4;  --logo: #1a1a1a;  --logo-sub: #b7b7b7;
  --invert-bg: #171717;  --invert-deep: #0e0e0e;
  --invert-text: #f4f4f4;  --invert-muted: #9a9a9a;
  --accent: #1a1a1a;  --accent-on: #ffffff;
  --code-bg: rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .t-home {
  --bg: #161616;  --text: #f1f1f1;  --muted: #8c8c8c;  --nav: #7d7d7d;
  --rule: #545456;  --logo: #ffffff;  --logo-sub: #6a6a6a;
  --invert-bg: #050505;  --invert-deep: #000000;
  --invert-text: #f4f4f4;  --invert-muted: #8c8c8c;
  --accent: #ffffff;  --accent-on: #161616;
  --code-bg: rgba(255, 255, 255, 0.07);
}

/* ---- Indigo ------------------------------------------------------------- */
[data-theme="light"] .t-indigo, .t-indigo,
html[data-theme] body.tag-indigo {
  --bg: #efeefe;  --text: #100f24;  --muted: #6c6a86;  --nav: #84838e;
  --rule: #d4d2f0;  --logo: #100f24;  --logo-sub: #a9a7c6;
  --invert-bg: #1f1e2f;  --invert-deep: #14132a;
  --invert-text: #efeefe;  --invert-muted: #a3a1bd;
  --accent: #6155f5;  --accent-on: #ffffff;  --app-store: #1f1e2f;
  --star: #c9c6f5;
  --code-bg: rgba(97, 85, 245, 0.08);
}
[data-theme="dark"] .t-indigo,
html[data-theme="dark"] body.tag-indigo {
  --bg: #1b1a2b;  --text: #efeefe;  --muted: #9c9ab4;  --nav: #807e98;
  --rule: #322f49;  --logo: #efeefe;  --logo-sub: #6f6d88;
  --invert-bg: #100f1e;  --invert-deep: #0a0916;
  --invert-text: #efeefe;  --invert-muted: #908ea8;
  --accent: #7d73ff;  --accent-on: #ffffff;  --app-store: #9d94ff;
  --star: #6155f5;
  --code-bg: rgba(125, 115, 255, 0.12);
}

/* ---- Croissant ---------------------------------------------------------- */
[data-theme="light"] .t-croissant, .t-croissant,
html[data-theme] body.tag-croissant {
  --bg: #fdf5ea;  --text: #221c12;  --muted: #6f6552;  --nav: #ab9c84;
  --rule: #ead9c0;  --logo: #221c12;  --logo-sub: #c4b69d;
  --invert-bg: #2e261a;  --invert-deep: #221b11;
  --invert-text: #fdf5ea;  --invert-muted: #b3a690;
  --accent: #f5821f;  --accent-on: #ffffff;  --app-store: #f5821f;
  --star: #f0c79a;
  --code-bg: rgba(245, 130, 31, 0.09);
}
[data-theme="dark"] .t-croissant,
html[data-theme="dark"] body.tag-croissant {
  --bg: #241d13;  --text: #fdf5ea;  --muted: #b3a690;  --nav: #7e715b;
  --rule: #3c3221;  --invert-bg: #181208;  --invert-deep: #100b04;
  --logo: #fdf5ea;  --logo-sub: #7e715b;
  --invert-text: #fdf5ea;  --invert-muted: #ad9f88;
  --accent: #ff962e;  --accent-on: #2e261a;  --app-store: #ff962e;
  --star: #f5821f;
  --code-bg: rgba(255, 150, 46, 0.1);
}

/* ===========================================================================
   BASE
=========================================================================== */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.55;
  font-size: 1.4rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--t), color var(--t);
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--pad); }
.container.narrow { max-width: calc(var(--narrow) + 2 * var(--pad)); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; line-height: 1; letter-spacing: -0.01em; }

.label {
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

a.ui-link {
  font-family: var(--font-ui); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: clamp(0.85rem, 0.3vw + 0.78rem, 0.95rem);
  text-decoration: none; color: var(--muted); transition: color var(--t), filter var(--t);
}
a.ui-link:hover { color: var(--text); }
a.ui-link.accent { color: var(--accent); }
a.ui-link.accent:hover { filter: brightness(1.08); }

.text-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: color var(--t), text-decoration-color var(--t);
}
.text-link:hover { text-decoration-color: var(--text); }
.band .text-link { color: var(--invert-text); text-decoration-color: var(--invert-muted); }

/* ===========================================================================
   SITE HEADER / NAV
=========================================================================== */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  margin-inline: auto;
  padding: clamp(1.5rem, 3vw, 2.6rem) var(--pad) 0;
}
.site-header .brand { display: inline-flex; align-items: center; color: var(--logo); text-decoration: none; }
.site-header .spacer { flex: 1; }

/* "Blog" sub-label beside the aniline wordmark */
.site-header .blog-label {
  font-family: var(--font-ui); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 0.82rem; line-height: 1;
  color: var(--logo-sub); text-decoration: none;
  margin-left: -0.6rem; padding: 0.15rem 0 0.15rem 0.9rem;
  border-left: 2px solid var(--rule);
  transition: color var(--t);
}
.site-header .blog-label:hover { color: var(--text); }

/* "aniline" wordmark drawn from the logo SVG as a mask, so it follows --logo */
.logo-mark {
  display: block;
  width: 116px; height: 18px;
  background: var(--logo);
  -webkit-mask: url(../img/logo-mark.svg) left center / contain no-repeat;
  mask: url(../img/logo-mark.svg) left center / contain no-repeat;
  transition: background var(--t);
}

.nav { display: flex; align-items: center; gap: clamp(1.1rem, 3vw, 2.2rem); }
.nav a {
  font-family: var(--font-ui); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; font-size: 0.82rem; text-decoration: none;
  color: var(--nav); transition: color var(--t);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* Theme toggle */
.theme-toggle {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--nav); border-radius: 50%; transition: color var(--t), background var(--t);
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ===========================================================================
   HERO (same lockup as the product pages)
=========================================================================== */
.prod-hero { text-align: center; padding: clamp(2.5rem, 7vw, 6rem) var(--pad) clamp(2.5rem, 6vw, 4.5rem); min-height: 42vh; display: flex; align-items: center; }
.prod-hero > .container { padding-inline: 0; }
.prod-hero .hero-lockup { display: inline-block; max-width: 100%; }
.prod-hero .wordmark {
  display: block;
  font-family: var(--font-display-wide);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
  font-size: clamp(2.8rem, 12vw, 10.5rem);
  line-height: 0.9;
  letter-spacing: -0.005em;
}
.prod-hero .meta-row {
  width: 100%; margin-top: clamp(0.5rem, 1.6vw, 1rem);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.prod-hero .meta-row .platforms { color: var(--muted); font-size: 0.9rem; }
.prod-hero .meta-row .app-store {
  font-family: var(--font-ui); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 0.9rem; text-decoration: none;
  color: var(--app-store, var(--accent));
}
.prod-hero .meta-row .app-store:hover { filter: brightness(1.12); }

.prod-lead { padding-block: clamp(1rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem); }
.prod-lead p { margin: 0; font-size: clamp(1.1rem, 0.6vw + 1rem, 1.4rem); }

/* ===========================================================================
   INVERTED BANDS + EMAIL SIGNUP (Ghost members form)
=========================================================================== */
.band {
  background: var(--invert-bg);
  color: var(--invert-text);
  transition: background var(--t), color var(--t);
}
.band h2 { color: var(--invert-text); }
.band .lead-copy { color: var(--invert-muted); }

.signup { text-align: center; }
.signup .signup-inner {
  max-width: 620px;
  margin-inline: auto;
  padding-block: clamp(3rem, 8vw, 6rem);
}
.signup h2 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin-bottom: 1rem; }
.signup .lead-copy { margin: 0 auto clamp(1.8rem, 4vw, 2.5rem); max-width: 46ch; }

.email-signup { margin: 0; }
.email-signup .field {
  display: flex; align-items: stretch; gap: 0.6rem;
  max-width: 440px; margin-inline: auto;
}
.email-signup input[type="email"] {
  flex: 1; min-width: 0;
  font-family: var(--font-ui); font-size: 1rem;
  color: var(--invert-text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--invert-muted);
  border-radius: 999px;
  padding: 0.85rem 1.3rem;
  transition: border-color var(--t), background var(--t);
}
.email-signup input::placeholder { color: var(--invert-muted); }
.email-signup input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}
.email-signup button[type="submit"] {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 52px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-on);
  cursor: pointer;
  transition: filter var(--t), opacity var(--t);
}
.email-signup button[type="submit"] svg { width: 20px; height: 20px; }
.email-signup button[type="submit"]:hover { filter: brightness(1.08); }
.email-signup.loading button[type="submit"] { opacity: 0.55; cursor: default; pointer-events: none; }

.email-signup .message {
  display: none;
  min-height: 1.4em; margin: 1.1rem 0 0;
  font-family: var(--font-ui); font-size: 0.95rem;
  color: var(--invert-muted);
}
.email-signup.success .msg-success { display: block; color: var(--invert-text); }
.email-signup.error .msg-error { display: block; color: #ff6b6b; }
.email-signup.success .field { display: none; }

/* ===========================================================================
   POST FEED
=========================================================================== */
.post-feed { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3rem, 8vw, 6rem); }

.post-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  padding-block: clamp(2rem, 5vw, 3.25rem);
  border-top: 2px solid var(--rule);
}
.post-card:first-child { border-top: 0; padding-top: 0; }
.post-card.has-image { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

.post-card .meta { margin: 0; color: var(--muted); }
.post-card .meta .tag { color: var(--accent); }
.dot { margin-inline: 0.55em; }

.post-card h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  line-height: 1.04;
  margin: 0.7rem 0 0.9rem;
}
.post-card h2 a { text-decoration: none; color: var(--text); transition: color var(--t); }
.post-card h2 a:hover { color: var(--accent); }
.post-card .excerpt { margin: 0 0 1.1rem; color: var(--muted); font-size: clamp(1.05rem, 0.5vw + 0.95rem, 1.25rem); }

.post-card .thumb { display: block; border-radius: 10px; overflow: hidden; background: var(--invert-bg); }
.post-card .thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 500ms ease; }
.post-card .thumb:hover img { transform: scale(1.03); }

.empty { color: var(--muted); text-align: center; padding-block: 3rem; margin: 0; }

.archive-head { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1rem, 3vw, 2rem); }
.archive-head .meta { color: var(--muted); margin: 0 0 0.8rem; }
.archive-head h1 { font-size: clamp(2.4rem, 7vw, 4rem); color: var(--text); }
.archive-head .lead { color: var(--muted); margin: 1rem 0 0; max-width: 46ch; font-size: clamp(1.1rem, 0.6vw + 1rem, 1.35rem); }

.pagination {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
.pagination .page-number { color: var(--muted); text-align: center; }
.pagination a:last-child { justify-self: end; }

/* ===========================================================================
   ARTICLE (post + page)
=========================================================================== */
.article-head { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem); }
.article-head .meta { margin: 0 0 1rem; color: var(--muted); }
.article-head .meta a { color: var(--accent); text-decoration: none; }
.article-title { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.02; color: var(--text); }
.article-head .lead { margin: 1.2rem 0 0; color: var(--muted); font-size: clamp(1.15rem, 0.7vw + 1rem, 1.5rem); line-height: 1.45; }
.article-head .byline { margin: 1.5rem 0 0; color: var(--muted); }
.article-head .byline a { color: var(--text); text-decoration: none; }

.article-image { margin: 0 auto clamp(2rem, 5vw, 3.5rem); }
.article-image img { width: 100%; height: auto; border-radius: 10px; }
.article-image figcaption, .gh-content figcaption {
  margin-top: 0.8rem; text-align: center;
  font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted);
}

/* ----- Post body -------------------------------------------------------- */
.gh-content {
  font-size: clamp(1.15rem, 0.6vw + 1rem, 1.4rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
  overflow-wrap: break-word;
}
.gh-content.no-head { padding-top: clamp(2.5rem, 7vw, 5rem); }
.gh-content > * { margin-top: 0; margin-bottom: 0; }
.gh-content > * + * { margin-top: 1.2em; }

.gh-content h2 { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.1; color: var(--text); }
.gh-content h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.15; color: var(--text); }
.gh-content h4, .gh-content h5, .gh-content h6 {
  font-family: var(--font-ui); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; font-size: 0.85rem; color: var(--muted);
}
.gh-content > * + h2 { margin-top: 2em; }
.gh-content > * + h3, .gh-content > * + h4 { margin-top: 1.7em; }
.gh-content h2 + *, .gh-content h3 + *, .gh-content h4 + * { margin-top: 0.6em; }

.gh-content a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color var(--t);
}
.gh-content a:hover { color: var(--accent); }

.gh-content strong { font-weight: 700; }
.gh-content ul, .gh-content ol { padding-left: 1.25em; }
.gh-content li + li { margin-top: 0.45em; }
.gh-content li::marker { color: var(--accent); }

.gh-content blockquote:not([class]) {
  margin-inline: 0; padding-left: 1.3em;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.gh-content blockquote.kg-blockquote-alt {
  margin-inline: 0; padding: 0.5em 0; border: 0; text-align: center;
  font-size: 1.3em; line-height: 1.4; font-style: italic; color: var(--text);
}

.gh-content hr { border: 0; border-top: 2px solid var(--rule); margin-block: 2.5em; }

.gh-content figure { margin-inline: 0; }
.gh-content img { height: auto; border-radius: 6px; }
.gh-content .kg-image-card img { margin-inline: auto; }

.gh-content code {
  font-family: var(--font-mono); font-size: 0.82em;
  background: var(--code-bg); padding: 0.12em 0.38em; border-radius: 4px;
}
.gh-content pre {
  background: var(--invert-bg); color: var(--invert-text);
  padding: 1.1em 1.3em; border-radius: 8px;
  overflow-x: auto; font-size: 0.78em; line-height: 1.6;
}
.gh-content pre code { background: none; padding: 0; font-size: inherit; color: inherit; }

.gh-content table { width: 100%; border-collapse: collapse; font-size: 0.85em; font-family: var(--font-ui); }
.gh-content th, .gh-content td { text-align: left; padding: 0.6em 0.8em; border-bottom: 1px solid var(--rule); }
.gh-content th { font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85em; color: var(--muted); }

/* Ghost editor card widths (required by Ghost) */
.gh-content .kg-width-wide {
  position: relative;
  width: min(calc(100vw - 2 * var(--pad)), calc(var(--container) - 2 * var(--pad)));
  left: 50%; transform: translateX(-50%);
}
.gh-content .kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%; transform: translateX(-50%);
}
.gh-content .kg-width-full img { border-radius: 0; }
.gh-content .kg-width-full figcaption { padding-inline: var(--pad); }

/* Let Ghost's own card styles pick up the palette */
.gh-content .kg-bookmark-card a.kg-bookmark-container { text-decoration: none; color: var(--text); border-color: var(--rule); }
.gh-content .kg-button-card a.kg-btn-accent, .gh-content .kg-header-card .kg-header-card-button { background: var(--accent); color: var(--accent-on); text-decoration: none; }
.gh-content .kg-callout-card { font-size: 0.92em; }
.gh-content .kg-toggle-card { border-color: var(--rule); }

/* Members-only CTA */
.gh-content .gh-post-upgrade-cta { margin-top: 2em; }

.comments { padding-bottom: clamp(3rem, 7vw, 5rem); }

/* Previous / next */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  border-top: 2px solid var(--rule);
  padding-top: clamp(1.75rem, 4vw, 2.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
.post-nav a { text-decoration: none; display: block; }
.post-nav .next { text-align: right; grid-column: 2; }
.post-nav .label { display: block; color: var(--muted); margin-bottom: 0.4rem; }
.post-nav .t { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.15; color: var(--text); transition: color var(--t); }
.post-nav a:hover .t { color: var(--accent); }

/* ===========================================================================
   FOOTER
=========================================================================== */
.site-footer {
  border-top: var(--rule-w) solid var(--rule);
}
main + .site-footer { margin-top: 0; }
.site-footer .inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.2rem;
  padding-block: clamp(2rem, 4vw, 3rem);
}
.site-footer .brand { color: var(--logo); }
.site-footer .foot-nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.site-footer small { color: var(--muted); font-family: var(--font-ui); font-size: 0.8rem; letter-spacing: 0.02em; }

/* ===========================================================================
   RESPONSIVE
=========================================================================== */
@media (max-width: 760px) {
  .post-card.has-image { grid-template-columns: 1fr; }
  .post-card.has-image .thumb { order: -1; }
  .site-header { flex-wrap: wrap; row-gap: 0.75rem; }
  .site-header .nav { gap: 1rem; flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .prod-hero .wordmark { font-size: clamp(3.4rem, 20vw, 6.5rem); }
  .prod-hero .meta-row { gap: 0.5rem; margin-top: 0.4rem; }
  .prod-hero .meta-row .platforms,
  .prod-hero .meta-row .app-store { font-size: clamp(0.56rem, 2.3vw, 0.78rem); letter-spacing: 0.03em; }
  .site-header .spacer { display: none; }
  .site-header .nav { width: 100%; }
  .site-header .theme-toggle { margin-left: auto; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
