/* AdBubbles — application styles. Brand: Tily Black #111111, Tily Orange #F05A24, Neutral Gray #6B7280. */

:root {
  --black: #111111;
  --orange: #F05A24;
  --orange-dark: #c84515;
  --gray: #6B7280;
  --gray-light: #e5e7eb;
  --gray-bg: #f7f7f8;
  --white: #ffffff;
  --success: #166534;
  --success-bg: #ecfdf3;
  --error: #991b1b;
  --error-bg: #fef2f2;
  --info: #1e3a8a;
  --info-bg: #eff6ff;
  --focus: #F05A24;
  --radius: 6px;
  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --black: #f3f4f6;
    --white: #121212;
    --gray: #9ca3af;
    --gray-light: #2a2a2e;
    --gray-bg: #1a1a1d;
    --success: #86efac; --success-bg: #052e16;
    --error: #fca5a5;   --error-bg: #450a0a;
    --info: #bfdbfe;    --info-bg: #172554;
  }
  img.logo-invert { filter: invert(1) hue-rotate(180deg); }
}

* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--black);
  background: var(--white);
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }

/* Accessibility */
.skip-link {
  position: absolute; left: -9999px; top: 0.5rem;
  background: var(--orange); color: #fff; padding: 0.5rem 1rem; border-radius: var(--radius); z-index: 100;
}
.skip-link:focus { left: 0.5rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Header / nav */
.site-header { border-bottom: 1px solid var(--gray-light); background: var(--white); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 0.75rem; }
.brand img { display: block; height: 48px; width: auto; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem 1.25rem; flex-wrap: wrap; align-items: center; }
.nav a, .link-button {
  color: var(--black); text-decoration: none; font-weight: 600; padding: 0.35rem 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"], .link-button:hover { border-bottom-color: var(--orange); }
.link-button { background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; cursor: pointer; padding: 0.35rem 0; }
.subnav { background: var(--gray-bg); border-bottom: 1px solid var(--gray-light); }
.subnav .nav { padding-block: 0.5rem; font-size: 0.95rem; }
form.inline { display: inline; }

/* Main */
main { padding-block: 1.5rem 3rem; min-height: 50vh; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--orange-dark); }
@media (prefers-color-scheme: dark) { a { color: #ff8a5c; } }
.muted { color: var(--gray); }
.lead { font-size: 1.2rem; }
code, .mono { font-family: var(--mono); font-size: 0.95em; }
pre { background: var(--gray-bg); padding: 1rem; overflow-x: auto; border-radius: var(--radius); }

/* Flash messages */
.flashes { margin-bottom: 1.25rem; }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius); border: 1px solid; margin: 0 0 0.5rem; }
.flash-success { color: var(--success); background: var(--success-bg); border-color: var(--success); }
.flash-error   { color: var(--error);   background: var(--error-bg);   border-color: var(--error); }
.flash-info    { color: var(--info);    background: var(--info-bg);    border-color: var(--info); }

/* Forms */
form.stack { max-width: 34rem; }
.field { margin-bottom: 1.1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.hint { display: block; font-weight: 400; color: var(--gray); font-size: 0.92rem; margin-top: 0.25rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; font: inherit; padding: 0.6rem 0.7rem; border: 1px solid var(--gray); border-radius: var(--radius);
  background: var(--white); color: var(--black);
}
textarea { min-height: 6rem; resize: vertical; }
fieldset { border: 1px solid var(--gray-light); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0 0 1.1rem; }
legend { font-weight: 600; padding: 0 0.4rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.4rem 0; font-weight: 400; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; flex: none; }
.button, button.primary, button.secondary {
  display: inline-block; font: inherit; font-weight: 600; padding: 0.65rem 1.2rem; border-radius: var(--radius);
  border: 2px solid var(--orange); background: var(--orange); color: #fff; cursor: pointer; text-decoration: none;
}
.button:hover, button.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
button.secondary, .button.secondary { background: transparent; color: var(--black); border-color: var(--gray); }
button.secondary:hover, .button.secondary:hover { border-color: var(--black); }
button.small { padding: 0.35rem 0.7rem; font-size: 0.92rem; }
.form-error { color: var(--error); background: var(--error-bg); border: 1px solid var(--error); padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
caption { text-align: left; font-weight: 600; padding: 0.5rem 0; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--gray-light); vertical-align: top; }
th { background: var(--gray-bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Cards / stats */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.card { border: 1px solid var(--gray-light); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--white); }
.card h2, .card h3 { margin-top: 0; }
.stat { font-size: 2rem; font-weight: 700; line-height: 1.1; margin: 0; }
.stat-label { color: var(--gray); margin: 0.2rem 0 0; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--gray); color: var(--gray); }
.badge-ok { border-color: var(--success); color: var(--success); }
.badge-warn { border-color: var(--orange); color: var(--orange-dark); }
.badge-err { border-color: var(--error); color: var(--error); }

/* Home */
.hero { padding: 2rem 0 1rem; max-width: 46rem; }
.hero h1 { font-size: 2.4rem; }
.demo-copy { max-width: 46rem; border-left: 4px solid var(--orange); padding: 0.5rem 1rem; background: var(--gray-bg); border-radius: 0 var(--radius) var(--radius) 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--gray-light); margin-top: 2rem; padding-block: 1.5rem 2rem; font-size: 0.95rem; }
.footer-row p { margin: 0 0 0.5rem; }

/* ---------------------------------------------------------------- articles */

.breadcrumb { margin: 0 0 1.5rem; font-size: 0.875rem; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; color: var(--gray); }
.breadcrumb [aria-current="page"] { color: var(--gray); }

.page-head { margin-bottom: 2.5rem; max-width: 44rem; }
.page-head h1 { margin-bottom: 0.5rem; }

.footer-nav { flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.875rem; }

.article-section { margin-bottom: 3rem; }
.article-list { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.article-item { padding: 1.125rem 0; border-top: 1px solid var(--gray-light); max-width: 46rem; }
.article-item h3 { margin: 0 0 0.375rem; font-size: 1.125rem; line-height: 1.4; }
.article-item h3 a { text-decoration: none; }
.article-item h3 a:hover { text-decoration: underline; }
.article-item p { margin: 0 0 0.25rem; }
.article-meta { font-size: 0.875rem; }

.article { max-width: 44rem; }
.article-head { margin-bottom: 2rem; }
.article-kicker { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.article-head h1 { margin-bottom: 0.75rem; }

.article-toc { border: 1px solid var(--gray-light); border-radius: 6px; padding: 1rem 1.25rem; margin-bottom: 2.5rem; background: var(--gray-bg); }
.article-toc h2 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.625rem; color: var(--gray); }
.article-toc ol { margin: 0; padding-left: 1.25rem; }
.article-toc li { margin-bottom: 0.3125rem; }
.article-toc li:last-child { margin-bottom: 0; }

.article-body > p { margin-bottom: 1.25rem; }
.article-body h2 { margin-top: 2.5rem; margin-bottom: 0.875rem; scroll-margin-top: 1rem; }

sup.cite { line-height: 0; font-size: 0.7em; }
sup.cite a { text-decoration: none; padding: 0 0.1em; font-variant-numeric: tabular-nums; }
sup.cite a:hover, sup.cite a:focus-visible { text-decoration: underline; }

.article-notes { margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--gray-light); }
.article-notes h2 { margin-top: 0; font-size: 1.125rem; }
.notes { padding-left: 1.5rem; font-size: 0.9375rem; }
.notes li { margin-bottom: 0.75rem; scroll-margin-top: 1rem; }
.note-url { word-break: break-all; }
.note-back { margin-left: 0.375rem; text-decoration: none; }

.article-cta { margin-top: 3rem; }
.article-cta h2 { margin-top: 0; }

.article-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-light); }
.article-nav p { flex: 1 1 16rem; margin: 0; }
.article-nav .next { text-align: right; }

@media (max-width: 40rem) {
  .article-nav .next { text-align: left; }
}

/* ---------------------------------------------------------------- WP1: sites */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 0; }
.actions-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 0.5rem 0 1.5rem; }
.copybox {
  background: var(--gray-bg); border: 1px solid var(--gray-light); border-radius: var(--radius);
  padding: 0.75rem 0.9rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
  font-family: var(--mono); font-size: 0.95rem; margin: 0.4rem 0 0.75rem;
}
.verify-method { border: 1px solid var(--gray-light); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; }
.verify-method h2 { margin-top: 0; }
.verify-method form.inline { margin-right: 0.5rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.2rem 1rem; }

/* Sample bubble on the preview page (static demo, not the real embed) */
.preview-article { max-width: 42rem; border: 1px solid var(--gray-light); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1rem 0; }
.demo-bubble-trigger { border-bottom: 2px dotted var(--orange); cursor: help; }
.demo-bubble {
  display: inline-block; max-width: 22rem; margin: 0.75rem 0; padding: 0.75rem 0.9rem;
  border: 1px solid var(--gray-light); border-radius: 10px; background: var(--white);
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
}
.demo-ad-label {
  display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: #fff; background: var(--orange); border-radius: 3px; padding: 0.05rem 0.35rem; margin-bottom: 0.35rem;
}
.demo-bubble-h { display: block; font-size: 1.05rem; }
.demo-bubble-b { display: block; color: var(--black); margin: 0.15rem 0; }
.demo-bubble-d { display: block; color: var(--gray); font-size: 0.9rem; }
.demo-ads-by { display: block; color: var(--gray); font-size: 0.75rem; margin-top: 0.4rem; }
