/* ==========================================================================
   FORM & FRAME: shared styles for long-form guides (SEO series, WordPress
   handbook, guides index). Loaded after base.css and sections.css on guide
   pages only. Mirrors the inline styles of the original guide pages.
   ========================================================================== */
body.page-guides { background: var(--bone); color: var(--ink); }
body.page-guides .nav { background: rgba(14,14,13,0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: rgba(243,239,231,0.12); }

/* hero */
.g-hero { padding-block: calc(var(--nav-h, 76px) + clamp(1.5rem, 4vw, 3rem)) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid rgba(14,14,13,0.12); }
.g-hero .wrap { max-width: 46rem; }
.g-hero--wide .wrap { max-width: 72rem; }
.g-crumb { font-size: 0.78rem; color: rgba(14,14,13,0.55); margin-bottom: 1rem; }
.g-crumb a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(14,14,13,0.25); }
.g-crumb a:hover { text-decoration-color: currentColor; }
.g-hero__cat { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 0.6rem; }
.g-hero__title { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.03em; line-height: 0.98; font-size: clamp(2rem, 5.5vw, 3.6rem); max-width: 24ch; }
.g-hero__meta { margin-top: 1rem; font-size: 0.82rem; color: rgba(14,14,13,0.55); }
.g-hero__lede { margin-top: 1.1rem; max-width: 44rem; font-size: clamp(1rem, 1.6vw, 1.2rem); color: rgba(14,14,13,0.7); line-height: 1.55; }

/* body */
.g-body { padding-block: clamp(2.5rem, 6vw, 4rem); }
.g-body .wrap { max-width: 46rem; }
.g-body--wide .wrap { max-width: 72rem; }
.article p { margin-top: 1.1rem; font-size: 1.05rem; line-height: 1.7; color: rgba(14,14,13,0.8); }
.article p.lede { font-size: 1.2rem; color: rgba(14,14,13,0.92); }
.article h2 { margin: 2.8rem 0 0.8rem; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.015em; font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.12; scroll-margin-top: 90px; }
.article h3 { margin: 1.9rem 0 0.4rem; font-family: var(--display); font-weight: 800; font-size: 1.08rem; text-transform: uppercase; letter-spacing: -0.01em; scroll-margin-top: 90px; }
.article ul, .article ol { margin-top: 0.9rem; display: grid; gap: 0.55rem; padding-left: 1.3rem; }
.article ul { list-style: disc; }
.article ol { list-style: decimal; }
.article li { color: rgba(14,14,13,0.8); line-height: 1.6; padding-left: 0.2rem; }
.article li::marker { color: var(--accent-ink); }
.article li b, .article p b, .article td b { color: var(--ink); font-weight: 650; }
.article a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(14,14,13,0.3); }
.article a:hover { text-decoration-color: var(--accent-ink); }
.article code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; background: rgba(14,14,13,0.06); border: 1px solid rgba(14,14,13,0.12); padding: 0.05em 0.35em; border-radius: 3px; word-break: break-word; }
.article .small-note { font-size: 0.85rem; color: rgba(14,14,13,0.6); margin-top: 0.3rem; }

/* key takeaways */
.g-key { margin-top: 1.8rem; padding: 1.3rem 1.5rem; background: #fff; border: 1px solid rgba(14,14,13,0.14); border-top: 3px solid var(--ink); }
.g-key__t { margin: 0 !important; font-size: 0.74rem !important; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink) !important; }
.g-key ul { margin-top: 0.6rem; }

/* callout, checklist, steps */
.g-callout { margin-top: 1.6rem; padding: 1.1rem 1.4rem; background: #fff; border: 1px solid rgba(14,14,13,0.14); border-left: 3px solid var(--accent); font-size: 0.97rem; line-height: 1.6; color: rgba(14,14,13,0.82); }
.g-check { list-style: none !important; padding-left: 0 !important; }
.g-check li { position: relative; padding-left: 1.8rem; }
.g-check li::before { content: ""; position: absolute; left: 0; top: 0.2em; width: 15px; height: 15px; border: 1.5px solid var(--ink); }
.g-steps { list-style: none !important; padding-left: 0 !important; counter-reset: gs; }
.g-steps > li { counter-increment: gs; position: relative; padding: 0.2rem 0 0.2rem 2.8rem; }
.g-steps > li::before { content: counter(gs, decimal-leading-zero); position: absolute; left: 0; top: 0.15rem; font-family: var(--display); font-weight: 800; font-size: 0.9rem; color: var(--accent-ink); }

/* tables */
.g-table { margin-top: 1.3rem; overflow-x: auto; border: 1px solid rgba(14,14,13,0.14); background: #fff; -webkit-overflow-scrolling: touch; }
.g-table table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.5; }
.g-table th, .g-table td { text-align: left; vertical-align: top; padding: 0.7rem 0.85rem; border-bottom: 1px solid rgba(14,14,13,0.1); }
.g-table th { background: rgba(14,14,13,0.04); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.02em; white-space: nowrap; }
.g-table tr:last-child td { border-bottom: 0; }
.g-table td { min-width: 9rem; color: rgba(14,14,13,0.82); }

/* code blocks (wrapped by js/kb.js with a copy button) */
.article pre, .g-code pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; background: #12151b; color: #e6e9ef; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; line-height: 1.6; white-space: pre; }
.article pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.article > pre, .article .g-callout pre { margin-top: 1.2rem; }
.g-code { margin-top: 1.2rem; border: 1px solid rgba(14,14,13,0.2); overflow: hidden; }
.g-code__head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem 0.4rem 0.9rem; background: #1c212b; color: #a8b4c6; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.72rem; }
.g-copy { background: #2a3346; color: #eef1f6; border: 1px solid #3a4763; border-radius: 4px; padding: 0.15rem 0.6rem; font-size: 0.72rem; font-family: var(--sans); cursor: pointer; }
.g-copy.is-done { background: #1f7a4a; border-color: #1f7a4a; }

/* table of contents */
.g-toc { margin: 1.8rem 0 1.6rem; border: 1px solid rgba(14,14,13,0.14); background: #fff; }
.g-toc summary { cursor: pointer; padding: 0.85rem 1.2rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; list-style: none; display: flex; justify-content: space-between; }
.g-toc summary::-webkit-details-marker { display: none; }
.g-toc summary::after { content: "+"; font-size: 1rem; line-height: 1; }
.g-toc[open] summary::after { content: "\2212"; }
.g-toc ol { margin: 0 !important; padding: 0 1.2rem 1rem 2.6rem !important; list-style: decimal; gap: 0.35rem !important; }
.g-toc li { font-size: 0.95rem; }

/* FAQ */
.g-faq { margin-top: 1rem; border-top: 1px solid rgba(14,14,13,0.14); }
.g-faq details { border-bottom: 1px solid rgba(14,14,13,0.14); }
.g-faq summary { cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; position: relative; font-weight: 650; font-size: 1.02rem; }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0.9rem; font-size: 1.2rem; color: var(--accent-ink); }
.g-faq details[open] summary::after { content: "\2212"; }
.g-faq details p { margin: 0 0 1.1rem !important; }

/* series grid, related, CTA */
.g-series { margin-top: 1.2rem; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.g-series a { display: block; padding: 1rem 1.1rem; background: #fff; border: 1px solid rgba(14,14,13,0.14); text-decoration: none !important; transition: border-color 0.25s var(--ease), transform 0.25s var(--ease); }
.g-series a:hover { border-color: rgba(14,14,13,0.45); transform: translateY(-2px); }
.g-series b { display: block; font-family: var(--display); font-weight: 800; font-size: 1rem; line-height: 1.2; }
.g-series span { display: block; margin-top: 0.3rem; font-size: 0.85rem; color: rgba(14,14,13,0.62); line-height: 1.45; }
.g-related { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(14,14,13,0.12); }
.g-related a { display: block; margin-top: 0.5rem; font-weight: 700; }
.g-cta { margin-top: 3rem; padding: 2rem; background: var(--ink); color: var(--bone); }
.g-cta h2 { color: var(--bone); margin-top: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.015em; font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.12; }
.g-cta p { color: rgba(243,239,231,0.72); margin-top: 0.8rem; line-height: 1.6; }
.g-cta .btn { margin-top: 1.2rem; }
.g-updated { margin-top: 2.5rem; font-size: 0.82rem; color: rgba(14,14,13,0.55); }

/* glossary */
.gl-filter { margin-top: 1.5rem; display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.gl-filter input { flex: 1; min-width: 14rem; padding: 0.65rem 0.85rem; border: 1px solid rgba(14,14,13,0.25); background: #fff; font-size: 0.95rem; }
.gl-filter span { font-size: 0.82rem; color: rgba(14,14,13,0.55); }
.g-gloss { margin-top: 1.2rem; display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; border: 1px solid rgba(14,14,13,0.14); background: #fff; }
.g-gloss dt, .g-gloss dd { padding: 0.75rem 0.95rem; border-bottom: 1px solid rgba(14,14,13,0.1); margin: 0; }
.g-gloss dt { font-weight: 700; background: rgba(14,14,13,0.035); scroll-margin-top: 90px; }
.g-gloss dd { color: rgba(14,14,13,0.8); line-height: 1.55; font-size: 0.96rem; }
.g-gloss .is-hidden { display: none; }
@media (max-width: 640px) { .g-gloss { grid-template-columns: 1fr; } .g-gloss dt { border-bottom: 0; padding-bottom: 0.15rem; } }

/* interactive checklists (enhanced by js/kb.js) */
ul.checklist { list-style: none !important; padding: 0 !important; margin-top: 0.9rem; border: 1px solid rgba(14,14,13,0.14); background: #fff; gap: 0 !important; }
ul.checklist > li { border-bottom: 1px solid rgba(14,14,13,0.1); padding: 0 !important; }
ul.checklist > li:last-child { border-bottom: 0; }
ul.checklist label { display: flex; gap: 0.75rem; padding: 0.7rem 0.95rem; cursor: pointer; align-items: flex-start; }
ul.checklist input { margin-top: 0.3rem; width: 16px; height: 16px; accent-color: #1f7a4a; flex: none; }
ul.checklist li.is-done .cl-t { text-decoration: line-through; color: rgba(14,14,13,0.5); }
html:not(.js) ul.checklist > li { padding: 0.7rem 0.95rem !important; }
.cl-bar { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.2rem; font-size: 0.82rem; color: rgba(14,14,13,0.6); }
.cl-meter { flex: 1; min-width: 8rem; height: 6px; background: rgba(14,14,13,0.1); }
.cl-meter i { display: block; height: 100%; width: 0; background: #1f7a4a; transition: width 0.2s; }
.cl-reset { border: 1px solid rgba(14,14,13,0.3) !important; padding: 0.2rem 0.7rem !important; font-size: 0.78rem; }

/* guides search (index page and handbook toolbar) */
.g-search { position: relative; margin-top: 1.6rem; max-width: 40rem; }
.g-search input { width: 100%; padding: 0.85rem 1rem; border: 1px solid rgba(14,14,13,0.3); background: #fff; font-size: 1rem; }
.g-search__res { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; background: #fff; border: 1px solid rgba(14,14,13,0.25); box-shadow: 0 18px 50px rgba(14,14,13,0.18); max-height: 65vh; overflow-y: auto; }
.g-search__res[hidden] { display: none; }
.g-search__res a { display: block; padding: 0.75rem 1rem; border-bottom: 1px solid rgba(14,14,13,0.08); text-decoration: none; }
.g-search__res a:hover, .g-search__res a.is-sel { background: rgba(14,14,13,0.05); }
.g-search__res b { display: block; font-size: 0.75rem; color: var(--accent-ink); letter-spacing: 0.02em; }
.g-search__res span { display: block; font-size: 0.9rem; color: rgba(14,14,13,0.78); line-height: 1.45; }
.g-search__res mark { background: #ffe08a; color: inherit; }
.g-search__empty { padding: 0.9rem 1rem; font-size: 0.9rem; color: rgba(14,14,13,0.6); }

/* guides index */
.g-list { padding-block: clamp(2rem, 5vw, 3.5rem); }
.g-list + .g-list { padding-top: 0; }
.g-list__head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; padding-bottom: 0.8rem; border-bottom: 1px solid rgba(14,14,13,0.14); }
.g-list__head h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; font-size: clamp(1.4rem, 3vw, 2.2rem); line-height: 1; }
.g-list__head p { font-size: 0.92rem; color: rgba(14,14,13,0.6); max-width: 34rem; }
.g-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.g-card { display: flex; flex-direction: column; gap: 0.55rem; padding: 1.5rem; border: 1px solid rgba(14,14,13,0.14); background: #fff; transition: border-color 0.25s var(--ease), transform 0.25s var(--ease); }
.g-card:hover { border-color: rgba(14,14,13,0.4); transform: translateY(-3px); }
.g-card--feature { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.g-card--feature .g-card__d { color: rgba(243,239,231,0.7); }
.g-card--feature .g-card__cat { color: var(--accent); }
.g-card__cat { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); }
.g-card__t { font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.15; }
.g-card__d { font-size: 0.92rem; color: rgba(14,14,13,0.62); line-height: 1.5; flex: 1; }
.g-card__link { font-size: 0.82rem; font-weight: 700; }

/* handbook toolbar and pager */
.hb-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0.8rem; margin-top: 1.6rem; }
.hb-bar label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(14,14,13,0.55); }
.hb-bar select, .hb-bar input { width: 100%; padding: 0.7rem 0.85rem; border: 1px solid rgba(14,14,13,0.3); background: #fff; font-size: 0.95rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.hb-bar .g-search { margin-top: 0; max-width: none; }
.hb-pager { margin-top: 2.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.hb-pager a { display: block; padding: 1rem 1.2rem; border: 1px solid rgba(14,14,13,0.16); background: #fff; text-decoration: none; }
.hb-pager a:hover { border-color: rgba(14,14,13,0.45); }
.hb-pager small { display: block; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(14,14,13,0.5); }
.hb-pager b { font-family: var(--display); font-weight: 800; font-size: 1rem; line-height: 1.2; }
.hb-pager .hb-next { text-align: right; grid-column: 2; }
@media (max-width: 720px) { .hb-bar { grid-template-columns: 1fr; } .hb-pager { grid-template-columns: 1fr; } .hb-pager .hb-next { grid-column: 1; } }

@media print {
  .nav, .mmenu, .foot, .g-cta, .hb-bar, .hb-pager, .g-search, .cl-bar, .g-copy { display: none !important; }
  body.page-guides { background: #fff; }
  .article pre { white-space: pre-wrap; background: #f4f4f4; color: #000; }
}

/* figures and long tables of contents */
.g-fig { margin: 1.8rem 0 0.5rem; }
.g-fig img { display: block; width: 100%; height: auto; border: 1px solid rgba(14,14,13,0.14); background: #fff; }
.g-fig figcaption { margin-top: 0.55rem; font-size: 0.85rem; color: rgba(14,14,13,0.6); line-height: 1.45; }
.g-toc--long ol { columns: 2 18rem; column-gap: 2.4rem; }
.g-toc--long li { break-inside: avoid; margin-bottom: 0.35rem; }
.article h4 { margin: 1.5rem 0 0.2rem; font-weight: 700; font-size: 1.02rem; scroll-margin-top: 90px; }
@media (min-width: 1100px) { .g-body .wrap .article .g-fig { margin-left: -6rem; margin-right: -6rem; } }
.g-callout > p:first-child, .g-callout > ol:first-child, .g-callout > ul:first-child { margin-top: 0; }
.g-callout ol, .g-callout ul { margin-top: 0.6rem; }
