/* ==========================================================================
   Unicode Formatter - SEO content layer
   --------------------------------------------------------------------------
   Styles the indexable, editorial half of the app: the platform guides that
   live under /unicode-formatter/ and the reference blocks that sit under the
   tool on the tool page itself.

   Deliberately depends on NOTHING but /responsive.css. That means every guide
   page ships one small sheet instead of the tool's full app.css, it inherits
   the light/dark tokens for free, and it cannot drift from the site chrome.

   The whole sheet is additive: it sets no block-start padding on body, html,
   .container or any other shell, because --aczh-header-pad-top in the shared
   sheet owns that offset (AGENT_GUIDE.md section 5).
   ========================================================================== */

/* ------------------------------------------------------------------ shell */

.seo-main {
  /* Content column. The tool page keeps its own full-width workspace above. */
  max-width: 860px;
  margin-inline: auto;
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2rem, 5vw, 3.5rem);
}

.seo-main:empty { display: none; }

/* ------------------------------------------------------------ typography */

.seo-h1 {
  font-size: clamp(1.6rem, 3.6vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--text-primary);
}

.seo-h2 {
  font-size: clamp(1.18rem, 2.4vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 2.4rem 0 .7rem;
  scroll-margin-top: calc(var(--aczh-header-pad-top) + var(--safe-top) + 1rem);
}

.seo-h3 {
  font-size: clamp(1rem, 1.9vw, 1.12rem);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text-primary);
  margin: 1.6rem 0 .45rem;
  scroll-margin-top: calc(var(--aczh-header-pad-top) + var(--safe-top) + 1rem);
}

.seo-lede {
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  line-height: 1.65;
  color: var(--text-secondary);
  margin-top: .6rem;
  max-width: 72ch;
}

.seo-p {
  font-size: .95rem;
  line-height: 1.78;
  color: var(--text-secondary);
  max-width: 74ch;
  margin: .85rem 0;
}

.seo-p strong,
.seo-p b,
.seo-faq .seo-a strong { color: var(--text-primary); font-weight: 700; }

.seo-p a,
.seo-faq .seo-a a,
.seo-table a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

[data-theme="dark"] .seo-p a,
[data-theme="dark"] .seo-faq .seo-a a,
[data-theme="dark"] .seo-table a { color: var(--uf-accent, #a5b4fc); }

.seo-p a:hover { text-decoration-thickness: 2px; }

.seo-p code,
.seo-faq .seo-a code,
.seo-table code,
.seo-h3 code {
  font-family: var(--font-mono);
  font-size: .86em;
  background: var(--surface-muted);
  padding: .12em .38em;
  border-radius: 5px;
  color: var(--text-primary);
  word-break: break-word;
}

.seo-ul {
  margin: .85rem 0 .85rem 1.1rem;
  padding: 0;
  list-style: none;
  max-width: 74ch;
}

.seo-ul li {
  position: relative;
  padding-left: 1.15rem;
  margin: .4rem 0;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.seo-ul li::before {
  content: "";
  position: absolute;
  left: .1rem;
  top: .62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
}

.seo-ol {
  margin: 1rem 0 1rem 1.2rem;
  padding: 0;
  list-style: none;
  counter-reset: seo-step;
  max-width: 74ch;
}

.seo-ol li {
  position: relative;
  counter-increment: seo-step;
  padding-left: 2.4rem;
  margin: .95rem 0;
  font-size: .95rem;
  line-height: 1.72;
  color: var(--text-secondary);
}

.seo-ol li::before {
  content: counter(seo-step);
  position: absolute;
  left: 0;
  top: .05em;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
}

/* ------------------------------------------------------------- callouts */

.seo-note {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--color-primary);
  background: var(--surface-card);
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  margin: 1.2rem 0;
  font-size: .92rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 74ch;
}

.seo-note > :first-child { margin-top: 0; }
.seo-note > :last-child { margin-bottom: 0; }

.seo-note strong { color: var(--text-primary); }

.seo-note-warn { border-left-color: #d97706; }
.seo-note-ok { border-left-color: #059669; }

/* --------------------------------------------------------------- tables */

.seo-table-wrap {
  overflow-x: auto;
  margin: 1.2rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  -webkit-overflow-scrolling: touch;
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  min-width: 540px;
}

.seo-table caption {
  caption-side: top;
  text-align: left;
  padding: .7rem .9rem .5rem;
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.seo-table th,
.seo-table td {
  padding: .55rem .8rem;
  text-align: left;
  border-top: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--text-secondary);
}

.seo-table thead th {
  background: var(--surface-muted);
  color: var(--text-primary);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .01em;
  white-space: nowrap;
}

.seo-table tbody tr:first-child td { border-top: 0; }

.seo-yes { color: #059669; font-weight: 700; }
.seo-no { color: #dc2626; font-weight: 700; }
.seo-part { color: #b45309; font-weight: 700; }

[data-theme="dark"] .seo-yes { color: #34d399; }
[data-theme="dark"] .seo-no { color: #f87171; }
[data-theme="dark"] .seo-part { color: #fbbf24; }

/* ------------------------------------------------------------------- FAQ
   Native <details>, so it is fully crawlable and readable with JavaScript
   disabled. No JS toggles any of this. */

.seo-faq { margin: 1.2rem 0; border-top: 1px solid var(--border-subtle); }

.seo-faq details { border-bottom: 1px solid var(--border-subtle); }

.seo-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem .1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  line-height: 1.45;
}

.seo-faq summary::-webkit-details-marker { display: none; }

.seo-faq summary::before {
  content: "+";
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: .12em;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--color-primary);
  font-size: .85rem;
  font-weight: 800;
  line-height: 1;
  transition: transform .18s ease;
}

.seo-faq details[open] > summary::before { transform: rotate(45deg); }
.seo-faq summary:hover { color: var(--color-primary); }

.seo-faq .seo-a {
  margin: 0;
  padding: 0 .1rem 1.1rem 1.85rem;
  font-size: .93rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 70ch;
}

.seo-faq .seo-a p { margin: 0 0 .6rem; }
.seo-faq .seo-a p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ guide cards */

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: clamp(.7rem, 1.6vw, 1rem);
  margin: 1.4rem 0;
}

.seo-card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease;
}

.seo-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.seo-card-kicker {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: .3rem;
}

.seo-card-title {
  display: block;
  font-size: .98rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.seo-card-desc {
  display: block;
  margin-top: .35rem;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------- breadcrumb */

.seo-crumbs {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .9rem;
}

.seo-crumbs a { color: var(--text-secondary); text-decoration: none; }
.seo-crumbs a:hover { color: var(--color-primary); text-decoration: underline; }
.seo-crumbs span[aria-current] { color: var(--text-primary); font-weight: 600; }

/* ------------------------------------------------------------ CTA button */

.seo-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.4rem;
  padding: .8rem 1.35rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: filter .16s ease, transform .16s ease;
}

.seo-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.seo-cta svg { width: 16px; height: 16px; flex: 0 0 auto; }

.seo-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin: 1.5rem 0 .5rem;
}

.seo-cta-secondary {
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.seo-cta-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* -------------------------------------------------------------- glyph row
   Shows the literal characters the guide is talking about, so a reader can
   confirm the page is talking about the same thing they are about to paste. */

.seo-glyphs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0;
}

.seo-glyph {
  font-size: 1.05rem;
  font-weight: 700;
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  line-height: 1.3;
}

.seo-glyph span {
  display: block;
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: .2rem;
  letter-spacing: .02em;
}

/* ------------------------------------------------------------------ misc */

.seo-meta {
  margin-top: 2.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.seo-meta a { color: var(--text-secondary); }

/* Screen-reader-only text that must still be indexed for context. */
.seo-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------ dark tokens
   /responsive.css ships only the light palette; app.css carries the dark one
   for the tool. The guide pages load seo.css alone, so they need their own
   copy of the same token values. Kept identical to app.css so a guide and the
   tool are never two shades apart. */

[data-theme='dark'] {
  --bg-canvas: #0b1120;
  --surface-card: #111827;
  --surface-muted: #1b2436;
  --border-subtle: #26324a;
  --text-primary: #f1f5f9;
  --text-secondary: #b6c2d6;
  --text-muted: #7c8aa3;
  --color-primary: #a5b4fc;
  color-scheme: dark;
}

/* ------------------------------------------------- header icon button
   app.css styles .icon-btn for the tool; a guide page loads seo.css alone, so
   the theme toggle needs its own rule or it renders unstyled. */

.seo-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}

.seo-icon-btn:hover { color: var(--color-primary); border-color: var(--color-primary); }
.seo-icon-btn svg { width: 18px; height: 18px; }
@media (max-width: 480px) {
  .seo-faq .seo-a { padding-left: .1rem; }
  .seo-faq summary { font-size: .95rem; }
}

@media print {
  .aczh-nav, .aczh-footer, .seo-cta, .seo-faq summary::before { display: none !important; }
  .seo-faq details > * { display: block !important; }
}